Skip to content
Related Articles

Related Articles

Algorithm for CSMA and Rules for CSMA/CD
  • Difficulty Level : Hard
  • Last Updated : 23 Dec, 2019

Rules for CSMA/CD:

  1. If medium is idle, transmit, otherwise go to 2
  2. If the medium is busy, continue to listen until the channel is idle, then transmit immediately
  3. If collision is detected during transmission then transmit a brief jamming signal to assure that all station knows that there has been a collision so that stations can cease the transmission
  4. After transmitting the jamminnig signal wait for a random amount of time reffered as back off then attemps transmit Again

Algorithm For CSMA:
Algorithm for CSMA are: Non-Persistant, 1-Persistant, and 2-Persistant. These are explained as following below.

(a) Non-Persistant CSMA:
If channel is not free then wait for random amount of time then sense the channel, if free then sends the data

  1. Transmit if medium is idle otherwise go to 2
  2. Wait for random amount of time and repeat (1) if medium is busy

(b) 1-Persistant CSMA:
Continuously sense the channel and when it sense that the channel is free, it transmit the data.

  1. If medium is idle transmit, otherwise go to 2
  2. Wait for random amount of time and repeat (1) if medium is busy

(c) 2-Persistant CSMA:
Sense the channel before sending the data.

  1. With probability “P”, the station sends its frame
  2. With probability 1-P, station waits for the beginning of the next time slot and check the line again:
    • (i) If line is idle go to 1
    • (ii) If line is busy, it act as a collision has occur ed and uses the backoff algorithm

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :