Carrier Sense Multiple Access (CSMA)
• Developed to overcome the problem found in ALOHA
and hence improve the collision.
• Based on the principle of “Carrier Sense”.
• The chances of collision reduces to great extent if a
station senses the channel before transmission.
• However, the chances of collision doesn't get eliminated
completely.
• The chances of collision still existed due to Propagation
Delay.
Carrier Sense Multiple Access (CSMA)
Carrier Sense Multiple Access (CSMA)
• Three types of CSMA protocols are there:
• 1- Persistent
• O-Persistent or Non-persistent
• P-Persistent
1-Persistent
• Station that wants to transmit data senses the channel
continuously to check whether the channel is idle or
busy.
• If the channel is busy, it waits until it becomes idle.
• When the channel is found idle, station immediately
transmits the data with probability 1 (Hence c/d 1-
persistent).
• This method of sensing has the highest chance of
collision.
1-Persistent
• When the collision occurs, station implements back-off
procedure.
1-Persistent : Drawbacks
• The propagation delay time greatly effects the
protocol.
• Even if, the propagation delay is zero the collision will
still occur.
O-Persistent or Non-Persistent
• When a station has a frame to send, it senses the
channel.
• If channel is idle, it transmits the data immediately.
• If channel is busy, it waits for random amount of time
and then senses the channel.
• The protocol does not continuously senses the channel.
• The method leads to better channel utilization but
longer delay.
O-Persistent or Non-Persistent: Pros & Cons
• Its advantage is that, it reduces the chance of collision.
• Major disadvantage, reduces the efficiency of channel.
P-Persistent
• Combines the advantages of 1-persistent CMSA and non-
persistent CMSA.
• When a transmitting station has a frame to send and it
senses a busy channel, it waits for the end of the
transmission, and then transmits with a probability p.
Since, it sends with a probability p, the name p –
persistent CSMA is given.
The algorithm of p-persistent CMSA is:
1. When a frame is ready, the transmitting station checks
whether the channel is idle or busy.
2. If the channel is idle then it transmits the frame
immediately.
3. If the channel is busy, the station waits and continually
checks until the channel becomes idle.
4. When the channel becomes idle, the station transmits the
frame with a probability p.
5. With a probability ( 1 – p ), the channel waits for next time
slot. If the next time slot is idle, it again transmits with a
probability p and waits with a probability ( 1 – p ).
The algorithm of p-persistent CMSA is:
6. The station repeats this process until either frame has
been transmitted or another station has begun
transmitting.
7. If another station begins transmitting, the station waits
for a random amount of time and restarts the algorithm.
Advantage of p-persistent CSMA
• It is the most efficient among 1-persistent CSMA, non-
persistent CSMA and p-persistent CSMA. It reduces the
number of collisions considerably as compared to 1-persistent
CSMA. The channel utilization is much better than non-
persistent CSMA.
CSMA/CD
• Operates in the Medium Access Control (MAC) layer.
• It senses or listens whether the shared channel for
transmission is busy or not, and defers transmissions until the
channel is free.
• No Acknowledgment.
• The collision detection technology detects collisions by sensing
transmissions from other stations. On detection of a collision,
the station stops transmitting, sends a jam signal, and then
waits for a random time interval before retransmission.
The algorithm of CSMA/CD is:
1. When a frame is ready, the transmitting station checks whether
the channel is idle or busy.
2. If the channel is busy, the station waits until the channel
becomes idle.
3. If the channel is idle, the station starts transmitting and
continually monitors the channel to detect collision.
4. If a collision is detected, the station starts the collision
resolution algorithm.
5. The station resets the retransmission counters and completes
frame transmission.
The algorithm of Collision Resolution is:
1. The station continues transmission of the current frame for a
specified time along with a jam signal, to ensure that all the
other stations detect collision.
2. The station increments the retransmission counter.
3. If the maximum number of retransmission attempts is
reached, then the station aborts transmission.
4. Otherwise, the station waits for a backoff period which is
generally a function of the number of collisions and restart
main algorithm
Average Case
Worst Case
CSMA/CA
• In contrast to CSMA/CD that deals with collisions after
their occurrence, CSMA/CA prevents collisions prior to
their occurrence.
• Detection and prevention techniques basically works for
wired medium.
• Not feasible to detect collision in wireless medium.
• Especially designed for Wireless mediums.
CSMA/CA
Three strategies work here back to back:
1. Intra Frame space (IFS)
2. Contention Window
3. Acknowledgement
Intra Frame Space
• Waiting time is called IFS.
• IFS allows the front of transmitted signal to reach to the station by
distant station. If after IFS channel is found idle still not eligible to
send data, Need to wait for contention window.
Contention Window
Contention Window
• Contention window is used to prioritize the station is there is any.
• The contention window is amount of time divided into slots. A station
that is ready to send chooses a random amount of time slot as its
wait time.
• The no. of slots in window changes according to binary exponential
back-off strategy.
• This means that it is set to one time slot for the first time and then
increases.
Contention Window
• Station need to sense after each time slot.
• If station busy does not restart the process, it just stops the timer and
restarts when channel is found idle. This gives priority to station with
longest waiting time.
Acknowledgement
• Positive acknowledgement or time out timer are
implemented.
Advantages
•CMSA/CA prevents collision.
•Due to acknowledgements, data is not lost unnecessarily.
•It avoids wasteful transmission.
•It is very much suited for wireless transmissions.
Disadvantage
•The algorithm calls for long waiting times.
•It has high power consumption.

