×

Computer Network Tutorial

Difference B/W Articles

Computer Network Practice

Carrier Sense Multiple Access (CSMA) in Computer Network

In this tutorial, we are going to learn about the Carrier Sense Multiple Access (CSMA) – which is a better version that Aloha discussed earlier.
By Radib Kar Last updated : May 05, 2023

In the earlier discussion, we saw that Aloha leads to collision and have efficiency only about 20-30%. That's why performance is not up to satisfaction. The concept was to reduce the chance of collision and increase the performance sensing the medium before trying to use it.

CSMA

Carrier sense multiple access (CSMA) requires that each station first listen to the medium and then send if sending doesn't lead to any collision. That means CSMA is based on "sense before transmit" principle. CSMA can reduce the possibility of collision, but it cannot eliminate it. The possibility of collision still exists because of propagation delay; when a station sends a frame, other stations are yet to sense that. Thus, a station may sense the medium and find it idle, only because the first bit sent by another station has not yet been received.

Let's see an example,

    A       B       C       D
                    T2
    T1

At time T1 station A senses the medium and finds it idle, so it sends a frame. At time T2 (T2> T1) station C senses the medium and finds it idle because the first bit from station A has not reached station C yet. Station C also sends a frame. The two signals collide and both frames are destroyed.

Vulnerable Time for CSMA

The vulnerable time for CSMA is the propagation time Tp. The propagation time is needed for a signal to propagate from one end of the medium to other ends. When two stations try to send respective frames simultaneously a collision will result. But if the first bit of the frame reaches the end of the medium, every station must have already heard the bit and will refrain from sending them.

Persistence Methods for CSMA

There are basically three persistence methods:

  1. 1-Persistent
  2. Non-Persistent
  3. p-Persistent

1. 1-Persistent

The 1-persistent method is simple and straightforward. When a station finds the channel idle, it sends its frame immediately (with probability 1).

This method has the highest chance of collision because two or more stations may find the channel idle at the same time and send their frames immediately.

2. Non-persistent method

In the non-persistent method, a station that has a frame ready to be sent senses the line first. If the channel is idle, it sends immediately. If the channel is not idle, it waits a random amount of time(quite like Aloha) and then senses the line again.

The non-persistent method reduces the chance of collision because it is unlikely that two or more stations will wait for the same amount of time since it’s random and retry to send simultaneously.

3. p-persistent method

The p-persistent method is used if the channel is slotted in time slots with a slot duration equal to or greater than the maximum propagation time. the p-persistent method reduces the chance of collision and improves efficiency. In this method, after the station finds the channel idle it follows these following steps:

  1. With probability p, the station sends its frame.
  2. With probability q = 1 -p, the station waits for the beginning of the next time slot and checks the line again.
    1. If the line is idle, it goes to step 1.
    2. If the line is busy, it acts as though a collision has occurred and uses the back-off procedure like Aloha.

References




Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.