Carrier Sense Multiple Access
In this tutorial, we will be covering the concept of Carrier Sense Multiple Access that lies under the category of Random Access methods in detail in the data link layer.
In order to minimize the chances of collision and in return to increase the performance, the method name CSMA was developed.
If a station senses the medium before trying to use it then it leads to a reduction in the chances of the collision.
The Carrier Sense Multiple Access(CSMA) mainly requires that each station first listens to the medium before sending the data.
In simple words, we can say the CSMA method is based on the principle "Sense before Transmit" or "Listen before Talking".
There is the possibility of the reduction of the collision but the CSMA method cannot eliminate the Collision.
Working of CSMA
On the shared medium, whenever any channel has a data frame to transmit, then the station attempts to detect the presence of any carrier signal from the other stations that are connected to the shared medium.
In case the station detects any carrier signal on the shared medium then it means that another transmission is in the progress on the shared medium.
After that, the station waits until the ongoing transmission completes, and then after the completion, the station then initiates its own transmission. Generally, the transmission by the station is received by all other stations that are connected to the channel/link.
As in CSMA, all stations detect before sending their own frames this leads to the reduction in the collision of frames.
If the shared medium is detected as idle by the two stations and they both initiate the transmission simultaneously then it will lead to the collision of frames.
Vulnerable time in CSMA
The propagation time is referred to as vulnerable time in the CSMA and it is denoted as
Tp. This is basically the time a signal needed by a signal in order to propagate from one end of the medium to another end.
When a station sends a frame and at the same time if any other station tries to send a frame then it will result in the collision.
In a case, if the first bit of the frame reaches the end of the medium then every station hears that bit and refrains from sending.
Access Modes in CSMA
There are different versions of Access modes in CSMA and these are as follows:
This is one of the simplest and straightforward methods. In this method, once the station finds that the medium is idle then it immediately sends the frame. By using this method there are higher chances for collision because it is possible that two or more stations find the shared medium idle at the same time and then they send their frames immediately.
Flow diagram of 1-Persistent approach:
The given below figure shows the behavior of a 1-persistent approach:
In this method, a station has a frame to send senses the line. If the line is idle then the station will send the frame and in case if the line is not idle then the station will wait for a random amount of time and it then senses the line again.
With the help of the Nonpersistent CSMA approach, the chances of collision get reduced because it is unlikely to happen that two or more stations wait for the same amount of time and then retry to send simultaneously.
But due to this approach, the efficiency of the network gets reduced because the medium stays idle when there may be stations having frames to send.
Flow diagram of NonPersistent approach:
The given below figure shows the behavior of a Nonpersistent approach:
This method is used in the case if the channel has time slots with a slot duration that is equal to or greater than the maximum propagation time. The p-persistent approach mainly combines the advantages of 1-persistent and Nonpersistent CSMA.
By using the p-persistent approach the chances of collision get reduced and there is increased efficiency.
Using this approach, if the station finds the line idle then it follows the given below steps:
With the probability p, the station sends its frame.
With the probability q=1-p, the station mainly waits for the beginning of the next time slot and then checks the line again.
Flow diagram of p-Persistent approach:
The given below figure shows the behavior of a p-Persistent approach:
Variations of the Carrier Sense Multiple Access
There are two variations of CSMA methods:
Carrier Sense Multiple Access with collision detection(CSMA/CD)
Carrier Sense Multiple Access with collision avoidance(CSMA/CA)