Sie sind auf Seite 1von 33

ECE

533 Advanced Computer


Communication Networks
Multiple Access

Multiple Access

Shared transmission medium


A receiver can hear multiple transmitters
A transmitter can be heard by multiple receivers

The major problem with multiple access is allocating the


channel between the users; nodes do not know when the other
nodes have data to send
Need to coordinate transmissions

Examples of Multiple Access Channels

Examples of Multiple Access Channels

Local area networks (LANs)


TraditionalnEthernet
Local area
etworks (LANs)

Recent trend to non-multi-access LANs

Traditional Ethernet
Recent trend to non-multi-access LANs

Satellite channels

Satellite channels

Wireless
Wireless
radioradio

Multi-drop telephone

NET
DLC
PHY

MAC
LLC

Medium
Access
Control
Medium Access
Control
(MAC) (MAC)
Regulates access
to channel
Regulates
access
to channel

Logical Link Control (LLC)

All L
other
functions (LLC)
Logical
ink DLC
Control
All other functionalities

an Modiano
Slide 3

Approaches to Multiple Access

Fixed Assignment (TDMA, FDMA, CDMA)


Each node is allocated a fixed fraction of bandwidth
Equivalent to circuit switching
Very inefficient for low duty factor traffic

Contention systems
Polling

Reservations and Scheduling

Random Access

Aloha

Random Access: Aloha


Single
receiver, many transmitters
Single receiver, many
transmitters

Receiver
...
.

Transmitters

E.g., Satellite system, wireless

E.g., satellite systems, wireless


Eytan Modiano
Slide 5

Slotted Aloha
Random Access:
Slotted Aloha
Time is divided into slots of one packet duration
Time
is divided
into slots
of one packet duration
E.g.,
fixed size
packets
E.g.,
packets
When
a nfixed
ode size
has
a packet to send, it waits until the start of the
next
When a node has a packet to send, it waits until the start of the next slot to
slot to send it
send it
Requires
synchronization
Requires synchronization
If
o oother
ther nodes
nodes
attempt
transmission
uring
slot, the
Ifnno
attempt
transmission
during dthat
slot,that
the transmission
is successful is successful
transmission
Otherwise collision
Otherwise
collision
Collided packet are retransmitted after a random delay
Collided packet are retransmitted after a random delay

Eytan Modiano
Slide 6

Slotted Aloha
Assumptions

Poisson external arrivals


No capture
Packets involved in a collision are lost
Capture models are also be possible
Immediate feedback
Idle (0), Success (1), Collision (e)
If a new packet arrives during a slot, transmit in next slot
If a transmission has a collision, node becomes backlogged
While backlogged, transmit in each slot with probability qr
until successful
Infinite nodes where each arriving packet arrives at a new node
Equivalent to no buffering at a node (queue size = 1)
Pessimistic assumption gives a lower bound on Aloha
performance
7

Slotted Aloha

Markov Chain for Slotted Aloha

Markov Chain
P03

P10

P13
2

P34
3

State
systemis
isnnumber
backlogged
nodes.
State
(n) (n)
of of
system
umber ofof
backlogged
nodes
P
pi,i-1
probability
of one backlogged
ttempt
and no new arrival
i,i-1== prob.
of one backlogged
attempt andano
new arrival
Pi,i = probability of one new arrival and no backlogged attempts
p
prob.
of one new
arrival
and no backlogged attempts or no new
i,i n=
or
o
n
ew arrival
a
nd
n
o
s
uccess
arrival and no success
pi,i+1 = probability of new arrival and one or more backlogged
p
attempts
i,i+1 = prob of one new arrival and one or more backlogged attempts
pi,i+j = probability of j new arrivals and one or more backlogged
pi,i+j = Prob. Of j new arrivals and one or more backlogged attempts or j+1
attempts
r j+1
arrivals attempts
and no backlogged attempts
new
arrivalsoand
nonew
backlogged
Steady state probabilities do not exists
Steady
state probabilities
do not
Backlog tends
to infinity
exists
system unstable

Eytan Modiano

