Random Access Protocol

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 18

Multiple Access Control

If there is a dedicated link between the sender and the


receiver then data link control layer is sufficient.
If there is no dedicated link present then multiple
stations can access the channel simultaneously.
Hence multiple access protocols are required to
decrease collision and avoid crosstalk.
Random Access Protocol:
• In this, all stations have same superiority that is no station has more
priority than another station. Any station can send data depending on
medium’s state( idle or busy).
It has two features: 
• There is no fixed time for sending data
• There is no fixed sequence of stations sending data
• There is no time scheduled for any station in order to transmit the
data, the transmission is random among all stations; that is why these
methods are called random access.
ALOHA 
The earliest method used for random access was ALOHA and it was
developed at the University of Hawaii in early 1970.ALOHA was mainly
designed for radio/Wireless LAN but it can also be used for shared
mediums.
• As the medium is shared between the stations, when a station sends
the data then the other station may attempt to do so at the same
time. Thus the data from the two stations collide.
• Original ALOHA is simply termed as "Pure ALOHA".
Pure Aloha: 
When a station sends data it waits for an acknowledgement.
If the acknowledgement doesn’t come within the allotted time then the
station waits for a random amount of time called back-off time (Tb) and re-
sends the data.
Since different stations wait for different amount of time, the probability of
further collision decreases. 

Vulnerable Time = 2* Frame transmission time


Throughput = G exp{-2*G}
Maximum throughput = 0.184 for G=0.5
There are 4 stations and each station sends two frames.
There is a total of 8 frames on the shared medium.
Among these 8 frames, there are some frames that collide
with each other.
The pure ALOHA method depends upon the acknowledgment
from the receiver, whenever any station sends a frame, then
it expects the receiver to send an acknowledgment. If there is
no arrival of acknowledgment after the time-out period then
the station assumes that the frame or the acknowledgment
gets destroyed and in this way, it resends the frame.
In the collision there is mainly the involvement of two or
more stations, in case if all the stations try to resend the
frames after the time-out period passes then all the frames
will collide again.
Thus in Pure ALOHA, when the time-out period passes then
each station waits for a random amount of time before
resending its frame and this randomness helps to avoid more
collisions and this time is referred to as back-off time (TB).
:

Given below is the procedure used for Pure ALOHA protocol:

Efficiency
The efficiency of the Pure ALOHA is as given below where G
denotes the number of stations that are willing to transmit the
data.
The maximum efficiency of the Pure ALOHA is very less
because of the large number of collisions. And the maximum
efficiency comes out as 18.4% on putting G=(1/2).
Vulnerable time
It is the time when there is the possibility of collision.
And the Vulnerable time in the case of Pure ALOHA is: 
2 x T fr
Slotted ALOHA

• the slotted ALOHA the time of the shared channel is simply divided
into discrete intervals that are commonly known as Time Slots.
• In Slotted ALOHA it is imposed on each station to send the data only
at the beginning of the time slot.
• As a station is allowed to send the data only at the beginning of the
time slot, in case if any station misses this moment then it must have
to wait until the beginning of the next time slot.
• In case if two stations try to send at the beginning of the same time
slot then there are chances for the occurrence of the collision
Efficiency
The efficiency of the slotted ALOHA is as given below:

where G indicates the Number of the stations that are willing


to transmit the data at the beginning of the same time slot.
For the maximum efficiency of Slotted ALOHA put the value
of G as 1 and then the efficiency comes out to be 36.8%.
Thus the maximum efficiency of the slotted ALOHA is high
due to the reason that there is a fewer number of collisions.
Difference between the Pure ALOHA and
Slotted ALOHA:
Pure ALOHA Slotted ALOHA

In the Pure ALOHA, the station can transmit the data frame whenever the In this, the station can transmit the data only at the beginning of the time
station has data to send. slot.

In the case of Pure ALOHA, the time is continuous In the case of Slotted ALOHA, the time is discrete and is in the form of
time slots.

One of the main advantages of using the slotted ALOHA is that there is a
One of the main advantages of using Pure ALOHA is that the reduction in the number of collisions and there is an increase in
implementation of this method is simple. efficiency as compared to Pure ALOHA. In simple terms, collisions are
reduced to half while the efficiency increases to double.

