CSMA/CD – Carrier Sense Multiple Access with Collision Detection

 

CSMA/CD – Carrier Sense Multiple Access with Collision Detection

CSMA/CD is an improvement over CSMA that not only senses the channel before transmission but also monitors the channel during transmission to detect collisions.

CSMA stands for Carrier Sense Multiple Access, and CD stands for Collision Detection.

Ordinary CSMA does not specify what a station should do after a collision. CSMA/CD adds a procedure to detect collisions, abort the transmission, and retransmit the frame later.

1. Basic principle

CSMA/CD follows three important actions:

  1. Listen before transmitting: Check whether the channel is idle.

  2. Listen while transmitting: Monitor the channel continuously to determine whether a collision has occurred.

  3. Abort and retry: If a collision is detected, stop transmitting and follow the back-off procedure before trying again.

The main difference is:

  • CSMA: Senses the medium before transmitting.

  • CSMA/CD: Senses the medium before transmitting and detects collisions while transmitting.

2. How does CSMA/CD work?

The operation can be understood through the following sequence.



The station uses one of the persistence methods—1-persistent, nonpersistent, or p-persistent—to decide when to begin transmission.

3. How does CSMA/CD detect a collision?

Consider two stations, A and C, connected to the same shared medium.

Collision between Stations A and C


  1. At time \(t_1\), Station A starts transmitting its frame.

  2. At time \(t_2\), Station C has not yet received A's first bit. C senses the channel as idle and starts transmitting.

  3. After \(t_2\), the signals collide somewhere along the medium.

  4. At time \(t_3\), C receives A's signal and detects the collision. C immediately aborts transmission.

  5. At time \(t_4\), A receives C's signal and detects the collision. A also aborts transmission.

Transmission durations

Station A

\(t_4-t_1\)

Station C

\(t_3-t_2\)

The important point is that each station detects the collision when the other station's signal reaches it. It then stops transmitting rather than continuing to send the entire frame.



4. Why does CSMA/CD send a jamming signal?

After detecting a collision, the station sends a short jamming signal.

Its purpose is to ensure that the other stations also become aware of the collision.

The sequence is:

Collision detected
        ↓
Abort frame transmission
        ↓
Send jamming signal
        ↓
Choose random back-off time
        ↓
Try transmitting again

The jamming signal is not the data frame. It is a signal used to make the collision known to other stations.

5. Minimum frame size in CSMA/CD

This is an important concept .

For collision detection to work, a station must still be transmitting when a collision occurs and its effect reaches the sender.

Therefore, the frame transmission time must be at least twice the maximum propagation time:

\[ \boxed{T_{fr}\geq 2T_p} \]

where:

  • \(T_{fr}\) = frame transmission time

  • \(T_p\) = maximum propagation time

Why is this necessary?

Consider the worst case, where two stations are at opposite ends of the network.

  1. Station A starts transmitting.

  2. Its signal takes \(T_p\) to reach Station B.

  3. Station B begins transmitting just before A's signal reaches it.

  4. The effect of the collision takes another \(T_p\) to reach Station A.

Thus, Station A may need to transmit for a total of \(2T_p\) to detect the collision.

If the frame finishes before then, A might not detect the collision.

Example 

Given:

  • Bandwidth = 10 Mbps

  • Maximum propagation time \(T_p=25.6\,\mu s\)

Step 1: Find minimum frame transmission time.

\[ T_{fr}=2T_p \]
\[ T_{fr}=2(25.6)=51.2\,\mu s \]

Step 2: Find minimum frame size.

\[ \text{Frame size}=\text{Bandwidth}\times T_{fr} \]
\[ =10\times10^6\times51.2\times10^{-6} \]
\[ \boxed{512\text{ bits}=64\text{ bytes}} \]

Therefore, the minimum frame size is 512 bits, or 64 bytes.

6. Back-off procedure after a collision

CSMA/CD uses a random back-off procedure to reduce the chance that stations involved in a collision will collide again.

The procedure is:

  1. Initialize the attempt counter \(K=0\).

  2. If a collision occurs, increment \(K\).

  3. Generate a random number \(R\) from \(0\) to \(2^K-1\).

  4. Calculate the back-off time.

  5. Wait and retry using a persistence method.

  6. If the attempt limit is reached, stop retrying for now.


\[ \boxed{T_B=R\times T_{fr}} \]

where \(T_B\) is the back-off time and \(R\) is the random number.

For example:

Attempt counter \(K\)

    Possible random values \(R\)

1

    0 to 1

2

    0 to 3

3

    0 to 7

4

    0 to 15

As the number of unsuccessful attempts increases, the range of possible waiting times increases. This helps reduce repeated collisions.

The flow diagram uses \(K<15\) as the retry condition.



7. Energy levels in CSMA/CD

The  three possible channel energy levels:

Energy level

        Meaning

Zero

        The channel is idle.

Normal

        A station is transmitting successfully.

Abnormal

        A collision has occurred; the energy level is approximately twice the normal level.

The station monitors the energy level to determine whether the channel is idle, busy, or experiencing a collision.



8. Throughput of CSMA/CD

CSMA/CD generally has higher throughput than Pure ALOHA or Slotted ALOHA because stations sense the channel and stop transmitting when they detect a collision.

Accordingly:

  • With 1-persistent CSMA/CD, maximum throughput is around 50%, when \(G=1\).

  • With nonpersistent CSMA/CD, maximum throughput can reach 90%, when \(G\) is between 3 and 8.

These values depend on the persistence method and network conditions.

9. Traditional Ethernet and CSMA/CD

The  traditional Ethernet as an example of a LAN that used CSMA/CD.

Traditional Ethernet:

  • Operated at 10 Mbps.

  • Was a broadcast LAN.

  • Used the 1-persistent method to control access to the shared medium.

Later Ethernet versions moved away from CSMA/CD access methods.

10. CSMA vs CSMA/CD

Feature

CSMA

CSMA/CD

Senses the channel before transmission

Yes

    Yes

Monitors channel during transmission

Not necessarily

    Yes

Detects collision during transmission

Not specified by basic CSMA

    Yes

Aborts transmission after collision

Not specified by basic CSMA

    Yes

Sends a jamming signal

Not specified

    Yes

Uses random back-off

Depends on the protocol

    Yes, after collision

Minimum frame-size requirement discussed here

— 

   \(T_{fr}\geq2T_p\)

Key points 

CSMA/CD = Listen before transmitting + Detect collision while transmitting + Abort + Jam + Back off + Retry.

The three most important points to remember are:

  1. Collision detection: The station transmits and monitors the channel simultaneously.

  2. Minimum frame size: The frame transmission time must be at least \(2T_p\) so that the sender can detect a collision before transmission ends.

  3. Recovery: The station aborts the frame, sends a jamming signal, waits for a random back-off time, and retries.

Comments

Popular posts from this blog

Computer Networks PCCST501 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Model Question Paper Computer Networks PCCST501 KTU 2024 Scheme and Answer Key

Introduction to Computer Networks