Backlog tends to infinity => system unstable


More later

Slotted Aloha

Let g(n) be the attempt rate (the expected number of packets


transmitted in a slot) in state n
g(n) = + nqr

The number of attempted packets per slot in state n is


approximately a Poisson random variable of mean g(n)

P(m attempts) = g(n)me-g(n)/m!


P(idle) = probability of no attempts in a slot = e-g(n)
P(success) = probability of one attempt in a slot = g(n) e-g(n)
P(collision) = P(two or more attempts) = 1 P(idle)
P(success)

Slotted
A
loha
Throughput of Slotted Aloha
Throughput

The throughput is the fraction of slots that contain a successful


he throughput
is the fraction of slots that contain a successful transmission =
-g(n)
success) = g(n)e
transmission
= P(success) = g(n) e-g(n)

When system
stable throughput
also equal
the external arrival
rate
() equal the external
is When
system must
is stable,
throughput
must
also

arrival rate ()

d
g(n)
g(n)
g(n)
d
!g( g(n)e
n)
!g( n)
!g( n)
=
e

g(n)e
=0
g(n)e
=
e
!
g(n)e
=
0
What value of g(n) maximizes dg(n) dg(n)
Whatthroughput?
value of g(n)
" g(n)
= 1g(n) = 1
maximizes throughput?

If g(n) < 1 too many idle slots


!g( n)
"
P(success)
=
g(n)e
= 1/ e #g(n)
0.36= 1 / e 0.36

P(success)
= g(n)e
<If 1g=>
(n) >
1 idle
too
many collisions
g(n)
too many
slots
g(n) > 1 => too many collisions
g(n) can
be ktoept
lose to arrival
1, an rate
external
arrival
rate
f 1/e packets per
Ifg(n)If can
be kept close
1, ancexternal
of 1/e packets
per slot
canobe
10
sustained
slots can be sustained

Instability of Slotted Aloha

Slotted Aloha

Instability of Slotted Aloha

Ifbbacklog
beyond
unstable
point (bad
luck)
then
it tends
to it
If
acklog increases
increases
beyond
unstable
point
(bad
luck),
then
increase
limit
and the ldeparture
drops tor0ate drops to 0
tends
to without
increase
without
imit and rate
departure
Drift in state n, D(n) is the expected change in backlog over one
Drift in state n, D(n) is the expected change in backlog over one time slot
time
lots= - P(success) = - g(n)e-g(n)
s
D(n)
D(n) = - g(n) e-g(n)

Eytan Modiano
Slide 11

11

Slotted Aloha

Stabilizing Slotted Aloha

Choosing qr small increases the backlog at which instability occurs


(since g(n) = + nqr), and also increases delay (since mean retry time is
1/qr)
Solution: estimate the backlog (n) from past feedback
Given the backlog estimate, choose qr to keep g(n) = 1
Assume all arrivals are immediately backlogged
g(n) = nqr, P(success) = nqr(1-qr)n-1
To maximize P(success) choose qr=min{1,1/n}

When the estimate of n is perfect:

Idles occur with probability 1/e, Successes with 1/e, and


Collisions with 1-2/e

When the estimate is too large, too many idle slots occur
When the estimate is too small, too many collisions occur
Nodes can use feedback information to make estimates
A good rule is increase the estimate of n on each collision, and to
decrease it on each idle slot or successful slot

12

Slotted Aloha

Stabilized Slotted Aloha

Assume all arrivals are immediately backlogged


g(n) = nqr = attempt rate
P(success) = nqr(1-qr)n-1

for max throughput set g(n) = 1 qr=min{1,1/n},


where n is the estimate of n

Let nk = estimate of backlog after kth slot

"max{, nk + 1}
nk+1 = #
$nk + +1 / (e 2)

upon idle or success


upon a collision

Can be shown to be able to stable for < 1/e


13

TDM vs. Slotted


Slotted
AlohaAloha

TDM vs Slotted Aloha


TDM, m=16
8
DELAY
TDM, m=8
4
ALOHA

0.2

0.4

0.6

0.8

