With 802.11w PMF in force, why does an unprotected Disassociation frame not end a live association, and how does the SA Query procedure resolve a real loss of state?
answer
- unprotected teardown is dropped
- but what if a side really rebooted
- ask the peer, protected
- comeback time and status 30
- no valid answer, drop the SA
basics
~20 sUnder PMF a station discards unprotected Deauthentication and Disassociation frames, because the real peer would protect them. SA Query then checks whether the peer still holds the keys: a protected answer keeps the association, a timeout ends it.
solid answer
~50 sOnce PMF is negotiated, Deauthentication and Disassociation from the peer must be protected, so an unprotected one is dropped. That creates a new problem: a side that genuinely lost its keys, an AP that restarted or a client that rebooted, can only send unprotected frames. **SA Query** resolves it. If a client with a live PMF association tries to associate again, the AP rejects it temporarily with status 30 and a Timeout Interval element giving an association comeback time, then sends a protected SA Query Request on the old association. A valid protected SA Query Response means the old association is alive; no valid response before the timeout (hostapd's `assoc_sa_query_max_timeout`, 1000 TU by default) means it is dead, and the next attempt succeeds. Clients run the mirror procedure when an unprotected frame claims the AP has lost them.
go deeper
Recall that with PMF a client ignores unprotected Deauthentication and Disassociation frames, and that SA Query is the protected check used when one side really lost its keys.
Walk through the exchange: temporary rejection with status 30 and a comeback time, a protected SA Query Request, and the timeout that decides whether the old association is dropped.
Recognise status 30 and short reconnect delays after client reboots as the procedure working, know the timeout settings, and know the client-side check triggered by reason codes 6 and 7.
Argue why required PMF is operable at scale only because of this recovery path, and what monitoring still has to cover because unprotected frames keep arriving.
## The problem PMF creates for itself Before **Protected Management Frames (802.11w)**, a Deauthentication or Disassociation frame was obeyed on sight. With PMF negotiated, these are **robust management frames**: from an associated peer they must arrive protected under the pairwise key, and a receiver discards one that is not. That is the protection. It also creates a dilemma. Suppose the access point restarts and loses its key state, or a laptop reboots and forgets its keys while the AP still holds the old association. The side that lost its keys can now only send **unprotected** frames, and the side that kept them is told to ignore exactly those. Without a tie-breaker, the client would be locked out until the stale association aged out. The **SA Query procedure** is that tie-breaker: before trusting an unprotected claim that an association is gone, ask the peer over the protected association whether it is still there. ## Case 1: the client lost its keys and associates again This is the case hostapd handles at the AP: 1. **STA to AP**: (Re)Association Request, unprotected, from a MAC address the AP still has a live PMF association with. 2. **AP to STA**: (Re)Association Response with status **30**, "association request rejected temporarily; try again later", carrying a **Timeout Interval element** whose type is the association comeback time. 3. **AP to STA**: **SA Query Request**, an action frame protected under the old pairwise key, carrying a transaction identifier. 4. If the old association is genuinely alive, the station answers with a protected **SA Query Response** echoing the identifier, and the AP keeps the existing association. 5. If no valid response arrives within `assoc_sa_query_max_timeout` (hostapd's default 1000 TU, about one second, with retries every `assoc_sa_query_retry_timeout`, default 201 TU), the AP concludes the old security association is gone, deletes it, and the client's next association attempt is accepted. The visible symptom is benign: a client that rebooted takes a second or so longer to reconnect. Operations engineers who see status 30 in association logs on a PMF network are usually looking at this, not a fault. ## Case 2: the access point lost its state The mirror case runs on the client. If the AP restarts, it receives data from a client it no longer knows and typically answers with an unprotected Deauthentication or Disassociation whose reason code is **6** (class 2 frame received from a non-authenticated station) or **7** (class 3 frame received from a non-associated station). The PMF client drops the frame, but because those reason codes suggest a real state mismatch, it starts its own SA Query toward the AP. wpa_supplicant, the reference client, logs "Unprotected disconnect dropped - possible AP/STA state mismatch - trigger SA Query" and limits how often it does so. No valid protected response means the AP really has lost the association, and the client reconnects. ## The pieces, side by side | Element | Role | |---|---| | SA Query Request and Response | robust action frames (category SA Query), sent protected, matched by a transaction identifier | | Status code 30 | association rejected temporarily while the AP checks the old association | | Timeout Interval element | tells the client the association comeback time | | Reason codes 6 and 7 | unprotected teardown that hints the peer lost state, triggering a client-side check | | `assoc_sa_query_max_timeout` | hostapd's limit, in TU, on waiting for a valid response | ## What it means for the WLAN you run - **PMF without SA Query would be unusable.** Every AP restart would strand clients; the procedure is what makes required PMF operable. - **Short reconnect delays are expected.** A comeback time and a brief rejection after a client reboots are the mechanism working. - **Fast BSS Transition is an exception.** hostapd does not start the check for a reassociation that used Fast BSS Transition (802.11r), whose own exchange involves the keys. - **Unprotected frames still reach the radio.** PMF decides what a client acts on, not what it receives; how forged-frame floods are detected is covered with WLAN attack detection, not here. ## Why this is the right design The rule underneath is simple: a claim that ends a protected relationship is only believed if it is protected, or if the peer fails to prove the relationship is alive when asked over a protected channel. That keeps a forged frame from ending a live session while still letting a side that really lost state recover in about a second.
- Why is an SA Query Request itself trustworthy when the frames that triggered it were not?It is a robust action frame sent under the existing pairwise key, so only a station that still holds that key can produce a valid SA Query Response with the matching transaction identifier. The question is asked and answered inside the very protection whose existence is in doubt, which is exactly what makes the answer meaningful.
- An operations engineer sees association status 30 for several laptops after a firmware rollout to clients. Is it a fault?Usually not. Laptops that rebooted still have live PMF associations on the APs, so each new association is rejected temporarily with a comeback time while the AP runs SA Query on the old one. When no protected response arrives, the old association is cleared and the next attempt succeeds, typically within about a second.
A hotel front desk gets an unsigned phone call saying the guest in room 412 has checked out. It does not clear the room on that call alone; it rings the room on the house line. If the guest answers, the booking stands; if nobody answers after a few tries, the desk frees the room.
- PMF clients still obey any Deauthentication frame carrying their AP's address
- SA Query is the frame exchange that installs the IGTK
- Status 30 on a PMF network means the client's passphrase is wrong
- The access point must wait for the old association to time out on its own
- SA Query frames are sent unprotected so a rebooted peer can read them