CSMA/CA: Carrier Sense Multiple Access with Collision Avoidance
Collision Avoidance: The Foundation of Wireless Medium Access
Read aloud is unavailable in this browser.
The Wireless Challenge
In wired Ethernet networks, stations detect collisions by monitoring the voltage levels on the shared copper medium while transmitting. When two stations transmit simultaneously, the resulting signal amplitude exceeds normal levels, and the collision is detected almost instantaneously. The stations then back off and retransmit later.
But wireless networks operate in a fundamentally different physical reality. The electromagnetic spectrum is a shared, invisible, and inherently unreliable medium. Signals attenuate dramatically with distance. Obstacles cause multipath fading. Two stations that can both reach an access point may be completely unaware of each other's existence.
This reality demanded an entirely new approach to medium access control—one that avoids collisions before they occur rather than detecting them after the fact. That protocol is CSMA/CA: Carrier Sense Multiple Access with Collision Avoidance, and it forms the backbone of every IEEE 802.11 wireless LAN in existence today.
By the end of this page, you will understand the fundamental principles of collision avoidance, why it's necessary in wireless environments, and how the basic CSMA/CA mechanism operates. You'll appreciate the engineering constraints that shaped this protocol and recognize its critical role in modern wireless communication.
The Physical Reality of Wireless Communication
To understand collision avoidance, we must first appreciate the physical characteristics that make wireless communication fundamentally different from wired transmission. These aren't minor differences—they're paradigm-shifting constraints that invalidate the assumptions underlying wired protocols.
- •Signal Propagation in Three Dimensions — Unlike copper cables that confine electrical signals to a conductor, radio waves propagate spherically in all directions. This means the signal power diminishes with the square of the distance (free-space path loss), making distant stations receive dramatically weaker signals than nearby ones.
- •No Simultaneous Send/Receive — Most wireless transceivers operate in half-duplex mode due to the enormous power difference between transmitted and received signals (typically 50-100 dB). The transmitter would overwhelm the receiver, making collision detection during transmission physically impossible.
- •Multipath Fading — Signals reflect off walls, floors, furniture, and people, arriving at the receiver via multiple paths with different delays. This causes constructive and destructive interference, creating rapidly changing channel conditions that vary by location and time.
- •Hidden Terminal Problem — Two stations may both be in range of an access point but out of range of each other. Each station cannot sense the other's transmissions, yet their signals collide at the access point. This is a fundamental challenge that carrier sensing alone cannot solve.
- •Exposed Terminal Problem — Conversely, two stations may hear each other but communicate with different access points. Naive carrier sensing would prevent valid simultaneous transmissions that wouldn't actually collide at their respective destinations.
In wired networks, if Station A can hear Station B, then B can also hear A (symmetric medium). In wireless, the medium is fundamentally asymmetric—transmission range, reception range, and interference range are all different, and they change dynamically with environmental conditions.
The Antenna Power Dilemma:
Consider a typical Wi-Fi radio transmitting at 100 milliwatts (20 dBm). The signal power received by a station 10 meters away might be 1 microwatt (-30 dBm). At 50 meters, it might drop to 10 nanowatts (-50 dBm). Meanwhile, the transmitting station's own signal at the antenna is 100 million times stronger than any signal it's trying to receive.
This 140+ dB difference makes it physically impossible to detect incoming signals while transmitting. There simply isn't enough dynamic range in practical receivers to isolate a weak incoming signal from the transmitter's overwhelming output. Even with sophisticated filtering, the transmitted signal would saturate the receiver, blinding it completely.
The Philosophy of Collision Avoidance
Collision avoidance represents a fundamental philosophical shift in medium access strategy. Instead of optimistically transmitting and reacting to collisions (the CSMA/CD approach), CSMA/CA takes a pessimistic stance: assume that collisions are likely and take proactive steps to minimize their occurrence.
This shift has profound implications for protocol design:
- •Transmit immediately if channel seems idle
- •Detect collisions through signal monitoring
- •Abort transmission upon collision detection
- •Truncated frames waste minimal bandwidth
- •Random backoff before retry
- •No positive acknowledgment needed
- •Collisions are normal, expected events
- •Defer if channel is busy, then wait additional time
- •Cannot detect collisions during transmission
- •Full frame transmitted even if collision occurs
- •Collided frames waste entire transmission time
- •Random backoff before initial transmission
- •Positive acknowledgment required for every frame
- •Collisions are costly failures to be prevented
The Cost of Collisions:
In CSMA/CD, when a collision is detected (typically within the first 64 bytes), the transmitting station sends a brief jam signal and aborts. The collision wastes only a fraction of the frame transmission time.
In wireless networks, without collision detection, the entire frame is transmitted before the sender realizes a collision occurred (via missing acknowledgment). For large frames, this can waste enormous channel time:
- 1500-byte frame at 54 Mbps: ~222 microseconds
- 1500-byte frame at 6 Mbps: ~2 milliseconds
- 1500-byte frame at 1 Mbps: ~12 milliseconds
Every collision wastes the complete transmission time for all colliding stations, plus the time waiting for missing acknowledgments, plus retransmission time. This makes collision prevention far more valuable in wireless than in wired networks.
The engineering wisdom embedded in CSMA/CA: when you cannot detect a problem as it occurs, invest heavily in preventing it. The random backoff before transmission, interframe spacings, and acknowledgment mechanisms all serve this preventive philosophy.
Basic CSMA/CA Operation
The fundamental CSMA/CA algorithm combines carrier sensing with mandatory waiting periods and explicit acknowledgments. Let's trace through the complete process step by step:
- •Frame Arrival: A station's network layer delivers a frame for transmission. The MAC layer determines the frame must access the wireless medium.
- •Initial Carrier Sense: The station performs carrier sensing (both physical and virtual) to determine if the medium is idle. Physical sensing examines RF energy levels; virtual sensing checks the Network Allocation Vector (NAV).
- •Interframe Space Wait: If the medium is idle, the station must wait for a specified interframe space (IFS) period before transmitting. This delay allows higher-priority traffic to access the medium first.
- •Backoff Procedure: If the medium was busy, or becomes busy during the IFS wait, the station must execute the random backoff procedure before transmission. A random number of slot times is selected from the contention window.
- •Backoff Countdown: The backoff timer counts down only while the medium is sensed idle. When the medium becomes busy, the countdown freezes and resumes when the medium becomes idle again (after another IFS).
- •Frame Transmission: When the backoff timer reaches zero, the station transmits the complete frame. Unlike CSMA/CD, there is no collision detection during transmission.
- •Acknowledgment Wait: After frame transmission, the sender waits for a specified Short Interframe Space (SIFS), then expects an ACK frame from the recipient.
- •ACK Reception or Timeout: If ACK is received, transmission succeeded. If no ACK arrives within timeout, a collision is assumed, the contention window is doubled, and retransmission is scheduled.
The random backoff is essential for collision avoidance. If multiple stations are waiting for a busy medium to become idle, they would all begin transmitting simultaneously the moment it does—causing certain collision. The random backoff spreads their transmission attempts across time, dramatically reducing collision probability.
Physical Carrier Sensing:
Physical carrier sensing operates at the RF level. The wireless interface continuously monitors the received signal strength and compares it against a threshold called the Clear Channel Assessment (CCA) threshold, typically around -82 dBm for 20 MHz channels.
- If the detected energy exceeds the CCA threshold, the medium is declared busy
- If the energy is below the threshold, the medium may be idle
- Physical sensing can detect non-802.11 interference (microwave ovens, Bluetooth, etc.)
Virtual Carrier Sensing:
Virtual carrier sensing uses the Network Allocation Vector (NAV), a timer that indicates how long the medium will be busy based on duration information embedded in frame headers. When a station hears any frame (even if not addressed to it), it extracts the Duration field and sets its NAV accordingly.
- The NAV acts as a reservation mechanism
- Stations will not transmit while their NAV is non-zero
- This helps with the hidden terminal problem—even stations that cannot hear the transmitter can hear the acknowledgment and will respect the NAV
The Three Pillars of Collision Avoidance
CSMA/CA employs three coordinated mechanisms to minimize collision probability. Each addresses a different aspect of the collision problem, and together they form a robust collision avoidance system:
| Mechanism | Purpose | Implementation | What It Prevents |
|---|---|---|---|
| Interframe Spacing (IFS) | Prioritization and settling time | Mandatory wait after channel idle before contention | Immediate contention after busy period; priority inversion |
| Random Backoff | Contention resolution | Random slot countdown from contention window | Synchronized simultaneous transmission from waiting stations |
| Positive ACK | Collision detection substitute | Recipient sends ACK after successful reception | Undetected frame loss; silent transmission failures |
How These Mechanisms Work Together:
Imagine three stations (A, B, C) all have data to send while station D is transmitting:
-
During D's transmission: A, B, and C all sense the medium busy and freeze their backoff timers (or haven't started them yet if they just received frames to send)
-
D finishes transmission: The medium becomes idle. All stations detect this.
-
IFS wait period: All three stations must wait for DIFS (DCF Interframe Space) before they can contend. During this time, the medium is protected for any SIFS-priority traffic (like the ACK for D's frame).
-
Random backoff begins: After DIFS, each station selects a random backoff from its contention window:
- Station A randomly selects 4 slot times
- Station B randomly selects 7 slot times
- Station C randomly selects 2 slot times
-
Backoff countdown: Slots count down while medium stays idle. C reaches zero first.
-
C transmits: A and B both detect C's transmission, freeze their timers (A at 2, B at 5).
-
After C's frame and ACK: Medium idle again. A and B wait for DIFS, then resume countdown.
-
A transmits: A reaches zero before B (only 2 slots vs 5 remaining slots).
This elegant choreography ensures that even when multiple stations are waiting, they transmit one at a time with high probability.
With a minimum contention window of 32 slots, two stations randomly selecting backoff values have only a 1/32 ≈ 3.1% chance of selecting the same slot. With three stations, the probability that at least two select the same slot is still only about 9.2%. The random backoff mechanism is remarkably effective.
Physical and Virtual Carrier Sensing
IEEE 802.11 employs two complementary carrier sensing mechanisms that work in parallel. Understanding both is crucial for grasping how CSMA/CA truly operates in practice.
- •Operates at hardware level in the radio transceiver
- •Detects energy on the channel above CCA threshold
- •Preamble detection — recognizes valid 802.11 frame starts
- •Sensitivity: Typically -82 dBm for 20 MHz channels
- •Limitation: Only works within physical sensing range
- •Vulnerable to: Hidden terminal problem
- •Responds to: Any RF energy (802.11 or not)
- •Operates at MAC layer using frame Duration field
- •Tracks channel reservation via NAV timer
- •Duration extraction — reads Duration from heard frames
- •Resolution: Microseconds, set by transmitting station
- •Advantage: Helps with hidden terminal problem
- •Resilient to: Stations can hear ACKs even if they miss data
- •Independent of: Physical signal strength
The Network Allocation Vector (NAV) in Detail:
Every IEEE 802.11 frame contains a Duration/ID field that specifies how long the medium will be occupied. When a station receives (or overhears) a frame, it performs the following:
if (received_frame.Duration > NAV):
NAV = received_frame.Duration
else:
# NAV unchanged - existing reservation is longer
The station considers the medium busy whenever:
- Physical carrier sensing detects energy, OR
- NAV is greater than zero (virtual sensing)
NAV Duration Calculation:
For a simple data frame exchange, the transmitter sets Duration to cover:
- SIFS + ACK transmission time
For RTS/CTS exchanges, the Duration covers:
- SIFS + CTS + SIFS + Data + SIFS + ACK
This allows stations that may not hear the data frame (hidden terminals) to respect the reservation by hearing the CTS or ACK.
Physical sensing is fast and catches all transmissions in range. Virtual sensing provides reservation information that propagates beyond physical range through frame headers. Together, they create a robust channel access control system that works even when stations cannot directly hear each other.
The Critical Role of Timing
CSMA/CA depends on precise timing at the microsecond level. Every station must agree on when a transmission ends, when the medium becomes idle, and when contention can begin. This synchronization happens without explicit coordination—stations independently measure time and reach the same conclusions.
Slot Time Fundamentals:
The slot time is the fundamental unit of time in 802.11 contention. It represents:
- Time for a station to detect that another station has started transmitting
- Includes propagation delay, CCA detection time, and MAC processing
| Standard | Frequency | Slot Time |
|---|---|---|
| 802.11b | 2.4 GHz | 20 μs |
| 802.11a | 5 GHz | 9 μs |
| 802.11g | 2.4 GHz | 9 μs (short), 20 μs (long) |
| 802.11n | 2.4/5 GHz | 9 or 20 μs |
| 802.11ac | 5 GHz | 9 μs |
| 802.11ax | 2.4/5/6 GHz | 9 μs |
Why Slot Time Matters:
The slot time defines the granularity of collision avoidance. If two stations have backoff values differing by at least one slot, they will not collide—the first station's transmission will be detected before the second station's backoff expires.
Smaller slot times (like 9 μs in 802.11a) allow faster contention resolution and higher efficiency, but require faster hardware. The 20 μs slot time in 802.11b reflected the capabilities of early 2.4 GHz hardware.
When 802.11g networks operate with legacy 802.11b devices present, the access point may fall back to the longer 20 μs slot time for compatibility. This protection mechanism reduces overall network efficiency but ensures all devices can fairly contend for the medium.
Efficiency Considerations
CSMA/CA imposes overhead that reduces the effective throughput compared to the raw physical layer rate. Understanding these overheads is essential for network capacity planning and performance optimization.
- •Interframe Spaces (IFS) — Mandatory waiting periods before transmission. DIFS alone is 28-50 μs depending on the PHY.
- •Backoff Time — Random wait from 0 to CWmin slots before first transmission. Average: CWmin/2 × slot_time = 15.5 × 9 μs ≈ 140 μs for 802.11a.
- •ACK Transmission — Every data frame requires an acknowledgment frame (14 bytes + preamble). At low rates, ACK alone takes significant time.
- •SIFS Before ACK — Short interframe space (10-16 μs) before recipient can send ACK.
- •Preamble and Header — Physical layer preamble and PLCP header add fixed overhead per frame, making small frames less efficient.
- •RTS/CTS Overhead — When used, adds two additional frame exchanges (RTS, CTS) with associated SIFS delays.
Efficiency Calculation Example (802.11a, 54 Mbps):
Transmitting a 1500-byte payload:
| Component | Duration |
|---|---|
| DIFS | 34 μs |
| Average Backoff (15.5 slots) | 140 μs |
| Preamble + PLCP Header | 20 μs |
| MAC Header (24 bytes) | 3.6 μs |
| Data (1500 bytes) at 54 Mbps | 222 μs |
| SIFS | 16 μs |
| ACK Preamble + ACK | 24 μs |
| Total | 459.6 μs |
Effective Throughput:
- Data transmitted: 1500 × 8 = 12,000 bits
- Time consumed: 459.6 μs
- Effective rate: 12,000 / 459.6 = 26.1 Mbps (48% of 54 Mbps PHY rate)
This demonstrates why wireless networks never achieve their advertised speeds—the protocol overhead is substantial, and it's an unavoidable cost of the collision avoidance mechanism.
For small frames (like VoIP packets or TCP ACKs), the fixed overhead dominates. A 100-byte VoIP packet at 54 Mbps achieves only about 6 Mbps effective throughput because DIFS, backoff, and ACK overhead remain constant regardless of frame size. Frame aggregation in 802.11n and later addresses this inefficiency.
KEEP LEARNING
Keep learning for free.
Read the complete lesson, save your notes and pick up where you left off with a free account. No card needed.