Random Access Protocols topicc in tcp/ip.pptx

  • 1.
    Carrier Sense MultipleAccess (CSMA) • Developed to overcome the problem found in ALOHA and hence improve the collision. • Based on the principle of “Carrier Sense”. • The chances of collision reduces to great extent if a station senses the channel before transmission. • However, the chances of collision doesn't get eliminated completely. • The chances of collision still existed due to Propagation Delay.
  • 2.
  • 3.
    Carrier Sense MultipleAccess (CSMA) • Three types of CSMA protocols are there: • 1- Persistent • O-Persistent or Non-persistent • P-Persistent
  • 4.
    1-Persistent • Station thatwants to transmit data senses the channel continuously to check whether the channel is idle or busy. • If the channel is busy, it waits until it becomes idle. • When the channel is found idle, station immediately transmits the data with probability 1 (Hence c/d 1- persistent). • This method of sensing has the highest chance of collision.
  • 5.
    1-Persistent • When thecollision occurs, station implements back-off procedure.
  • 6.
    1-Persistent : Drawbacks •The propagation delay time greatly effects the protocol. • Even if, the propagation delay is zero the collision will still occur.
  • 7.
    O-Persistent or Non-Persistent •When a station has a frame to send, it senses the channel. • If channel is idle, it transmits the data immediately. • If channel is busy, it waits for random amount of time and then senses the channel. • The protocol does not continuously senses the channel. • The method leads to better channel utilization but longer delay.
  • 8.
    O-Persistent or Non-Persistent:Pros & Cons • Its advantage is that, it reduces the chance of collision. • Major disadvantage, reduces the efficiency of channel.
  • 9.
    P-Persistent • Combines theadvantages of 1-persistent CMSA and non- persistent CMSA. • When a transmitting station has a frame to send and it senses a busy channel, it waits for the end of the transmission, and then transmits with a probability p. Since, it sends with a probability p, the name p – persistent CSMA is given.
  • 10.
    The algorithm ofp-persistent CMSA is: 1. When a frame is ready, the transmitting station checks whether the channel is idle or busy. 2. If the channel is idle then it transmits the frame immediately. 3. If the channel is busy, the station waits and continually checks until the channel becomes idle. 4. When the channel becomes idle, the station transmits the frame with a probability p. 5. With a probability ( 1 – p ), the channel waits for next time slot. If the next time slot is idle, it again transmits with a probability p and waits with a probability ( 1 – p ).
  • 11.
    The algorithm ofp-persistent CMSA is: 6. The station repeats this process until either frame has been transmitted or another station has begun transmitting. 7. If another station begins transmitting, the station waits for a random amount of time and restarts the algorithm.
  • 12.
    Advantage of p-persistentCSMA • It is the most efficient among 1-persistent CSMA, non- persistent CSMA and p-persistent CSMA. It reduces the number of collisions considerably as compared to 1-persistent CSMA. The channel utilization is much better than non- persistent CSMA.
  • 13.
    CSMA/CD • Operates inthe Medium Access Control (MAC) layer. • It senses or listens whether the shared channel for transmission is busy or not, and defers transmissions until the channel is free. • No Acknowledgment. • The collision detection technology detects collisions by sensing transmissions from other stations. On detection of a collision, the station stops transmitting, sends a jam signal, and then waits for a random time interval before retransmission.
  • 14.
    The algorithm ofCSMA/CD is: 1. When a frame is ready, the transmitting station checks whether the channel is idle or busy. 2. If the channel is busy, the station waits until the channel becomes idle. 3. If the channel is idle, the station starts transmitting and continually monitors the channel to detect collision. 4. If a collision is detected, the station starts the collision resolution algorithm. 5. The station resets the retransmission counters and completes frame transmission.
  • 15.
    The algorithm ofCollision Resolution is: 1. The station continues transmission of the current frame for a specified time along with a jam signal, to ensure that all the other stations detect collision. 2. The station increments the retransmission counter. 3. If the maximum number of retransmission attempts is reached, then the station aborts transmission. 4. Otherwise, the station waits for a backoff period which is generally a function of the number of collisions and restart main algorithm
  • 16.
  • 17.
  • 18.
    CSMA/CA • In contrastto CSMA/CD that deals with collisions after their occurrence, CSMA/CA prevents collisions prior to their occurrence. • Detection and prevention techniques basically works for wired medium. • Not feasible to detect collision in wireless medium. • Especially designed for Wireless mediums.
  • 19.
    CSMA/CA Three strategies workhere back to back: 1. Intra Frame space (IFS) 2. Contention Window 3. Acknowledgement
  • 20.
    Intra Frame Space •Waiting time is called IFS. • IFS allows the front of transmitted signal to reach to the station by distant station. If after IFS channel is found idle still not eligible to send data, Need to wait for contention window.
  • 21.
  • 22.
    Contention Window • Contentionwindow is used to prioritize the station is there is any. • The contention window is amount of time divided into slots. A station that is ready to send chooses a random amount of time slot as its wait time. • The no. of slots in window changes according to binary exponential back-off strategy. • This means that it is set to one time slot for the first time and then increases.
  • 23.
    Contention Window • Stationneed to sense after each time slot. • If station busy does not restart the process, it just stops the timer and restarts when channel is found idle. This gives priority to station with longest waiting time.
  • 24.
    Acknowledgement • Positive acknowledgementor time out timer are implemented.
  • 25.
    Advantages •CMSA/CA prevents collision. •Dueto acknowledgements, data is not lost unnecessarily. •It avoids wasteful transmission. •It is very much suited for wireless transmissions. Disadvantage •The algorithm calls for long waiting times. •It has high power consumption.