Skip to content
Home » CSMA/CD and CSMA/CA Protocols

CSMA/CD and CSMA/CA Protocols

Both CSMA/CD and CSMA/CA are Random Access protocols used in the MAC sub-layer to control access to a shared communication medium.

CSMA stands for:

Carrier Sense Multiple Access

The basic idea is:

Before transmitting, a device listens to the channel to check whether another device is transmitting.

There are two important versions:

  1. CSMA/CD – Carrier Sense Multiple Access with Collision Detection
  2. CSMA/CA – Carrier Sense Multiple Access with Collision Avoidance

1. CSMA – Basic Idea

Suppose several computers share one network:

Computer A ──┐
Computer B ──┤
Computer C ──┼── Shared Network
Computer D ──┘

When Computer A wants to send data, it first senses/listens to the channel.

If channel is free:

It transmits.

If channel is busy:

It waits.

However, simply checking the channel does not completely eliminate collisions.

Why?

Because two computers may check the channel at almost the same time and both find it free.

A → Channel is free ✓
B → Channel is free ✓

A ─────►
B ─────►

      COLLISION

This is where CD and CA approaches differ.


2. CSMA/CD

CSMA/CD = Carrier Sense Multiple Access with Collision Detection

It was traditionally used in shared, half-duplex Ethernet.

The important idea is:

Listen → Transmit → Detect collision → Stop → Wait → Retransmit


Working of CSMA/CD

Step 1: Carrier Sense

The computer first listens to the network.

Is channel free?
       ↓
     YES
       ↓
   Transmit

If the channel is busy, the computer waits.


Step 2: Multiple Access

Many computers share the same communication channel.

Therefore, multiple computers have the opportunity to transmit.


Step 3: Collision Detection

While transmitting, the computer continues monitoring the channel.

If it detects that another computer is transmitting at the same time:

Collision occurs.

A ─────────►
       ◄───────── B

          ✕
      COLLISION

Step 4: Stop Transmission

When a collision is detected, both computers stop transmitting.

They send a jam signal so that other stations know that a collision has occurred.


Step 5: Random Backoff

The computers wait for a random period of time before trying again.

This reduces the probability that both computers will retransmit simultaneously.


Step 6: Retransmission

After waiting, the computer again senses the channel and retransmits the frame.

Sense
  ↓
Transmit
  ↓
Collision?
 ↙     ↘
No      Yes
↓        ↓
Success  Stop
          ↓
      Random Wait
          ↓
       Retransmit

3. Binary Exponential Backoff

CSMA/CD uses a technique called Binary Exponential Backoff.

After a collision, the station chooses a random waiting time.

As collisions continue, the possible waiting range becomes larger.

For example:

1st collision → choose from a small range
2nd collision → choose from a larger range
3rd collision → choose from an even larger range

This reduces repeated collisions.

Important point

Binary exponential backoff helps reduce the probability of repeated collisions.


4. Example of CSMA/CD

Suppose A and B want to send data.

A → senses channel → Free
B → senses channel → Free

Both start transmitting.

A ─────────►
B ─────────►
       ↓
    Collision

Both detect the collision.

A → Stop → Random wait
B → Stop → Random wait

Suppose A waits 2 units and B waits 5 units.

A retransmits first.

A ─────────────► SUCCESS

Then B can transmit.


5. CSMA/CA

CSMA/CA = Carrier Sense Multiple Access with Collision Avoidance

It is mainly associated with wireless LANs such as Wi-Fi.

The important idea is:

Try to avoid collisions before they happen.

This is different from CSMA/CD.


6. Why CSMA/CA is Used in Wireless Networks

In wireless communication, detecting a collision while transmitting is difficult.

Consider:

A )))       ((( B
      Wireless

A may not be able to reliably detect that B is also transmitting.

Therefore, instead of detecting collisions after they happen, wireless networks try to avoid collisions before transmission.


7. Working of CSMA/CA

The basic process is:

Sense → Wait → Random Backoff → Transmit → Acknowledgement

Step 1: Sense the channel

The device checks whether the wireless channel is busy.

Step 2: If busy

It waits.

Step 3: If free

It does not necessarily transmit immediately.

It waits for the appropriate interframe space and selects a random backoff period.

Step 4: Transmit

When the backoff counter reaches zero, the station transmits.

Step 5: ACK

The receiver sends an ACK (Acknowledgement) after successfully receiving the frame.

Sender                    Receiver
  |                           |
  |---- DATA ---------------->|
  |                           |
  |<----------- ACK ----------|

If the sender does not receive an ACK, it assumes that the frame may have been lost/collided and tries again.


8. RTS/CTS in CSMA/CA

CSMA/CA can also use:

  • RTS = Request to Send
  • CTS = Clear to Send

This is particularly useful when there is a possibility of the hidden terminal problem.

The process is:

Sender                    Receiver
   |                         |
   |-------- RTS ----------->|
   |<-------- CTS -----------|
   |                         |
   |-------- DATA ---------->|
   |<-------- ACK -----------|

Meaning

RTS: “I want to send data.”

CTS: “You may send.”

Then the sender transmits the data.

Other stations that hear the CTS remain silent for the specified period.


9. Hidden Terminal Problem

This is an important reason for using RTS/CTS.

Suppose:

A )))      B      ((( C

A and C cannot hear each other because they are too far apart.

Both want to send data to B.

A checks the channel and thinks it is free.

C also checks the channel and thinks it is free.

Both transmit:

A ─────► B ◄───── C

       COLLISION

This is called the hidden terminal problem.

RTS/CTS can help reduce this problem.


10. CSMA/CD vs CSMA/CA

FeatureCSMA/CDCSMA/CA
Full formCarrier Sense Multiple Access with Collision DetectionCarrier Sense Multiple Access with Collision Avoidance
Main useTraditional shared EthernetWireless LAN/Wi-Fi
ApproachDetect collisionTry to avoid collision
CollisionDetected after it occursMinimized/avoided before transmission
ACKNot the basic collision mechanismImportant for successful reception
BackoffUsed after collisionUsed before transmission and after failures
RTS/CTSNot normally usedCan be used
Wireless networksNot suitableSuitable
Modern switched EthernetGenerally not neededNot applicable to wired Ethernet

11. Very Important Difference

Remember this simple rule:

CSMA/CD

“I will transmit, and if a collision happens, I will detect it.”

CSMA/CA

“I will try to avoid a collision before transmitting.”


12. Simple Real-Life Example

Imagine students talking in a classroom.

CSMA/CD

A student starts speaking while listening.

If two students speak together:

“Collision!”

They both stop, wait for a random time, and try again.

Detect → Stop → Wait → Retry

CSMA/CA

Students first listen to the classroom.

If the classroom is free, they wait for their turn/random waiting period and then speak.

Listen → Wait → Speak → Get confirmation


13. Advantages

CSMA/CD

  • Simple concept.
  • Efficient for traditional shared Ethernet.
  • Detects collisions quickly.
  • Uses backoff to reduce repeated collisions.

CSMA/CA

  • Suitable for wireless networks.
  • Helps reduce collisions.
  • ACK provides confirmation of successful delivery.
  • RTS/CTS can reduce hidden-terminal problems.

14. Disadvantages

CSMA/CD

  • Collisions can still occur.
  • Performance decreases when network traffic becomes heavy.
  • Not suitable for modern full-duplex switched Ethernet where collisions do not normally occur.

CSMA/CA

  • Cannot completely eliminate collisions.
  • Requires additional waiting and control mechanisms.
  • Overhead is higher.
  • Wireless conditions can make collision avoidance difficult.

⭐ Exam Revision

CSMA
  │
  ├── CSMA/CD
  │     ↓
  │   Collision Detection
  │     ↓
  │   Traditional shared Ethernet
  │
  └── CSMA/CA
        ↓
      Collision Avoidance
        ↓
      Wi-Fi / Wireless LAN

Remember:

CD = Collision Detection

CA = Collision Avoidance

CSMA/CD → Detect collision after it happens

CSMA/CA → Try to avoid collision before it happens

RTS/CTS → Helps solve the Hidden Terminal Problem