^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) # This outlines the Linux authentication/association and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) # deauthentication/disassociation flows.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) # This can be converted into a diagram using the service
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) # at http://www.websequencediagrams.com/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) participant userspace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) participant mac80211
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) participant driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) alt authentication needed (not FT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) userspace->mac80211: authenticate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) alt authenticated/authenticating already
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) mac80211->driver: sta_state(AP, not-exists)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) mac80211->driver: bss_info_changed(clear BSSID)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) else associated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) note over mac80211,driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) like deauth/disassoc, without sending the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) BA session stop & deauth/disassoc frames
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) end note
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) end
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) mac80211->driver: config(channel, channel type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) mac80211->driver: bss_info_changed(set BSSID, basic rate bitmap)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) mac80211->driver: sta_state(AP, exists)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) alt no probe request data known
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) mac80211->driver: TX directed probe request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) driver->mac80211: RX probe response
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) end
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) mac80211->driver: TX auth frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) driver->mac80211: RX auth frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) alt WEP shared key auth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) mac80211->driver: TX auth frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) driver->mac80211: RX auth frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) end
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) mac80211->driver: sta_state(AP, authenticated)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) mac80211->userspace: RX auth frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) end
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) userspace->mac80211: associate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) alt authenticated or associated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) note over mac80211,driver: cleanup like for authenticate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) end
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) alt not previously authenticated (FT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) mac80211->driver: config(channel, channel type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) mac80211->driver: bss_info_changed(set BSSID, basic rate bitmap)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) mac80211->driver: sta_state(AP, exists)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) mac80211->driver: sta_state(AP, authenticated)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) end
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) mac80211->driver: TX assoc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) driver->mac80211: RX assoc response
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) note over mac80211: init rate control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) mac80211->driver: sta_state(AP, associated)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) alt not using WPA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) mac80211->driver: sta_state(AP, authorized)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) end
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) mac80211->driver: set up QoS parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) mac80211->driver: bss_info_changed(QoS, HT, associated with AID)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) mac80211->userspace: associated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) note left of userspace: associated now
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) alt using WPA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) note over userspace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) do 4-way-handshake
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) (data frames)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) end note
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) userspace->mac80211: authorized
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) mac80211->driver: sta_state(AP, authorized)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) end
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) userspace->mac80211: deauthenticate/disassociate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) mac80211->driver: stop BA sessions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) mac80211->driver: TX deauth/disassoc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) mac80211->driver: flush frames
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) mac80211->driver: sta_state(AP,associated)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) mac80211->driver: sta_state(AP,authenticated)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) mac80211->driver: sta_state(AP,exists)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) mac80211->driver: sta_state(AP,not-exists)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) mac80211->driver: turn off powersave
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) mac80211->driver: bss_info_changed(clear BSSID, not associated, no QoS, ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) mac80211->driver: config(channel type to non-HT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) mac80211->userspace: disconnected