Carrier Sense Multiple Access with Collision Detection (CSMA/CD)
1. Principle of CSMA (Carrier Sense Multiple Access)
ALOHA protocols suffer low throughput because stations transmit blindly without checking the channel ("talk before listening").
CSMA introduces the rule: "Listen Before You Talk" (LBT):
- A station with a frame to transmit first senses the physical medium (carrier).
- If the medium is busy, the station defers transmission.
- If the medium is idle, the station transmits.
CSMA Persistence Strategies:
- 1-Persistent CSMA:
- If idle: Transmit immediately (with probability 1).
- If busy: Continue listening continuously until the channel becomes idle, then transmit immediately.
- Issue: If two stations are waiting for a busy channel to clear, both will transmit at the exact instant it clears, causing a guaranteed collision!
- Non-Persistent CSMA:
- If idle: Transmit immediately.
- If busy: Wait a random period of time before sensing the channel again.
- Advantage: Reduces collisions; Drawback: Channel may sit idle while stations are in backoff, increasing latency.
- p-Persistent CSMA (Used in Slotted Channels):
- If idle: Transmit with probability ; defer to the next slot with probability .
2. Collision Detection: Adding "CD" to CSMA
Even with carrier sensing, collisions still occur due to Propagation Delay ():
- Station A senses the channel idle at time and transmits.
- Station B, located at the far end of the cable, senses the channel at time before Station A's signal has had time to propagate to B.
- Station B also senses the line idle and transmits Collision occurs in transit!
In standard CSMA, stations continue transmitting the rest of the frame even after a collision, wasting channel time.
CSMA/CD adds Collision Detection: "Listen While Talking":
- The transmitting station continuously monitors the electrical voltage on the cable while transmitting.
- If the observed voltage exceeds a threshold (), a collision is detected.
- The station aborts transmission immediately, saving valuable channel bandwidth!
3. Mathematical Condition for Collision Detection
A transmitting station must be able to detect a collision before it finishes transmitting its frame.
In the worst-case scenario, the collision occurs just before the signal reaches the furthest station (taking time ). The collision signal takes another to travel back to the original sender:
For the transmitter to still be transmitting when the collision signal returns:
*(This is the fundamental reason why classic Ethernet over has a strict minimum frame size of 64 bytes (512 bits)!)*
4. The Jam Signal and Exponential Backoff
When a station detects a collision:
- Transmits a Jam Signal: A 32-to-48 bit pattern (e.g., alternating
1010...) broadcast onto the wire to ensure all other stations detect the collision and abort. - Invokes Truncated Binary Exponential Backoff (BEB):
- Let be the collision attempt count for this frame ().
- The station chooses a random integer uniformly from the range:
- The station waits a backoff time:
- If after 16 consecutive collision attempts () the frame still fails, the station gives up and reports an unrecoverable transmission error to the upper layer.
5. Flowchart of CSMA/CD Operation
Frequently Asked Questions
QCalculate the minimum frame size for a $1\text{ Gbps}$ CSMA/CD network with a maximum cable length of $1\text{ km}$. Signal speed in cable is $2 \times 10^8\text{ m/s}$.
- .
- Round-trip delay = .
- Minimum Frame Size:
QWhy is CSMA/CD disabled in Full-Duplex switched Ethernet?
In full-duplex switched Ethernet, each station has dedicated transmit () and receive () twisted-pair wires directly connected to an intelligent switch port (microsegmentation). Transmissions can never physically collide on the wire, making collision detection and backoff obsolete.
QWhat is the purpose of the Jam Signal in CSMA/CD?
It reinforces the collision voltage on the medium, ensuring that all communicating stations across the entire length of the cable unambiguously detect the collision and discard their partial frames.
QHow does truncated binary exponential backoff work in CSMA/CD?
After the -th collision a station picks a random integer from (capped at ) and waits slot time (51.2 µs in 10 Mbps Ethernet). After 16 failed attempts the frame is dropped and an error is reported.