skip to content

In 802.11, what are the three station states, which frame classes does each allow, and how do deauthentication and disassociation move a station?

level: middleimportance: nice to knowfreq 16%

answer

  1. three states, three frame classes
  2. authenticated is not associated
  3. data only in State 3
  4. one step back or two
  5. reason code on every teardown

basics

~20 s

An 802.11 station is unauthenticated (State 1, class 1 frames only), authenticated (State 2, adding class 2 association frames) or associated (State 3, adding class 3 data). Disassociation returns it to State 2; deauthentication to State 1.

solid answer

~40 s

**State 1**, not authenticated and not associated, allows only **class 1** frames, which include beacons, probes, Authentication and Deauthentication frames. **State 2**, authenticated but not associated, adds **class 2** frames: Association, Reassociation and Disassociation. **State 3**, authenticated and associated, adds **class 3** frames, which include data frames and power-save polls. A frame from the wrong state draws a teardown: hostapd deauthenticates a station that asks to associate before authenticating (reason 6) and tears down one that sends data before associating (reason 7). **Disassociation** is a notice that moves a station from State 3 to State 2; **deauthentication** moves it from State 2 or 3 to State 1. Both carry a **reason code**, and neither is a request the receiver can refuse.

go deeper

for a junior

Recall the three states in order, and that a station must be both authenticated and associated before it may send data.

for a middle

Explain which frames belong to each class, which state each teardown frame returns a station to, and what reason codes 6 and 7 mean.

for a senior

Read teardowns as evidence: tell a leaving client from an inactivity timeout or a state mismatch after an AP restart, and know that keys are lost with the association.

for a principal

Use reason-code statistics across the estate to separate client behaviour from infrastructure faults, and decide where inactivity timers should sit for battery-powered devices.

## Why 802.11 tracks states A wired switch port either has link or it does not. An 802.11 access point has no cable to tell it who is present, so the standard gives every **station** (a client radio) an explicit **state** in the AP's station table and ties each kind of frame to the state in which it is allowed. Each side tracks the state, and a frame that arrives in the wrong state is treated as an error rather than processed. The design keeps an AP from carrying user data for a station that never joined, and it gives both sides a defined way to leave. ## The three states and the frame classes | State | Meaning | Frames allowed | |---|---|---| | State 1 | not authenticated, not associated | **class 1**, which includes beacons, probe requests and responses, Authentication and Deauthentication | | State 2 | authenticated, not associated | class 1 plus **class 2**: Association Request and Response, Reassociation Request and Response, Disassociation | | State 3 | authenticated and associated | classes 1, 2 and **3**: data frames, power-save polls and the other frames of an established link | The transitions upward follow the join sequence: 1. A successful **Authentication** exchange moves the station from State 1 to State 2. With open-system authentication that is the AP's Authentication frame with transaction number 2 and status 0. 2. A successful **Association Response** (status 0) moves it from State 2 to State 3. 3. On WPA2 and WPA3 networks, reaching State 3 is not yet enough for user traffic: the 802.1X controlled port stays closed, passing only EAPOL frames, until the key handshake has installed keys. ## Frames from the wrong state hostapd, the open-source reference AP implementation, shows how an AP enforces the classes: - An **Association Request** from a station that never authenticated gets a **Deauthentication** frame with reason 6, "class 2 frame received from a non-authenticated station" (`WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA` in the Linux 802.11 headers). - A **data frame or power-save poll** from a station that is not associated gets reason 7, "class 3 frame received from a non-associated station". hostapd sends it in a **Disassociation** if the station is authenticated and in a **Deauthentication** if it is not. Seeing reason 6 or 7 in a capture or a client log usually means the two sides disagree about the state, for example after an AP restarted and forgot a station that still believes it is associated. ## Leaving: deauthentication against disassociation Both frames are **notifications**, not requests: the receiver cannot refuse them, and the sender does not wait for permission. Both carry a **reason code** that explains why. | Frame | Effect | Common reason codes | |---|---|---| | Disassociation | State 3 -> State 2: the association ends, authentication remains | 8, station leaving; 4, inactivity; 5, AP unable to handle all associated stations; 7, data from an authenticated but unassociated station | | Deauthentication | State 2 or 3 -> State 1: authentication and association both end | 3, station leaving; 2, previous authentication no longer valid; 6, association attempt before authentication | A client that is turned off or moves away typically sends one of these with a "leaving" reason. An AP clears idle stations the same way: hostapd's `ap_max_inactivity` (default 300 seconds) sends an empty data frame to a silent station and, if it is not acknowledged, disassociates and then deauthenticates it. ## What this means in practice - **Keys go with the association.** On a WPA2 or WPA3 network, leaving State 3 discards the pairwise keys, so a station that comes back must associate and run the key handshake again. - **Reason codes are evidence.** "Leaving" codes point to the client; inactivity points to an idle or departed device; wrong-state codes point to a state mismatch. - **Management-frame protection changes who can send these frames, not what they mean.** With Protected Management Frames (802.11w) negotiated, deauthentication and disassociation are integrity-protected and an unprotected one does not end that association; configuring PMF is covered with WLAN security. - **Not every disconnect is a frame.** A station that simply walks out of range sends nothing; the AP notices only through its inactivity check or missing acknowledgements. The model to remember: authenticated is one step, associated is the next, data needs both, and each teardown frame takes the station back one step or two.

  • Why does hostapd poll an idle station before disassociating it?
    After `ap_max_inactivity` seconds of silence (default 300), hostapd sends the station an empty data frame. If the frame is acknowledged, the station is merely idle and stays; if not, hostapd disassociates and then deauthenticates it. Polling first avoids dropping devices that are still in range, and `skip_inactivity_poll=1` makes hostapd disconnect on the timer alone.
  • With Protected Management Frames in use, what changes about deauthentication and disassociation?
    Once Protected Management Frames (802.11w) are negotiated for an association, these frames are integrity-protected, and an unprotected one does not end that association. They remain one-way notices with reason codes that the receiver cannot refuse; protection only ensures that they really come from the peer. Configuration and certification rules for PMF are covered with WLAN security.

  • Disassociation and deauthentication are two names for one frame.
  • A station can refuse a deauthentication it disagrees with.
  • Disassociation sends a station all the way back to unauthenticated.
  • Data frames are allowed as soon as open-system authentication succeeds.
  • Reason codes are sent only when the AP detects an attack.