LABS · PROTOCOLS · NET TRACK

Wi-Fi: how a device joins a WPA2 network, frame by frame

Before sending a single byte over Wi-Fi, a device listens, asks, associates and negotiates its keys. Follow every 802.11 frame between Ana's laptop and a Cisco AP, with the WPA2 4-way handshake computed byte by byte.

Level: intermediate · 20 minutes

Interactive simulation

The animation needs JavaScript. The full lesson is written out below.

Download the capture and open it in Wireshark to keep exploring.

Bands and channels

BandChannelsAdvantagesWatch out for
2.4 GHz1, 6 and 11 non-overlapping (20 MHz)Longer range, better through wallsFew channels; microwaves and Bluetooth interfere
5 GHzOver 20 channels of 20 MHz; bonded into 40, 80 or 160 MHzHigher speed and less interferenceShorter range; some channels need DFS because of radars
6 GHzUp to 59 channels of 20 MHz (Wi-Fi 6E and 7)Lots of clean spectrumNew devices only, and WPA3 is required

Signal is measured in dBm: −30 is excellent and −67 is the usual minimum for voice. Noise and interference from other networks on the same channel (co-channel) or on overlapping channels lower the signal-to-noise ratio (SNR) and the speed.

The connection phases

PhaseFramesWhat it achieves
DiscoverBeacon (passive) or Probe Request/Response (active)Find the AP, its channel and its security
AuthenticateAuthenticationOpen System in WPA2; SAE in WPA3-Personal
AssociateAssociation Request/ResponseJoin the BSS and agree on the cipher; get an AID
Get keysEAPOL-Key 1/4 to 4/4PTK for unicast and GTK for broadcast
Send dataData encrypted with CCMPThen DHCP, ARP and everything else follow

How it works: from the Beacon to the installed keys

Six steps: the Beacon, active scanning, Open System authentication, association and the two pairs of 4-way handshake messages.

  1. Beacon: the AP advertises the network

    The AP sends a Beacon to the broadcast address: the SSID “CL-Visitas”, the supported rates, the country and allowed power per channel, the TIM for sleeping devices and the RSN element, which says how to protect yourself: CCMP (AES) encryption and PSK keys (WPA2-Personal). The laptop hears it on channel 36 (5180 MHz) at −52 dBm: a good signal. Listening for Beacons is passive scanning.

  2. Probe Request and Probe Response

    Ana asks to connect and the laptop sends a Probe Request with the SSID it is looking for, to broadcast, on the channel. The AP answers with a unicast Probe Response carrying the same data as the Beacon (minus the TIM). This active scanning is faster than waiting for the Beacon and lets the laptop measure each AP before choosing one.

  3. Open System authentication

    The laptop sends an Authentication frame with the Open System algorithm (0) and the AP answers “success”. Despite the name, no password is checked here: it is a step inherited from the original standard. Real security comes later, with the 4-way handshake. In WPA3-Personal, by contrast, these frames carry SAE, which does prove the password without sending it.

  4. Association: AID and agreed cipher

    In the Association Request, the laptop repeats the SSID and sends its own RSN element: it picks CCMP and PSK from what the AP offers. The AP accepts it into the BSS with AID 1 and tells the WLC. From here the laptop is associated but cannot send data yet: the AP's 802.1X port only lets EAPOL through until there are keys.

  5. 4-way handshake: messages 1 and 2

    Both sides already know the PMK: PBKDF2 of the network passphrase with the SSID, 4096 rounds of HMAC-SHA1. The AP sends the ANonce (message 1). The laptop picks its SNonce and computes the PTK with the 802.11i PRF from the PMK, both MACs and both nonces. It sends the SNonce with a MIC made with the KCK (message 2). The AP computes the same PTK and checks the MIC: if it matches, the laptop knows the passphrase, even though it never sent it.

  6. Messages 3 and 4: keys installed

    In message 3, the AP asks to install the PTK and sends the GTK (the key for broadcast traffic) encrypted with the KEK using AES Key Wrap, together with its RSN so the laptop can confirm nobody altered it. The laptop answers with message 4 and both install the keys: from here on, every data frame travels encrypted with CCMP (AES). The WLC shows the client in the Run state.

WEP, WPA, WPA2 and WPA3

CipherPersonalEnterpriseStatus
WEPRC4Static key—Broken: do not use
WPATKIP (RC4)PSK802.1XObsolete
WPA2CCMP (AES)PSK + 4-way handshake802.1X with RADIUSStill common
WPA3CCMP or GCMP (AES)SAE: resists offline dictionary attacks802.1X; 192-bit modeRecommended; PMF mandatory

With WPA2-Personal, anyone who captures the 4-way handshake can try millions of passphrases offline until one produces the same MIC. That is why the passphrase must be long, and why WPA3 replaces the PSK with SAE. Corporate networks use Enterprise: each user authenticates with 802.1X against a RADIUS server and gets their own PMK.

Wi-Fi with Cisco Catalyst 9800

Command or screenWhat it shows or does
wlan CL-Visitas 1 CL-VisitasCreates the WLAN with its ID and SSID.
security wpa akm psk · security wpa psk set-key ascii 0 …WPA2-Personal with its passphrase.
no shutdownEnables the WLAN.
show wlan summaryThe WLANs, their state and their security.
show wireless client summaryClients, their AP, protocol and state (Run = connected).
show ap summaryAPs joined to the controller.
Client: nmcli, iw dev wlan0 link, netsh wlan show interfacesSignal, channel and security from Linux or Windows.

CCNA v2.0 topics 1.5 and 1.6 ask you to describe wireless principles (bands, channels, RF, security and interference) and to troubleshoot wired and wireless client connectivity on Windows, macOS and Linux.

Frequently asked questions

Is Open System authentication insecure?

It checks nothing, but it is not the network's security: in WPA2 protection comes from the 4-way handshake that follows.

Does the Wi-Fi password travel?

No. Both sides turn it into the PMK and it is only checked through the 4-way handshake MIC.

What is the difference between the PTK and the GTK?

The PTK is unique per client and encrypts its unicast traffic. The GTK is shared by all the AP's clients and encrypts broadcast and multicast.

Why WPA3?

Because SAE prevents offline dictionary attacks against the handshake and because it requires protected management frames (PMF).

What is the BSSID?

The MAC of the AP radio for that SSID. An AP with several SSIDs uses one BSSID per SSID.

What you take away

  • The AP advertises the network with Beacons; the client can ask with a Probe Request.
  • Open System protects nothing: in WPA2 the security is in the 4-way handshake.
  • The network passphrase becomes the PMK and never travels over the air.
  • The PTK encrypts each client's unicast and the GTK the broadcast.
  • WPA3 replaces the PSK with SAE and makes PMF mandatory.
  • In 2.4 GHz only channels 1, 6 and 11 do not overlap.

NEXT STEP

From this lesson to the Canadá Logística network

In the CCNA 2.0 Course you configure Canadá Logística's WLANs on a Catalyst 9800 (WPA2 and WPA3, Personal and Enterprise with RADIUS), connect the APs to their switches and troubleshoot wireless clients. We'll let you know when it opens.

Upcoming protocol lessons

Sources

Lesson prepared with AI assistance and checked against the sources cited. The bytes of every packet are generated according to the standard and verified with an independent tool.