You are on page 1of 97

ITT350:

Computer Networks
Module 2: Access Control

Instructor: Dr. Iqra Altaf Gillani


Data link layer
Multiple access control
Multiple access control is similar to multiplexing in the sense that we combine
data from different sources and send over a common link.

However, these are different because:

● In multiple access we can also give priority to a device or decide who gets the
access to the link first and send data.
● Multiple access is a data link layer technique while multiplexing is a physical
layer technique.

Multiple access solves the access control problem for a multi-point or broadcast
connection.
Multiple-access protocols
Random Access
In random access or contention methods, no station is superior to another
station and none is assigned the control over another. No station permits, or does
not permit, another station to send.

At each instance, a station that has data to send uses a procedure defined by the
protocol to make a decision on whether or not to send and the decision depends
on the state of the medium (idle/busy).
Random Access
In random access or contention methods, no station is superior to another
station and none is assigned the control over another. No station permits, or does
not permit, another station to send.

At each instance, a station that has data to send uses a procedure defined by the
protocol to make a decision on whether or not to send and the decision depends
on the state of the medium (idle/busy).

● No scheduled time for station to transmit ⇒ Random transmission among


stations.
● No rules specify which station should transmit next, station compete with each
other ⇒ Contention
Random Access
Every station has right to medium without being controlled by other stations.
However, if more than one station tries to send, there is access-conflict or collision
and frames are destroyed or modified.

Questions:

● When can station access the medium?


● How to determine success or failure of transmission?
● What to do if medium is busy?
● What to do for access-conflict?
Aloha
● This was the earliest random access method developed at the University of
Hawaii in early 1970s.
● This was primarily designed for radio (wireless LAN).
● Two versions:
○ Pure Aloha
○ Slotted Aloha
Pure Aloha
Each station senda a frame whenever it has a frame to send.

However, since there is only one channel to share, there is a possibility of


collision, so the frames need to be resend.
Pure Aloha
Pure Aloha relies on ACKs from the receiver. When station sends a frame it
expects receiver to send back ACK. if ACK is not received after time out period,
station assumes ACK/frame is lost and resends it.

If two stations retry after time out, collision may occur again.

Each station waits for random amount of time before resending. This is known as
backoff time (T_B). Also, to prevent further congestion of retransmitted frames,
after a maximum no. of retransmission attempts (K_max) a station needs to give
up.
Pure Aloha parameters
Timeout period:

Backoff time:
Pure Aloha parameters
Timeout period: 2* T_p = Maximum possible round-trip propagation delay.

Backoff time: is a random value that depends on K (no. of attempted unsuccessful


transmissions).

Binary exponential backoff - For each transmission choose a multiplier


R=0 to 2^K -1 and multiply by T_p or T_fr (average time required to send a frame).
Range of numbers increases with every collision.
Pure Aloha Flow diagram
Example: Stations on a ALOHA network are 600 km
apart. Find possible values of T_B for K=2.
Example: Stations on a ALOHA network are 600 km
apart. Find possible values of T_B for K=2.

Solution:

T_B= 0,2,4,6 msec.


Pure Aloha - vulnerable time
Pure Aloha - vulnerable time
Example: An aloha
network transmits 200
bit frame on a shared
channel of 200 kbps.
How to make it collision
free?
Pure Aloha - vulnerable time
Example: An aloha
network transmits 200
bit frame on a shared
channel of 200 kbps.
How to make it collision
free?
Solution: Vulnerable
time = 2 msec.
Pure Aloha - throughput
Let G be the average number of frames generated by the system during one
frame transmission time. Then, it is proven that the throughput or average no. of
successfully transmitted frames is S=G*e^(-2G).
Pure Aloha - throughput
Pure Aloha - throughput
Example
Example
Example
Slotted Aloha
Pure Aloha has no rules defined when a station can send so vulnerable time is
2*T_fr.

In slotted Aloha, we divide time into slots of T_fr seconds and force the station sto
send only at the beginning of time slot. If a station misses out beginning it has to
wait for the next slot.
Slotted Aloha
Slotted Aloha - vulnerable time
Slotted Aloha - throughput
Example:
Example:
Example:
Aloha vs. Slotted Aloha: Throughput comparison
Aloha and slotted Aloha summary
CSMA - Carrier sense multiple access
Chances of collision can be reduced if a station senses the medium before trying
to use it.

