요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
#
# 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
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
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
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에 전달합니다.
원문의 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-83userspace가 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로 변경합니다.
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-95userspace가 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를 알립니다.
연결 상태를 역순으로 정리하는 과정입니다.
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
요약·해설
mac80211-auth-assoc-deauth.txt:1-95Station 상태는 not-exists → exists → authenticated → associated → authorized로 올라가며 해제 때 역순으로 내려갑니다. FT, WPA, shared-key WEP 여부에 따라 중간 단계가 달라집니다.
대표 상태 전이입니다.