Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction to CSMA with Collision Detection 
1.1.
Procedure of CSMA with collision Detection
2.
Advantages of CSMA/CD
3.
Disadvantages of CSMA/CD
4.
Frequently Asked Questions
4.1.
In which scenario CSMA/CD is not necessary?
4.2.
What is collision Detection?
4.3.
What is the difference between CSMA/CA and CSMA/CD?
5.
Conclusion
Last Updated: Mar 27, 2024

CSMA with Collision Detection

Computer Networks

Introduction to CSMA with Collision Detection 

Carrier-sense multiple access with collision detection (CSMA/CD) is a media access control (MAC) mechanism first utilized for local area networking in early Ethernet technology. Thanks to carrier sensing, transmission is deferred until no other stations are broadcasting. This is used in conjunction with collision detection, in which a transmitting station detects collisions while sending a frame by detecting transmissions from neighboring stations. When a collision is detected, the station pauses transmitting that frame, sends a jam signal, and then waits a random amount of time before attempting to resend the frame.

CSMA/CD is a carrier-sense multiple access modification (CSMA). CSMA/CD is a protocol that improves CSMA performance by stopping transmission as soon as a collision is detected, reducing the time necessary for a retry.

Procedure of CSMA with collision Detection

The technique for starting a transmission is as follows. When the frame is successfully transferred, or a collision is discovered during transmission, the operation is complete. 

  1. Is a frame transmission-ready? If not, you'll have to wait for a frame.
  2. Is medium a waste of time? If it isn't ready yet, wait till it is.
  3. Begin transmitting and keep an eye out for collisions while doing so.
  4. Is there a possibility of a collision? If this is the case, proceed to the collision detection method.
  5. Reset the retransmission counters and transmit the whole frame.

 

The technique for resolving a detected collision is as follows. When retransmission is started or when retransmission is terminated owing to multiple collisions, the operation is finished.

  1. Continue transmitting until the minimum packet duration is achieved (with a jam signal instead of frame header/data/CRC) to guarantee that all receivers notice the collision.
  2. The retransmission counter should be increased.
  3. Is it possible that the maximum number of transmission attempts has been reached? Abort transmission if this is the case.
  4. Calculate the random backoff duration depending on the number of collisions and wait for it.
  5. Return to step 1 of the main operation.
     

CSMA/CD simplified technique with retransmission logic to resolve a detected collision.

CSMA/CD simplified technique with retransmission logic to resolve a detected collision.

         Source: Wikipedia

Collision detection methods are media-dependent. Collisions may be detected on a shared electrical bus, such as 10BASE5 or 10BASE2, by comparing sent and received data or identifying a greater than usual signal amplitude on the bus. A carrier detected on the receiving channel while transmitting generates a collision event on all media. Jam signals are propagated by repeaters or hubs that detect collisions on their own.

The collision recovery technique is similar to what occurs during a dinner party when all participants communicate with one another over a shared medium (the air). Each visitor waits respectfully for the present speaker to complete before speaking. Stop and wait for brief, random periods of time if two visitors begin speaking simultaneously (in Ethernet, this time is measured in microseconds). The goal is that by picking a random amount of time, neither visitor would attempt to speak again at the same moment, preventing another collision.

Know about Stop and Wait Protocol here.

Advantages of CSMA/CD

  • It is used to identify collisions on a shared channel in a very short amount of time.
  • For collision detection, CSMA CD outperforms CSMA.
  • CSMA CD is used to prevent the transfer of any trash.
  • It is used to consume or share the same bandwidth at each station as required.
  • Compared to the CSMA CA, it has a reduced CSMA CD overhead.

Disadvantages of CSMA/CD

  • It is not ideal for long-distance networks since the effectiveness of CSMA CD reduces as the distance rises.
  • It can only detect collisions up to a range of 2500 meters, beyond which it is unable to detect collisions.
  • Collision detection performance is degraded when many devices are added to a CSMA CD.

Frequently Asked Questions

In which scenario CSMA/CD is not necessary?

Since each Ethernet segment, or collision domain, is now separated in modern Ethernet networks designed with switches and full-duplex connections, CSMA/CD is no longer required.

What is collision Detection?

The technique by which a node decides whether or not a collision has occurred is known as collision detection. Collisions happen in almost all networks; hence a protocol is needed to recover from them. Ethernet's collision detection and recovery mechanism is CSMA/CD.

What is the difference between CSMA/CA and CSMA/CD?

CSMA/CD (carrier sense multiple access/collision detect) is different from CSMA/CA in that it deals with transmissions after a collision has occurred.

Conclusion

In this article, we learned about the Introduction to CSMA/CD, and procedure to implement CSMA with Collision Detection, and the advantages and disadvantages of CSMA/CD.

I hope you understand the carrier sense multiple access with collision detection(CSMA/CD). 

Recommended Readings:


Also check out some of the Guided Paths on topics such as Data Structure and Algorithms, Competitive Programming, Operating Systems, Computer Networks, etc. as well as some Contests, Test Series, Interview Bundles, and some Interview Experiences curated by top Industry Experts only on Coding Ninjas Studio.

Until then, Keep Learning and Keep Coding.

Live masterclass