ARRIVAL RATE

Aloha achieves lower delays when arrival rates are low


Aloha achieves lower delays when arrival rates are low
very
large
delays
with
large ofnusers,
umber
of Aloha
of is
TDM
TDMresults
results inin
very
large
delays
with large
number
while
independent
number
of users
users,
while ofAthe
loha
is independent
of the number of users

Eytan Modiano
Slide 14

14

Pure (unslotted) Aloha

Random Access: Pure (unslotted) Aloha

New arrivalsare
arettransmitted
immediately
(no slots)
New arrivals
ransmitted
immediately
(no slots)
n
No
needfor
for ssynchronization
No
eed
ynchronization
No need for fixed length packets
No need for fixed length packets
A
retried
after
n exponentially
distributed
bAacklogged packet
backlogged packet iiss retried
after
an aexponentially
distributed
random
random
delay
with
some
delay with
some
mean
1/x mean 1/x
The
total
arrival
rocess isis aatime
time
varying Poisson
process
f rate
The
total
arrivalpprocess
varying
Poisson process
of rateog(n)
=+
nx=(n
= ave. time
between
retransmissions)
g(n)
=+ backlog,
nx (n = 1/x
backlog,
1/x =
average
time between
retransmissions)
Note that an attempt suffers a collision if the previous attempt is not yet
Note
that a(tn
attempt suffers a collision if the previous attempt
finished
i-ti-1<1) or the next attempt starts too soon (ti+1-ti<1)
is not yet finished (ti-ti-1 < 1) or the next attempt starts too soon
New Arrivals
(ti+1-ti < 1)
!

t1

t4

Collision
Eytan Modiano
Slide 15

Retransmission

15

Pure (unslotted) Aloha


Throughput

An attempt is successful if the inter-attempt intervals on both


sides exceed 1 (for unit duration packets)
P(success) = e-g(n) e-g(n) = e-2g(n)
Throughput (success rate) = g(n) e-2g(n)

For max throughput at g(n) = 1/2, Throughput = 1/2e 0.18

Stabilization issues are similar to slotted aloha


Advantages of unslotted aloha are simplicity and possibility
of unequal length packets

16

Random Access: CSMA

CSMA: Carrier Sense Multiple Access

In certain situations nodes can hear each other by listening to


the channel carrier sensing
CSMA: Polite version of Aloha
Nodes listen to the channel before they start transmission
Channel idle Transmit
Channel busy Wait ( join backlog)
When do backlogged nodes transmit?
When channel becomes idle backlogged nodes attempt
transmission with probability qr
Persistent protocol, qr = 1
Non-persistent protocol, qr < 1

17

CSMA

Let = the maximum propagation delay on the channel


CSMA
When a node starts/stops transmitting, it will take this
long for all nodes to detect busy/idle
Let = the maximum propagation delay on the channel

When a node starts/stops transmitting, it will take this long for all nodes to
For
initial understanding, view the system as slotted mini-
detect channel busy/idle
slots of duration equal to the maximum propagation
For
initial understanding, view the system as slotted with "mini-slots" of
delay
duration equal to the maximum propagation delay
Normalize the mini-slot duration =/Dtp and packet
Normalize the mini-slot duration to = /Dtp and packet duration
=1
duration = 1

"> ! <"

<----------- 1 ---------------->
packet

minislots

Actual systems are not slotted, but this hypothetical


Actual
systems
are not slotted,
but this hypothetical
system simplifies
system
simplifies
the analysis
and understanding
of Cthe
SMA

analysis and understanding of CSMA

18

Slotted CSMA
Rules

When a new packet arrives

Backlogged nodes attempt transmission after an idle mini-


slot with probability qr < 1 (non-persistent)

If current mini-slot is idle, start transmitting in the next mini-slot


If current mini-slot is busy, node joins backlog
If a collision occurs, nodes involved in collision become
backlogged

Transmission attempts only follow an idle mini-slot


Each busy-period (success or collision) is followed by an idle slot
before a new transmission can begin

Time can be divided into epochs:

A successful packet followed by and idle mini-slot (duration = +1)


A collision followed by an idle mini-slot (duration = +1)
An idle mini slot (duration = )
19

Slotted CSMA
Analysis

Let the state of the system be the number of backlogged


nodes
Let the state transition times be the end of idle slots

Let T(n) = average amount of time between state transitions when


the system is state n
T(n) = + (1 e-(1-qr)n)
when qr is small (1-qr)n e-qrn T(n) = + (1 e--nqr)

At the beginning of each epoch, each backlogged node


transmits with probability qr
New arrivals during the previous idle slot are also
transmitted
With backlog n, the number of packets that attempt
transmission at the beginning of an epoch is approximately
Poisson with rate
g(n) = + nqr
20

Slotted CSMA
Analysis

The probability of success (per epoch) is


Ps = g(n)e-g(n)

The expected duration of an epoch is approximately


T(n) + (1 e-g(n))

Thus, the success rate per unit time is


g(n)
g(n)e
< departure rate =
+1 eg(n)

21

Maximum
Throughput
Slotted
CSMAfor CSMA

Maximum Throughput

The optimal value of g(n) can again be obtained:

The optimal value of g(n) can again


1 be obtained

!<

g(n) ! 2 "

1+ 2"

<
g(n)

Tradeoff between idle slots and time wasted


1+ 2oncollisions

between
idle
lots and time wasted on collisions
Tradeoff
High throughput
when
isssmall
High throughput when is small
Stability
Stability issues similar to Aloha (less critical)
issues similar to Aloha (less critical)
1-!2!

Departure rate
Arrival rate

Eytan Modiano
Slide 7

!2 !

g(n) = "! + nq
r
22

Unslotted CSMA

Slotted CSMA is not practical


Difficult to maintain synchronization
Mini-slots are useful for understanding but not critical
to the performance of CSMA

Unslotted CSMA will have slightly lower throughput due to


increased probability of collision

Unslotted CSMA has a smaller effective value of than


slotted CSMA
Essentially becomes average instead of maximum
propagation delay
23

Random Access:
SMA/CD
CSMA/CDC
and
Ethernet and
Ethernet
Two way cable
WS

WS

WS

WS

WS

CSMA
with
Detection
capability
CSMA
withCollision
Collision Detection
(CD)(CD)
capability

Nodes
ableto
to d
detect
collisions
Nodes
able
etect
collisions
Upon detection of a collision nodes stop transmission
Upon
dReduce
etection
of a collision nodes stop transmission
the amount of time wasted on collisions

WS

Reduce the amount of time wasted on collisions

Protocol:
Protocol:

All nodes listen to transmissions on the channel


All nodes listen to transmissions on the channel
When a node has a packet to send:

Eytan Modiano
Slide 9

Channel
idle
a Transmit
When a node
has
packet to send:
Channelbidle
Channel
usy Transmit
Wait a random delay (binary exponential
Channel busy wait a random delay (binary exponential back-off)
back-off)

If a tIfransmitting
ode
detects
a collision it
stops
a transmitting n
node
detects
a collision
it stops transmission
Waits a random delay and tries again
transmission

Waits a random delay and tries again

24

CSMA/CD
nd Ecollisions
thernet
Time toadetect
Time to detect collision

WS

WS

delay

A collision can occur while the signal propagates between


the
A collision can occur while the signal propagates between the two nodes
two nodes

= prop

It would take an additional propagation delay for both users to detect the collision
and stop transmitting

It would take an additional propagation delay for both


users
If is tthe
maximum
delayaon
thescable
if a collision occurs, it can
o d
etect tpropagation
he collision
nd
top tthen
ransmitting
take up to 2 seconds for all nodes involved in the collision to detect and stop
transmission

Eytan Modiano
Slide 10

It is the maximum propagation delay on the cable, then if


a collision occurs, it can take up to 2 seconds for all nodes
involved in the collision to detect and stop transmission
25

Approximateamodel
for CSMA/CD
CSMA/CD
nd Ethernet

Approximate model for CSMA/CD