The efficiency offered by the Pure ALOHA is 18.4%. The Efficiency offered by the slotted ALOHA is 36.8%

The probability of the successful transmission of the data packet is equals The probability of the successful transmission of the data packet is equals
to G x e-2G to G x e-G

The Vulnerable time offered by the Pure ALOHA is 2 x T fr The Vulnerable time offered by the slotted ALOHA is T fr
Carrier Sense Multiple Access

• 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.
Example: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.
Example, if station A wants to send data, it will first sense the medium.If it finds the channel idle, it will start sending
data. However, by the time the first bit of data is transmitted (delayed due to propagation delay) from station A, if
station B requests to send data and senses the medium it will also find it idle and will also send data. This will result in
collision of data from station A and B. 
CSMA access modes- 
• 1-persistent: The node senses the channel, if idle it sends the data, otherwise it
continuously keeps on checking the medium for being idle and transmits
unconditionally(with 1 probability) as soon as the channel gets idle.
• Non-Persistent: The node senses the channel, if idle it sends the data, otherwise it
checks the medium after a random amount of time (not continuously) and transmits
when found idle. 
• P-persistent: The node senses the medium, if idle it sends the data with p probability.
If the data is not transmitted ((1-p) probability) then it waits for some time and checks
the medium again, now if it is found idle then it send with p probability. This repeat
continues until the frame is sent. It is used in Wifi and packet radio systems. 
• O-persistent: Superiority of nodes is decided beforehand and transmission occurs in
that order. If the medium is idle, node waits for its time slot to send data. 
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.

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.
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:
1.With the probability p, the station sends its frame.
2.With the probability q=1-p, the station mainly waits for the
beginning of the next time slot and then checks the line again.
1. In case if the line is found idle then go to step 1.
2. In case if the line is found busy then it acts as though a
collision has been occurred and then it makes use of the
back-off procedure.
•Though this algorithm detects collisions,
it does not reduce the number of collisions.
•It is not appropriate for large networks
performance degrades exponentially when more
stations are added.
• Carrier Sense Multiple Access with Collision Detection (CSMA/CD) is a network protocol for carrier transmission that 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. 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.
• Algorithms
• The algorithm of CSMA/CD is:
• When a frame is ready, the transmitting station checks whether the channel is idle or busy.
• If the channel is busy, the station waits until the channel becomes idle.
• If the channel is idle, the station starts transmitting and continually monitors the channel to detect collision.
• If a collision is detected, the station starts the collision resolution algorithm.
• The station resets the retransmission counters and completes frame transmission.
• The algorithm of Collision Resolution is:
• 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.
• The station increments the retransmission counter.
• If the maximum number of retransmission attempts is reached, then the station aborts transmission.
• Otherwise, the station waits for a backoff period which is generally a function of the number of collisions and restart main algorithm.
• Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) is a network protocol for carrier
transmission that operates in the Medium Access Control (MAC) layer. In contrast to CSMA/CD (Carrier
Sense Multiple Access/Collision Detection) that deals with collisions after their occurrence, CSMA/CA
prevents collisions prior to their occurrence.
• Algorithm
• The algorithm of CSMA/CA is:
• When a frame is ready, the transmitting station checks whether the channel is idle or busy.
• If the channel is busy, the station waits until the channel becomes idle.
• If the channel is idle, the station waits for an Inter-frame gap (IFG) amount of time and then sends the
frame.
• After sending the frame, it sets a timer.
• The station then waits for acknowledgement from the receiver. If it receives the acknowledgement before
expiry of timer, it marks a successful transmission.
• Otherwise, it waits for a back-off time period and restarts the algorithm.
Advantages of CMSA/CD
•CMSA/CA prevents collision.
•Due to acknowledgements, data is not lost unnecessarily.
•It avoids wasteful transmission.
•It is very much suited for wireless transmissions.
Disadvantages of CSMA/CD
•The algorithm calls for long waiting times.
•It has high power consumption.

You might also like