Wi-Fi Pro Lab › Connecting and coexisting

Association, security and roaming

Before a single byte of your data moves, a device and an access point exchange a short, fixed conversation. Knowing its order is the fastest way to find out why a client will not connect.

4frame exchanges to join a WPA2 network: discover, authenticate, associate, handshake
102.4 msdefault beacon interval (100 time units)
15reason code for a failed four-way handshake
802.11k, v, rthe roaming helpers

Where it livesWhich protocol, which layer, which frame

QuestionAnswer
Which standards?Authentication and association are in the base IEEE 802.11 standard. WPA2 is the Wi-Fi Alliance name for the RSN security of IEEE 802.11i (2004). WPA3 (Wi-Fi Alliance, 2018) uses SAE, the “dragonfly” handshake, which is also part of the base standard. Roaming helpers 802.11k (neighbour reports), 802.11v (BSS transition requests) and 802.11r (fast transition) started as amendments and are now in the base standard.
Which layer?The MAC layer: management frames for joining and roaming. The four-way handshake that creates the encryption keys travels as EAPOL messages inside ordinary data frames.
Which frames carry it?Beacons and probe responses advertise the security (RSN element) and roaming support (mobility domain element). Then come Authentication, Association Request and Response, four EAPOL-Key messages, and for roaming Reassociation and Action frames.
Which Wi-Fi generations?All of them can join and use WPA2. WPA3 is required for Wi-Fi 6E and Wi-Fi 7 devices on 6 GHz, and available on newer Wi-Fi 6 devices. 802.11k, v and r are optional on any generation.

1. DefinitionThe words

  • Discovery: finding networks, by listening for beacons (passive scanning) or by sending probe requests (active scanning).
  • Authentication: in 802.11 terms a formal first step. Open-system authentication proves nothing; WPA3 uses it to carry the SAE exchange.
  • Association: the client joins the access point, which records its capabilities and gives it an association ID.
  • Key management: turning a password or an enterprise credential into the keys that encrypt the traffic.
  • Roaming: moving from one access point to another without losing the session. Steering is the access point or controller persuading a client to move.

2. PurposeWhat it protects against

Radio signals reach everyone nearby, so the network has to prove that a device is allowed in and keep what it sends private. Without encryption anyone in range can read the traffic and join the network. The handshake gives each client its own key, so one client cannot read another’s traffic.

3. MechanismStep through the connection

Choose the type of network and click through each step. The diagram shows the frames, the card shows what they do, the Wireshark filter to find them and what failure looks like at that point.

SecurityIntroducedProtects withNotes
WPA2003TKIPA stop-gap for older hardware; no longer acceptable
WPA2 (IEEE 802.11i)2004AES-CCMP; four-way handshakePersonal (shared password) or Enterprise (802.1X / EAP)
WPA32018SAE for Personal; stronger keys for Enterprise; protected management framesRequired for Wi-Fi 6E and 6 GHz operation, together with Enhanced Open (OWE) for open networks

4. VisualRoaming and the sticky client

A client walks between two access points. It decides for itself when to roam. Raise the roaming threshold and the client moves earlier; lower it and the client holds on to the first access point long after the second is stronger.

5. MathematicsKeys and thresholds

  • Pairwise transient key. Both sides compute PTK = PRF(PMK, ANonce, SNonce, AP address, client address). The master key (PMK) comes from the password (Personal) or from 802.1X (Enterprise). The nonces are random numbers, so each connection gets fresh keys, and the key itself never crosses the air.
  • Roaming rule. A typical client roams when its signal drops below a threshold and a candidate is stronger by a margin: here, with the access points 40 m apart and a threshold of -70 dBm, the client holds on to the first access point for about 7 m beyond the halfway point. The model uses free-space loss at 5 GHz with an exponent of 3.
  • Beacon interval. The default is 100 time units; one time unit is 1024 µs, so 102.4 ms. A client scanning 13 channels spends at least that long on each channel to hear every beacon, which is why active scans and 802.11k neighbour lists matter.

6. Real-world behaviourFailures and fixes

