Top Banner
CS 453 CS 453 Computer Networks Computer Networks Lecture 13 Lecture 13 Medium Access Control Medium Access Control Sublayer Sublayer
36

CS 453 Computer Networks

Jan 25, 2016

Download

Documents

bess

CS 453 Computer Networks. Lecture 13 Medium Access Control Sublayer. MAC Sublayer. So, lets add another complication… So far we have discussed protocols with the assumption that the lower physical layer medium is wire-like – But it a different sense than serial throughput - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CS 453 Computer Networks

CS 453CS 453Computer NetworksComputer Networks

Lecture 13Lecture 13

Medium Access Control Medium Access Control

SublayerSublayer

Page 2: CS 453 Computer Networks

MAC Sublayer

So, lets add another complication…

So far we have discussed protocols with the assumption that the lower physical layer medium is wire-like –

But it a different sense than serial throughput That is, it is point to point , and… It is single channel (this is not completely true) We did not need to consider how the communicating

stations (ends) get access to the medium

Page 3: CS 453 Computer Networks

MAC Sublayer

But media are not point-to-point

We call these Broadcast media

These include – Radio Cable – I’ll explain later Satellite Ethernet

These have a diffused, wide area footprint

And….

Page 4: CS 453 Computer Networks

MAC Sublayer

There is simultaneous potential for access by multiple stations – possibly many stations

Not only simultaneous potential access to the medium, but to a single channel

So, the problem is – How to grant that access And enable communications

Page 5: CS 453 Computer Networks

MAC Sublayer

We have already looked at a few ways grant or allocate access to single channels- Frequency Division Multiplexing (FDM)

Divide the frequency bandwidth of a channel into multiple smaller channels, and…

Allocate the smaller channels as if they were point-to-point channels

Page 6: CS 453 Computer Networks

MAC Sublayer

FDM Simple and, in principle, very efficient However, with bursty or irregular data traffic… Some channels may be heavily used… While other channel little or not used at all Unused bandwidth can not usually be

reallocated, so Very inefficient is this scenario

Page 7: CS 453 Computer Networks

MAC Sublayer

Time Division Multiplexing (TDM) Instead of dividing up the frequency bandwidth of the

channel… We can divide up time on the channel, and … Allocate slices of time to alternative pairs of

communicating stations

TDM has similar problems to FDM

With Statistical Time Division Multiplexing (STDM) we can achieve some improvement in efficiency

Page 8: CS 453 Computer Networks

MAC Sublayer

With broadcast media like radio, wireless, satellite and cable, we have a new set of problems…

We can’t use static allocations schemes like FDM and TDM

N stations potentially accessing the medium

N might be unknown

N might be variable

We might not know the location of the stations

Page 9: CS 453 Computer Networks

MAC Sublayer

Broadcast media We have a single communication media Potentially many stations competing for

access and use of the media Multiple stations trying to access the medium

at the same time is know as contention We need a way to resolve contention if any

communications is going to get done And we need to do this dynamically

Page 10: CS 453 Computer Networks

MAC Sublayer

Before going on – a few assumptions Single channel – our problem (for now)

concerns the allocation of a single communications channel

Collisions – any time two or more stations try to or do transmit at the same time, all transmitted frames are mangled and consider destroyed

Collision detection – all stations can detect collisions

Page 11: CS 453 Computer Networks

MAC Sublayer

A side note – To a large extent the broadcast medium issues

discussed here concern local area network (LAN) and metropolitan area networks (MAN)

Wide Area Networks (WAN) typically use point-to-point links

Satellites are notable exception to the previous statement…

… and the broadcast medium allocation issues apply

Page 12: CS 453 Computer Networks

MAC Sublayer

Multiple Access Protocols There are many Multiple Access Protocols Date back to the early 1970s Some have come and gone Some have come and gone and come back

again

Page 13: CS 453 Computer Networks

MAC SublayerAloha Alohanet – work in 1970s at University of

HawaiiBy Abramson and colleaguesTo establish communications links among Hawaiian islandsUsed radioRadio is a broadcast mediumThey had a multistation contention problemDeveloped an access protocol called (you guessed it) Aloha

Page 14: CS 453 Computer Networks

MAC SublayerAloha

Frames are fixed size Any station can transmit a frame anytime it wants

Free-for-allNo waitingNo clock

Since the transmission is broadcast the sender can listen to what it sent

If there was another overlapping transmission by another station (collision)…

Each sending/listening station would here a garbled version of what it sent…

And declare its transmission to be in error... …wait a random period and.. retransmit

Page 15: CS 453 Computer Networks

MAC Sublayer

Aloha So how well does it work, or how much data

gets through Frame time is the amount of time the channel

is used to transmit one frame If two frames are transmitted in the same

frame time there is a collision

Page 16: CS 453 Computer Networks

MAC SublayerAloha N = mean number of frames transmitted per

frame time (N is a Poisson distribution) If N>1 nearly every frame has a collision 0<N<1 for Aloha to work with any efficiency For every frame that has a collision that frame

is retransmitted G = N (number of frames transmitted per

frame time) + number of retransmissions due to collisions

Page 17: CS 453 Computer Networks

MAC Sublayer

Aloha S (throughput) = GP where P = Probability of

frame avoiding a collision

S = Ge-2G

Page 18: CS 453 Computer Networks

