← Documents Documentation/networking/mac80211-auth-assoc-deauth.txt GitHub 원문 ↗

Linux 6.18.37 · Networking

mac80211 Authentication and Association Flows

userspace, mac80211, driver 사이의 authentication, association, WPA authorization과 해제 순서를 보여 줍니다.

Source pathDocumentation/networking/mac80211-auth-assoc-deauth.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

mac80211-auth-assoc-deauth.txt:1-95

Station 상태는 not-exists → exists → authenticated → associated → authorized로 올라가며 해제 때 역순으로 내려갑니다. FT, WPA, shared-key WEP 여부에 따라 중간 단계가 달라집니다.

Station state
not-existsexistsauthenticatedassociatedauthorized
authorizedassociatedauthenticatedexistsnot-exists

대표 상태 전이입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Authentication 흐름

1-46

참여자는 userspace, mac80211, driver입니다. FT가 아닌 authentication이 필요하면 userspace가 mac80211에 authenticate를 요청합니다. 이미 authenticated/authenticating이면 기존 AP station을 not-exists로 내리고 BSSID를 지웁니다. 이미 associated였다면 BA session 중지와 deauth/disassoc frame 송신만 생략하고 동일한 cleanup을 수행합니다.

mac80211은 channel과 channel type을 설정하고 BSSID와 basic rate bitmap을 알린 뒤 AP station을 exists 상태로 만듭니다. probe request data가 없으면 directed probe request와 response를 먼저 교환합니다. 이어 authentication frame을 송수신하고 WEP shared-key authentication이면 한 차례 더 교환합니다. 마지막으로 station을 authenticated 상태로 올리고 받은 auth frame을 userspace에 전달합니다.

Authentication sequence
userspace: authenticatemac80211: 기존 상태 cleanupdriver: channel/BSSID/STA exists선택: probe request/responseauth frame 송수신선택: WEP 추가 교환STA authenticateduserspace: RX auth

원문의 sequence diagram 명령을 참여자별 흐름으로 옮겼습니다.

#
# This outlines the Linux authentication/association and
# deauthentication/disassociation flows.
#
# This can be converted into a diagram using the service
# at http://www.websequencediagrams.com/
#

participant userspace
participant mac80211
participant driver

alt authentication needed (not FT)
userspace->mac80211: authenticate

alt authenticated/authenticating already
mac80211->driver: sta_state(AP, not-exists)
mac80211->driver: bss_info_changed(clear BSSID)
else associated
note over mac80211,driver
like deauth/disassoc, without sending the
BA session stop & deauth/disassoc frames
end note
end

mac80211->driver: config(channel, channel type)
mac80211->driver: bss_info_changed(set BSSID, basic rate bitmap)
mac80211->driver: sta_state(AP, exists)

alt no probe request data known
mac80211->driver: TX directed probe request
driver->mac80211: RX probe response
end

mac80211->driver: TX auth frame
driver->mac80211: RX auth frame

alt WEP shared key auth
mac80211->driver: TX auth frame
driver->mac80211: RX auth frame
end

mac80211->driver: sta_state(AP, authenticated)
mac80211->userspace: RX auth frame

end

Association과 authorization

47-83

userspace가 associate를 요청하면 기존 authenticated 또는 associated 상태를 authentication 때와 비슷하게 정리합니다. FT 때문에 이전 authentication이 없었다면 channel과 BSSID/basic rate를 설정하고 station을 exists, authenticated 상태로 바로 올립니다.

association request와 response를 교환한 뒤 mac80211이 rate control을 초기화하고 station을 associated로 바꿉니다. WPA를 사용하지 않으면 즉시 authorized 상태로 올립니다. 이어 QoS parameter와 BSS의 QoS·HT·AID association 정보를 driver에 설정하고 userspace에 association 완료를 알립니다.

WPA를 사용하면 userspace가 data frame으로 4-way handshake를 수행한 뒤 mac80211에 authorized를 요청하고, mac80211이 driver station 상태를 authorized로 변경합니다.

Association sequence
userspace: associate선택: FT용 STA exists/authenticatedassoc TX/RXrate control 초기화STA associatedQoS/HT/AID 설정userspace: associated
WPA 사용4-way handshakeuserspace: authorizeddriver: STA authorized
WPA 미사용driver: STA authorized

FT와 WPA 여부에 따른 association 분기입니다.


userspace->mac80211: associate
alt authenticated or associated
note over mac80211,driver: cleanup like for authenticate
end

alt not previously authenticated (FT)
mac80211->driver: config(channel, channel type)
mac80211->driver: bss_info_changed(set BSSID, basic rate bitmap)
mac80211->driver: sta_state(AP, exists)
mac80211->driver: sta_state(AP, authenticated)
end
mac80211->driver: TX assoc
driver->mac80211: RX assoc response
note over mac80211: init rate control
mac80211->driver: sta_state(AP, associated)

alt not using WPA
mac80211->driver: sta_state(AP, authorized)
end

mac80211->driver: set up QoS parameters

mac80211->driver: bss_info_changed(QoS, HT, associated with AID)
mac80211->userspace: associated

note left of userspace: associated now

alt using WPA
note over userspace
do 4-way-handshake
(data frames)
end note
userspace->mac80211: authorized
mac80211->driver: sta_state(AP, authorized)
end

Deauthentication·disassociation

84-95

userspace가 deauthenticate 또는 disassociate를 요청하면 mac80211은 BA session을 중지하고 deauth/disassoc frame을 송신한 뒤 대기 frame을 flush합니다. station 상태를 associated, authenticated, exists, not-exists 순으로 단계적으로 낮춥니다.

그 뒤 power save를 끄고 BSSID, association, QoS 등 BSS 정보를 지우며 channel type을 non-HT로 되돌립니다. 마지막으로 userspace에 disconnected를 알립니다.

해제 sequence
userspace: deauth/disassocBA session 중지deauth/disassoc TXframe flushassociated → authenticated → exists → not-existspower save off / BSS clear / non-HTuserspace: disconnected

연결 상태를 역순으로 정리하는 과정입니다.

userspace->mac80211: deauthenticate/disassociate
mac80211->driver: stop BA sessions
mac80211->driver: TX deauth/disassoc
mac80211->driver: flush frames
mac80211->driver: sta_state(AP,associated)
mac80211->driver: sta_state(AP,authenticated)
mac80211->driver: sta_state(AP,exists)
mac80211->driver: sta_state(AP,not-exists)
mac80211->driver: turn off powersave
mac80211->driver: bss_info_changed(clear BSSID, not associated, no QoS, ...)
mac80211->driver: config(channel type to non-HT)
mac80211->userspace: disconnected