Reason codeMeaningUsual cause
1Unspecified reasonAnything; look at what happened just before
2Previous authentication no longer validClient or AP lost its state, often after a restart or a roam
3Deauthenticated because the sender is leavingA client disconnecting normally
4Disassociated due to inactivityThe AP’s idle timer expired, often a sleeping device
5AP unable to handle all current stationsThe AP is full
154-way handshake timeoutWrong password, or weak signal during the handshake
16Group key handshake timeoutClient stopped answering during a key update

Reason codes from IEEE Std 802.11-2020, Table 9-49.

  • Sticky clients. Raise the minimum rate or signal an access point will accept, enable 802.11k and 802.11v where the clients support them, and avoid power levels so high that a distant access point still looks strong.
  • Slow reconnects. A full re-authentication with 802.1X takes much longer than a handover with 802.11r (fast BSS transition), which carries the keys ahead.
  • Protected management frames (802.11w) stop spoofed deauthentication frames from forcing a client off; WPA3 and the 6 GHz band require them.

Practical validationProve it in a capture and on a spectrum analyser

Reading about a band is one thing; seeing it in your own evidence is the skill. These checks work with any monitor-mode capture:

  • Capture a client joining a network and find each step: wlan.fc.type_subtype == 0x000b (authentication), 0x0000 and 0x0001 (association request and response), eapol (the four-way handshake).
  • Walk between two access points with a laptop capturing and find the reassociation request (wlan.fc.type_subtype == 0x0002). Note the signal of the old access point at that moment.
  • Look for deauthentication (0x000c) and disassociation (0x000a) frames and read the reason code.
  • Question to answer: a client repeatedly fails with reason 15 on one SSID only. What is the first thing to check?

In your captureWhere to find each step and how to filter it

These filters were tested with TShark 4.6 on hand-built captures with the same frame layout. Check them on your own capture and version.

What you want to seeWhich frame and elementDisplay filter
The security a network offersBeacon or Probe Response → RSN element → Auth Key Management (AKM) Suite. Type 2 is WPA2-Personal (PSK), 8 is WPA3-Personal (SAE), 1 is 802.1X, 4 and 9 are fast-transition versions.wlan.rsn.akms.type == 8
A WPA3 (SAE) handshake startingAuthentication frame with algorithm 3 (SAE). Sequence 1 is the commit, 2 the confirm.wlan.fixed.auth.alg == 3
Joining and leavingAuthentication, Association Request and Response; a refusal shows a status code, a disconnect shows a reason code.wlan.fc.type_subtype == 0x000b
wlan.fixed.status_code != 0
wlan.fixed.reason_code
The four-way handshakeFour EAPOL-Key frames inside data frames. Wireshark numbers them 1 to 4.eapol
wlan_rsna_eapol.keydes.msgnr == 1
Fast roaming (802.11r) offeredBeacon → Mobility Domain element. Access points that share a mobility domain ID can do fast transitions.wlan.mobility_domain.mdid
An access point asking a client to move (802.11v)Action frame, category 10 (WNM), action 7: BSS Transition Management Request. Action 8 is the client’s answer.wlan.fixed.category_code == 10 && wlan.fixed.action_code == 7
A neighbour list (802.11k)Action frame, category 5 (Radio Measurement): action 4 asks for the list, action 5 answers.wlan.fixed.category_code == 5 && wlan.fixed.action_code == 5
The client actually movingReassociation Request (subtype 2). Compare the time between the last frame to the old access point and this frame.wlan.fc.type_subtype == 0x0002
  • Healthy: authentication, association and all four EAPOL messages appear within a fraction of a second, in order.
  • Problem: the handshake repeats (message 1 appears again and again: wrong password or a key mismatch), a status code is not 0, or a reason code appears right after the handshake.
  • Question: a phone sits on a weak access point and never moves. Which frames would show whether the network ever suggested a better one?

Check your understandingQuick quiz

ReferencesSources and further reading

Frame subtypes, reason codes (Table 9-49) and the beacon interval come from IEEE Std 802.11-2020. WPA, WPA2 and WPA3 dates and requirements are from the Wi-Fi Alliance. The roaming model is a simplified illustration with stated assumptions, not a model of any particular client.