What happens when you join Wi-Fi

Your phone joins the home Wi-Fi on its own in a fraction of a second. In between, keys are exchanged, an address is handed out and the internet is checked. Walk through it step by step.

Use the arrow keys to move between steps. Click a term to see what it means, or any row of the timeline.

Sent

Inside the message

Where the time goes

Times are typical values for illustration, not measurements.

How it works

About every 100 ms the router broadcasts a beacon with the network name. The phone joins it (association) and a four-way handshake follows: a key for this connection only is derived from the password and random numbers from both sides. The password itself never goes over the air.

WPA3 adds an SAE exchange before the handshake. It stops eavesdropping on the handshake and guessing the password offline, which works against WPA2 with a weak password.

Then the phone gets an IP address from DHCP, learns the router's physical address through ARP and checks whether the internet works. If the network wants a sign-in (hotel, train), a sign-in page opens.

The phone remembers network names. An attacker in a cafe can broadcast the same name with a stronger signal and the phone joins it on its own. HTTPS then protects you, unencrypted pages do not. Times are typical values.

When it helps

  • Understand why WPA3 and a strong Wi-Fi password make sense.
  • Explain why public Wi-Fi is a risk and how HTTPS protects you.
  • Find out what an address like 192.168.x.x means and where it comes from.
Glossary 20 terms
SSID
The name of a Wi-Fi network. Anyone can broadcast it, on its own it proves nothing.
Beacon
A short message the router broadcasts about ten times a second so devices can find it.
Association
Joining a device to a Wi-Fi access point. The router gives it a connection identifier.
MAC address
The physical address of a network card. Phones now use a random one for each network so they cannot be tracked.
Four-way handshake
Four messages in which the phone and the router derive a key for this connection only from the password and random numbers.
Nonce
A random number used only once. Thanks to it every connection gets a different key even with the same password.
MIC
A checksum of a message computed with the key. It only matches when both sides know the same password.
PMK
The master key derived from the Wi-Fi password. A temporary key for each connection is computed from it.
DHCP
The service that automatically gives a device on the network its IP address, gateway and DNS server.
Broadcast
A message to everyone on the network at once. Used when a device does not yet know whom to ask.
Lease
How long DHCP lends an address. The device renews it before it runs out.
IP address
The numeric address of a computer on the internet, such as 203.0.113.10. Routers deliver data by it, like the post delivers by the address on an envelope.
ARP
A question to the local network: "who has this IP address?". The device that has it answers with its MAC address.
Captive portal
The page a hotel or train network shows before letting you online. The phone detects it with a check request.
SAE (WPA3)
The WPA3 key exchange. Eavesdropping does not help to guess the password, every attempt has to go through the router.
Deauthentication
A message with which the router disconnects a device, for example after a failed password check.
Evil twin
An attacker's Wi-Fi with the same name as a known network. A device may join it on its own.
Man-in-the-middle attack
An attacker sits on the path between you and the server, for example on a fake Wi-Fi, and reads or changes unencrypted traffic. HTTPS prevents it.
Certificate
A server's digital ID: "this key belongs to example.com", signed by a trusted authority. It is valid for a limited time.
HSTS
A site's instruction to only connect over HTTPS. An attacker then cannot force the unencrypted version.

Frequently asked questions

// 01 Does the phone send the Wi-Fi password over the air?

No. Both sides derive the same key from the password and only prove they know it. With WPA2 and a weak password a captured handshake can still be guessed offline, hence WPA3 and a longer password.

// 02 Is public Wi-Fi dangerous?

An open network encrypts nothing and an attacker can broadcast the same name. HTTPS sites stay protected, but sensitive things are better done over mobile data or a VPN.

// 03 Why is my home address 192.168.1.x?

It is a private address the router handed out through DHCP. You go online under one public address of the router, which remembers whom the answers belong to (NAT).

QR code for a PayPal donation

Did this save you time?

The tools and simulations are free, ad-free and need no sign-up. If they helped you, you can send a contribution for coffee and new tools.

Donate via PayPal

Need a hand?

I build and maintain web applications in Laravel and PHP. If something on these pages is giving you trouble in a project, get in touch.

Get in touch