Set 3 in ppt

advertisement
Poisson Random Process
t 

(0,
t]} 
k
Pk  P{k arrivals in
P0  P{0 arrivalsin (0,t ]}  e
k!
e
 t
t
P{some arrivalsin (0,t ]}  1  P0  1  e
t
1
Mean and Variance Results
Exponential:
E(Y )  1/ ;  2  1/ 2
Poisson:
E( X )   2  t
Geometric:
E( X )  1/ p;  2  q / p 2
Binomial:
E( X )  np;  2  npq
You have to memorize these!
You should be able to derive any of the above
2
CMPE 252A:
Computer Networks
SET 3:
Medium Access Control
Protocols
3
Medium Access Control
Protocols

Used to share the use of transmission media that can be
accessed concurrently by multiple users.
APPLICATION
PRESENTATION
SESSION
TRANSPORT
NETWORK
logical link control
Sharing of link and transport
of data over the link
medium access
control
LINK
PHYSICAL
4
Contention-Based MAC
Protocols

No coordination: Stations transmit at will when they have data to
send (e.g., ALOHA)




Carrier sensing (listen before transmit): Stations sense the
channel before transmitting a data packet (e.g., CSMA).
Listen before and during transmission: Stations listen before
transmitting and stop if noise is heard while transmitting (CSMA/CD).
Collision avoidance (floor acquisition): Stations carry out a
handshake to determine which one can send a data packet (e.g.,
MACA, FAMA, IEEE802.11, RIMA).
Collision resolution: Stations determine which one should try again
after a collision.
5
ALOHA Protocol


The first protocol for multiple access channels;
the first analysis of such protocols (Norm
Abramson, Univ. of Hawaii, 1970).
Originally planned for systems with a central base
station or a satellite transponder.
Two frequency bands;
Up link and down link
(413MHz, 407MH at 9600bps)
Central node retransmits
every packet it receives!
6
ALOHA Protocol




Population is a large number of bursty
stations.
Each station transmits a packet whenever it
receives it from its user; no coordination
with other stations!
Central node retransmits all packets (good
or bad) on down link.
Stations decide to retransmit based on the
information they hear from central node
7
ALOHA Protocol
Packet
ready?
An integral part of the ALOHA
protocol is feedback from the
receiver
Feedback occurs after a
packet is sent
No coordination among
sources
no
yes
transmit
delay packet
transmission
k times
wait for a
round-trip time
yes
positive
ack?
no
compute random
backoff integer k
8
The ALOHA Channel

We assume:








An (essentially) infinite population of stations.
An ideal perfect down link for the transmission of
feedback to senders.
Stations are half duplex; have zero processing delays.
Retransmissions are scheduled such that all packets are
statistically independent.
Each packet has the same duration P.
Stations have the same round-trip delay from one
other; this time can be much longer than P (irrelevant).
Packet arrivals are Poisson with rate lambda.
Collisions are the only sources of errors.
9
The ALOHA Channel
user i
τ
P
NEW
NEW
RET.
time
user j
NEW
sum
...
time
collision
NEW
I

RET.
B
NEW
NEW
I
B
RET.
RET.
I
B
I
B
time
I
What percentage of time is the channel sending correct packets?
This gives us the throughput of the protocol.
10
Throughput of ALOHA Protocol
 is the arrival rate.
For convenience, we normalize the arrival rate as:
G  P
Because arrivals are Poisson and all packets have equal length,
every packet has the same probability of being successful.
S  G p
From the definition of throughput:
where p is the probability of a successful packet transmission
A packet is successful if no packets arrive within P seconds before
it starts or while it is being transmitted; accordingly,
p  e( 2 P)  e2G
Therefore,
S
0.18
2G
S  Ge
G
0.5
11
Throughput of ALOHA Protocol
packet overlaps
with start of packet
from node i
packet overlaps
with end of packet
from node i
interfering frame
node i frame
time
interfering frame
t0 - 1
t0
Node i’s frame is vulnerable from
any arrival in the time interval
(t0-1, t0+1]
All packets have the same length
t0 + 1
Throughput of ALOHA Protocol
packet overlaps
with start of packet
from node i
packet overlaps
with end of packet
from node i
interfering frame
node i frame
time
interfering frame
t0 - 1
t0
t0 + 1
Node i’s frame is vulnerable from
any arrival in the time interval
(t0-1, t0+1]
Highest throughput when we have one packet for each 2-packet time
period
Slotted ALOHA




The throughput of ALOHA can be improved by reducing
the time a packet is vulnerable to interference from other
packets.
Slotted ALOHA works in a “slotted channel” providing
discrete time slots.
Stations can start transmitting only at the beginning of
time slots.
The time synchronization needed for slotting is
accomplished at the physical layer, and some
synchronization is required in many cases anyway.
14
Slotted ALOHA Protocol
Packet
ready?
no
yes
Wait for start of next slot
transmit
delay packet
transmission
k times
wait for a
round-trip time
quantized in slots
yes
positive
ack?
no
compute random
backoff integer k
15
Throughput of Slotted ALOHA
The vulnerability period of a packet is a slot time:
i
time
Any arrivals in prior slot
collide with packet i
arrivals
If T is the duration of a time slot and G is the normalized
T
G
packet arrival rate, then S  Ge ; S  Ge forT  P
We can obtain the same result by computing the likelihood
and average length of utilization, idle and busy periods.
16
Slotted ALOHA
user i
τ
P
NEW
user j
RET
NEW
time slot
NEW
sum
RET
time
...
collision
NEW
NEW
I
time
B
time
I
B
B
I
B
IMPORTANT:
The starting point of a busy period is a “renewal point”!
System is busy
17
Renewal Theory


Recall the Poisson random process:
 N(t) = number of arrivals in (0, t]
 Inter-arrival times are exponentially distributed
 N(t) is a counting process with exponential
inter-arrival times.
Definition of Renewal Process:
A counting process N(t) for which inter-arrival
times X1, X2, …, Xn are an independent
identically distributed (iid) random sequence.
18
Poisson Random Variable
Make n   and t  0 :
T heprobability of more thanone arrivalin t is negligible
comparedto theprobability of having0 or 1 arrivals.
By assumption, whether or not an event occurs in a subinterval is
independent of the outcomes in other subintervals.
We have:
t
arrival
time
….
0
1
2
3
1 2 3 4
A sequence of n independent Bernoulli trials;
with X being the number of arrivals in (0, t]
k
t
n
19
Renewal Theory Example

At each time t = 1, 2, …, a Bernoulli process
N(t) has an arrival with probability p, and this is
independent of the occurrence of arrivals at any
other times.
arrival
1
0
1

….
2
2
3
3
4
time
k
n
Is N(t) a renewal process?
20
Renewal Theory Example

Answer:
 For any inter-arrival period n, the inter-arrival time
Xn equals x if there were x-1 Bernoulli failures
followed by a success.
Xn = 3 if we have 2 failures followed by a success!
1
2
3
….
0
time
(1-p) (1-p) (p)
21
Renewal Theory Example

Therefore, each inter-arrival time Xn has the Geometric
PMF:
 (1  p) x 1 p
PX n ( x)  
0


x  1,2,...
otherwise
Because each Bernoulli trial is independent, Xn is
independent of the previous inter-arrival times
X1, X2 ,…Xn-1.
This implies that a Bernoulli arrival process is a
renewal process!
22
Renewal Theory

After an arrival (in a renewal process), the
subsequent inter-arrival times are distributed
identically to the original inter-arrival times.

Effectively, the process restarts, or has a
renewal, whenever an arrival occurs!
23
Renewal Theory



Suppose that N(t) has n arrivals by time t1, the
additional time until the next arrival is denoted by
Sn+1 - t1, and the subsequent inter-arrival times are
Xn+2 , Xn+3 ,… and so on.
Renewal Point: For a renewal process N(t), time t1
with N(t1) = n is a renewal point if Sn+1 - t1, Xn+2,
Xn+3,… is an iid random sequence statistically identical
to X1, X2, X3,…
Every instant of time is a renewal point for a Poisson
process!
24
Renewal Theory
Alternating renewal process: System is on and off
(that is, or busy and idle).
system
collision
success
success
...
off
on
off
on
off
on
off ...
Y1
X1
Y2
X2
Y3
X3
Y4 ...
time
X1, X2, X3,…. are i.i.d. with mean E(X)
Y1, Y2, Yx,…, are i.i.d. with mean E(Y)
P(t) = P{system is ON at time t in steady state} = E(x)/{E(x)+E(Y)}
Average cycle length = E(X) + E(Y)
25
Evaluating Throughput

We assume that the system is “stationary,” i.e., system behaves in cycles that are
statistically equivalent
Average cycle consists of an idle period (I ) and a busy period (B ).
The busy portion of a cycle has good and part parts.

The portion of time used to send user data is called the utilization period (U )


good busy
period
idle period
success
Bg
bad busy
period
failure
I
Bb
time
U
U
T hroughput is defined as
: S

I  B I  (Pg Bg  Pb Bb )
26
Evaluating Throughput



The expression for S amounts to simply taking averages.
What we need to do now is compute the probability that
I, B (good a bad parts), and U happen in an average cycle,
and their average duration.
Ideally, these probabilities are based on independent
events, and we can express S based on knowledge of the
present state of the system.
Let Ti and Pi denotetheaveragedurationand
probability of occurrenceof each componenti of S then
TU PU
U
S

I  B TI PI  TB PB
27
Throughput of Slotted ALOHA
Idle, busy and utilization periods are multiples of
time slots.
We need to count the time slots in each average
period and we are done.
Average length of idle period:
I = number of slots in idle period
time
no
arrivals
arrivals
transmissions
start
idle period
starts
28
Idle Period in Slotted ALOHA
I has one slot:
there is a prior busy period
time
... at least one arrival!
P{I  one slot}  P{somepkts arrive in theidle slot}
 1  P{no pktsarrivein slot} 1  eT
I has two slots:
time
no arrivals
... at least one arrival!
P{I  two slots}  P{no pktsin first slot and some pktsin 2nd slot}
 P{no pktsin slot 1} P{some pktsin slot 2} 
 e T (1  e T )
29
Idle Period in Slotted ALOHA
I has k slots:
1
k-1
...
k
…
no arrivals
time
some arrivals
P{I  k slots}  P{no pktsin first k  1 slotsand some pkts in last slot}
 P{no pktsin slot 1} ... P{no pktsin slot k  1} P{some pktsin slot 2}
P{I  k slots}  e

 T k1
(1 e T )
This corresponds to the Geometric r.v., and we know its average value
to be 1/p, with p being the probability of success.
Success now consists of ending the idle period!
I
Therefore:
1
(1  e T )
30
Busy Period in Slotted ALOHA

We follow the same approach:

Solve the problem with the Geometric random variable
B has k slots:
prior slot considered
in idle period
1
...
k-1
…
some arrivals
k
time
no arrivals
P{B  k slots}  P{some pktsin first k  1 slotsand no pkts in last slot}
 P{some pktsin slot 1} ... P{some pktsin slot k  1} P{no pktsin slot 2}
P{B  k slots}  1 e
B
1
e T

 T k1
(e T )
 e T
31
Utilization Period


Here we have to make use of conditional probability!
A busy period has good and bad time slots (transmission
periods).
sum
collision
time
The probability that a slot (transmission period) in the
current busy period is successful is the probability that only
one packet arrives in the prior slot, given that there is a
busy period
Arrivals are Poisson, so we make use of the definition of that
random variable as follows….
32
Utilization Period
The probability that a given slot within a busy period is successful is:
PS  P{one arrivalin T | som earrivalsin T }
P{one arrivalin T and som earrivalsin T }

P{som earrivalsin T }
P{one arrivalin T }
Te T


P{som earrivalsin T } 1  e T
The portion of an average busy period used to send useful data
equals the length of the average busy period in slots, times the
probability that any given slot is successful.
 T


Te
U  B  PS  eT 
T
1

e


T
 
T
1

e

We can use the Binomial random variable to proof the above!
33
Throughput of Slotted ALOHA
We now just substitute B,I, and U in S:
U
 T 
S

 T 
I  B 1 e 
1
1
T

e
1  e T
 Te T
Analyti cal Results
S  GeG
with G  T
1
Slotted CSMA
0.9
Pur e CSMA
0.8
0.7
0.6
S ( Thr oughput)

0.5
Maximum throughput is
twice that of ALOHA.
This occurs when G = 1
0.4
Slotted Aloha
0.3
0.2
Pur e Aloha
0.1
0
-3
10
10
-2
10
-1
10
0
1
10
Offer ed Load: G
10
2
10
3
10
4
10
5
34
Average Delay of MAC
Protocols



We want to measure or compute the average time
from the instant the first bit of a packet is first
transmitted to the moment the last bit is received
correctly at the destination.
Assume that arrivals (of new and retransmitted
data or control packets) to the channel are
Poisson.
Assume fully-connected networks.
35
Average Delay in ALOHA
Assumptions:
A satellite channel with propagation delay NxP, where P is the packet
length and NxP >> P
A retransmission is sent after an average backoff time of BxP seconds.
Direct method:
The average number of transmissions needed for a packet to be
received correctly is G / S  e 2G
2G
Therefore, the number of retransmissions is G / S  1  e  1
A packet is transmitted (G/S-1) times in error (due to collisions) and each
such transmission wastes P+NxP +BxP seconds.
The last transmission is successful and must take P+NxP seconds.
Therefore, the average delay incurred is:
D  P  N  P  (e2G 1)(P  N  P  B  P)
36
Average Delay in ALOHA
Indirect Method:
Based on the fact that the success of a transmission is independent of
others, and knowing how many times we have retransmitted does not
change the likelihood of success in the next transmission!
We use a diagram showing possible states, probabilities of transition,
and delay incurred in that transition.
START
PS , P  N  P
END
1  PS ,
P  N  P  B P
1  PS ,
BACK
OFF
PS , P  N  P
From the diagram.
we obtain a
number of
simultaneous
equations that we
solve to obtain
delay from START
to END.
P  N  P  B P
37
Average Delay in ALOHA
From the diagram we have:
D  PS (P  N  P)  (1 PS )(P  N  P  B  P  R)
R  PS (P  N  P)  (1 PS )(P  N  P  B  P  R)
Solving these two equations:
(1  PS )
R  P NP
( P  N  P  B  P)
PS
D  P  N  P  (PS1 1)(P  N  P  B  P)
Substituting
PS  e2G
we obtain the same result expected from the
Geometric r.v.
The same method can be applied on the other MAC protocols!
38
Average Delay of ALOHA

The delay increases exponentially with heavy load, which
is not acceptable for real-time applications.
39
CSMA:
Carrier Sense Multiple Access




The capacity of ALOHA or slotted ALOHA is limited
by the large vulnerability period of a packet.
By listening before transmitting, stations try to
reduce the vulnerability period to one propagation
delay.
This is the basis of CSMA (Kleinrock and Tobagi,
UCLA, 1975)
Many of the assumptions made for ALOHA are
made now for CSMA.
40
CSMA Protocol
Packet
ready
Channel
Busy?
yes
no
Assume non-persistent
carrier sensing.
Requires a maximum
propagation delay much
smaller than packet
lengths!
transmit
delay packet
transmission
k times
wait for a
round-trip time
yes
positive
ack?
no
compute random
backoff integer k
41
CSMA Throughput
A virtual secondary channel used to send ACKs reliable
and in 0 time!
Same assumptions made for pure ALOHA analysis.
All stations are at one propagation delay from each other
and that equals:

Arrivals are Poisson with average rate

Peer-to-peer communication
No base station or transponder
Explicit feedback to sender!
42
CSMA Protocol
user i
P
τ
RET
NEW
time
user j
NEW
sum
RET.
...
time
collision
RET
NEW
NEW
I
B
B  P  2
I
B
RET.
I
B
time
I
The big difference compared to ALOHA is
that busy periods are bounded!
43
CSMA Throughput
P

collision
RET.
NEW
NEW
I
B
I
B
RET.
I
 P  2
P 
failed period
successful period
B
I
We can approximate:
Length of average idle period (exponential interarrivals)?
The probability that a packet is successful is?
time
PS  e
B  P  2
I  1/ 
(no packets can arrive within tau sec. after the start of the packet!)
The average length of a utilization period is?
U  P  e  
44
CSMA Throughput
Substituting we have:
S
Pe 
P  2 
1
Pretty accurate for  << P


More accurate estimation of S requires finding the average length of B.
START
END
P

Y


LAST
FIRST
B  P  Y 

Y
time
Y is a random variable!
45
CSMA Throughput
START

Y =y
LAST
FIRST
y
time
no arrivals, no more arrivals occur after LAST
P(Y  y)  FY ( y)  P(0 arrivalsin   y sec)  e (  y )


1
E (Y )   (1  FY ( y))dy   (1  e  (  y ) )dy  0    (1  e  )
0
B  P  2 
0
1

(1  e
 
)

Note that the average length of B is determined
by the time between the start of the first and
the last packet in the busy period.
46
CSMA Throughput
Substituting we get:
 aG
Ge
S
(1  2a)G  e aG
Analyti cal Results
1
Slotted CSMA
0.9
Pur e CSMA
0.8
a  / P
0.7
0.6
S ( Throughput)
with G  P,
0.5
Approximate:
aG
Ge
S
(1 2a)G 1
0.4
Slotted Aloha
0.3
0.2
Pur e Aloha
0.1
0
-3
10
10
-2
10
-1
10
0
1
10
Offer ed Load: G
10
2
10
3
10
4
10
5
47
Slotted CSMA
Packet
ready


Non-persistent strategy.
A slot lasts one maximum
propagation delay.
Channel
Busy?
yes
no
wait for start of next slot
transmit
wait for a round-trip time
quantized in slots
yes
positive
ack?
no
delay packet
transmission
k times
compute random
backoff integer k
48
Computing the Throughput of
Slotted CSMA
collision
success
RET.
NEW
P
time

I
B
I
B
I has k slots:

1
...
no arrivals
Just as in slotted ALOHA,
with slot duration equal to 
I
k-1
k
…
time
some arrivals
1

I
slots; I 
sec
 

(1  e )
(1  e )
49
Throughput of Slotted CSMA



We follow the same approach as in slotted ALOHA
B has k transmission periods, each of P + τ sec
What happens in a transmission period depends only on the
last time slot of the prior transmission period!
P 
Slotted CSMA:
...
1
k-1
time
k
… no arrivals in last slot of
some arrivals in
last transmission period
last slot of each
transmission period
P{B  k trans. periods }  P{B  k(P   ) sec}  1 e

  k1
(e  )
50
Throughput of Slotted CSMA
We use the Geometric r.v. to
obtain the average number of
transmission periods in B :
B
1
e
 
transmiss ion periods
P 
B    ( P   )e  sec
e
A transmission period is successful with probability
and the period has useful data for P seconds
P{one arrivalin  }
 e 
PS 

, so

P{som earrivalsin  } 1  e
PS
B
U  P
 PS sec
P 
 P
U
sec
 
1 e
51
Throughput of Slotted CSMA

We now substitute U, B and I in S:
aGe aG
S
;
 aG
(1  a)  e
with G  P, a   / P
52
CSMA Throughput

Because prop. delay is much smaller than pkt length, slotted
and pure CSMA have very similar performance.
When MAC protocol requires small prop delays, we
can use slotted version to predict performance of
unslotted version.
Analyti cal Results
1
Reminder: These results are
only an upper bound on
performance, because we did
not take into account the
effect of ACKs sent from
receivers!
Slotted CSMA
0.9
Pur e CSMA
0.8
0.7
0.6
S ( Thr oughput)

0.5
0.4
Slotted Aloha
0.3
0.2
Pur e Aloha
0.1
0
-3
10
10
-2
10
-1
10
0
1
10
Offer ed Load: G
10
2
10
3
10
4
10
5
53
CSMA/CD:
CSMA with Collision Detection





CSMA improves on the performance of ALOHA
tremendously.
The remaining limitation is that, once a packet is sent,
feedback occurs a roundtrip time after the entire packet is
transmitted.
The solution to improve on the performance of CSMA is to
listen to the channel while a packet is being sent.
This is called collision detection.
R.M Metcalfe and D.R. Boggs, “Ethernet: Distributed Packet Switching
for Local Computer Networks,” Comm. ACM, Vol. 19, 1976
(Xerox PARC).
54
CSMA/CD Protocol
Non-persistent transmission strategy
Collision detection serves as a NACK!
Packet
ready
Channel
busy?
no
Assumption are:
• All stations hear one
yes
delay packet
transmission
k times
another
• Propagation delay is much
smaller than packets
transmit
no
Collision
detected?
compute random
backoff integer k
yes
abort
transmission
send jamming
signal
Station listens to channel
while transmitting;
Collision is detected when
signals sent and heard
differ.
Jamming signal sent to
ensure all stations know of
the collision.
55
Throughput of CSMA/CD
first packet starts (A)
first interfering packet starts (B)
B starts hearing A and jams
  J 
A starts hearing B and jams
A
B

NEW
time
J

Z 
collision interval:
C  Z  2  J  3  J
idle
period

P
average idle period:
I  1/ 
successful packet:
P 
B  (1  PS )[Z  2  J ]  PS ( Z  P   ) with Z   ; PS  e-
B  Z  2  J  e- ( P  J   )
56
Throughput of CSMA/CD

Notes:


The average length of a bad busy period is much smaller than in
CSMA because J<<P.
This length is determined by the time between the first packet in
the busy period and the first packet that interferes (in contrast, in
CSMA, it is the last interfering packet that counts)
The utilization period is only that portion of a packet transmission that
has no overhead, that is:
U  Pe
For   P we can approximate:
B  J  3  e ( P  J   )
However, we can derive an exact value of the average value of Y.
57
Throughput of CSMA/CD
Substituting we get:
S
Pe 
1

 J  3  e  ( P  J   )
58
Throughput of CSMA/CD
FZ ( z )  P{Z  z}  1  P{Z  z}; for 0  z  
P{Z  z}  P{no arrivalsin (0, z ) | some arrivalsin (0, )}
P{no arrivalsin (0, z ) and some arrivalsin (0,  )}
P{Z  z} 
P{some arrivalsin (0, )}
P{no arrivalsin (0, z )}P{ some arrivalsin ( z,  )}

P{some arrivalsin (0, )}
e z (1  e  (  z ) ) e z  e  ( )


 
1 e
1  e 
Therefore:
e z  e   1  e z
FZ ( z )  1  P{Z  z}  1 


1 e
1  e 


1
e  
E ( Z )   (1 FZ (t ))dt   2 

 

1

e


0
59
Download