Collision Detection in CSMA/CD
Last Updated : 24 Jul, 2024
CSMA/CD (Carrier Sense Multiple Access/ Collision Detection) is a
media access control method that was widely used in Early Ethernet
technology/LANs when there used to be shared Bus Topology and
each node ( Computers) was connected by Coaxial Cables.
Nowadays Ethernet is Full Duplex and Topology is either Star
(connected via Switch or Router) or point-to-point ( Direct
Connection). Hence CSMA/CD is not used but they are still supported
though.
Consider a scenario where there are 'n' stations on a link and all are
waiting to transfer data through that channel. In this case, all 'n'
stations would want to access the link/channel to transfer their own
data. The problem arises when more than one station transmits the
data at the moment. In this case, there will be collisions in the data
from different stations.
CSMA/CD is one such technique where different stations that follow
this protocol agree on some terms and collision detection measures
for effective transmission. This protocol decides which station will
transmit when so that data reaches the destination without
corruption.
How Does CSMA/CD Work?
Step 1: Check if the sender is ready to transmit data packets.
Step 2: Check if the transmission link is idle.
The sender has to keep on checking if the transmission link/medium is
idle. For this, it continuously senses transmissions from other nodes. The
sender sends dummy data on the link. If it does not receive any collision
signal, this means the link is idle at the moment. If it senses that the
carrier is free and there are no collisions, it sends the data. Otherwise, it
refrains from sending data.
Step 3: Transmit the data & check for collisions.
The sender transmits its data on the link. CSMA/CD does not use an
'acknowledgment' system. It checks for successful and unsuccessful
transmissions through collision signals. During transmission, if a collision
signal is received by the node, transmission is stopped. The station then
transmits a jam signal onto the link and waits for random time intervals
before it resends the frame. After some random time, it again attempts to
transfer the data and repeats the above process.
Step 4: If no collision was detected in propagation, the sender completes
its frame transmission and resets the counters.
How Does a Station Know if Its Data Collide?
Consider the above situation. Two stations, A & B.
Propagation Time: Tp = 1 hr ( Signal takes 1 hr to go from A to B)
At time t=0, A transmits its data.
t= 30 mins : Collision occurs.
After the collision occurs, a collision signal is generated and sent to both A &
B to inform the stations about the collision. Since the collision happened
midway, the collision signal also takes 30 minutes to reach A & B.
Therefore, t=1 hr: A & B receive collision signals.
This collision signal is received by all the stations on that link. Then,
How to Ensure that it is our Station’s Data that Collided?
For this, Transmission time (Tt) > Propagation Time (Tp) [Rough bound]
This is because we want that before we transmit the last bit of our data from
our station, we should at least be sure that some of the bits have already
reached their destination. This ensures that the link is not busy and collisions
will not occur.
But, above is a loose bound. We have not taken the time taken by the
collision signal to travel back to us. For this consider the worst-case scenario