MAC Protcols Final
MAC Protcols Final
1
Multiple access problem
Example:
Business party – many people gather
together in a large room
Broadcast medium – air
Another example: a classroom
Human protocols:
2
Figure 1 Data link layer divided into two functionality-oriented sublayers
Control
MAC
Responsible framing
and MAC address and
Multiple Access Control
Multiple Access
ALOHA Protocols
Was designed for wireless LAN and can be used for any shared medium
Pure ALOHA Protocol Description
All frames from any station are of fixed length (L bits)
Stations transmit at equal transmission time (all stations produce frames with equal frame lengths).
A station that has data can transmit at any time
After transmitting a frame, the sender waits for an acknowledgment for an amount of time (time out) equal
to the maximum round-trip propagation delay = 2* tprop(see next slide)
If no ACK was received, sender assumes that the frame or ACK has been destroyed and resends that frame
after it waits for a random amount of time
Channel utilization or efficiency or Throughput is the percentage of the transmitted frames that arrive
successfully (without collisions) or the percentage of the channel bandwidth that will be used for
transmitting frames without collisions
ALOHA Maximum channel utilization is 18% (i.e, if the system produces F frames/s, then 0.18 * F frames
will arrive successfully on average without the need of retransmission).
Maximum Propagation Delay
Maximum propagation delay(tprop): time it takes for a bit of a frame
to travel between the two most widely separated stations.
The farthest
station
Station B
receives the
first bit of
the frame at
time t= tprop
Figure 4 Procedure for ALOHA protocol
Critical time for pure ALOHA protocol
Tfr= Frame
Transmission time
0.4
0.3
Slotted Aloha
0.2
0.1
Pure Aloha
rate)
Disadvantage
If (M) nodes want to transmit, many collisions can occur and the rate
allocated for each node will not be on average R/M bps
This causes low channel utilization
Random Access – Carrier Sense Multiple Access
(CSMA)
To improve performance, avoid transmissions that are certain to cause
collisions
Based on the fact that in LAN propagation time is very small
If a frame was sent by a station, All stations knows immediately so they can
wait before start sending
A station with frames to be sent, should sense the medium for the
presence of another transmission (carrier) before it starts its own
transmission
This can reduce the possibility of collision but it cannot eliminate it.
Collision can only happen when more than one station begin transmitting
within a short time (the propagation time period)
Random Access – Carrier Sense Multiple Access
(CSMA)
Vulnerable time for CSMA is the maximum propagation time
The longer the propagation delay, the worse the performance of the
protocol because of the above case.
Types of CSMA Protocols
Different CSMA protocols that determine:
What a station should do when the medium is idle?
What a station should do when the medium is busy?
1. Non-Persistent CSMA
2. 1-Persistent CSMA
3. p-Persistent CSMA
Nonpersistent CSMA
A station with frames to be sent, should sense the medium
1. If medium is idle, transmit; otherwise, go to 2
2. If medium is busy, (backoff) wait a random amount of time and repeat 1
Non-persistent Stations are deferential (respect others)
Performance:
Random delays reduces probability of collisions because two stations with
data to be transmitted will wait for different amount of times.
Bandwidth is wasted if waiting time (backoff) is large because medium will
remain idle following end of transmission even if one or more stations have
frames to send
Random Waiting
times
Wasted time
1-persistent CSMA
To avoid idle channel time, 1-persistent protocol used
Station wishing to transmit listens to the medium:
1. If medium idle, transmit immediately;
2. If medium busy, continuously listen until medium becomes idle; then
transmit immediately with probability 1
Performance
1-persistent stations are selfish
If two or more stations becomes ready at the same time, collision guaranteed
P-persistent CSMA
Time is divided to slots where each Time unit (slot) typically equals
maximum propagation delay
Station wishing to transmit listens to the medium:
1. If medium idle,
transmit with probability (p), OR
wait one time unit (slot) with probability (1 – p), then repeat 1.
2. If medium busy, continuously listen until idle and repeat step 1
3. Performance
Reduces the possibility of collisions like nonpersistent
Reduces channel idle time like 1-persistent
Flow diagram for three persistence methods
Persistent and Nonpersistent CSMA
Comparison of the channel utilization versus load for various random access
protocols.
CSMA/CD (Collision Detection)
CSMA (all previous methods) has an inefficiency:
If a collision has occurred, the channel is unstable until
collisions.
Sender stops transmission if collision has occurred
Examples:
detecting voltage level on the line
detecting power level
detecting simultaneous transmission & reception
29
CSMA/CD Protocol
Use one of the CSMA persistence algorithm
(non-persistent, 1-persistent, p-persistent) for
transmission
If a collision is detected by a station during its transmission
then it should do the following:
Abort transmission and
Transmit a jam signal (48 bit) to notify other stations of collision
so that they will discard the transmitted frame also to make sure
that the collision signal will stay until detected by the furthest station
After sending the jam signal, backoff (wait) for a random amount
of time, then
Transmit the frame again
CSMA/CD
Question: How long does it take to detect a collision?
Answer: In the worst case, twice the maximum propagation delay of
the medium
Note: a = maximum propagation delay
CSMA/CD
N=0
Choose R between
0 & 2k - 1
K=10 K=N
Yes
No
No
N < 10 N==16
N=N+1
Yes
Abort
Exponential Backoff Algorithm
Reduces the chance of two waiting stations picking the
same random waiting time
When network traffic is light, it results in minimum
waiting time before transmission
As congestion increases ( traffic is high), collisions
increase, stations backoff by larger amounts to reduce the
probability of collision.
Exponential Back off algorithm gives last-in, first-out
effect
Stations with no or few collisions will have the chance to transmit
before stations that have waited longer because of their previous
unsuccessful transmission attempts.
Performance of Random Access Protocols
Simple and easy to implement
Decentralized (no central device that can fail and bring down the entire
system)
In low-traffic, packet transfer has low-delay
However, limited throughput and in heavier traffic, packet delay has no
limit.
In some cases, a station may never have a chance to transfer its packet.
(unfair protocol)
A node that has frames to be transmitted can transmit continuously at
the full rate of channel (R) if it is the only node with frames
If (M) nodes want to transmit, many collisions can occur and the rate
for each node will not be on average R/M