100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

What is CSMA/CD?

Learn what CSMA/CD is, how carrier sensing, collision detection, and backoff work on shared Ethernet, with interview Q&A.

mediumQ151 of 224 in Computer Networks Est. time: 5 minsLast updated:
Open Code Lab

Expected Interview Answer

CSMA/CD (Carrier Sense Multiple Access with Collision Detection) is the media access method used on legacy shared Ethernet segments where a device listens before transmitting, keeps listening while transmitting to detect collisions, and backs off with a random delay before retrying if a collision occurs.

Before sending, a device performs carrier sense โ€” it listens to the shared medium to check whether another device is already transmitting. If the medium is idle, it transmits, but because two devices can sense an idle line at nearly the same instant, it continues listening while sending to detect a collision (a garbled signal caused by overlapping transmissions). If a collision is detected, both senders stop, send a jam signal to ensure all stations notice the collision, and each waits a random backoff period calculated by the binary exponential backoff algorithm before retrying, reducing the chance of an immediate repeat collision. CSMA/CD was essential on shared-medium hubs and coaxial Ethernet, but full-duplex switched Ethernet eliminates collisions entirely because each device has a dedicated link to the switch, making CSMA/CD effectively obsolete on modern wired LANs.

  • Lets multiple devices share one physical medium without a central scheduler
  • Detects collisions in real time instead of only failing silently
  • Binary exponential backoff spreads out retries to avoid repeat collisions
  • Made shared-medium Ethernet practical before switches existed

AI Mentor Explanation

CSMA/CD is like two batters calling for a run on a shared pitch: each batter first checks that the other is not already mid-call before shouting (carrier sense), but if both shout at once their calls collide and become unintelligible (collision), so both stop immediately, shout a quick abort signal so everyone knows what happened (jam signal), and each waits a random pause before calling again (backoff) to avoid colliding a second time. This continuous listen-while-talking behavior is exactly what CSMA/CD does on a shared network cable. Once a purpose-built dedicated line replaces the shared pitch, this whole collision-avoidance dance becomes unnecessary, just as switched Ethernet made CSMA/CD obsolete.

Step-by-Step Explanation

  1. Step 1

    Carrier sense

    A device listens to the shared medium and only transmits if it appears idle.

  2. Step 2

    Transmit and monitor

    While sending, the device keeps listening to detect if its signal collides with another.

  3. Step 3

    Collision & jam signal

    On collision, both senders stop and broadcast a jam signal so all stations know a collision occurred.

  4. Step 4

    Backoff and retry

    Each sender waits a random period (binary exponential backoff) before attempting retransmission.

What Interviewer Expects

  • Explains carrier sense, collision detection, and backoff as three distinct phases
  • Names binary exponential backoff as the retry strategy
  • Knows CSMA/CD applied to shared/half-duplex Ethernet, not switched full-duplex
  • Understands why modern switched networks make CSMA/CD largely obsolete

Common Mistakes

  • Confusing CSMA/CD with CSMA/CA (used in Wi-Fi, which avoids rather than detects collisions)
  • Thinking CSMA/CD still governs traffic on modern switched, full-duplex Ethernet
  • Forgetting the jam signal step that notifies all stations of a collision
  • Assuming backoff delay is fixed rather than randomized and exponential

Best Answer (HR Friendly)

โ€œCSMA/CD was the traffic rule older wired networks used so that multiple devices could share one cable without constantly talking over each other. A device listens before it sends, keeps listening while it sends to catch any collision, and if a collision happens, both devices back off for a random moment before trying again. Modern switches give each device its own private link, so this whole mechanism is rarely needed today.โ€

Code Example

Checking for collisions and duplex mismatches on a Linux interface
# Check interface statistics for collisions (legacy shared/half-duplex segments)
ip -s link show eth0

# Example relevant output line:
# RX: bytes  packets  errors  dropped  overrun  mcast
# TX: bytes  packets  errors  dropped  carrier  collsns

# Confirm the negotiated duplex mode (half-duplex still uses CSMA/CD-style behavior)
ethtool eth0 | grep Duplex

Follow-up Questions

  • How does CSMA/CA in Wi-Fi differ from CSMA/CD in wired Ethernet?
  • Why does full-duplex switched Ethernet eliminate the need for CSMA/CD?
  • What is binary exponential backoff and how does it calculate wait times?
  • What is a collision domain, and how do switches shrink it?

MCQ Practice

1. What does CSMA/CD primarily add on top of carrier sensing?

CSMA/CD detects collisions during transmission and triggers a randomized backoff before retrying.

2. On which type of Ethernet segment is CSMA/CD actually needed?

CSMA/CD matters on shared or half-duplex media where multiple devices contend for the same channel.

3. What does a device do immediately after detecting a collision?

Both senders stop, send a jam signal, and then apply randomized backoff before retrying.

Flash Cards

What does CSMA/CD stand for? โ€” Carrier Sense Multiple Access with Collision Detection.

What happens on a collision? โ€” Both senders stop, send a jam signal, and apply randomized binary exponential backoff.

Where is CSMA/CD relevant today? โ€” Legacy shared or half-duplex Ethernet; largely obsolete on switched full-duplex LANs.

How does a device decide to transmit? โ€” It senses the carrier is idle first, then transmits while continuing to listen.

1 / 4

Continue Learning