What is Wi-Fi?
Wi-Fi is Ethernet-style networking over radio, defined by IEEE 802.11. An access point announces a network name, devices join it, and frames travel through the air on 2.4, 5 or 6 GHz channels.
Because anyone nearby can hear radio, Wi-Fi needs a lock. WPA2-Personal, from IEEE 802.11i, uses a shared password and a 4-way handshake to make fresh AES keys for each device each time it joins. The password itself is never sent over the air.
Think of it like this. Joining WPA2 Wi-Fi is like two people proving they know the same secret word without saying it. Each picks a random number and shares it openly. Each mixes the secret word with both numbers to make the same code, then shows a stamp made with that code. If the stamps match, both know the word.
Step by step
Normal
5 stepsA phone finds a WPA2 network, joins it and proves it knows the password without ever sending it.
Normal
5 stepsA phone finds a WPA2 network, joins it and proves it knows the password without ever sending it.
- 1
Find the network
Beacons and probes
Access points announce themselves with beacons. A phone can also ask with a probe request. Both say the name (SSID), the channel and the security type.
- 2
Open authentication
A formality
Two short Authentication frames. In WPA2 they check nothing; they survive from the first Wi-Fi standard.
- 3
Association
The phone joins the cell
The phone asks to join and lists what it supports. The access point replies with an association ID. Data is still blocked until keys exist.
- 4
4-way handshake
Prove the password, make fresh keys
Both sides turn the password and network name into the same master key (PMK). They swap random numbers (ANonce and SNonce) and each compute a session key. MIC values prove both have the same key, and message 3 delivers the group key (GTK).
- 5
Encrypted traffic
AES on every frame
Every data frame is now encrypted with AES-CCMP. The password itself never crossed the air. Next the phone asks DHCP for an IP address, inside encrypted frames.
Wrong password
4 stepsOne typo in the password makes the MIC in message 2 fail, and the access point gives up.
Wrong password
4 stepsOne typo in the password makes the MIC in message 2 fail, and the access point gives up.
- 1
Joining goes fine
Authentication and association pass
The password is not checked during association, so these steps succeed even with a typo.
- 2
Message 2 fails
MIC does not match
The phone builds its key from the wrong password, so the MIC in message 2 is wrong. The access point cannot verify it and silently drops it. It never sends message 3.
- 3
Retries
Message 1 again
The access point waits, then resends message 1 with a higher replay counter. The phone answers again with the same wrong key.
- 4
Disconnect
Reason 15: handshake timeout
After a few tries the access point sends a deauthentication. The phone shows a message like Incorrect password.
Roaming
5 stepsKenji walks to the bedroom and his phone moves to a second access point with the same network name.
Roaming
5 stepsKenji walks to the bedroom and his phone moves to a second access point with the same network name.
- 1
Signal fades
Retries pile up
As Kenji walks away, frames to the living room access point need retries and slower speeds. The phone decides on its own to look for a better access point.
- 2
Scan
Probe on the new channel
The phone sends probe requests and hears a stronger answer from the bedroom access point, which has the same SSID and password.
- 3
Reassociate
Join the new access point
Authentication, then a Reassociation Request that names the old access point. With WPA2-Personal the master key comes from the password, so it is the same on both.
- 4
New handshake
Fresh session keys
A new 4-way handshake makes new session keys for this access point. Features called 802.11r (fast transition) and 802.11k/v can shorten or guide this step.
- 5
Traffic moves
The switch relearns the phone
The new access point sends a small frame from the phone's MAC into the wired network, so the switch updates its table. Video calls usually only blip.
Myths and mix-ups
- Hiding the network name does not make it secure; the name still appears in probe and association frames.
- MAC address filtering does not keep people out; MAC addresses are sent in the clear and are easy to copy.
- Your Wi-Fi password is not sent over the air when you join; only values derived from it are.
- Full signal bars do not mean fast internet; the bars measure only the radio link to the access point.
- A strong WPA2 password still matters, because a captured handshake can be guessed against offline.
Try it yourself
Run these on your own computer to see Wi-Fi at work.
Wi-Fi details (Windows)
netsh wlan show interfacesShows SSID, BSSID, channel, signal and the authentication type, such as WPA2-Personal.
Nearby networks (Linux)
nmcli dev wifiLists SSID, channel, signal and security. Add rescan yes to refresh.
Current link (Linux)
iw dev wlan0 linkYour interface may be named wlp2s0 or similar; check with ip link.
Wi-Fi details (macOS)
sudo wdutil infoOn recent macOS the old airport command is gone; wdutil shows SSID, BSSID, channel and security. Option-click the Wi-Fi icon for a quick view.
Wi-Fi at a glance
- Layer
- Data link (2) and physical (1)
- Bands
- 2.4 GHz, 5 GHz and 6 GHz
- Security here
- WPA2-Personal (PSK) with AES-CCMP
- Password length
- 8 to 63 characters
- Key exchange
- 4-way handshake, EAPOL (EtherType 0x888e)
- Master key
- PBKDF2-SHA1 of password and SSID, 4096 rounds
- Beacon interval
- Usually 100 TU (102.4 ms)
- Defined in
- IEEE 802.11, security from 802.11i (2004)
Defined inIEEE 802.11IEEE 802.11iIEEE 802.1X
Header fields
What Wi-Fi puts in its messages, with example values from the stories above.
IEEE 802.11
- Frame type
BeaconManagement frames run the joining process. With WPA2 they are not encrypted.- Receiver address
ff:ff:ff:ff:ff:ff (broadcast)- Transmitter address
a4:91:b1:5e:00:10- BSSID
a4:91:b1:5e:00:10The MAC address of the access point radio. It names this one network cell.- Random MAC
YesModern phones use a private random MAC per network so they are harder to track.- Protected
1The body is encrypted with AES-CCMP using the key from the handshake.
Beacon
- SSID
Kenji-HomeThe network name you see in the Wi-Fi list.- Beacon interval
100 TU (102.4 ms)How often the beacon repeats. One time unit is 1024 microseconds.- RSN element
WPA2: CCMP (AES), AKM PSKSays which security the network uses: WPA2 with a shared password and AES encryption.- Channel
36 (5 GHz)
Probe Request
- SSID
Kenji-Home
Test yourself
Which step actually checks the WPA2 password?
Questions people ask
How does a Wi-Fi password work?
Your device and the access point both turn the password and network name into a master key. They swap random numbers, make a session key from all of it and prove they match. The password never travels over the air.
What is the WPA2 4-way handshake?
Four EAPOL key messages after joining. Message 1 sends the ANonce, message 2 the SNonce and a MIC, message 3 the group key and install, message 4 confirms. After that, data is encrypted.
Why does my phone say incorrect password when the password is right?
The handshake failed or timed out, often from weak signal, an old saved password, or a router that does not support the security mode your phone wants. Forget the network and join again close to the router.
Is WPA2 still safe?
WPA2 with AES and a long random password is still fairly safe, and patched devices fixed the 2017 KRACK flaws. A short or common password can be guessed offline from a captured handshake. WPA3 removes that risk.
What is the difference between 2.4 GHz and 5 GHz Wi-Fi?
2.4 GHz reaches farther and passes walls better but is slower and more crowded. 5 GHz and 6 GHz are faster with more channels but have shorter range.