How does CSMA/CD work?
Carrier Sense Multiple Access with Collision Detection (CSMA/CD) is a network protocol for carrier transmission that operates at the
An analogy
The CSMA/CD technique can be compared to a group discussion in which it would be complicated to communicate if everyone spoke at once.
Instead, for effective communication, one person must speak after the other so that everyone can comprehend their contribution to the topic. We should wait a predetermined amount of time after a participant has finished talking to check if any additional participants are speaking or not. Only when everyone else has finished should one speak again. We should pause, take a break, and try again later if another participant speaks at the exact moment as us.
Working
For a comprehensive understanding of the working of CSMA/CD, consider the following scenario:
- The illustration above shows three stations A, B, and C connected via
. If A wants to transmit data to station C, first, it must sense the carrier. If it is idle, the data will be delivered to the corresponding station.bus topology This means that all the nodes on the network are connected via shared half duplex link. - A station cannot sense the entire carrier; it can only detect the point of contact. The protocol states that any station may send data at any time, but the sole prerequisite is that it must determine if the carrier is idle or busy.
- If A and B start transmitting their data, then the data of both stations may collide. So, both the stations will receive inaccurate collided data.
Collision detection
For collision detection, the station must continue broadcasting the data until the transmitting station receives the collision signal.
Consider the following scenario in which the initial bits being sent by the station are colliding. Think of the three stations as A, B, and C. Assuming a 40 mins
- Both stations, A and C, identify the carrier as available at 8 am and begin transmitting.
- If the overall propagation delay is 40 minutes, the station's first bits will meet in the middle and collide within 20 minutes.
- Precisely at 8:20 am, a collision will occur. Collision is detected by the change in amplitude of the signal in the wire.
- Stations A and C will receive the collision signals at 8:40 am or approximately 40 minutes after the collisions.
Note: The transmission time
for both stations must be greater than the propagation time (that is, ) to detect that their data has clashed.
Worst case
In the worst situation, collision is detected if the station continues transmitting data till
- At 8:39:59 am, station A is still transmitting data to station C, which began at 8 am.
- Station C began transmitting at this point after detecting a free carrier.
- The first bit of the data packet delivered from station C will collide with the packet sent by station A.
- The carrier will then send the collided signal to their respective senders.
- Approximately after 40 mins, station A will receive the collided signal back.
Free Resources