Wi-Fi/Sharing the air/Sharing airtime
Lesson 7 of 13 · in 3D and VR

Sharing airtime

Stations on one channel take turns. Each listens, waits a short gap, counts down a random backoff that freezes while the air is busy, and learns of a collision only when no acknowledgement comes back.

Lonely BinaryUpdated 2026-10-095 min readNo board required

View it in VR

Lesson 7 of the Wi-Fi course opens in a VR headset, on a table in front of you, and a voice starts three seconds after you arrive. Type this short address into the browser on a headset such as Meta Quest or Apple Vision Pro, and press Enter VR. No headset? Press Start the lesson: the same lesson, full screen.

learn.lonelybinary.com/vr/wifi/7

Listen, wait, count

Stations on one channel share the air, so only one should send at a time. The rule is CSMA/CA; what follows is a simplified model of its basic form. A station with a frame senses the channel. If it has been idle for DIFS, the station sends. If it is busy, the station draws a random number of slots from its contention window, 0 to 15 to start with, and waits.

The counter runs only while the channel is sensed idle, after a fresh DIFS of idle, one count a slot. While anyone else is sending it freezes, keeping its count. At zero the station sends. A station that lost a round keeps its place: it does not draw again.

At 2.4 GHz, with every station using the short slot, a slot is 9 microseconds, SIFS 10 and DIFS 28 (DIFS is SIFS plus two slots). On 5 GHz SIFS is 16 and DIFS 34. The bench runs about forty thousand times slower.

Why it waits for an acknowledgement

A radio is half duplex: while it transmits, its own signal swamps its receiver, so it cannot notice a collision as it happens. Shared-cable Ethernet could, and stopped at once (one shared channel); a switched, full-duplex link has no collisions at all. Wi-Fi avoids them instead, and finds out afterwards.

Every frame addressed to one station gets a reply from it: an ACK, SIFS after the frame ends. SIFS is shorter than DIFS, so nobody else can start in that gap. No ACK, and the sender counts the frame as lost.

When it fails

After each failure the window doubles, 0 to 31, then 0 to 63, up to 1023, and the station draws again and retries. A success puts the window back to 15. It tries a few times, then gives up and drops the frame; the exact count is up to the implementation. Two stations that draw the same number reach zero in the same slot, both frames are usually lost, and both retry with the wider window.

A frame for everyone, broadcast or multicast, gets no ACK and no retry at this layer. Since 802.11n, Wi-Fi often acknowledges a batch of frames at once, and newer versions add priorities to the basic rule. The code that turns all this into a connection on an ESP32 starts at station mode.

Common mistakes

  • Expecting a broadcast to be confirmed. Group frames get no acknowledgement and are not retried by Wi-Fi, so a lost one is simply gone. Anything that must arrive belongs in a frame for one station.
  • Treating a busy channel as a faulty board. Every station on the channel, the neighbours' networks included, takes its turns from the same air. A crowded channel means more frozen counters and more waiting.
  • Thinking a radio can hear its own collisions. It cannot while it sends. It learns of a loss only from the missing acknowledgement, after the airtime is already spent.

Edit this page — content/fundamentals/wifi/sharing-airtime.mdx

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Fundamentals on the forum →