CSMA requires every station should first listen to medium (or check the state of
medium before transmitting ⇒ Sense/listen before transmit

CSMA can reduce collision but not eliminate them.


CSMA
CSMA

Collisions may
still exist as when
a station sends a
frame it takes
some time for first
bit to be received
by all stations.
Vulnerable time in CSMA
Persistent methods: What to do if the channel is
busy/idle?
Persistent methods
CSMA/CD - Carrier sense multiple access/Collision
detection
CSMA doesn’t specify the procedure to be followed after collision.

CSMA/CD augments the algorithms to handle the collision.

Stations monitor the medium after it sends a frame to see if the transmission is
successful. If so the transmission is finished or else if collision has occurred it has
to resend.
Collision of first-bit in CSMA/CD
Collision and abortion in CSMA/CD
Minimum frame size
Before sending the last bit of frame, sending station must detect a collision, if any
and abort its transmission, because once the entire frame is sent the station does
not keep a copy of frame and does not monitor line for collision detection.

In CSMA/CD we need a restriction on frame size.

T_fr>= ???
Minimum frame size
In CSMA/CD we need a restriction on frame size.

Before sending the last bit of frame, sending station must detect a collision, if any
and abort its transmission, because once the entire frame is sent the station does
not keep a copy of frame and does not monitor line for collision detection.

T_fr>= 2*T_p
Example:
Example:
CSMA/CD Flow diagram
Energy level of channel

Possible energy levels: Zero, normal, abnormal


Energy level of channel

Possible energy levels: Zero (idle), normal (a station has captured the channel) ,
abnormal (collision).

So, a station that has to send or is sending frames needs to monitor the energy
level to determine channel is busy, idle or a collision has occurred.
Performance of CSMA/CD
Throughput: Higher than slotted Aloha but depends on G and persistence method.
Performance of CSMA/CD
Throughput: Higher than slotted Aloha but depends on G and persistence method.

● 1-persistent: S_max=50% for G=1


● Non-persistent: S_max upto 90% for G=3-8
● P-persistent: depends on p

Example: Traditional Ethernet (LANs)


CSMA/CA- Carrier sense multiple access/Collision
Avoidance
Developed for Wireless Networks.

In CSMA/CD station needs to be able to receive while transmitting to detect


collision.

● When there is no collision, station receives one signal (own).


● When there is a collision, station receive two signals and energy doubles.
CSMA/CA- Carrier sense multiple access/Collision
Avoidance
Developed for Wireless Networks.

In CSMA/CD station needs to be able to receive while transmitting to detect


collision.

● When there is no collision, station receives one signal (own).


● When there is a collision, station receive two signals and energy doubles.

In wired networks, received signal has almost same energy as sent signal
because of repeaters or shorter length.

In wireless since much of the sent energy is lost in transmission, the received
signal has very little energy and collision may only add 5-10% of additional energy
which is not useful for collision detection. So, we need to avoid collisions as they
cannot be detected.
CSMA/CA- Carrier sense multiple access/Collision
Avoidance
Developed for Wireless Networks.

In CSMA/CD station needs to be able to receive while transmitting to detect


collision.

● When there is no collision, station receives one signal (own).


● When there is a collision, station receive two signals and energy doubles.

In wired networks, received signal has almost same energy as sent signal
because of repeaters or shorter length.

In wireless since much of the sent energy is lost in transmission, the received
signal has very little energy and collision may only add 5-10% of additional energy
which is not useful for collision detection. So, we need to avoid collisions as
they cannot be detected.
Collision avoidance strategies in CSMA/CA
Three strategies:

● Interframe space (IFS)


● Contention window
● ACKs
IFS and contention window
Interframe space (IFS): collisions are avoided by deferring even if the channel is
idle. When the channel is idle do not send immediately and wait for IFS because
even though channel appears idle some distant station might have already started
transmission. It can also be used to assign priority to the stations.
Interframe Space (IFS)
Interframe space (IFS): collisions are avoided by deferring even if the channel is
idle. When the channel is idle do not send immediately and wait for IFS because
even though channel appears idle some distant station might have already started
transmission. It can also be used to assign priority to the stations. Shorter IFS
means higher priority. Even after waiting for IFS time if the channel is idle,
stations need to wait for contention window.
Contention window
Contention window is amount of time divided into slots. A station that is ready to
send chooses a random number of slots as wait time. No. of slots change as per
the binary exponential backoff strategy, R=0 to 2^K -1.
Contention window
Contention window is amount of time divided into slots. A station that is ready to
send chooses a random number of slots as wait time. No. of slots change as per
the binary exponential backoff strategy, R=0 to 2^K -1.

Working: Station needs to sense the channel after each time slot. If channel is
busy, it stops the timer and restarts it when the channel is idle.
Contention window
Contention window is amount of time divided into slots. A station that is ready to
send chooses a random number of slots as wait time. No. of slots change as per
the binary exponential backoff strategy, R=0 to 2^K -1.

Working: Station needs to sense the channel after each time slot. If channel is
busy, it stops the timer and restarts it when the channel is idle. Stations with
longest waiting time gets priority.
CSMA/CA Flow diagram
Hidden node problem
Exposed node problem
Solution: RTS-CTS
A station that needs to send data sends a RTS (request to send). If the receiver is
available it sends to clear to send (CTS).

How does that help in the hidden-node and exposed node problems?
Network allocation vector (NAV)
When a station sends RTS it also includes
duration of time it needs to occupy the
channel. Stations affected by this
transmission create a timer called
Network allocation vector (NAV) that
shows how much time must pass before
stations are allowed to check the channel.
CSMA/CA Flow diagram
Controlled Access
In controlled access, the stations consult one another to find which station has the
right to send.

A station cannot send unless it has been authorized by other stations. We discuss
three popular controlled-access methods.
Reservation access method
A station needs to make a reservation before sending data. Time is divided into
intervals. In each interval, a reservation frame precedes data frame. If there are N
stations in a system, there are N minislots in reservation frame.
Reservation access method
A station needs to make a reservation before sending data. Time is divided into
intervals. In each interval, a reservation frame precedes data frame. If there are N
stations in a system, there are N minislots in reservation frame.
Polling access method
It works with topologies in which one device is designated as primary station and
others devices are secondary stations. All data exchanges must be through
primary.
Polling access method
It works with topologies in which one device is designated as primary station and
others devices are secondary stations. All data exchanges must be through
primary.

Primary device controls the link, secondary device follows the instructions. Primary
is the initiator of session and uses poll and select functions to prevent collisions.

Drawback:
Polling access method
It works with topologies in which one device is designated as primary station and
others devices are secondary stations. All data exchanges must be through
primary.

Primary device controls the link, secondary device follows the instructions. Primary
is the initiator of session and uses poll and select functions to prevent collisions.

Drawback: Primary station can be the bottleneck.


Polling access method: Poll and SEL
Token-passing access method
Stations are organized in form of a logical ring, i.e., each station has a
predecessor and a successor. Current station is the one accessing the channel.
The right to access the channel is passed from predecessor to current station to
successor.
Token-passing access method
Stations are organized in form of a logical ring, i.e., each station has a
predecessor and a successor. Current station is the one accessing the channel.
The right to access the channel is passed from predecessor to current station to
successor.

The right is passed in form of a special packet called token which circulates
through the logical ring. Possession of token gives right to access the channel and
send data.
Token-passing access method
Stations are organized in form of a logical ring, i.e., each station has a
predecessor and a successor. Current station is the one accessing the channel.
The right to access the channel is passed from predecessor to current station to
successor.
The right is passed in form of a special packet called token which circulates
through the logical ring. Possession of token gives right to access the channel and
send data.
A limited time must be given for possession of token. Token movement must be
monitored and prevented from lost/destruction. It can also be used to assign
priority to the stations.
Token-passing access method
Channelization
Channelization or channel partition is a multiple-access method in which the
available bandwidth of a link is shared in time, frequency, or through code,
between different stations.
Channelization
Channelization or channel partition is a multiple-access method in which the
available bandwidth of a link is shared in time, frequency, or through code,
between different stations.

These are used in cellular networks like GSM and CDMA-2000.


FDMA: Frequency division multiple access
Available bandwidth of link
is divided into frequency
bands. Each station is
allocated a band to send
its data.
FDMA: Frequency division multiple access
Available bandwidth of link
is divided into frequency
bands. Each station is
allocated a band to send
its data.
Each band is reserved for
that station for entire
communication, so entire
stream of data can be
send.
TDMA: Time division multiple access
Available bandwidth of link
is shared in time. Each
station is allocated a time
slot to send its data.
TDMA: Time division multiple access
Available bandwidth of link
is shared in time. Each
station is allocated a time
slot to send its data.

Each station uses entire


bandwidth to send data in
that slot.
CDMA: Code division multiple access
CDMA differs from FDMA in that only one channel occupies entire bandwidth of
link. It differs from TDMA in that all stations send data simultaneously, there is no
time sharing.
CDMA: Code division multiple access
CDMA differs from FDMA in that only one channel occupies entire bandwidth of
link. It differs from TDMA in that all stations send data simultaneously, there is no
time sharing.

Idea: Communication using codes.


CDMA: Code division multiple access
CDMA differs from FDMA in that only one channel occupies entire bandwidth of
link. It differs from TDMA in that all stations send data simultaneously, there is no
time sharing.

Idea: Communication using codes. Let us assume we have 4 stations 1,2,3,4 with
data d1,d2,d3,d4 and codes c1,c2,c3,c4.
CDMA: Code division multiple access
CDMA differs from FDMA in that only one channel occupies entire bandwidth of
link. It differs from TDMA in that all stations send data simultaneously, there is no
time sharing.

Idea: Communication using codes. Let us assume we have 4 stations 1,2,3,4 with
data d1,d2,d3,d4 and codes c1,c2,c3,c4. Properties of codes:

● If we multiply each code by another, we get 0 (orthogonal), i.e., c1*c2=0.


● If we multiply each code by itself, we get no. of stations, i.e., c1*c1=N
CDMA
1. Multiply data with code,
i.e., d1.c1.
2. Send data on channel
which is sum of all
these terms.
3. If anyone wants to hear
from other station
multiply by their code,
i.e., if station 3 wants to
hear to station 1 it
multiples by c1.
4. Divide result by no. of
stations.
CDMA chip sequence and data
CDMA is based on coding theory. Each station is assigned a cod which is a
sequence of numbers called chips. These are orthogonal.
CDMA chip sequence and data
CDMA is based on coding theory. Each station is assigned a cod which is a
sequence of numbers called chips. These are orthogonal.
Properties of codes
● Each sequence is made of N elements, where N is the number of stations.
● If we multiply a sequence by a number, every element in the sequence is
multiplied by that element. This is called multiplication of a sequence by a
scalar. For example, 2. [+1 +1-1-1]=[+2+2-2-2]
● If we multiply two equal sequences, element by element, and add the results,
we get N, where N is the number of elements in the each sequence. This is
called the inner product of two equal sequences. For example, [+1 +1-1 -1]·
[+1 +1 -1 -1] = 1 + 1 + 1 + 1 = 4
● If we multiply two different sequences, element by element, and add the
results, we get 0. This is called inner product of two different sequences. For
example, [+1 +1 -1 -1] • [+1 +1 +1 +1] = 1 + 1 - 1 - 1 = 0
● Adding two sequences means adding the corresponding elements. The result
is another sequence. For example, [+1+1-1-1]+[+1+1+1+1]=[+2+2 0 0].
CDMA chip sequence and data
CDMA is based on coding theory. Each station is assigned a cod which is a
sequence of numbers called chips. These are orthogonal.
CDMA - operation
CDMA - code generation
Example:
Example:
References
● Chapter 12 [BAF]
● Packet Multiple Access. http://web.mit.edu/modiano/www/6.263/lec10.pdf
[Accessed date: 1 March 2023]
● Random access. http://bbcr.uwaterloo.ca/~lcai/ece418/5-2.pdf
[Accessed date: 1 March 2023]
● Lec 25-27 [AP-NPTEL]
● Note: Source of all images unless specified is [BAF] book (4th Edition).

You might also like