# 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 jamming signal wait for a random amount of time referred as back off then attempts transmit Again

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

(a) Non-Persistent 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-Persistent 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. Continuously keep sensing for the medium to become idle and repeat (1) if medium is busy

(c) 2-Persistent 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 occurred and uses the backoff algorithm

Level Up Your GATE Prep!
Embark on a transformative journey towards GATE success by choosing Data Science & AI as your second paper choice with our specialized course. If you find yourself lost in the vast landscape of the GATE syllabus, our program is the compass you need.

Previous
Next
Similar Reads