Wi-Fi Pro Lab › How Wi-Fi shares the air

802.11 MAC: how stations take turns

A Wi-Fi radio cannot listen while it transmits, so it cannot detect collisions the way old wired Ethernet did. It tries to avoid them, and a large share of the time on every channel goes on that avoidance.

16 / 9 µsSIFS and slot time, OFDM at 20 MHz
10 / 20 µsSIFS and slot time, DSSS / CCK
15 to 1023contention window range (OFDM)
about 30 Mbit/sreal throughput of a 54 Mbit/s link

1. DefinitionWhat does the MAC do?

The medium access control (MAC) layer decides who may transmit, builds the frames and checks that they arrive. The basic rule of 802.11 is CSMA/CA (carrier sense multiple access with collision avoidance), implemented as the distributed coordination function (DCF).

  • Carrier sense. Listen before sending. The channel is busy if the radio hears a valid Wi-Fi signal or enough energy. A NAV (network allocation vector) timer also marks the channel busy for the duration written in a frame header.
  • Interframe spaces. A station waits a short time before it acts. SIFS (the shortest) is used before an acknowledgement; DIFS = SIFS + 2 slots is used before a new transmission.
  • Backoff. After DIFS the station waits a random number of idle slots, counting down while the channel is idle, then sends.
  • Acknowledgement. The receiver answers every unicast frame with an ACK after a SIFS. No ACK means the sender doubles its contention window and tries again.
  • Frame types. Management frames (beacons, authentication), control frames (RTS, CTS, ACK) and data frames.

2. PurposeWhy waiting is necessary

Wi-Fi is half duplex and the radio medium is shared by everyone within range. Two stations that talk at the same moment spoil both frames. Random backoff spreads the stations out in time so that, most of the time, only one of them sends in each slot.

3. MechanismContention and collisions

The simulation keeps every station saturated: each always has a frame to send. Add stations and watch what happens to the share of transmissions that collide and the time lost to them.

Try this. (1) With 2 stations, note the collision rate. Raise it to 10 and then 30. (2) Change aCWmin from 15 to 31 and see how a larger window trades fewer collisions for more idle time. (3) Use longer frames and notice that each collision then costs more.

4. VisualWhere the airtime goes

Even a station that has the channel to itself spends most of every frame on overheads. The bar shows one complete frame exchange: DIFS, average backoff, preamble, data, SIFS and acknowledgement. Only the green part is your data.

PHY (20 MHz)SIFSSlotDIFS = SIFS + 2 x slotaCWmin
DSSS / HR-DSSS (802.11b)10 µs20 µs50 µs31
ERP (802.11g), long slot10 µs20 µs50 µs31 for DSSS / CCK, 15 for OFDM
ERP (802.11g), short slot10 µs9 µs28 µs15 for OFDM
OFDM (802.11a, 5 GHz)16 µs9 µs34 µs15

From IEEE Std 802.11-2020, Tables 16-4, 17-21 and 18-5 (characteristics of the HR/DSSS, OFDM and ERP PHYs). aCWmax is 1023 for all of them.

5. MathematicsThe overhead, with numbers

  • Contention window. The backoff is a random whole number of slots from 0 to CW, so on average CW / 2 slots. CW starts at aCWmin, becomes 2 × CW + 1 after each failure (15, 31, 63, 127 … 1023) and returns to aCWmin after a success.
  • One frame exchange, OFDM 54 Mbit/s, 1500 bytes: DIFS 34 µs + average backoff 67.5 µs + preamble and signal field 20 µs + data 228 µs + SIFS 16 µs + ACK at 24 Mbit/s 28 µs = 393.5 µs, which delivers 12 000 bits, or 30.5 Mbit/s: 56% of the headline rate.
  • The same at 6 Mbit/s: 2225.5 µs for the frame exchange: 5.4 Mbit/s, which is 90% of the rate, because the data part is now long compared with the fixed overheads. Slow stations take a lot of airtime.
  • 802.11b, 11 Mbit/s, 1500 bytes: 1922 µs, 6.2 Mbit/s: 57% of the rate; at 1 Mbit/s it is 0.92 Mbit/s and takes 13 ms of airtime for one frame.
  • Small packets are worst: a 100-byte payload at 54 Mbit/s delivers just 4.3 Mbit/s, since the fixed overhead of about 185 µs dwarfs the data.

Quality of service: EDCA

802.11e added four access categories with different waiting rules. A higher-priority category waits less (a smaller AIFSN) and draws from a smaller contention window, so it wins more often:

Access categoryAIFSNCWminCWmax
Background (AC_BK)7151023
Best effort (AC_BE)3151023
Video (AC_VI)2715
Voice (AC_VO)237

Default values for OFDM PHYs (aCWmin 15, aCWmax 1023) from Table 9-155 of IEEE Std 802.11-2020. The access point can announce different values to its clients.

6. Real-world behaviourHidden nodes, slow clients and aggregation

Two clients on opposite sides of an access point may not hear each other, so carrier sensing cannot work between them. Their frames collide at the access point. Switching on RTS/CTS lets the access point’s CTS reserve the channel for both.

  • Slow clients cost everyone. A frame sent at 6 Mbit/s occupies the channel nine times as long as one at 54 Mbit/s, so a single poor client reduces the throughput of all the others. Disabling the lowest data rates on an access point keeps such clients from connecting at rates that waste airtime.
  • Aggregation. 802.11n introduced A-MPDU: many frames are sent behind one preamble and acknowledged together with a Block Ack, which recovers much of the overhead shown above.
  • Retries show waste. A frame that is sent again uses airtime twice. A retry rate above about 10 to 15% is a common warning level in practice, though no standard sets it.
  • Protection. In a 2.4 GHz network with 802.11b devices, newer devices send protection frames at slow rates first, costing yet more airtime.

Practical validationProve it in a capture and on a spectrum analyser

Reading about a band is one thing; seeing it in your own evidence is the skill. These checks work with any monitor-mode capture:

  • Filter on retried frames with wlan.fc.retry == 1 and compare their count with all data frames.
  • Find RTS, CTS and ACK frames: wlan.fc.type_subtype == 0x001b (RTS), 0x001c (CTS), 0x001d (ACK), 0x0019 (Block Ack). Check the duration field (wlan.duration) that sets the NAV.
  • Question to answer: a station sends at 6 Mbit/s and another at 54 Mbit/s, each the same frame size. How much more airtime does the slow one take per frame, ignoring overhead?

Check your understandingQuick quiz

ReferencesSources and further reading

Slot, SIFS and contention window values and the EDCA defaults were checked against IEEE Std 802.11-2020 (Tables 9-155, 16-4, 17-21 and 18-5). The simulations are simplified teaching models: they ignore the interframe spaces between events, capture effect, rate adaptation and aggregation.