MAC Sublayer

Aloha So, S maxs out with G = 0.5 -- S = 1/2e or about 18%

efficiency With G> 0.5

collision retries begin to swamp the network

Aloha Throughput

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

G - Frame attempts per frame time

Su

cces

sfu

l F

ram

es p

er F

ram

e ti

me

Aloha

Page 19: CS 453 Computer Networks

MAC SublayerSlotted Aloha

Remember – Aloha was a free-for-allAny station any time

Slotted Aloha –Create time slotsAny station can transmitBut only at the start of a time slotIf a station does not have anything to transmit at the start of the time slot, …It must wait until the next time slotSo now, all collisions are complete collisions…No overlap collisionsSynchronization? - Aloha – broadcast a clock tick

Page 20: CS 453 Computer Networks

MAC Sublayer

Slotted Aloha S (throughput) = GP where P = Probability of

frame avoiding a collision now…

S = Ge-G

Page 21: CS 453 Computer Networks

MAC SublayerSlotted Aloha

With Slotted Aloha, S maxs out

with G = 1 S = 1/e or about 37%

efficiency With G> 1 collision

retries begin to swamp the network,…

… collisions increase exponentially

Throughput

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

G frame attemps per frame time

S T

hro

ug

hp

ut

Aloha

Slotted Aloha S

Page 22: CS 453 Computer Networks

MAC Sublayer

Carrier Sense Multiple Access With Slotted Aloha the best we can do for

throughput is 1/e What if each station could, before transmitting

a frame, listen to see if the channel is idle or busy…

…and only if idle transmit a frame This is Carrier Sense Multiple Access or CSMA

Page 23: CS 453 Computer Networks

MAC Sublayer

Persistent Carrier Sense Multiple Access A greedy protocol When a station wants to transmit it listen to

the channel. If busy it continues to listen until the channel

is idle…Sort of like eaves-dropping on a party-line

Then transmits its frame

Page 24: CS 453 Computer Networks

MAC Sublayer

Persistent Carrier Sense Multiple Access Can still have collisions

Two stations listen and find the channel busy

Both continue listening and …

when the transmission finishes (hangs up)..

Both immediately start transmitting their frame

Page 25: CS 453 Computer Networks

MAC Sublayer

Persistent Carrier Sense Multiple Access Propagation delay problems

Station 1 listens and finds the channel idle

But it takes a millisecond or so to start transmission

In the millisecond, Station 2 listens and…

Find the channel seemingly idle because of the propagation delay in Station 1…

So Station 2 proceed to transmit, even though Station 1 has already started…

=Collision

Page 26: CS 453 Computer Networks

MAC SublayerNon-persistent Carrier Sense Multiple Access In non-persistent CSMA Stations listen – If they find the channel busy, They don’t continue to listen,… but backoff and wait a random wait-time… then listen again Nearly eliminates collisions Still can have some --- how?

Page 27: CS 453 Computer Networks

MAC Sublayer

Peak efficiency Aloha ~17% Slotted Aloha ~37% 1-persistent CSMA ~55% Non-persistent CSMA ~90%

Page 28: CS 453 Computer Networks

MAC Sublayer

CSMA-CD CSMA with Carrier Detection Up to now the protocols could only tell there

was a collision after the transmission completed

So the mangle frames arrive Are determined to be irrepairable and Trashed… But…

Page 29: CS 453 Computer Networks

MAC Sublayer

CSMA-CD What if tranmitting stations could sense a

collision as soon as it occurs? This is CSMA-CD As soon as a collision is detected both senders

terminate the transmission… Wait a random wait-period.. And reinitiate the carrier-sense-tranmit

algorithm..

Page 30: CS 453 Computer Networks

MAC Sublayer

CSMA/CD Collision Detection does not reduce the

number of collisions.. But it does stop transmissions as soon as the

collision is detected… This frees up bandwidth that would have been

waste by continuing to transmit mangled frames

Page 31: CS 453 Computer Networks

MAC Sublayer

CSMA/CD CSMA/CD is commonly used as MAC sublayer

protocol on LANs CSMA/CD is the basis for Ethernet

Page 32: CS 453 Computer Networks

MAC Sublayer

Collision Free Protocols

It is possible to have protocols that avoid collisions altogether…

At the expense, usual of some overhead

Page 33: CS 453 Computer Networks

MAC Sublayer

Collision Free Protocols Reservation Protocols In short a station needing to send a frame makes a reservation

to to do so Bit-map scheme There are N stations A contention frame is broadcast, The contention frame has a bit position for each of the N stations Each station can transmit in order, but only if it has made a

reservation It does this by setting its bit in the contention slot to 1 Then if its bit is 1, it transmits its frame after any (if any) previous

stations that made a reservation

Page 34: CS 453 Computer Networks

MAC Sublayer

Collision Free Protocols

Reservation Protocols

0 1 0 0 1 1 0 0 Frame 1 Frame 4 Frame 5

Page 35: CS 453 Computer Networks

MAC Sublayer

Collision Free Protocols Token Passing A small (low overhead) token is passed from station to

stationCan be physically or numerically a ring

A station can transmit a frame on the medium… When and only when, it has the token If the station has nothing to transmit it passes the

token to the next station If the station has something to transmit, it transmits its

frame of data, then passes its frame to the next station

Page 36: CS 453 Computer Networks