Simplified
approximation
for added
insight
Simplified
approximation
for
added insight

Consider a slotted system with mini-slots of duration 2

Consider a slotted system with mini-slots of duration 2


> 2 <

<----------- 1 ---------------->
packet

Mini-slots

IfIf aanode
starts
transmission
at the beginning
ofbaeginning
mini-slot, byothe
of the mini node
starts
transmission
at the
f a end
mini-
slot either

slot,
bcollision
y the eoccurred
nd of and
the
ini-
lot
either will be uninterrupted
No
them
rest
of sthe
transmission
No
A collision
occurred,
but by the end
of the
mini-slot
would be idle again
collision
occurred
and
the
rest othef tchannel
he transmission
be uninterrupted
Hencewill
a collision at most affects one mini-slot
A collision occurred, but by the end of the mini-slot the
channel would be idle again

Hence a collision at most affects one mini-slot

26

CSMA/CD and Ethernet


Analysis of CSMA/CD

Assume N users and that each attempts transmission


during a free mini-slot with probability p

P includes new arrivals and retransmissions


!N$ i
P[i users attempt] = # & P (1 P) Ni
"i %
P[exactly 1attempt] = P[succes] = NP(1 P) N1

To maximize P[success];
d
[NP(1 P) N1 ] = N(1 P) N1 N(N 1)P(1 P) N2 = 0
dP
Popt =

1
N

Average attempt rate of one per slot


Notice the similarity to slotted Aloha
27

CSMA/CD and Ethernet


Analysis of CSMA/CD

" 1%
P[success] = NP(1 P) N1 = $1 '
# N&
1
Ps = lim N P[success] =
e

N1

Let X be the average number of slots per successful


transmission
P[X = i] = (1 Ps )i1 Ps

E[X] =

1
=e
Ps

Once a mini-slot has been successfully captured,


transmission continues without interruption
New transmission attempts will begin at the next mini-slot
after the end of the current packet transmission

28

CSMA/CD and Ethernet


Analysis of CSMA/CD

Let S be the average amount of time between successful


packet transmissions

S = (e 1)2 + DTp +
Idle/collision
mini-slots

Packet transmission
time

Average time
until start of
next mini-slot

Efficiency = DTp/S = DTp/(DTp+ + 2(e-1))

Let =/DTp Efficiency 1/(1 + 4.4) = < 1/(1 + 4.4)

Compare to CSMA without CD where <

1
1+ 2
29

CSMA/CD and Ethernet


Notes on CSMA/CD

Can be viewed as a reservation system where the mini-slot


are used for making reservations for data slots

In this case, Aloha is used for making reservations during


the mini-slots

Once a user captures a mini-slot it continues to transmit


without interruptions

In practice, of course, there are no mini-slots


Minimal impact on performance but analysis is more
complex
30

CSMA/CD and Ethernet


Examples

Example: Ethernet
Transmission rate = 10 Mbps
Packet length = 1000 bits, DTp = 10-4 sec
Cable distance = 1 mile, = 510-4
= 510-2 and E = 80%

Example: GEO Satellite propagation delay 1/4 second


= 2500, and E 0%

CSMA/CD only suitable for short propagation scenarios

How is Ethernet extended to 100 Mbps?

How is Ethernet extended to 1 Gbps?

31

Migration to switched LANs


Migration to switched LANs
Migration to switched LANs

Migration
t
o
S
witched
L
ANs

Traditional Ethernet

Nodes connected with coax


Traditional
TraditionalEEthernet
thernet

Long runs of wire everywhere

Nodes connected with coax


cLong
onnected
with protocol
coax
Nodes
Traditional
Ethernet
runs
CSMA/CD
of wire everywhere

o f
Nodes
connected
with coax
Long
wire protocol
everywhere
runs
CSMA/CD
Long runs of wire everywhere
Hub
Ethernet

CSMA/CD
protocol
CSMA/CD protocol

Nodes
connected to hub
Hub
Hub
Ethernet
Ethernet

WS

WS

WS

Hub acts as a broadcast repeater

Nodes connected to hub


