CSMA/CD Explained: Collision Detection, Binary Backoff and Solved Numericals

Learn why carrier sensing cannot prevent every collision, then solve propagation, minimum-frame, backoff, and efficiency questions on one consistent network.

KnowledgeGate Team

Exam prep & CS education

Updated 8 Nov 20266 min read
CSMA/CD Explained: Collision Detection, Binary Backoff and Solved Numericals

A station listens before transmitting, so why can a collision still happen? A distant signal takes time to arrive, so the medium may appear idle locally after another station has started. CSMA/CD involves collision detection, the minimum-frame condition, binary exponential backoff, and Computer Networks numericals. The CS Fundamentals category links CSMA/CD with the surrounding Computer Networks concepts.

CSMA/CD meaning and the network in which it works

CSMA/CD stands for Carrier Sense Multiple Access with Collision Detection. In operation, a station:

  1. Senses the carrier by listening to the shared medium.

  2. Contends with multiple stations allowed to access that medium.

  3. Transmits after sensing idle at its own location.

  4. Detects collisions by monitoring while it transmits.

This is a medium-access-control function at the data-link layer. It assumes one shared, half-duplex broadcast medium forming a collision domain. Switched full-duplex Ethernet isolates each link and permits simultaneous sending and receiving, removing the shared-medium collision problem.

CSMA/CD decides who may use one shared link. Data Link Layer Access Control: ALOHA and CSMA/CD Math compares the wider ALOHA, controlled-access and channelization families. CSMA/CD itself narrows the task to collision timing, minimum frame size, binary exponential backoff and efficiency.

The CSMA/CD transmit algorithm, state by state

The transmit loop follows a fixed order:

  1. Sense the carrier.

  2. If the medium is busy, defer.

  3. If it is idle, begin transmitting.

  4. Monitor the medium throughout the transmission.

  5. If a collision is detected, stop the frame and send a jam indication so every contender can recognise the collision.

  6. Choose a random backoff measured in slot times.

  7. Sense the carrier again and retry.

Carrier sense is local evidence, not instantaneous global knowledge. A's signal may not have reached B, so B can sense idle and still collide with A.

Collision handling is also different from TCP Congestion Control for GATE. CSMA/CD reacts when stations use one shared link simultaneously. TCP reacts to overload along an end-to-end path.

Why two stations can both sense an idle medium

Use one network throughout: A and B sit at opposite ends of a 2,000 m shared cable. Propagation speed is v = 2 × 10^8 m/s, and data rate is R = 100 Mb/s.

The one-way propagation delay is:

tau = distance / speed = 2,000 m / (2 × 10^8 m/s) = 10^-5 s = 10 microseconds

A starts at t = 0. At t = 9 microseconds, A's signal is still 200 m from B, so B senses idle and begins. After another 0.5 microseconds, their fronts meet 1,900 m from A and 100 m from B.

A's signal reaches B at t = 10 microseconds, so B detects the collision then. B's signal reaches A at t = 19 microseconds, when A detects it.

In the limiting case, B starts just before A's signal arrives at 10 microseconds. Evidence of the collision can then return to A just before 20 microseconds = 2 tau. That is why the detection window uses round-trip propagation rather than one-way delay.

Space-time diagram of stations A and B across a 2,000 m cable, with B detecting the collision at 10 microseconds and A at 19 microseconds.

Worked example 1: minimum frame size from propagation delay

The sender must still be transmitting when the worst-case collision indication returns. Therefore:

frame transmission time >= 2 tau

Since frame transmission time is L / R:

L_min / R >= 2 tau, so L_min >= 2 tau R

Substitute the values:

L_min = (20 × 10^-6 s) × (100 × 10^6 bit/s) = 2,000 bit = 250 bytes

Seconds cancel, leaving bits. Then 2,000 / 8 = 250 bytes.

Now test two candidates. A 180-byte frame contains 180 × 8 = 1,440 bits. Its transmission time is:

1,440 bit / (100 × 10^6 bit/s) = 14.4 × 10^-6 s = 14.4 microseconds

It can finish before the worst-case collision returns, so it is too short. A 250-byte frame lasts 20 microseconds and meets this theoretical network's minimum. Real Ethernet standards set their own minimum frame size, so treat 250 bytes as this example network's answer only.

The earlier Ethernet in the Data Link Layer: Frame Format, CSMA/CD, and Worked GATE Examples ties the standard 64-byte floor to frame fields, backoff and switch behaviour. This 100 Mb/s case isolates the theoretical propagation-timing calculation.

Worked example 2: binary exponential backoff after a collision

For this network, one slot is the 20 microsecond collision-detection window. Suppose a textbook question says a station has just suffered its third collision. With r = 3, it samples an integer K uniformly from:

{0, 1, 2, 3, 4, 5, 6, 7}

The retransmission delay is K × slot time. If the question gives K = 5:

delay = 5 × 20 microseconds = 100 microseconds

For the expected delay, the average of the eight possible values is:

E[K] = (0 + 1 + 2 + 3 + 4 + 5 + 6 + 7) / 8 = 28 / 8 = 3.5

Therefore, E[delay] = 3.5 × 20 = 70 microseconds.

After one more collision, the textbook range for r = 4 becomes K in {0, ..., 15}. The larger random window reduces repeat collisions. It does not reserve the channel, and every retry begins by sensing.

Backoff slot strip after a third collision: K = 5 gives a 100 microsecond retry, with a wider K = 0 to 15 window after a fourth.

How exams test CSMA/CD numericals and sequences

Recurring question forms include:

  • calculating one-way and round-trip propagation delays;

  • finding minimum frame size or maximum cable length from T_frame >= 2 tau;

  • tracing when each endpoint detects a collision;

  • finding a backoff range, a given delay, or an expected delay;

  • arranging the transmit algorithm in order; and

  • distinguishing collision domains from broadcast domains, and CSMA/CD from wireless CSMA/CA.

An efficiency question may supply a textbook approximation. For a 1,000-byte frame on this network:

T_frame = 8,000 bit / (100 × 10^6 bit/s) = 80 microseconds

So a = tau / T_frame = 10 / 80 = 0.125. If the question supplies efficiency approximately 1 / (1 + 5a), then:

efficiency approximately 1 / (1 + 5 × 0.125) = 1 / 1.625 = 0.615, or about 61.5%.

This approximation is separate from the exact minimum-frame inequality and does not represent observed throughput after collision and backoff overhead.

Common traps and the correction for each

  • Using tau instead of 2 tau: draw the outward signal and returning collision path before inserting values.

  • Assuming idle means nobody has started: idle describes what a station can sense locally after propagation delay.

  • Treating slot time as any frame's transmission time: in these numericals, the slot is the collision-detection window supplied or derived by the question.

  • Mixing different mechanisms: identify the layer and medium first. Collision is not TCP congestion, CSMA/CD is not wireless collision avoidance, and a switched full-duplex link is not a shared half-duplex collision domain.

  • Treating K = 5 as fixed after every third collision: 5 is one sampled value from 0 through 7 in this example.

CSMA/CD short version and the next step

Listen, transmit, keep listening, abort on collision, wait a random number of slots, and retry. Retain L_min >= 2 tau R and backoff delay = K × slot time. Now redraw the 2,000 m timeline from memory, then stretch the cable to 5,000 m at the same 100 Mb/s: the one-way delay grows to 25 microseconds, the detection window to 50 microseconds, and the theoretical minimum becomes (50 × 10^-6) × (100 × 10^6) = 5,000 bits = 625 bytes. Distance moves both the detection window and the frame floor, while rate moves only the floor. Continue through Zero to Hero Complete CS Course for the broader course path, or use CS Fundamentals for Placements by Sanchit Sir as the interview-focused alternative.