RADIO · IEEE 802.11

How Wi-Fi works

One radio channel, shared by everything in the room. Only one device can talk at a time, and nobody is in charge of whose turn it is. This page runs the real rules slowed down a thousand times or more: devices listen, wait a random moment, talk, and wait for a receipt. Drag the router and the devices around the room.

The room

The room is 24 m × 14 m. The white line is where the signal drops to −82 dBm: beyond it other devices no longer notice the transmission. Walls: thin drywall, red brick, thick grey concrete.

The channel, slowed down

data ACK (receipt) RTS / CTS beacon joining lost hears someone else told to stay quiet (NAV) counting down its random wait

Frame log

Controls

Selected device

Who gets what

DeviceStateSignalLink rateDeliveredResent

What is going on

1. A signal that fades

The router and every device are small radio transmitters of about a tenth of a watt. The signal weakens with distance and loses more passing through each wall. What matters is how far the signal stands above the background noise, the signal-to-noise ratio. A strong signal can carry many bits per symbol (the dense grids of dots in the constellation picture); a weak one must fall back to a few robust bits. That is why the link rate drops when you drag a device behind a concrete wall, and why 5 GHz is faster nearby but fades sooner.

2. Listen before you talk

There is no conductor. A device with something to send first listens. If the channel is quiet for a short fixed time (DIFS, 28 to 34 millionths of a second), it may go. If it hears anyone else, it holds.

3. Wait a random moment

If everyone who was waiting started the instant the channel fell silent, they would all crash into each other. So each one picks a random number of 9-microsecond slots and counts them down, pausing whenever the channel is busy. The lowest number goes first. The small numbers next to the devices are these countdowns.

4. Every frame needs a receipt

A radio cannot hear while it is transmitting, so the sender cannot tell whether its frame arrived. The receiver answers with a tiny ACK 10 to 16 microseconds later. No ACK means the frame is presumed lost: the sender doubles its range of random waits and tries again, up to seven times.

5. Collisions and hidden devices

Two devices sometimes draw the same number and talk at once. Worse, two devices can each be in range of the router but out of range of each other, so listening first does not help. Open the “Hidden devices” room to see it, then switch on RTS / CTS: the router's short “go ahead” reaches both sides and tells the other one to stay quiet. Data frames stop being lost, but every frame now pays for two extra short messages, so with frames as short as these the total delivered goes down. Real devices use it only for long transmissions.

6. Joining

The router announces the network with a beacon about ten times a second. A new device asks who is there (probe), proves it may join (authentication), registers (association), and then both sides derive fresh encryption keys in four messages without ever sending the password itself. Press Restart to watch each device go through it.

7. Slow devices cost everyone

Turns are handed out per frame, not per second. A device at the edge of range needs ten times longer to send the same frame, and everyone else waits while it does. Try “One far device” with traffic flat out and look at the airtime bar.

What is simplified