13cd7920aSJohannes Berg# 23cd7920aSJohannes Berg# This outlines the Linux authentication/association and 33cd7920aSJohannes Berg# deauthentication/disassociation flows. 43cd7920aSJohannes Berg# 53cd7920aSJohannes Berg# This can be converted into a diagram using the service 63cd7920aSJohannes Berg# at http://www.websequencediagrams.com/ 73cd7920aSJohannes Berg# 83cd7920aSJohannes Berg 93cd7920aSJohannes Bergparticipant userspace 103cd7920aSJohannes Bergparticipant mac80211 113cd7920aSJohannes Bergparticipant driver 123cd7920aSJohannes Berg 133cd7920aSJohannes Bergalt authentication needed (not FT) 143cd7920aSJohannes Berguserspace->mac80211: authenticate 153cd7920aSJohannes Berg 163cd7920aSJohannes Bergalt authenticated/authenticating already 176d430c25SYegor Yefremovmac80211->driver: sta_state(AP, not-exists) 183cd7920aSJohannes Bergmac80211->driver: bss_info_changed(clear BSSID) 193cd7920aSJohannes Bergelse associated 203cd7920aSJohannes Bergnote over mac80211,driver 213cd7920aSJohannes Berglike deauth/disassoc, without sending the 223cd7920aSJohannes BergBA session stop & deauth/disassoc frames 233cd7920aSJohannes Bergend note 243cd7920aSJohannes Bergend 253cd7920aSJohannes Berg 26*24398e39SJohannes Bergmac80211->driver: config(channel, channel type) 273cd7920aSJohannes Bergmac80211->driver: bss_info_changed(set BSSID, basic rate bitmap) 283cd7920aSJohannes Bergmac80211->driver: sta_state(AP, exists) 293cd7920aSJohannes Berg 303cd7920aSJohannes Bergalt no probe request data known 313cd7920aSJohannes Bergmac80211->driver: TX directed probe request 323cd7920aSJohannes Bergdriver->mac80211: RX probe response 333cd7920aSJohannes Bergend 343cd7920aSJohannes Berg 353cd7920aSJohannes Bergmac80211->driver: TX auth frame 363cd7920aSJohannes Bergdriver->mac80211: RX auth frame 373cd7920aSJohannes Berg 383cd7920aSJohannes Bergalt WEP shared key auth 393cd7920aSJohannes Bergmac80211->driver: TX auth frame 403cd7920aSJohannes Bergdriver->mac80211: RX auth frame 413cd7920aSJohannes Bergend 423cd7920aSJohannes Berg 433cd7920aSJohannes Bergmac80211->driver: sta_state(AP, authenticated) 443cd7920aSJohannes Bergmac80211->userspace: RX auth frame 453cd7920aSJohannes Berg 463cd7920aSJohannes Bergend 473cd7920aSJohannes Berg 483cd7920aSJohannes Berguserspace->mac80211: associate 493cd7920aSJohannes Bergalt authenticated or associated 503cd7920aSJohannes Bergnote over mac80211,driver: cleanup like for authenticate 513cd7920aSJohannes Bergend 523cd7920aSJohannes Berg 533cd7920aSJohannes Bergalt not previously authenticated (FT) 54*24398e39SJohannes Bergmac80211->driver: config(channel, channel type) 553cd7920aSJohannes Bergmac80211->driver: bss_info_changed(set BSSID, basic rate bitmap) 563cd7920aSJohannes Bergmac80211->driver: sta_state(AP, exists) 573cd7920aSJohannes Bergmac80211->driver: sta_state(AP, authenticated) 583cd7920aSJohannes Bergend 593cd7920aSJohannes Bergmac80211->driver: TX assoc 603cd7920aSJohannes Bergdriver->mac80211: RX assoc response 613cd7920aSJohannes Bergnote over mac80211: init rate control 623cd7920aSJohannes Bergmac80211->driver: sta_state(AP, associated) 633cd7920aSJohannes Berg 643cd7920aSJohannes Bergalt not using WPA 653cd7920aSJohannes Bergmac80211->driver: sta_state(AP, authorized) 663cd7920aSJohannes Bergend 673cd7920aSJohannes Berg 683cd7920aSJohannes Bergmac80211->driver: set up QoS parameters 693cd7920aSJohannes Berg 703cd7920aSJohannes Bergmac80211->driver: bss_info_changed(QoS, HT, associated with AID) 713cd7920aSJohannes Bergmac80211->userspace: associated 723cd7920aSJohannes Berg 733cd7920aSJohannes Bergnote left of userspace: associated now 743cd7920aSJohannes Berg 753cd7920aSJohannes Bergalt using WPA 763cd7920aSJohannes Bergnote over userspace 773cd7920aSJohannes Bergdo 4-way-handshake 783cd7920aSJohannes Berg(data frames) 793cd7920aSJohannes Bergend note 803cd7920aSJohannes Berguserspace->mac80211: authorized 813cd7920aSJohannes Bergmac80211->driver: sta_state(AP, authorized) 823cd7920aSJohannes Bergend 833cd7920aSJohannes Berg 843cd7920aSJohannes Berguserspace->mac80211: deauthenticate/disassociate 853cd7920aSJohannes Bergmac80211->driver: stop BA sessions 863cd7920aSJohannes Bergmac80211->driver: TX deauth/disassoc 873cd7920aSJohannes Bergmac80211->driver: flush frames 883cd7920aSJohannes Bergmac80211->driver: sta_state(AP,associated) 893cd7920aSJohannes Bergmac80211->driver: sta_state(AP,authenticated) 906d430c25SYegor Yefremovmac80211->driver: sta_state(AP,exists) 916d430c25SYegor Yefremovmac80211->driver: sta_state(AP,not-exists) 923cd7920aSJohannes Bergmac80211->driver: turn off powersave 933cd7920aSJohannes Bergmac80211->driver: bss_info_changed(clear BSSID, not associated, no QoS, ...) 94*24398e39SJohannes Bergmac80211->driver: config(channel type to non-HT) 953cd7920aSJohannes Bergmac80211->userspace: disconnected 96