Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA)
1. Motivation: Why Avoidance Instead of Detection?
In wireless communications (IEEE 802.11 Wi-Fi), collision detection (CSMA/CD) is physically impractical because:
- Dynamic Power Mismatch: A wireless transmitter's local output power overwhelms any weak incoming collision from a distant station by a factor of thousands ().
- Hidden Terminal Problem: Two stations out of radio range of each other cannot detect when their transmissions collide at a mutual receiving access point.
Because stations cannot reliably detect collisions while transmitting, the strategy shifts from Collision Detection to Collision Avoidance (CSMA/CA): the protocol does everything possible to prevent collisions before they occur.
2. Core Mechanisms of CSMA/CA
CSMA/CA prevents collisions using three coordinated mechanisms:
- Interframe Space (IFS)
- Contention Window & Backoff Counter
- Virtual Carrier Sensing via RTS/CTS & NAV
3. The Interframe Space (IFS) Hierarchy
Before a station can transmit, it must sense the channel idle for a specified duration called an Interframe Space (IFS). Priority is enforced by duration: shorter IFS gives higher priority:
- SIFS (Short Interframe Space):
- Shortest waiting time (typically in 802.11b/g).
- Used for immediate control responses: CTS (Clear to Send), ACK (Acknowledgment), and subsequent fragments.
- Prevents other stations from seizing the channel mid-handshake.
- PIFS (PCF Interframe Space):
- Medium duration (); used in centralized polling (Point Coordination Function).
- DIFS (DCF Interframe Space):
- Standard waiting time () required before any station can attempt to transmit an RTS or initial data frame under Distributed Coordination Function.
- EIFS (Extended Interframe Space):
- Longest duration; invoked when a station receives a corrupted, unreadable frame to allow the other stations time to recover.
4. Contention Window and Random Backoff
Even if two stations wait for DIFS, if both have frames queued, both would transmit at the instant DIFS expires, causing a collision.
To prevent this, CSMA/CA enforces a Random Backoff:
- The station picks a random number of time slots from a Contention Window (CW):
- The station listens to the channel slot-by-slot:
- If a slot is idle, the station decrements its backoff counter ().
- If the channel becomes busy, the counter is frozen.
- When the channel becomes free again for DIFS, the counter resumes from its frozen value (ensuring fairness for waiting stations).
- When the backoff counter reaches zero (), the station transmits its frame.
- If an ACK is not received (collision), the contention window doubles exponentially:
(Typically or , ).
5. Channel Reservation: The RTS/CTS Handshake & NAV
To eliminate the Hidden Terminal Problem, CSMA/CA employs an optional four-way handshake:
- RTS (Request to Send): Station A sends an RTS frame containing the total transmission duration needed for the Data and ACK frames.
- CTS (Clear to Send): The AP broadcasts a CTS frame granting permission. Station C (which could not hear Station A) hears the CTS broadcast!
- NAV (Network Allocation Vector): Station C reads the duration field inside the CTS and sets its internal NAV timer. The station treats the medium as busy until NAV hits zero, completely eliminating hidden node collisions.
- Positive Acknowledgment (ACK): In CSMA/CA, every unicast data frame requires an explicit ACK; without an ACK, the frame is assumed lost and scheduled for backoff retransmission.
6. Comparison: CSMA/CD vs. CSMA/CA
| Parameter | CSMA/CD (IEEE 802.3 Ethernet) | CSMA/CA (IEEE 802.11 Wi-Fi) |
|---|---|---|
| Physical Medium | Wired copper / coaxial cables | Wireless RF / radio waves |
| Primary Goal | Detect collisions in progress & abort early | Avoid collisions before transmitting |
| Handshake Mechanism | None (transmits directly) | RTS / CTS optional reservation |
| Carrier Sensing | Physical carrier sensing only | Physical + Virtual (NAV timer) |
| Interframe Delays | Interpacket Gap (IPG = 96 bit-times) | SIFS, PIFS, DIFS, EIFS hierarchy |
| Acknowledgment | No link-layer ACK (relies on CD) | Mandatory ACK for every unicast frame |
| Recovery Mechanism | Jam Signal + Truncated Exponential Backoff | Binary Exponential Backoff on Contention Window |
Frequently Asked Questions
QWhy does CSMA/CA require positive acknowledgments (ACKs) while CSMA/CD does not?
In wired CSMA/CD, the sender listens to the physical line while transmitting; if no collision is detected during the minimum frame transmission window, the frame is known to have succeeded. In wireless CSMA/CA, the transmitter cannot listen while sending and cannot detect hidden collisions at the receiver, making an explicit ACK mandatory to confirm reception.
QWhat is the Network Allocation Vector (NAV) and how is it updated?
The NAV is a virtual carrier-sensing timer maintained locally by each wireless station. When a station overhears an RTS or CTS frame addressed to another node, it updates its NAV to the duration value specified in that frame, remaining silent until the timer expires.
QRank SIFS, DIFS, and PIFS in order of increasing duration and explain the rationale.
. SIFS is shortest to give urgent control frames (ACK, CTS) the highest channel priority without interruption from new data frames.
QWhy is the backoff counter frozen when the channel becomes busy in CSMA/CA?
Freezing it and resuming later keeps the station's progress, which is fair to stations that have already waited. The counter only decrements during idle slots and the station transmits when it reaches zero.