EEC 682/782

EEC-484/584
Computer Networks
Lecture 9
Wenbing Zhao
[email protected]
(Part of the slides are based on materials supplied by
Dr. Louise Moser at UCSB and Prentice-Hall)
2
Outline
• Channel allocation problem
• Multiple Access Protocols
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
3
Medium Access Control Sublayer
• Broadcast channels often used on DLL
– multiaccess or random access
• The channel allocation problem: Who gets
to use the channel?
– Static Channel Allocation
– Dynamic Channel Allocation
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
4
Static Channel Allocation
• FDM – Frequency Division Multiplexing
– Frequency spectrum divided into logical channel
– Each user has exclusive use of own frequency band
• TDM – Time Division Multiplexing
– Time divided into slots each user has time slot
– Users take turns in round robin fashion
• Problem: wasted bandwidth if user does not use
his/her frequency band or timeslot
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
5
Frequency Division Multiplexing
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
6
Time Division Multiplexing
T1 Carrier (1.544 Mbps)
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
Model for
Dynamic Channel Allocation
• N independent stations (also called
terminals)
• Probability of a frame being generated in
an interval Dt is lDt (arrival rate l constant)
• Once a frame has been generated, the
station is blocked until the frame is
transmitted successfully
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
7
Model for
Dynamic Channel Allocation
• Single Channel shared by all stations
• Collision – event when two frames
transmitted simultaneously and the
resulting signal is garbled
– All stations can detect collisions
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
8
Model for
Dynamic Channel Allocation
• Frame transmission time
– Continuous Time – can begin at any instant
– Slotted Time – always begin at the start of a
slot
• Carrier sense or not
– Carrier sense – stations can tell if the channel
is busy. Do not send if channel is busy
– No carrier sense – just go ahead and send
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
9
10
Multiple Access Protocols
•
•
•
•
ALOHA
Carrier Sense Multiple Access Protocols
Collision-Free Protocols
Wireless LAN Protocols
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
11
Pure ALOHA
• Let users transmit whenever they have data
to send
• If frame destroyed
(due to collision),
sender waits
random amount
of time, sends again
• User does not listen before transmitting
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
12
Pure ALOHA
• Let frame time
= amount of time to transmit frame
= frame length / bit rate
• Assume infinite population of users, generate
new frames according to a Poisson distribution
with mean N frames per frame time
• If N > 1, more frames generated than channel
can handle
– Nearly every frame involved in collision
• For reasonable throughput, want 0 < N < 1
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
13
Pure ALOHA: Vulnerable Period
• Vulnerable period for a frame: A collision will
happen if another frame is sent during this period
2 frame time
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
14
Pure ALOHA
• Throughput S = GP0
– G – offered load
– P0 – probability that a frame does not suffer a collision
• A frame will not undergo collision if no other
frame sent during the vulnerable time
– Vulnerable time: 2 frame time
– In an interval two frame times long, the mean number
of frames generated is 2G => P0 = e-2G
– S = GP0 = G e-2G, max occurs when G=0.5,
S = 0.184
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
15
Pure ALOHA
• Throughput for ALOHA systems
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
16
Slotted ALOHA
• Idea: divide time into intervals, each
interval corresponds to one frame
– Station is permitted to send only at the
beginning of next slot
• Vulnerable period is halved (1 frame time)
– Probability of no collision in time slot = e-G
– Throughput S = G e-G
– Max occurs when G = 1, S = 2*0.184
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
17
Slotted ALOHA
• Operating at higher values of G reduces number
of empty slots, increases number of collisions
exponentially
• Probability of no collision = e-G,
probability of collision = 1 – e-G
• Probability of transmission requiring exactly k
attempts, i.e., k-1 collisions followed by 1
success: Pk = e-G(1- e-G)k-1
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
18
Slotted ALOHA
• Expected number of transmissions
(original + retrans)


