Upload
godwin-bradley
View
217
Download
0
Tags:
Embed Size (px)
Citation preview
1
Poisson Random Process
€
Pk = P{k arrivals in (0,t]} =λ t( )
k
k!e−λt
tetPP λ−== ]}(0, in arrivals 0{0
tePtP λ−−=−= 11]}(0, in arrivals some{ 0
2
Mean and Variance Results
You have to memorize these!You should be able to derive any of the above
Exponential: 22 /1 ;/1)( λσλ ==YE
Poisson: tXE λσ == 2)(
Geometric:22 / ;/1)( pqpXE == σ
Binomial: npqnpXE == 2 ;)( σ
3
CMPE 252A: Computer Networks
SET 3:
Medium Access Control Protocols
4
medium access control
logical link control
Medium Access Control Protocols Used to share the use of transmission media that
can be accessed concurrently by multiple users.
PHYSICAL
LINK
NETWORK
TRANSPORT
SESSION
PRESENTATION
APPLICATION
Sharing of link and transportof data over the link
5
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.
6
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 retransmitsevery packet it receives!
7
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
8
ALOHA Protocol An integral part of the ALOHA protocol is
feedback from the receiverFeedback occurs after a packet is sentNo coordination among sources
Packetready?
transmit
yes
wait for a round-trip time
positiveack?yes
no
compute randombackoff integer kno
delay packettransmission
k times
9
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.
10
The ALOHA Channel
What percentage of time is the channel sending correct packets? This gives us the throughput of the protocol.
time
user i
time
user j
time
sum...
NEW
NEW
P
NEW NEW
collision
I B I B I B I B I
NEW
NEW
RET.
RET.
RET.
RET.
τ
11
Throughput of ALOHA Protocol is the arrival rate.For convenience, we normalize the arrival rate as: PG λ=
λ
From the definition of throughput: pGS ×=where p is the probability of a successful packet transmission
Because arrivals are Poisson and all packets have equal length, every packet has the same probability of being successful.
A packet is successful if no packets arrive within P seconds before it starts or while it is being transmitted; accordingly, GP eep 2)2( −− == λ
Therefore,
GGeS 2−= G
S
0.18
0.5
Throughput of ALOHA Protocol
time
node i frame
t0
All packets have the same length
packet overlaps with start of packet from node i
t0 - 1 t0 + 1
packet overlaps with end of packet from node i
interfering frame
interfering frame
Node i’s frame is vulnerable from any arrival in the time interval (t0-1, t0+1]
Throughput of ALOHA Protocol
Highest throughput when we have one packet for each 2-packet time period
time
node i frame
t0
packet overlaps with start of packet from node i
t0 - 1 t0 + 1
packet overlaps with end of packet from node i
interfering frame
interfering frame
Node i’s frame is vulnerable from any arrival in the time interval (t0-1, t0+1]
14
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.
15
Slotted ALOHA Protocol
Packetready?
transmit
yes
wait for a round-trip time
quantized in slots
positiveack?
yes
no
compute randombackoff integer k
no
delay packettransmission
k times
Wait for start of next slot
16
Throughput of Slotted ALOHA
The vulnerability period of a packet is a slot time:
Any arrivals in prior slotcollide with packet i
time
arrivals
i
If T is the duration of a time slot and G is the normalized packet arrival rate, then PT GeSGeS GT === −− for ;λ
We can obtain the same result by computing the likelihood and average length of utilization, idle and busy periods.
17
Slotted ALOHA
...
P τ
collision
time
user i
time
user j
time
sum
time slot
I B I B B I B
NEW
NEW
NEW
NEW
NEW
NEW RET
RET
IMPORTANT:The starting point of a busy period is a “renewal point”! System is busy
18
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.
19
Poisson Random Variable
A sequence of n independent Bernoulli trials;
with X being the number of arrivals in (0, t]
arrivals. 1or 0 having ofy probabilit the tocompared
negligible is in arrival one than more ofy probabilit The
:0 and Make
t
tn
Δ→Δ∞→
By assumption, whether or not an event occurs in a subinterval is independent of the outcomes in other subintervals.We have:
tΔ
…. time
t0
arrival
1 2 3 4 n
1 2 3 k
20
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.
Is N(t) a renewal process?
…. time
0
arrival
1 2 3 4 n
1 2 3 k
21
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.
…. time
0 (1-p)(1-p) (p)
1 2 3
Xn = 3 if we have 2 failures followed by a success!
22
Renewal Theory Example Therefore, each inter-arrival time Xn has the Geometric PMF:
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!⎩⎨⎧ =−
=−
otherwise 0
1,2,... x)1()(
1 ppxP
x
X n
23
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!
24
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!
25
Renewal Theory
Alternating renewal process: System is on and off (that is, or busy and idle).
time
system collision
...
success success
off on off on off on off ...
Y1 X1 Y2 X2 Y3 X3 Y4 ...
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)
26
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 )
€
Throughput is defined as : S =U
I + B=
U
I +(PgBg + PbBb )
timesuccess failure
gB I bB
good busy period
idle period bad busyperiod
27
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.
then of component each of occurrence ofy probabilit
andduration average thedenote and Let
Si
PT ii
BBII
UU
PTPT
PT
BI
US
+=
+=
28
Throughput of Slotted ALOHAIdle, 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
arrivals transmissionsstart
no arrivals
idle periodstarts
29
Idle Period in Slotted ALOHA
TenoP
somePslotoneIPλ−−=−=
==
1 }slot in arrive pkts {1
}slot idle in the arrive pkts {} {
I has one slot:
time
there is a prior busy period
...at least one arrival!
time
I has two slots:
...at least one arrival!no arrivals
)1(
2}slot in pkts some{1}slot in pkts no{
slot} 2ndin pkts some andslot first in pkts no{} {
TT ee
PP
PslotstwoIP
λλ −− −=
=×====
30
Idle Period in Slotted ALOHA
time
I has k slots:
...
no arrivals
1 k-1 k
… some arrivals
2}slot in pkts some{}1slot in pkts no{...1}slot in pkts no{
slot}last in pkts some and slots 1first in pkts no{} {
PkPP
kPslotskIP
×−××=−==
€
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! Therefore:
)1(
1Te
I λ−−=
31
Busy Period in Slotted ALOHA We follow the same approach:
Solve the problem with the Geometric random variable
time
B has k slots:
...
some arrivals
1 k-1 k
… no arrivals
2}slot in pkts no{}1slot in pkts some{...1}slot in pkts some{
slot}last in pkts no and slots 1first in pkts some{} {
PkPP
kPslotskBP
×−××=−==
€
P{B = k slots} = 1− e−λT( )
k−1(e−λT )
TT
ee
B λλ == −
1
prior slot consideredin idle period
32
Utilization Period Here we have to make use of conditional probability! A busy period has good and bad time slots
(transmission periods).
collision
time
sum
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 thatrandom variable as follows….
33
Utilization Period
T
T
S
e
Te
TsomeP
ToneP
TsomeP
TsomeandToneP
TsomeTPP
λ
λλ−
−
−==
=
=
1} in arrivals {} in arrival {
} in arrivals {} in arrivals in arrival {
} in arrivals | in arrival one{
The probability that a given slot within a busy period is successful is:
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.
TT
TT
S e
T
e
TeePBU λλ
λλ λλ
−−
−
−=⎟⎟
⎠
⎞⎜⎜⎝
⎛
−=×=
11
We can use the Binomial random variable to proof the above!
34
Throughput of Slotted ALOHA We now just substitute B,I, and U in S:
10-3
10-2
10-1
100
101
102
103
104
105
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1Analytical Results
Offered Load: G
S (Throughput)
Pure CSMA
Slotted CSMA
Pure Aloha
Slotted Aloha
T
TT
TTe
ee
e
T
BI
US λ
λλ
λ λλ −
−
− =+
−
⎟⎠
⎞⎜⎝
⎛−
=+
=
11
11
Maximum throughput is twice that of ALOHA.This occurs when G = 1
TGwith
GeS G
λ== −
35
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.
36
Average Delay in ALOHA
Direct method: The average number of transmissions needed for a packet to be received correctly is GeSG 2/ =
Therefore, the number of retransmissions is 11/ 2 −=− GeSG
Assumptions:
A satellite channel with propagation delay NxP, where P is the packet length and NxP >> PA retransmission is sent after an average backoff time of BxP seconds.
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:
))(1( 2 PBPNPePNPD G ×+×+−+×+=
37
Average Delay in ALOHAIndirect 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 END
BACKOFF
PNP , ×+SP
PBPNP
,1
×+×+− SP
PBPNP
,1
×+×+− SP
PNP , ×+SP
From the diagram. we obtain a number of simultaneous equations that we solve to obtain delay from START to END.
38
Average Delay in ALOHAFrom the diagram we have:
))(1()( RPBPNPPPNPPD SS +×+×+−+×+=
))(1()( RPBPNPPPNPPR SS +×+×+−+×+=Solving these two equations:
)()1(
PBPNPP
PPNPR
S
S ×+×+−
+×+=
))(1( 1 PBPNPPPNPD S ×+×+−+×+= −
Substituting GS eP 2−= we obtain the same result expected from the
Geometric r.v.
The same method can be applied on the other MAC protocols!
39
Average Delay of ALOHA The delay increases exponentially with heavy load,
which is not acceptable for real-time applications.
40
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.
41
CSMA ProtocolAssume non-persistent carrier sensing.Requires a maximum propagation delay much smaller than packet lengths!
transmit
no
wait for a round-trip time
positiveack?yes
compute randombackoff integer kno
delay packettransmission
k times
Packetready
ChannelBusy?
yes
42
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 communicationNo base station or transponderExplicit feedback to sender!
43
CSMA Protocol
The big difference compared to ALOHA is that busy periods are bounded!
time
user i
time
user j
time
sum...
I B I B I B I
RET.
RET.
RET
RET
NEW
NEW
P
NEWNEW
collision
τ2+≤ PB
τ
44
CSMA ThroughputP
timeRET.RET.NEWNEW
collisionτ
I B I B I B I
τ2+≤ Pfailed period
τ+Psuccessful period
Length of average idle period (exponential interarrivals)? λ/1=IThe probability that a packet is successful is?
λτ−=ePS
The average length of a utilization period is?
(no packets can arrive within tau sec. after the start of the packet!)λτ−×= ePU
We can approximate: τ2+= PB
45
CSMA Throughput
Substituting we have:
λτ
λτ
12 ++
≈−
P
PeS Pretty accurate for << P
More accurate estimation of S requires finding the average length of B.
timeFIRST
LAST
P
START END
Y
Y Y is a random variable!τ++= YPB
€
τ
€
τ
€
τ
46
CSMA Throughput
)()sec in arrivals 0()()( yY eyPyFyYP −−=−==≤ τλτ
timeFIRST
LAST
START
Y =y
no arrivals, no more arrivals occur after LASTy−τ
)1(1
0)1())(1()(0
)(
0
λττ
τλ
λτ −−−
∞
−−=+−=−= ∫∫ edyedyyFYE yY
)1(1
2 λτ
λτ −−−+= ePB
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.
τ
47
CSMA ThroughputSubstituting we get:
10-3
10-2
10-1
100
101
102
103
104
105
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1Analytical Results
Offered Load: G
S (Throughput)
Pure CSMA
Slotted CSMA
Pure Aloha
Slotted Aloha
aG
aG
eGa
GeS −
−
++=
)21(
Pa
PG
/
,with
τλ
==
€
S =Ge−aG
(1+ 2a)G +1
Approximate:
48
Slotted CSMA Non-persistent strategy. A slot lasts one maximum propagation delay.
no
wait for a round-trip timequantized in slots
positiveack?yes
compute randombackoff integer k
no
delay packettransmission
k times
Packetready
ChannelBusy?
yes
transmit
wait for start of next slot
49
Computing the Throughput of Slotted CSMA
NEW
P
time
collision
τI B I B I
success
RET.
time
I has k slots:
...
no arrivals
1 k-1 k
… some arrivals
Just as in slotted ALOHA, with slot duration equal to τ
τ
sec )1(
; slots )1(
1λτλτ
τ−− −
=−
=e
Ie
I
50
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{B = k trans. periods} = P{B = k(P + τ ) sec} = 1− e−λ τ( )
k−1(e−λ τ )
time...
some arrivals in last slot of each transmission period
1k-1
k… no arrivals in last slot of last transmission period
τ+PSlotted CSMA:
51
Throughput of Slotted CSMA
sec )( λτλτ ττ
ePeP
B +=+
= −
so ,1
}in arrivals {
}in arrival { λτ
λτλττ
τ−
−
−==
ee
somePoneP
PS sec SPP
BPU ×
+×=
τ
A transmission period is successful with probabilityand the period has useful data for P seconds
SP
sec 1
λτ
λτ−−
=eP
U
periodsion transmiss1λτ−=
eB
We use the Geometric r.v. to obtain the average number of transmission periods in B :
52
Throughput of Slotted CSMA We now substitute U, B and I in S:
PaPGea
aGeS
aG
aG
/ , with ;)1(
τλ ==−+
= −
−
53
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.
10-3
10-2
10-1
100
101
102
103
104
105
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1Analytical Results
Offered Load: G
S (Throughput)
Pure CSMA
Slotted CSMA
Pure Aloha
Slotted Aloha
Reminder: These results are only an upper bound on performance, because we did not take into account the effect of ACKs sent from receivers!
54
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).
55
CSMA/CD ProtocolNon-persistent transmission strategyCollision detection serves as a NACK!
transmit
no
abort transmission
Collision detected?
no compute randombackoff integer k
yes
delay packettransmission
k times
Packetready
Channelbusy?
yes
send jammingsignal
Assumption are:• All stations hear one another • Propagation delay is much smaller than packets
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.
56
Throughput of CSMA/CD
time
JJZC +≤++= ττ 32collision interval: successful packet:
τ+P
first packet starts (A)
τ ττ≤Z
J
first interfering packet starts (B)
A starts hearing B and jams
B starts hearing A and jams
idleperiod
τP
NEWAB
ττ ++ J
average idle period:
λ/1=I
)(e2
e ; with )(]2)[1( -
-
ττ
τττλτ
λτ
−−+++=
=≤+++++−=
JPJZB
PZPZPJZPB SSS
57
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)
For
However, we can derive an exact value of the average value of Y.
P<<τ we can approximate: )(3 ττ λτ −−++≈ − JPeJB
The utilization period is only that portion of a packet transmission that has no overhead, that is:λτ−=PeU
58
Throughput of CSMA/CD
Substituting we get:)(3
1 ττλ
λτ
λτ
−−+++≈
−
−
JPeJ
PeS
59
Throughput of CSMA/CD
λτ
τλλ
λτ
τλλ
ττ
ττ
ττ
−
−−
−
−−−
−−
=−−
=
=
=>
=>≤≤>−=≤=
e
ee
e
ee
P
zPzP
P
zPzZP
zPzZP
zzZPzZPzF
zzz
Z
11
)1(
)},0(in arrivals some{
)},(in arrivals some {)},0(in arrivals no{
)},0(in arrivals some{
)},0(in arrivals some and ),0(in arrivals no{}{
)},0(in arrivals some|),0(in arrivals no{}{
0for };{1}{)(
)()(
Therefore:
λτ
λ
λτ
λτλ
−
−
−
−−
−−
=−−
−=>−=e
e
e
eezZPzF
zz
Z 1
1
11 }{1)(
⎥⎦
⎤⎢⎣
⎡
−−+=−= −
−
∫ λτ
λττ
λττ
e
edttFZE Z 1
12))(1()(
0