In wireless networks, the hidden terminal problem fundamentally breaks CSMA/CD's collision detection mechanism. Unlike wired Ethernet where all nodes share the same physical medium, wireless devices may not "hear" each other's transmissions due to:
- Distance limitations (Device A can communicate with AP but not Device B)
- Physical obstructions (walls, furniture blocking signals)
- Radio interference patterns
// Simplified scenario demonstrating hidden node issue
void hiddenNodeScenario() {
Device A = new Device(range: 50m);
Device B = new Device(range: 50m);
AccessPoint AP = new AccessPoint();
// A and B are 80m apart - can't detect each other
A.connect(AP);
B.connect(AP);
// Both transmit simultaneously
A.beginTransmission(); // Can't detect B's transmission
B.beginTransmission(); // Can't detect A's transmission
// Collision occurs at AP but undetectable by endpoints
AP.receiveCollision();
}
Wireless transceivers cannot simultaneously transmit and listen (half-duplex constraint). This creates several technical challenges:
- Receive/Transmit switching delay: Typical WiFi radios require 5-20μs to switch modes
- Signal strength asymmetry: A transmitting device's own signal drowns out any incoming signals
- Carrier sense range ≠ transmission range
The collision avoidance mechanism uses a three-way handshake:
// Pseudo-code of basic CSMA/CA flow
function transmitPacket() {
if (channelIdle(DIFS)) {
sendRTS(duration); // Request to Send
waitForCTS(timeout); // Clear to Send
if (CTSreceived) {
transmitData();
waitForACK();
} else {
exponentialBackoff();
}
} else {
deferTransmission();
}
}
Parameter | Typical Value | Purpose |
---|---|---|
DIFS | 34μs (802.11g) | Minimum idle time before transmission |
SIFS | 10μs (802.11g) | Short interframe spacing |
Slot Time | 9μs (802.11g) | Time unit for backoff calculations |
When working with wireless protocols, consider these implementation specifics:
// Python example using scapy to analyze WiFi frames
from scapy.all import *
def packet_callback(pkt):
if pkt.haslayer(Dot11):
if pkt.type == 1 and pkt.subtype == 11: # RTS frame
print(f"RTS from {pkt.addr2} duration {pkt.Duration}")
elif pkt.type == 1 and pkt.subtype == 12: # CTS frame
print(f"CTS from {pkt.addr1}")
sniff(iface="wlan0mon", prn=packet_callback)
Key observations from real-world deployments:
- Collision avoidance overhead reduces maximum throughput by ~40% compared to theoretical limits
- Dense deployments require careful tuning of contention window parameters
- Frame aggregation techniques help amortize protocol overhead
In wired Ethernet networks, CSMA/CD works because all nodes share the same physical medium. When two devices transmit simultaneously, the resulting voltage fluctuation is detectable by all connected devices. Wireless networks face the "hidden node" problem where Node A might be transmitting to Node B while Node C (out of A's range) simultaneously transmits to Node B, causing undetectable collisions at the receiver.
// Simplified pseudocode showing wired collision detection
function transmitWithCSMACD(packet) {
while (true) {
if (carrierSense() == IDLE) {
send(packet);
if (collisionDetectedDuringTransmission()) {
backoffRandomInterval();
continue;
}
break;
}
}
}
Three key technical barriers prevent CSMA/CD in WiFi:
- Half-duplex operation: Wireless radios cannot transmit and receive simultaneously on the same frequency
- Signal strength asymmetry: A station might detect a clear channel, but its transmission could still collide at the receiver
- Propagation delay differences: RF signals attenuate differently than electrical signals in cables
Here's how modern WiFi handles this using Request-to-Send/Clear-to-Send (RTS/CTS):
// Python-like pseudocode for CSMA/CA
class WirelessNode:
def __init__(self):
self.cw_min = 15 # Contention window slots
self.nav = 0 # Network Allocation Vector
def transmit(self, packet):
while True:
if self.medium_idle() and self.nav == 0:
self.send_rts()
if self.receive_cts_timeout():
self.exponential_backoff()
continue
self.transmit_data(packet)
if self.receive_ack():
break
else:
self.retry_count += 1
if self.retry_count > MAX_RETRIES:
abort_transmission()
When developing wireless applications, consider these timing constraints:
Parameter | 802.11n Value | Impact |
---|---|---|
SIFS (Short Interframe Space) | 16μs | Minimum wait for high-priority frames |
DIFS (DCF Interframe Space) | 34μs | Minimum idle time before transmission |
Slot Time | 9μs | Backoff time unit |
Contemporary WiFi standards implement additional collision avoidance techniques:
- Frame Aggregation (802.11n/ac): Bundles multiple frames to reduce contention overhead
- MU-MIMO: Enables simultaneous transmissions to multiple clients
- OFDMA (802.11ax): Divides channels into smaller resource units