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.
- Is a frame transmission-ready? If not, you'll have to wait for a frame.
- Is medium a waste of time? If it isn't ready yet, wait till it is.
- Begin transmitting and keep an eye out for collisions while doing so.
- Is there a possibility of a collision? If this is the case, proceed to the collision detection method.
- 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.
- 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.
- The retransmission counter should be increased.
- Is it possible that the maximum number of transmission attempts has been reached? Abort transmission if this is the case.
- Calculate the random backoff duration depending on the number of collisions and wait for it.
-
Return to step 1 of the main operation.
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.