Loading learning content...
Imagine a busy conference room where multiple people try to speak at once. The result is chaos—overlapping voices, unintelligible words, and frustrated participants. Someone needs to recognize that a collision has occurred before any productive conversation can resume.
In computer networking, when multiple stations on a shared medium transmit simultaneously, their electrical signals interfere with each other, creating what we call a collision. But unlike human conversations where we naturally sense overlapping speech, electronic systems need a deliberate mechanism to detect these collisions. This is where Carrier Sense Multiple Access with Collision Detection (CSMA/CD) enters the picture—a protocol that transformed early Ethernet from chaotic shared-wire networks into the reliable LANs we depend on today.
By the end of this page, you will understand precisely how collision detection works at the physical and electrical level, why it was revolutionary for LAN technology, and how stations differentiate between normal transmissions and collisions. You'll master the timing constraints, signal analysis, and protocol mechanics that make CSMA/CD possible.
Before we can understand collision detection, we must first understand why collisions occur and what they look like at the physical layer.
Shared Medium Fundamentals:
In early Ethernet networks (10BASE5, 10BASE2, and original 10BASE-T with hubs), all stations connected to a single shared communication channel—typically a coaxial cable or a hub that electrically connected all ports. When any station transmitted, its signal propagated throughout the entire medium, reaching all other stations.
This shared architecture creates a fundamental problem: if two stations transmit simultaneously, their signals overlap. Since both stations drive the same electrical medium, the superposition of their signals produces a corrupted waveform that neither station can decipher.
| Aspect | Normal Transmission | Collision State |
|---|---|---|
| Voltage Levels | Defined Manchester encoding levels | Superimposed voltages, often exceeding normal ranges |
| Signal Amplitude | Within expected bounds (-0.85V to +0.85V for 10BASE-T) | Higher peaks due to signal addition |
| DC Bias | Near zero (balanced) | May shift due to unequal signal contributions |
| Data Integrity | Recoverable bit patterns | Corrupted, uninterpretable data |
| Detection Time | N/A | Must occur within one RTT |
The Physics of Collisions:
When two signals collide on a shared medium, the result depends on the physical layer encoding:
Coaxial Cable (10BASE5/10BASE2): The cable acts as a transmission line. When two sources drive it simultaneously, the voltage at any point is the analog sum of both signals. If both transmit a logic '1', the resulting voltage might double. If one transmits '0' and the other '1', the voltages partially cancel.
Twisted Pair with Hub (10BASE-T): The hub electrically combines signals from all ports. A collision manifests as signal corruption at the hub, which then propagates the corrupted signal to all ports.
Manchester Encoding Implications: Ethernet uses Manchester encoding where each bit has a transition in the middle. During a collision, these transitions become irregular, violating the strict timing requirements of the encoding scheme.
A collision is not just 'noise'—it's a specific, detectable event caused by the superposition of multiple structured signals. The collision produces an energy level or pattern that violates the normal signaling constraints, making it distinguishable from valid data.
Collision detection operates by monitoring the medium while transmitting. This is the critical distinction from pure CSMA protocols: a CSMA/CD station doesn't just listen before transmitting—it continues to listen during transmission to verify that only its own signal is present on the medium.
The Detection Mechanism:
The transceiver (transmitter-receiver unit) at each station performs three simultaneous operations during transmission:
123456789101112131415161718192021222324252627282930313233343536
// Collision Detection State Machine// Runs concurrently with transmission function monitorDuringTransmission(frame: Frame): TransmitResult { startTransmission(frame); while (transmission.inProgress) { // Read current signal on the medium receivedSignal = readMedium(); expectedSignal = currentlyTransmitting(); // Check for collision indicators if (receivedSignal.amplitude > NORMAL_MAX * COLLISION_THRESHOLD) { // Voltage level too high - collision detected return COLLISION_DETECTED; } if (receivedSignal.dcBias != EXPECTED_BIAS) { // DC level shifted - collision detected return COLLISION_DETECTED; } if (receivedSignal.bits != expectedSignal.bits) { // Bit mismatch - another station's signal present return COLLISION_DETECTED; } } // No collision detected throughout transmission return TRANSMISSION_SUCCESS;} // Constants for 10BASE-Tconst NORMAL_MAX = 0.85; // Voltsconst COLLISION_THRESHOLD = 1.4; // Multiplier (produces ~1.2V)const EXPECTED_BIAS = 0.0; // Volts (balanced)The Transceiver Architecture:
The transceiver contains separate transmit and receive circuits that operate simultaneously:
┌─────────────────────────────────────────────────────────────┐
│ TRANSCEIVER UNIT │
├─────────────────────────────────────────────────────────────┤
│ ┌───────────┐ ┌───────────────┐ │
│ │ TX Driver │──────┬───────────────────▶│ Medium │ │
│ └───────────┘ │ │ (Coax/UTP) │ │
│ │ └───────────────┘ │
│ ▼ │ │
│ ┌─────────────┐ │ │
│ │ Collision │◀───────────────────┘ │
│ │ Detector │ │
│ └─────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ RX Receiver │ │
│ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘
The collision detector operates in real-time, feeding its findings to the MAC controller within bit times to ensure timely response.
The timing of collision detection is absolutely critical to the correct operation of CSMA/CD. A station must detect any collision before it finishes transmitting the frame. This constraint drives the fundamental design parameters of Ethernet networks.
Why Timing Matters:
Consider this scenario:
If A finishes transmitting before the collision evidence returns, A believes the frame was sent successfully. But the frame is actually corrupted. This creates a silent failure—the worst kind of network error.
The absolute worst case for collision detection occurs when two stations at opposite ends of the network transmit at the same time. The collision occurs somewhere in the middle, and evidence of the collision must propagate back to both stations. This defines the Round-Trip Time (RTT) requirement.
The Round-Trip Time (RTT) Constraint:
For collision detection to function correctly:
Frame Transmission Time ≥ 2 × Maximum Propagation Delay
Or equivalently:
Frame Transmission Time ≥ RTT (Round-Trip Time)
This formula encapsulates the fundamental timing requirement. Let's derive it step by step:
T_prop to traverse the entire networkT_propT_prop to return to the sender2 × T_prop = RTT| Parameter | 10 Mbps Ethernet | Calculation/Notes |
|---|---|---|
| Bit Time | 100 ns | 1 / 10 Mbps = 100 × 10⁻⁹ s |
| Maximum Network Diameter | 2,500 m | 5 segments × 500 m (10BASE5 repeater rule) |
| Propagation Speed in Cable | ~2 × 10⁸ m/s | Approximately 0.67c (speed of light) |
| One-Way Propagation Delay | 12.5 μs | 2,500 m / (2 × 10⁸ m/s) |
| Round-Trip Time | 25 μs | 2 × 12.5 μs |
| Bits in RTT | 250 bits | 25 μs / 100 ns per bit |
| Safety Margin | 262 bits | Accounts for repeaters, delays |
| Slot Time | 512 bit times | 51.2 μs (includes safety margin) |
The Slot Time Concept:
Ethernet defines a slot time as the maximum time a station needs to detect a collision. For 10 Mbps Ethernet:
This value includes:
The slot time directly determines the minimum frame size (covered in the next page) and the collision domain diameter (maximum network extent where CSMA/CD functions correctly).
The slot time was carefully engineered to balance competing constraints: too short limits network size, too long reduces efficiency for small frames. The 512-bit choice for 10 Mbps Ethernet represented a practical compromise that worked well for campus-scale networks of the era.
The complete CSMA/CD protocol, with collision detection, can be modeled as a state machine. Understanding this state machine is essential for grasping how the protocol orchestrates transmission, detection, and recovery.
States in the CSMA/CD State Machine:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
// Full CSMA/CD Protocol State Machine enum State { IDLE, CARRIER_SENSE, TRANSMITTING, COLLISION, JAMMING, BACKOFF, RETRY } class CSMAController { state: State = IDLE; attemptCount: number = 0; maxAttempts: number = 16; function handleFrame(frame: Frame): TransmitResult { this.attemptCount = 0; while (this.attemptCount < this.maxAttempts) { // CARRIER SENSE state this.state = CARRIER_SENSE; waitForMediumIdle(); // Wait Inter-Frame Gap (IFG = 96 bit times) delay(IFG); // TRANSMITTING state this.state = TRANSMITTING; startTransmission(frame); // Monitor during transmission while (isTransmitting()) { if (collisionDetected()) { // COLLISION state this.state = COLLISION; stopTransmission(); // JAMMING state - enforce collision this.state = JAMMING; transmitJamSignal(32); // 32 bits of jam this.attemptCount++; if (this.attemptCount >= this.maxAttempts) { return EXCESSIVE_COLLISIONS_ERROR; } // BACKOFF state this.state = BACKOFF; backoffSlots = binaryExponentialBackoff(this.attemptCount); delay(backoffSlots * SLOT_TIME); // RETRY state this.state = RETRY; break; // Exit monitoring loop, retry transmission } } // Check if transmission completed successfully if (this.state == TRANSMITTING) { this.state = IDLE; return SUCCESS; } } this.state = IDLE; return FAILURE; } function binaryExponentialBackoff(k: number): number { // k = attempt number (1 to 16) // Returns random integer in [0, 2^min(k,10) - 1] let maxSlots = Math.pow(2, Math.min(k, 10)) - 1; return randomInteger(0, maxSlots); }}Key State Transitions:
| Current State | Event | Next State | Action |
|---|---|---|---|
| IDLE | Frame to send | CARRIER_SENSE | Begin monitoring medium |
| CARRIER_SENSE | Medium idle for IFG | TRANSMITTING | Start frame transmission |
| TRANSMITTING | No collision, frame complete | IDLE | Frame sent successfully |
| TRANSMITTING | Collision detected | COLLISION | Stop transmission immediately |
| COLLISION | — | JAMMING | Transmit 32-bit jam signal |
| JAMMING | Jam complete | BACKOFF | Calculate random wait time |
| BACKOFF | Wait complete | RETRY | Restart with carrier sense |
| RETRY | — | CARRIER_SENSE | Begin next attempt |
In actual hardware, the collision detection logic operates at clock speeds of 10/100/1000 MHz, making decisions within individual bit times. The state machine is implemented in silicon, not software, for the performance required in real-time collision detection.
The physical mechanism for collision detection varies depending on the transmission medium. Understanding these differences illuminates why CSMA/CD works in some contexts but not others.
Coaxial Cable (10BASE5 and 10BASE2):
Original Ethernet used thick (10BASE5) or thin (10BASE2) coaxial cable as a single shared bus topology:
The transceiver monitors the cable voltage. Normal Manchester encoding produces predictable voltage swings. During collision, the combined voltage of two or more transmitters exceeds normal ranges—typically producing peaks 40-100% higher than single-transmitter levels.
Twisted Pair with Hub (10BASE-T, 100BASE-TX):
When Ethernet moved to Category 3/5 cabling with hubs, the collision detection mechanism changed:
┌─────────┐ ┌─────────┐
│ Station │──TX──────────────RX───────│ │
│ A │──RX──────────────TX───────│ HUB │
└─────────┘ │ │
│ │
┌─────────┐ │ │
│ Station │──TX──────────────RX───────│ │
│ B │──RX──────────────TX───────│ │
└─────────┘ └─────────┘
Each station has separate TX and RX pairs. A station detects collision when:
Since stations only transmit on the TX pair and receive on the RX pair, receiving something while transmitting means another station is also transmitting—a collision.
The Hub's Role:
The hub is a multi-port repeater. When two stations transmit simultaneously:
Modern switches create individual collision domains per port. Each port is isolated—Station A cannot detect Station B's transmission because they're on separate switch ports with buffered connections. This eliminates collisions but also makes CSMA/CD irrelevant. Switched Ethernet operates in full-duplex mode, completely abandoning CSMA/CD.
Why Collision Detection Is Impossible in Wireless:
CSMA/CD cannot work for wireless networks (WiFi) for a fundamental reason:
Wireless stations cannot receive while transmitting. The transmitter overwhelms the receiver—it's like trying to hear a whisper while shouting through a megaphone.
The hidden terminal problem. Station A might not be able to detect Station C's transmission while both are in range of Station B.
This limitation led to the development of CSMA/CA (Collision Avoidance) for 802.11 networks, which attempts to prevent collisions rather than detect them.
The efficiency of collision detection depends on how quickly stations can recognize and respond to collisions. Faster detection means less wasted bandwidth.
Collision Detection Latency:
The time from collision occurrence to station awareness consists of:
For 10 Mbps Ethernet, typical detection delays:
| Parameter | 10 Mbps | 100 Mbps | 1 Gbps |
|---|---|---|---|
| Bit Time | 100 ns | 10 ns | 1 ns |
| Slot Time | 512 bits (51.2 μs) | 512 bits (5.12 μs) | 4096 bits (4.096 μs) |
| Min Frame Size | 64 bytes | 64 bytes | 512 bytes (slotTime) |
| Max Segment | 2500 m | 250 m | 25 m (for half-duplex) |
| Detection Latency | ~100-500 ns | ~10-50 ns | ~1-5 ns |
Why Faster Ethernet Has Shorter Reach:
Notice how maximum segment length decreases as speed increases:
This is a direct consequence of collision detection requirements. At higher speeds:
For Gigabit Ethernet, this constraint became impractical, leading to two solutions:
Virtually all modern Ethernet networks use full-duplex switched connections where CSMA/CD is disabled. Understanding CSMA/CD remains valuable for: (1) legacy network support, (2) understanding network fundamentals, (3) certification exams, and (4) appreciating why switches transformed LAN design.
We've explored the foundational concept of collision detection—the 'CD' in CSMA/CD that made Ethernet reliable on shared media.
What's Next:
With collision detection understood, we need to examine a critical consequence: the minimum frame size requirement. The next page explores why Ethernet frames must be at least 64 bytes long—and what happens when they're not.
You now understand how collision detection works—the physical mechanisms, timing constraints, and protocol architecture that enable stations to detect simultaneous transmissions. Next, we'll see why minimum frame size is a direct consequence of these collision detection requirements.