Loading learning content...
Imagine a conference room where multiple people need to speak, but everyone shares a single microphone. Without coordination, chaos ensues—voices overlap, messages become garbled, and meaningful communication breaks down. This is precisely the challenge that early Ethernet networks faced.
Ethernet's genius solution: CSMA/CD—Carrier Sense Multiple Access with Collision Detection. This elegant protocol transformed an inherently contentious shared medium into a reliable, high-performance communication system that would become the dominant LAN technology for decades.
By the end of this page, you will understand the complete operational mechanics of CSMA/CD in Ethernet—from carrier sensing through collision detection to the jam signal and recovery process. You'll grasp why this protocol was so successful and how its design constraints shaped the fundamental parameters of Ethernet networks that persist even today in modern switched environments.
To truly appreciate CSMA/CD, we must understand the environment in which it emerged and the problem it was designed to solve.
The Birth of Ethernet:
In 1973, Robert Metcalfe and David Boggs at Xerox PARC developed the first Ethernet network to connect Alto workstations. They drew inspiration from the ALOHANET system developed at the University of Hawaii, which used radio waves to connect computers across the Hawaiian islands. ALOHAnet's simple "transmit and hope" approach demonstrated that random access protocols could work, but its maximum throughput of only 18.4% (for pure ALOHA) or 36.8% (for slotted ALOHA) left enormous room for improvement.
Metcalfe's doctoral dissertation at Harvard involved analyzing the ALOHA protocol. His key insight was that by adding carrier sensing and collision detection to the ALOHA approach, efficiency could be dramatically improved—from 36.8% to theoretical maximums approaching 100% under ideal conditions.
The Shared Medium Reality:
Original Ethernet used a thick coaxial cable ("thicknet") as a shared broadcast medium. Every station connected to this cable could potentially transmit at any time. The fundamental challenge was coordination:
CSMA/CD emerged as an elegant solution to this distributed coordination problem, using the physics of the medium itself as a coordination mechanism.
| Protocol | Key Innovation | Peak Efficiency | Collision Handling |
|---|---|---|---|
| Pure ALOHA | Random transmission | 18.4% | Wait random time, retry |
| Slotted ALOHA | Time synchronization | 36.8% | Wait random slots, retry |
| CSMA | Listen before transmit | ~55% | Still wait and retry |
| CSMA/CD | Detect collisions during transmission | ~85-95% | Stop immediately, back off |
CSMA/CD operates on three fundamental principles, each addressing a specific aspect of the shared medium access problem. Understanding these pillars is essential to grasping why the protocol works so effectively.
Collision Detection was Ethernet's crucial innovation over basic CSMA. In radio-based systems (like ALOHA), stations cannot easily transmit and receive simultaneously. But on a wired medium, voltage or current changes caused by collisions can be detected during transmission. This enables stations to abort failed transmissions quickly rather than wasting time completing frames that will be discarded anyway.
Why "Carrier Sense" Matters:
The term "carrier" comes from analog telecommunications, where a carrier wave is modulated with information. In Ethernet, carrier sensing means detecting the presence of a signal on the wire—indicating that another station is transmitting.
On coaxial Ethernet, carrier sensing was implemented by monitoring the voltage level on the cable. When no station is transmitting, the cable sits at a baseline voltage. When a station transmits, it impresses Manchester-encoded signals onto the cable, causing voltage fluctuations that other stations can detect.
This simple mechanism eliminates most potential collisions. If a station senses a carrier, it knows the medium is busy and waits. The probability that two stations will begin transmitting in the brief moment when the medium first becomes idle is much lower than the probability that two stations will transmit within a vulnerable period of a frame length (as in ALOHA).
The CSMA/CD algorithm can be precisely specified as a state machine that governs station behavior. Let's trace through the complete operation step by step, examining what happens at each stage and why.
After 16 failed transmission attempts, Ethernet gives up and reports an error to the higher layer. This is relatively rare in well-designed networks but can occur under extreme congestion. The error is reported as an excessive collision error, indicating serious network problems requiring administrator attention.
The Interframe Gap (IFG) Explained:
The interframe gap serves multiple critical purposes:
Receiver Recovery: Receivers need time to process the just-completed frame before another arrives. The IFG provides this processing window.
Transceiver Turnaround: Hardware needs time to switch from receive mode to transmit mode (and vice versa).
Signal Settling: The medium needs time for electrical transients to subside after a transmission ends.
Fair Access: The IFG prevents a single station from monopolizing the medium with back-to-back transmissions.
In 10 Mbps Ethernet, the IFG is 9.6 μs (96 bit times). For 100 Mbps Ethernet, it's 0.96 μs, and for Gigabit Ethernet, it's 96 ns. The IFG scales proportionally with speed to maintain the same 96 bit times.
Understanding how collisions are physically detected requires diving into the electrical characteristics of Ethernet signaling. The mechanism varies slightly depending on the physical medium, but the principle remains consistent.
Coaxial Ethernet (10BASE5, 10BASE2):
On coaxial cable, collision detection uses DC voltage levels. When a single station transmits, the voltage on the cable follows a predictable pattern based on the transmitted data (Manchester encoding). When two stations transmit simultaneously, their voltages combine:
The transceiver monitors these voltage levels and detects a collision when the voltage deviates from expected single-transmitter levels. Specifically, if the average DC level exceeds a threshold (indicating two transmitters driving the line high simultaneously), a collision is declared.
| Medium | Detection Method | Collision Indicator |
|---|---|---|
| 10BASE5 (Thick Coax) | DC voltage monitoring | Voltage exceeds ±1.5V normal range |
| 10BASE2 (Thin Coax) | DC voltage monitoring | Same as 10BASE5 |
| 10BASE-T (Twisted Pair) | Simultaneous TX/RX activity | Signal received while transmitting |
| 100BASE-TX | Simultaneous TX/RX activity | Link pulse on receive pair during TX |
| Fiber Optic | Loop-back detection | Signal on receive fiber during TX |
Twisted Pair Ethernet (10BASE-T and beyond):
In twisted pair Ethernet, separate wire pairs are used for transmit and receive. A station connects to a hub (or in half-duplex mode, a switch) with one pair for sending and another for receiving. Under normal operation:
This makes collision detection straightforward: receiving any signal while transmitting indicates a collision.
The Hub's Role:
In a hub-based network, the hub acts as a multiport repeater. When any station transmits, the hub repeats that signal to all other ports. If two stations transmit simultaneously, their signals collide within the hub, and the hub transmits a jam signal to all ports, ensuring everyone detects the collision.
Modern switched Ethernet typically operates in full-duplex mode, where each station has a dedicated connection to a switch port with separate transmit and receive paths. In this configuration, collisions cannot occur, and CSMA/CD is disabled. This is why modern Gigabit and 10 Gigabit Ethernet networks don't use CSMA/CD, even though they inherit Ethernet's frame format and addressing.
When a collision is detected, the transmitting station doesn't simply stop—it sends a jam signal before ceasing transmission. This seemingly counterintuitive behavior serves a crucial purpose in the CSMA/CD protocol.
Jam Signal Specifications:
The Collision Event Timeline:
The jam signal ensures that even if the collision detection happens near the end of a minimum-sized frame, there's enough collision energy on the wire for all stations to recognize the event.
The 32-bit jam signal length was chosen to be long enough to ensure reliable collision detection across maximum-length cable segments while being short enough to minimize wasted bandwidth. This seemingly small detail is actually carefully engineered based on propagation delays and detection thresholds.
Ethernet uses 1-persistent CSMA, meaning that when a station has a frame to send and finds the medium busy, it persistently monitors the medium and transmits with probability 1 (i.e., certainly) as soon as the medium becomes idle. This behavior has important implications for network performance.
The Hidden Cost of 1-Persistence:
Consider this scenario: Station A is transmitting a long frame while stations B, C, and D all have frames queued. All three are 1-persistently waiting for the medium to become idle. The moment A finishes:
This scenario demonstrates why Ethernet performance degrades under heavy load. The 1-persistent behavior, while optimal for low-load conditions, becomes pathological when many stations are waiting.
Alternative: p-Persistent CSMA
In p-persistent CSMA, a station that has been waiting transmits with probability p (e.g., 0.5) when the medium becomes idle, and defers with probability (1-p). This spreads out transmission attempts and reduces collision probability. However, it increases delay, so Ethernet chose 1-persistence and relies on binary exponential backoff to manage contention.
Theoretical analysis of CSMA/CD predicts excellent efficiency, but real-world performance depends on many factors. Understanding these factors helps network designers optimize Ethernet installations.
Efficiency Formula:
The maximum efficiency of CSMA/CD can be approximated by:
$$\text{Efficiency} = \frac{1}{1 + 5 \times \frac{t_{prop}}{t_{trans}}}$$
Where:
The ratio t_prop/t_trans is often denoted as a. For Ethernet to be efficient, we want a to be small, meaning frames should be long compared to propagation delay.
| Parameter | Value | Effect on Efficiency |
|---|---|---|
| Lower propagation delay | Shorter cables, fewer repeaters | Higher efficiency (smaller a) |
| Larger frame sizes | More data per frame | Higher efficiency (smaller a) |
| Higher bandwidth | 10 Mbps → 100 Mbps | Lower efficiency (unless cables shortened) |
| More stations | 10 → 100 stations | More collisions, lower efficiency |
| Higher load | 10% → 90% utilization | More collisions, lower efficiency |
Practical Performance Numbers:
In well-designed 10 Mbps Ethernet networks:
The 40% Rule of Thumb:
Network engineers traditionally recommend keeping shared Ethernet segments below 40% sustained utilization. Above this point, collision rates increase rapidly, and the network becomes less predictable. This is one reason why switched Ethernet (with dedicated collision domains per port) became so popular—it eliminates shared medium contention entirely.
Under heavy load, CSMA/CD can exhibit a 'capture effect' where a station that just finished transmitting has an advantage. Its backoff counter is at 0, while other stations may have higher backoff values from previous collisions. This can cause temporary unfairness, though it usually balances out over time.
We've explored the complete operation of CSMA/CD, the protocol that made Ethernet possible and practical. Let's consolidate the key insights:
What's Next:
Now that we understand how CSMA/CD detects and handles collisions, we face a critical question: How do we ensure collisions are always detected? The answer lies in the minimum frame size requirement of 64 bytes. In the next page, we'll explore the mathematical derivation of this fundamental Ethernet parameter and understand why shorter frames would break the collision detection mechanism.
You now understand the operational mechanics of CSMA/CD in Ethernet networks. This protocol enabled reliable shared-medium communication and laid the foundation for the dominant LAN technology. Next, we'll examine why the minimum frame size of 64 bytes is essential for CSMA/CD to function correctly.