CSMA/CA MAC Protocol

The Fundamental Challenge of Unlicensed Spectrum

Unlike cellular systems where a central scheduler coordinates all transmissions, Wi-Fi operates in unlicensed spectrum where any device may transmit at any time. The MAC protocol must therefore resolve contention distributedly, without a coordinator, while being fair to all stations and robust to the hidden node problem. The 802.11 Distributed Coordination Function (DCF) uses Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) — a protocol whose throughput characteristics are fundamentally different from the scheduled access of cellular systems. Understanding CSMA/CA is essential for analysing Wi-Fi performance in dense deployments.

CSMA/CA Timing Diagram

CSMA/CA Timing Diagram
CSMA/CA timing for three competing stations. Each station waits for DIFS, then counts down a random backoff. The station with the shortest backoff transmits first. A collision occurs when two stations reach zero simultaneously, triggering binary exponential backoff.

Historical Note: From ALOHA to CSMA/CA

1970s--2000s

The random access lineage begins with the ALOHA protocol (Norman Abramson, University of Hawaii, 1970), which allowed terminals to transmit at will and retransmit after collisions. Carrier sensing (CSMA) was added by Leonard Kleinrock and Fouad Tobagi at UCLA in 1975, dramatically improving throughput by having stations listen before transmitting. The collision avoidance variant (CSMA/CA) was developed specifically for wireless networks because a wireless transceiver cannot detect collisions during transmission (unlike Ethernet's CSMA/CD). Giuseppe Bianchi's 2000 Markov chain analysis provided the first tractable model for 802.11 DCF throughput, enabling rigorous protocol optimisation.

Definition:

Distributed Coordination Function (DCF)

The DCF is the fundamental MAC access mechanism in 802.11, based on CSMA/CA with binary exponential backoff:

Basic access:

  1. A station (STA) with a frame to transmit senses the channel.
  2. If the channel is idle for a duration DIFS (DCF Interframe Space), the STA transmits.
  3. If the channel is busy, the STA defers and enters backoff:
    • Draw a random backoff counter bUniform(0,W1)b \sim \mathrm{Uniform}(0, W-1) where WW is the contention window.
    • Decrement bb for each idle slot time (σ\sigma) after DIFS.
    • Freeze bb when the channel becomes busy; resume after next DIFS.
    • Transmit when b=0b = 0.
  4. After successful transmission, the receiver sends an ACK after SIFS.
  5. If no ACK is received (collision), double the contention window: Wmin(2W,Wmax)W \leftarrow \min(2W, W_{\max}), and repeat from step 3.
  6. After a successful transmission, reset W=WminW = W_{\min}.

Timing parameters (802.11ax, 5 GHz):

  • Slot time σ=9\sigma = 9 μ\mus
  • SIFS =16= 16 μ\mus
  • DIFS =SIFS+2σ=34= \text{SIFS} + 2\sigma = 34 μ\mus
  • Wmin=16W_{\min} = 16, Wmax=1024W_{\max} = 1024

CSMA/CA uses collision avoidance (backoff before transmission) rather than collision detection (as in Ethernet CSMA/CD). In wireless, a transmitting station cannot simultaneously listen for collisions because the transmitted signal overwhelms the receiver.

Definition:

Enhanced Distributed Channel Access (EDCA)

EDCA (introduced in 802.11e, mandatory since 802.11n) provides QoS differentiation by defining four Access Categories (ACs):

AC Priority AIFSN WminW_{\min} WmaxW_{\max} TXOP limit
AC_VO (Voice) Highest 2 4 8 2.080 ms
AC_VI (Video) High 2 8 16 4.096 ms
AC_BE (Best Effort) Normal 3 16 1024 0
AC_BK (Background) Low 7 16 1024 0

Each AC has its own backoff entity with a different Arbitration IFS Number (AIFSN): AIFS[AC]=SIFS+AIFSN×σ\text{AIFS}[\text{AC}] = \text{SIFS} + \text{AIFSN} \times \sigma. Higher-priority ACs use shorter AIFS and smaller contention windows, giving them statistical priority. The TXOP (Transmit Opportunity) allows a station that wins channel access to transmit multiple frames back-to-back.

Internal collisions (two ACs in the same STA reaching b=0b = 0 simultaneously) are resolved locally by granting access to the higher-priority AC and treating the lower-priority AC as if it experienced a collision.

Definition:

RTS/CTS Handshake

The RTS/CTS (Request to Send / Clear to Send) mechanism mitigates the hidden node problem:

  1. Before transmitting data, the sender transmits a short RTS frame.
  2. The receiver replies with CTS after SIFS.
  3. All stations that hear either RTS or CTS set their Network Allocation Vector (NAV) to defer for the indicated duration.
  4. The sender transmits the data frame, followed by ACK.

Overhead analysis: RTS (20 bytes) + CTS (14 bytes) + 2 SIFS adds \sim60 μ\mus of overhead. This is worthwhile only when the data frame duration exceeds the RTS/CTS overhead, typically for frames >500> 500 bytes. The RTS threshold parameter controls when RTS/CTS is used.

RTS/CTS does not completely solve the hidden node problem in all geometries. If a hidden node is outside the range of both the sender and receiver, it cannot hear RTS or CTS and will not defer.

Definition:

Hidden and Exposed Node Problems

Hidden node problem: Station A transmits to station B. Station C is within range of B but not A. C cannot sense A's transmission, so it may transmit simultaneously, causing a collision at B.

Exposed node problem: Station B transmits to station A. Station C is within range of B but wants to transmit to station D (which is out of range of B). C senses B's transmission and defers, even though its transmission to D would not cause interference at A.

The hidden node problem causes collisions that CSMA/CA cannot prevent; the exposed node problem causes unnecessary deferrals that reduce throughput. RTS/CTS mitigates the hidden node problem but worsens the exposed node problem.

In dense deployments with many overlapping BSSs, the hidden node problem is a primary cause of throughput degradation. 802.11ax BSS coloring (Section 25.3) provides a partial solution by allowing spatial reuse.

Theorem: Bianchi Saturation Throughput Model

Consider nn stations operating under DCF with minimum contention window Wmin=WW_{\min} = W and maximum backoff stage mm (so Wmax=2mWW_{\max} = 2^m W). Under saturation (every station always has a frame to transmit), the normalised throughput is:

S=PsPtrE[L](1Ptr)σ+PtrPsTs+Ptr(1Ps)TcS = \frac{P_s P_{\mathrm{tr}} E[L]}{(1 - P_{\mathrm{tr}})\sigma + P_{\mathrm{tr}} P_s T_s + P_{\mathrm{tr}}(1-P_s) T_c}

where:

  • Ptr=1(1τ)nP_{\mathrm{tr}} = 1 - (1-\tau)^n is the probability that at least one station transmits in a slot
  • Ps=nτ(1τ)n1PtrP_s = \frac{n\tau(1-\tau)^{n-1}}{P_{\mathrm{tr}}} is the probability of successful transmission given a transmission occurs
  • τ\tau is the per-station transmission probability, obtained from:

τ=2(12p)(12p)(W+1)+pW(1(2p)m)\tau = \frac{2(1-2p)}{(1-2p)(W+1) + pW(1-(2p)^m)}

p=1(1τ)n1p = 1 - (1-\tau)^{n-1}

  • TsT_s = successful transmission duration (data + SIFS + ACK + DIFS)
  • TcT_c = collision duration (data + ACK timeout + DIFS)
  • E[L]E[L] = average payload length
  • σ\sigma = slot time

The system (τ,p)(\tau, p) is solved by fixed-point iteration.

Each station transmits with probability τ\tau in any given slot. A collision occurs when two or more stations transmit simultaneously. The key insight is that from any single station's perspective, the collision probability pp is constant across slots (because all other stations are statistically identical in saturation). This memoryless property makes the Markov chain model tractable.

CSMA/CA Binary Exponential Backoff Procedure

Input: Frame to transmit, WminW_{\min}, WmaxW_{\max}, max retries RR
Procedure:
1. Set backoff stage i0i \leftarrow 0, contention window WWminW \leftarrow W_{\min}
2. WHILE frame not acknowledged AND iRi \leq R:
a. Wait for channel idle for DIFS (or AIFS for EDCA)
b. Draw bUniform(0,W1)b \sim \mathrm{Uniform}(0, W-1)
c. WHILE b>0b > 0:
- If channel idle for one slot (σ\sigma): bb1b \leftarrow b - 1
- If channel busy: freeze bb, wait for channel idle for DIFS
d. Transmit frame
e. Wait for ACK (timeout = SIFS + ACK duration + slot time)
f. IF ACK received:
- Reset WWminW \leftarrow W_{\min}
- RETURN success
g. ELSE (collision):
- ii+1i \leftarrow i + 1
- Wmin(2W,Wmax)W \leftarrow \min(2W, W_{\max})
3. RETURN failure (frame dropped after RR retries)
Timing (802.11ax, 5 GHz):
- σ=9\sigma = 9 μ\mus, SIFS =16= 16 μ\mus, DIFS =34= 34 μ\mus
- Wmin=16W_{\min} = 16, Wmax=1024W_{\max} = 1024, R=7R = 7

CSMA/CA Timing Diagram

Visualise the CSMA/CA contention process for multiple stations. The plot shows the backoff countdown, DIFS/SIFS timing, and collision events over time. Adjust the number of stations to observe how collision probability increases. Changing the contention window WminW_{\min} demonstrates the trade-off between collision probability and idle time overhead.

Parameters
34
16
16
3

Hidden Node Geometry

Explore the hidden node problem geometry. Stations A and C communicate with station B in between. The carrier sense range determines whether A can hear C and vice versa. When the carrier sense range is less than the distance dAB+dBCd_{AB} + d_{BC} (or more precisely, when C is outside A's carrier sense range), C becomes a hidden node with respect to A. Adjust distances and carrier sense range to visualise the hidden node region.

Parameters
150
150
200

Example: Saturation Throughput for 10 Stations

Compute the saturation throughput for 10 802.11ax stations with:

  • Wmin=16W_{\min} = 16, m=6m = 6 (so Wmax=1024W_{\max} = 1024)
  • Payload E[L]=1500E[L] = 1500 bytes, 802.11ax MCS 7 (86 Mbps PHY rate)
  • σ=9\sigma = 9 μ\mus, SIFS =16= 16 μ\mus, DIFS =34= 34 μ\mus

Quick Check

In the Bianchi model, what happens to the saturation throughput as the number of contending stations nn increases?

Throughput increases linearly because more stations contribute data

Throughput remains constant because the protocol adapts the contention window

Throughput decreases because the collision probability increases faster than the contention window grows

Throughput increases up to a point then drops to zero

⚠️Engineering Note

Wi-Fi MAC Overhead in Practice

The gap between PHY rate and application throughput is dominated by MAC-layer overhead:

  • Contention overhead: DIFS (34 μ\mus) + average backoff (\sim72 μ\mus at Wmin=16W_{\min} = 16) per frame = 106 μ\mus wasted before every transmission.
  • Preamble overhead: 802.11ax preamble is 40--100 μ\mus depending on the number of spatial streams. For short data frames, the preamble can exceed the data duration.
  • ACK overhead: SIFS (16 μ\mus) + ACK (44 μ\mus) per frame.
  • Aggregation: A-MPDU aggregation (concatenating multiple frames into one TXOP) is essential for efficiency. Without aggregation, 802.11ax MAC efficiency is 30--40%; with A-MPDU aggregation of 64 frames, it reaches 75--85%.
  • Block ACK: Replaces individual ACKs for aggregated frames, using a bitmap to indicate which sub-frames were received.

In dense deployments with many short-packet IoT devices, the per-frame overhead dominates and OFDMA (Section 25.3) provides a significant efficiency improvement.

Practical Constraints
  • MAC efficiency without aggregation: 30-40% of PHY rate

  • A-MPDU aggregation raises efficiency to 75-85%

  • 802.11ax preamble: 40-100 μs (comparable to short data frames)

Common Mistake: The Bianchi Model Assumes Saturation

Mistake:

Using the Bianchi saturation throughput formula to predict throughput in a lightly loaded network.

Correction:

The Bianchi model assumes every station always has a frame to transmit (saturation). In practice, most Wi-Fi networks operate well below saturation, where throughput scales linearly with load and the collision probability is much lower than predicted. For non-saturated analysis, use extensions of the Bianchi model that account for finite arrival rates (e.g., Medepalli and Tobagi, 2006).

Common Mistake: RTS/CTS Does Not Fully Solve the Hidden Node Problem

Mistake:

Enabling RTS/CTS and assuming the hidden node problem is eliminated.

Correction:

RTS/CTS only works when the hidden node is within reception range of either the sender or receiver. If a hidden node is outside both ranges, it cannot hear RTS or CTS and will not defer. Furthermore, RTS/CTS adds 60+ μ\mus of overhead per frame, which can reduce throughput for small packets. In modern 802.11ax/be deployments, BSS coloring and coordinated spatial reuse are more effective than RTS/CTS for managing inter-BSS interference.

Wi-Fi vs. Cellular: Design Philosophy Comparison

AspectWi-Fi (802.11)Cellular (4G/5G)
SpectrumUnlicensed (2.4/5/6 GHz)Licensed (sub-6 GHz, mmWave)
MAC accessContention-based (CSMA/CA)Scheduled (centralised)
QoS guaranteeBest-effort (EDCA provides statistical priority)Guaranteed (per-bearer QoS)
Multi-userOFDMA (802.11ax+), MU-MIMOOFDMA (always), MU-MIMO
Coverage20--50 m indoor200 m -- 30 km
HandoverClient-driven (slow)Network-controlled (fast)
Typical latency5--20 ms (single link)1--10 ms (scheduled)
Deployment costLow (consumer APs)High (licensed spectrum + infrastructure)

Distributed Coordination Function (DCF)

The fundamental contention-based MAC access mechanism in IEEE 802.11, using CSMA/CA with binary exponential backoff. Stations sense the channel, defer if busy, and transmit after a random backoff period.

Related: Enhanced Distributed Channel Access (EDCA), Network Allocation Vector (NAV)

Enhanced Distributed Channel Access (EDCA)

A QoS extension to DCF that defines four access categories (voice, video, best effort, background) with different contention parameters, providing statistical priority for delay-sensitive traffic.

Related: Distributed Coordination Function (DCF)

Network Allocation Vector (NAV)

A virtual carrier-sensing timer maintained by each station. When a station receives an RTS, CTS, or data frame with a duration field, it sets the NAV to defer transmission for the indicated period, even if the physical carrier sense indicates idle.

Related: Distributed Coordination Function (DCF)