onnected
to hub
Nodes
HubcHub
Ethernet
Shorted
cable
runs, Useful for 100 Mbps
acts as a broadcast
repeater

CSMA/CD
connected
toprotocol
hub for 100 Mbps
cable runs,
Useful
Hub acts a s a Shorted
bNodes
roadcast
repeater
Hub
actstoasadd/remove
a broadcast repeater

Easy
users

CSMA/CD
protocol
Shorted cable runs,
Useful for 100Mbps
Shorted cable runs, Useful for 100 Mbps

WS

WS
WS
WS
WS

WS
WS

WS
WS

WS
WS

WS
WS
WS

WS
WS

WS

WS

WS
WS

WS
Easy to localize

Easy toadd/remove
users faults
WS

CSMA/CD
protocol
WS

CSMA/CD
protocol
localize
Cheap
cabling (twisted pair, 10baseT)

Easy
to
faults
t o aEasy
to add/remove
users

dd/remove
sers
WS
WS
Easy
Cheap
cabling
(twistedupair,
10baseT)

Easy
to
localize
faults
WS
WS

Easy
localize fEthernet
aults
to Switched
Cheap cabling (twisted pair, 10baseT)
WS
Cheap Ethernet
cabling
Switched

No(twisted
CSMA/CDp air, 10baseT)
WS
WS
WS
Easy to increase data rate (e.g., Gbit Ethernet)

No
CSMA/CD
Switched
Ethernet
Switched
Ethernet
Nodes transmit
when
they
want
Easy
to increase
data rate (e.g.,
Gbit
Ethernet)
WS WS
WS

SMA/CD
No
CSMA/CD
Switch
queues
the packets and transmits to
No C
Nodes
transmit
when
they want
WS
WS
destination
Easy
to increase
rate
(e.g., Gbit to
Ethernet)
WS
Easy to increase
d ata
rthe
ate
(e.g., data
Gand
bit
Ethernet)
Switch queues
packets
transmits
WS
Con

Nodes
transmit
when they
wantof 20-40 ports
WS

Typical switch
capacity
destination
Packet
To
Connect

Nodes
transmit
when
tof
hey
want
WS

Switch
queues
thecan
packets
transmits

Typical
capacity
20-40
ports
switch
Each
node
now and
transmit
at thetofull rate of
Switch
WS Packet
To other Swi

Switch
ueues
tnow
he ptransmit
ackets atand
ransmits
10/100/Gbps

Eachqdestination
node
can
the tfull
rate of t o d estination
Switch
Connect
Switchs
WS
WS
switch
Typical
switch
capacity
of
20-40
ports
10/100/Gbps

Modularity:
Switches
can
be connected to each
Packet

Typical
c
apacity
o
f
2
0-40
p
orts
To other
WS
other
using
high
ports

Each node
can
now
transmit
at the to
full
rate of

Modularity:
Switches
can
berate
connected
each
Switch WS
Switchs

Each other
node
can
now
ransmit at the full rate of 10/100
WS
using
high
ratetports
10/100/Gbps
WS
WS
WS
Gbps Modularity: Switches can be connected to each
other using high rate ports

Modularity: Switches can be connected to each other


WS
Eytan Modiano

Eytan Modiano
Slide 17

using high rate ports

Slide 17

Eytan Modiano

32

Packet Multiple Access Summary

Latency: Ratio of propagation delay to packet transmission time

Low latency protocols

GEO example: Dp = 0.5 sec, packet length = 1000 bits, R = 1 Mbps


Latency = 500 very high
LEO example: Dp = 0.1 sec
Latency = 100 still very high
Over satellite channels data rate must be very low to be in a low
latency environment
CSMA, Polling, Token Rings, etc.
Throughput 1/(1+a), = latency, a = constant

High latency protocols

Aloha is insensitive to latency, but generally low throughput


very little delays
Reservations system can achieve high throughput delays for
making reservations
Protocols can be designed to be a hybrid of Aloha and
reservations Aloha at low roads, reservations at high roads

33

Das könnte Ihnen auch gefallen