Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 13

MAC Protocols

Media Access Control


(who gets the use the channel)

TDM and FDM are inefficient.


It is best to share the medium so that who ever needs it can use it.
And if it is not needed, it is not used.
Think of bursty transmissions.
The objective is dynamic allocation of the channel.

Contention-based
ALOHA and Slotted ALOHA.
CSMA.
CSMA/CD.
The ALOHA Protocol
• Developed @ U of Hawaii in early 70’s.
• Packet radio networks.
• “Free for all”: whenever station has a frame to send, it
does so.
– Station listens for maximum RTT for an ACK.
– If no ACK after a specified amount of time (how long?), re-
sends frame after waiting a random amount of time
(otherwise?)
– It continues to retry for a number of times and then gives up.
– Receivers check FCS and destination address to ACK.
Collisions
• Invalid frames may be caused by channel
noise or
• Because other station(s) transmitted at the
same time: collision.
• Collision happens even when the last bit of
a frame overlaps with the first bit of the
next frame.
ALOHA’s Performance 1

t0 t0+t t0+2t t0+3t


Time
vulnerable
ALOHA’s Performance
• Assume that users try to send frames at random times
(Poisson events).
• Let G be the average rate that users try to send frames per
frame time.
• The probability of trying to send k frames in TWO frame
time is
P k  
 2G 
k 2 G
e
k!
The probability no other frames are sent is P(0)=e-2G.
The throughput is the rate that frames are sent multiplied
by the probability that the transmission is successful
G e-2G
ALOHA’s Performance
0.2
0.184

 2 G 0.1
Ge

0 0
0 1 2 3
0 G 3

The best throughput occurs for what value of G?


What is this best throughput?
Slotted Aloha
• Doubles performance of ALOHA.
• Frames can only be transmitted at beginning
of slot: “discrete” ALOHA.
• Vulnerable period is halved.
• S = G e-G.
• S = Smax = 1/e = 0.368 for G = 1.
Slotted Aloha Performance
0.4
0.368

 G 0.2
G e

0 0
0 2 4
0 G 4
Slotted Aloha Performance
How long does it take to send a frame?

The probability that it takes exactly k tries : p  k   e G


1  e 
G k 1

one success k-1 failures


 
E   kp  k    ke G
1  e 
G k 1

k 0 k 0
Expected  

 k 1  e   e  1  e 
G G k 1 G d G k
number of e
transmissions k 1 k 1 dk

d  G  
e G

dk k 1
1  e 
G k
 e 
1  1
1
 e G

 1   e G


Carrier Sense Multiple Access
(CSMA)
• ALOHA Protocols have poor utilization.
• Key property of LANs: propagation delay
between stations is small compared to frame
transmission time.
• Consequence: stations can sense the
medium before transmitting.
• This can reduce the vulnerable period.
CSMA
• 1-persistent
– If medium is idle, then transmit.
– If medium is not idle, then wait until it is and then transmit.
• p-persistent (for slotted channels only)
– If medium is idle, then transmit.
– If medium is not idle, then wait until it is idle
– Once idle then transmit with probability p. And wait for the
next slot with probability 1-p and repeat.

• Problem: when a collision occurs, it lasts for a long time,


the whole frame transmission time.
Carrier Sense Multiple Access
with Collision Detection
CSMA/CD
When transmitting, detect if a collision is occurring. If a
collision is occurring, abort as soon as possible and wait a
random amount of time before retrying.

Suppose that two nodes begin to transmit at the same time.


How long until the collision is detected? The propagation delay.

After beginning transmission, how long until we know that we


have control of the channel? Twice the propagation delay.
CSMA/CD
After beginning transmission, how long until we know that we
have control of the channel? Twice the propagation delay.

Let T be the propagation delay.


At t=0, node 1 begins transmission.
Suppose that at t=T- node 2 begins to transmit.
At t=T, node 2 detects the collision.
At t=2T-, node 1 detects the collision.

Keeping propagation delay small can improve efficiency.


After a collision is detected, often a jamming signal is applied.
This slightly increases the contention interval.

You might also like