k 1
k 1
E   kPk   ke G (1  e G )k 1  eG
• Small increases in channel load G can
drastically reduce performance
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
19
Carrier Sense Multiple Access
• When station has data to send, listens to channel
to see if anyone else is transmitting
• If channel is idle, station transmits a frame
• Else station waits for it to become idle
• If collisions occurs, station waits random amount
of time, tries again
• Also called 1-persistent CSMA
– With probability 1 station will transmit if channel is idle
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
Carrier Sense Multiple Access:
Collision Still Possible
• After a station starts sending, it takes a while
before 2nd station receives 1st station’s signal
– 2nd station might start sending before it knows that
another station has already been transmitting
• If two stations become ready while third station
transmitting
– Both wait until transmission ends and start
transmitting, collision results
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
20
21
p-persistent CSMA:
Reduce the Probability of Collision
• Sense continuously, but does not always send
when channel is idle
– Applicable for slotted channels
• When ready to send, station senses the channel
– If channel idle, station transmits with probability p,
defers to next slot with probability q = 1-p
– Else (if channel is busy) station waits until next slot
tries again
– If next slot idle, station transmits with probability p,
defers with probability q = 1-p
– …
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
22
Non-Persistent CSMA
• Does not sense continuously, send if it senses
the channel is idle
• Before sending, station senses the channel
– If channel is idle, station begins sending
– Else station does not continuously sense, waits
random amount of time, tries again
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
23
Persistent and Nonpersistent CSMA
• Improves over ALOHA because they ensure no
station to transmit when it senses channel is busy
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
24
CSMA with Collision Detection
• If two stations start transmitting simultaneously,
both detect collision and stop transmitting
• Minimum time to detect collision = time for signal
to propagate
• CSMA/CD can be in one of three states:
– Transmission: a station is busy transmitting, it has
exclusive usage on the channel
– Contention: when a transmission finishes, one or
more stations might want to start transmitting, and
compete for the channel
– Idle: if no station has anything to transmit
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
25
CSMA with Collision Detection
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
Contention Period:
Minimum Time to Detect Collision
A
B
• Let the time for a signal to propagate between the
two farthest stations be t
• For station to be sure it has channel and other
stations will not interfere, it must wait 2t without
hearing a collision (not t as you might expect)
– At t0, station A begins transmitting
– At t0+t-e, B begins transmitting, just before A’s signal
arrives
– B detects collision and stops
– At t0+t-e+t (t0+2t-e), A detects collision
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
26
27
Collision-Free Protocols
• For long, high-bandwidth fiber optic networks
– large transmission delay t, short frames, collisions
are a problem
– collision-free protocols are more desirable
• Assumption: N stations with addresses 0,…,N-1
• Bit map protocol
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
28
Bit-Map Protocol
• Reservation based
• If station k has frame to send, transmits 1 in kth
slot, announcing that it has a frame to send
• Stations then transmit in numerical order
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
29
Bit-Map Protocol:
Time to Wait before Transmitting
• For low-numbered stations => 1.5N
– On average, the station will have to wait N/2 slots for
the current scan to finish
– Another full N slots for the following scan to run to
completion
• For high-numbered stations => 0.5N
– Only needs to wait N/2 slots for the current scan to
finish
• Mean for all stations is N slots
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
30
Bit-Map Protocol:
Channel Efficiency
• Low load
– Overhead per frame: N bits
– If amount of data is d bits, efficiency is d/(N+d)
• High load
– Overhead per frame: 1 bit
– If amount of data is d bits, efficiency is d/(1+d)
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
31
Contention vs. Collision-Free Protocols
• Contention protocols
– At low load, low delay => preferable
– As load increases, overhead increases due to
channel arbitration
• Collision-free protocols
– At low load, high delay
– As load increases, channel utilization
improves
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
Wireless LAN Protocols:
Infrastructure
• Base stations wired by copper/fiber in
building
• If transmission power of base stations 3-4
meters, then each room forms a single cell
• Each cell has one channel
• Bandwidth 11-108 Mbps (for now)
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
32
33
Wireless LAN Protocols:
Special Problems
• When receiver within range of two active
transmitters, resulting signals garbled and
useless
• Not all stations within range of each other
• Walls etc. impact range of each station
• What matters is interference at receiver
– Sender needs to know whether there’s activity around
the receiver
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
34
Hidden Station Problem
• A transmits to B
• C out of range of A, thinks OK to transmit to B
• C transmits to B, interference occurs at B
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
35
Exposed Station Problem
• B transmits to A
• C sense transmission, concludes can’t
send to D, when it could have
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
Multiple Access with Collision Avoidance:
MACA Protocol
• A sends Request to Send (RTS) to B containing
length of data frame to follow
• B replies with Clear to Send (CTS) to A
containing length in RTS
• When A receives CTS, A sends data frame
• Collision can occur (for RTS), use exponential
backoff
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
36
37
MACA
• Any station (e.g., C,E) hearing RTS is close to A, must
keep quite until B finishes sending CTS
• Any station (e.g., D,E) hearing CTS is close to B, must
keep quite until A finish sending data frame
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
38
Exercise
• How long does a station, s, have to wait in
the worst case before it can start
transmitting its frame over a LAN that uses
the basic bit-map protocol?
(Assume N stations, each frame is d bits)
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao
39
Exercise
• Six stations, A through F, communicate
using the MACA protocol. Is it possible
that two transmissions take place
simultaneously?
Spring Semester 2006
EEC-484/584: Computer Networks
Wenbing Zhao