Algorithm for CSMA and Rules for CSMA/CD

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

Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


1


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.