Chapter 4
Multiple users access the same communication channel
Multi-access Communication
Multiple users access the same communication channel
Multiple access protocols can be classified according to the amount of coordination between users.
Multi-access Communication
ALOHAS-ALOHA…CSMACSMA/CD(Ethernet)Reservation-basedprotocols
Most coordination
Overhead
Least coordination
Section 4.2
Slotted ALOHA
4.2 Slotted ALOHA1. Slotted System : fixed length packets
packet transmission time = 1 slot, all transmit are synchronized.
2. Poisson arrivals : arrival to each of the m stations is an independent Poisson process with rate /m.(because close to real world situation, and easy to analysis)infinite # users, each user generates a small fraction of total traffic, the aggregate traffic → Poisson
In fact,Slot time較 transmittime 大
4.2 Slotted ALOHA
3. Collision or perfect reception : If 2 or more nodes send a packets in a slot, then collision. If exacting one node transmits, then it is received correctly.
4. 0, 1, e: immediate feedbackmore than one
5. Retransmissions : Collided packets will be retransmitted.
4.2.2 Slotted ALOHA Simple throughput analysis
Let G = expected # of transmit in a slot = + rate of retransmitsAssume(incorrect) : the # of transmit in
a slot, K, is Poisson.
...2,1,0,
!)(
kk
eGkKP
Gk PoissonRate of re-txSo never Poisson for G
4.2.2 Slotted ALOHA
)(
)1(
successPGe
kPThroughputSe
# of successPer second
G : attempt rate : # transmit/slotS : # success transmit/slot
0.368 1/e
S
G
4.2.2 Slotted ALOHA Delay Analysis : Markov model(6a:assume no-bu
ffering p.276) Backlogged node is node with packet to be retransmi
tted. Unbacklogged node is node that may generate new tr
affic. After a collision, a backlogged node waits L slots befo
re re-transmit, where P(L=i)=(1-qr)i-1qr, i=1,2,… An unbacklogged node, will transmit a new packet wi
th probability qa=P(at least one new packet in a slot)
me
1
is total arrived rate# users=m
4.2.2 Slotted ALOHA
State of Markov process is the # of backlogged nodes.
Let Nt=# of backlogged nodes at the beginning of slot t.
0 1 2 n m不可能 …… ……
4.2.2 Slotted ALOHALet Qa(i, n)=probably of i unbacklogged nodes transmit i
n a given slot, given N=n
nmigqi
nm inma
ia
,...,1,0,1
Let Qr(i, n)=probably of i backlogged nodes transmit in a given slot, given N=
n nigq
i
n inr
ir ,...,1,0,1
4.2.2 Slotted ALOHA
1),,1(),0(
0,),1(1),0(),0(),1(
1,),0(1),1(
2),,(
|
,
1,
inQnQ
inQnQnQnQ
inQnQ
nminiQ
P
nNinNPPLet
ra
rara
ra
a
inn
ttinn
4.2.2 Slotted ALOHA {Nt, t=0,1,2,…} is an irreducible a perio
dic Markov Chain. Thus, limit probability {n, n=0,1,…,m} exist
m
ii
iijij P
0
1
Can find delay?(using Little’s theorem)N=T
直覺上, leave qr 大 ? But for large m? heavy backlog very long
4.2.2 Slotted ALOHA Let Dn = drift
= expected change in backlog over one slot time give
n state n. = (m-n)qa-[Qa(1,n)Qr(0,n)
+Qa(0,n)Qr(1,n)] increase in backlog
decrease in backlog
=Psucc. (4.5)
4.2.2 Slotted ALOHA Let G(n)=expected # of attempted tx
(new+backlogged) in a slot, given state n = (m-n)qa+nqr
Let A(n)=expected # of new tx in a slot, given state n = (m-n)qa
Homework #2 Due 11/15 3.9, 3.16, 3.37, 4.3 , 4.5 共 5 題
4.2.2 Slotted ALOHA When qa and qr are small, PsuccG(n)e-G(n)
)6.4()5.4()1(
...)!2
1()(2
Fromx
xxee
y
yyxxy
4.2.2 Slotted ALOHA
4.2.2 Slotted ALOHA
0 mn
mqa
mqr
G(n)
(qr>qa)
4.2.2 Slotted ALOHA
Adjust qr such that attempt rate G=1
n
mqa
mqr
G(n)
adjustqr=>
4.2.2 Slotted ALOHA
1. Psucc : at most e-1 for large m.2. qr ↑ , delay in re-tx ↓, but G(n)↑with n
同樣的 n , qr ↑ 相對 G(n) 較大 Psucc 圖形會被壓縮。上圖 U 點向左移較少 n 即到達 U
3. 反之 qr↓, retx delay↑, but only one state point.
4.2.3 Stabilized Slotted Aloha
Change qr dynamically to maintain G(n)=1, n = estimate n.
[Pseudo-Bayesian Algorithm] (Rivest) Assumptions:
Slotted, Poisson Arrivals, collision or perfect reception, immediately feedbacks.
Infinite # of nodes – each newly arriving packets arrives at a new nodes.
All nodes with a packet(new or old) transmits in a slot with probably qr
4.2.3 Stabilized Slotted Aloha
Let nk = # of backlogged nodes at the beginning of slot k ( 全部看成 backlogged, if 有 packet(new or old))
Ik = the event slot k is idle Sk = the event slot k is success Ck = the event slot k is collision Ak = # of new arrivals in slot k
4.2.3 Stabilized Slotted Aloha
nk+Ak if Ik
nk+1= nk+Ak-1 if Sk
nk+Ak if Ck
Let nk be the estimate of nk computed by each node.
Each node assumes nk is Poisson dist.
nk nk+1
Slot k
4.2.3 Stabilized Slotted Aloha
Algorithm: Each backlogged node transmits in
slot k with probably.
Each node updates its estimate by
k
r nq
ˆ1
,1min Try to getG=1
2
1ˆ
1ˆ,maxˆ 1
en
nn
k
k
k
If Ik or Sk 減少 qr↑
If Ck 增加 qr↓
4.2.3 Stabilized Slotted Aloha
Properties of the Algorithm: Assume : nk is Poisson distributed with m
ean nk 1
(1)
,...2,1,0,
!
ˆ)(
ˆ
ll
enlnP
knlk
k
,...2,1,0,
!
1ˆ
)|()1ˆ(
1
jj
en
IjnP
knjk
kk
4.2.3 Stabilized Slotted Aloha
1ˆ1ˆ
ˆ
0
0
!
ˆ
ˆ1
1
|)(
eee
i
en
n
inPinIPIP
kk
k
nn
nik
i
i
ikkkk
4.2.3 Stabilized Slotted Aloha
!
)1ˆ()
ˆ1
1(!
ˆ
)(
)()|(
)1ˆ(
1
ˆ
l
en
e
nlen
IP
IandlnPIlnP
k
k
nlk
l
k
nlk
k
kkkk
Poisson
4.2.3 Stabilized Slotted Aloha
)(
)|()|(
)|()|(
)1)(1ˆ(1
)1()1)(1ˆ(1
1
PoissonstilleZ
eeZ
nconvolutioIAPInP
IjAnPIjnP
zn
zzn
kkkk
kkkkk
k
k
4.2.3 Stabilized Slotted Aloha
(2)
Poissonj
enSjnP
Poissonj
enSjnP
e
inPinSPSP
jnjk
kk
njk
kk
ikkkk
k
k
!
)1ˆ(|
)!1(
)1ˆ(|
1
)()|()(
)1ˆ(1
1
)1ˆ(1
1
4.2.3 Stabilized Slotted Aloha
(3)
以上 (1)~(3) Assume Poisson is OK, and alg. to estimate nk+1 is reasonable.
Poissone
nuwhere
j
eCjnP
eSPIPCP
k
uj
kk
kkk
2
1ˆ
!|
211)(
1
#
4.2.3 Stabilized Slotted Aloha
(4)
1ˆ1
ˆ)(
,ˆ
kkr
kk
nnnqnG
thennnIf
# of userswith packets
Probably of trans.
What we wantMaximum throughput.
4.2.3 Stabilized Slotted Aloha
(5)
)()|(
)()|(
)()()(
thenlarge,ˆ If
1
1
11
kkkk
kkkkkk
kkkk
kk
SPSnnE
CIPCInnE
nnEnEnE
nn
4.2.3 Stabilized Slotted Aloha
01
)(
)()|1(
)()|()()|(
)()|1(
)()|(
eSP
SPSE
SPSAECIPCIAE
SPSAE
CIPCIAE
k
kk
kkkkkkkk
kkk
kkkkk
Mean nk+1 gettingsmaller e states
4.2.3 Stabilized Slotted Aloha
01
)2
1)(2
1(
2)1()ˆˆ( 1
e
ee
ennE kk
estimate. accurately large, ,n̂n if
backlog thereduce to tendssystem The
kk
P(Ik+Sk)
P(Ck)
4.2.3 Stabilized Slotted Aloha
njnnj
n
nG
nnnG
jn
k
j
k
kk
...2,1,0 ,)ˆ1
1()ˆ1
(j)P(R
1)() E(R tx,of #Let R
1ˆ1
ˆ)(
)( 1n̂n if
k
kk
kk
估計不正確,會如何?
4.2.3 Stabilized Slotted Aloha
1)P(C2)P(R
0)P(S1)P(R
0)P(I0)P(R
1) E(Rsince
kk
kk
kk
k
kk
k
nnnn
nn
ˆ)ˆE(-)E(
thenˆ IfShow
k11k
k
4.2.3 Stabilized Slotted Aloha
39.12
1
)ˆ()ˆ()(
C 2
1ˆ)ˆ(
)()(
11
k1
1
e
nnnEnEe
nnE
AEnnE
kkkk
kk
kkk
幾乎為
accurate. more
is estimate that means this
4.2.3 Stabilized Slotted Aloha
[Approximate delay for Pseudo-Bayesian] ( 之前 prove, estimate is accurate G(n)→1,
max throughput stable) How about delay?
n̂n and
large is n backlogged then
,e
1λ large Assume
4.2.3 Stabilized Slotted Aloha
1,2,3...ifor
n̂1
1
i!
)n̂(
1)n|iP(n
Poisson0,1,...ii!
)n̂( i) P(nk,slot For
ˆk
ˆ
ˆik
kk
ˆik
k
kk
k
k
nn
n
n
ee
e
e
P(nk=0) P(nk=1)
4.2.3 Stabilized Slotted Aloha
kk
k
nn
nik
i
i kk
eei
en
nni
ˆk
ˆ
ˆ
1
2kk
n̂1
1
!
)ˆ(
)ˆ1
1(ˆ1
1)n|P(S
P(1 tx)
4.2.3 Stabilized Slotted Aloha
11)n|P(S
1
n̂1
11
n̂1
1
1)!-(i
1)-n̂(1
kk
ˆk
ˆ
)1ˆ(
2ˆ
kˆ
)1ˆ(1-ik
eee
e
e
ee
e
e
kk
k
kk
k
nn
n
inn
n
4.2.3 Stabilized Slotted Aloha
Wi = delay from the i-th arrival until the beginning of the slot of the i-th departure
Qi = # of backlogged pkts(excluding possible successful trans) at the instant before the i-th arrival.
假設 FCFS, 因為 average is the same.Qi
i-th arrivalWi
rit1 t2 i-th departure
S
tQi yiL
4.2.3 Stabilized Slotted Aloha
Let yi = # of slots from the Qi-th successful tx (end of slot) until the beginning of the i-th successful tx
i
Q
jjii ytrW
i
1
Where tj = # of slots needed for the j-th successful tx after the i-th arrival
4.2.3 Stabilized Slotted Aloha
e
yEW
yEWeW
yEtEQEREWE iiii
1
)(21
)(2
1
)()()()()(
W2
1
succP
1
4.2.3 Stabilized Slotted Aloha
Let L be the slot #, immediately following Qi-th success tx. Suppose nL=1, then E(y| nL)=0 Suppose nL>1, then E(y| nL>1)=e-1
yi+S S success
4.2.3 Stabilized Slotted Aloha
P1 = fraction of slots in which n=1 and pkt is successfully tx.
= fraction of slots in which there is a successful tx
= fraction of packets successfully trans. From
state 1
)1()1(0)(
)ˆ(Let P
1
k
L
L
nPePyE
knP
1P
4.2.3 Stabilized Slotted Aloha
= fraction of packets successful transmitted from higher state #
11P
S S S S S
)1)(1()( 1
P
eyE
statesother ,1
1 state ,0
ymean
) y(
i
i
e
really
長度每個定義
4.2.3 Stabilized Slotted Aloha
slot previous inarrival
100
101
1
)(
1)1(
)1)(1()(
no
stateprevious
ePPP
ePPP
PeyE
4.2.3 Stabilized Slotted Aloha
fig4.6 ,1)-1)(e-(e-1
1)-1)(e-(e-
e-121
-eW
1)-1)(e-(e-1
1)-e)(e-(1get P tosolve 1
see
4.3.1 Tree Algorithm
Tree Algorithm Using labels Collision resolution interval : split
left/right side When traffic highTDMA ,best for
high traffic Throughput =
0.387(1/e=0.368,ALOHA) Although,throughput is improved a
little But “STABLE”
Tree Algorithm
Tree Algorithm At each slot k,each node computes T(k)
and (k) The interval [T(k), T(k)+ (k) ) is called
the allocation interval for slot k The interval from [T(k)+ (k), k ) is
called the waiting interval for slot k All nodes with packets that arrived in
the allocation interval transmit in slot k; All nodes with packets that arrived in the waiting interval wait.
Tree Algorithm At time k+1,each node does the
following:i. If feedback is collision ,then
T(k+1)= T(k)(k+1)= ½[(k)] (k+1)=L
(k)=L statusor R left or Right
Tree Algorithm
ii. If feedback is successful and (k)=LT(k+1)= T(k)+ (k)(k+1)= (k) (k+1)=R
iii. If feedback is idle, and (k)=LT(k+1)= T(k)+ (k)(k+1)= ½[(k)] (k+1)=L Masseyo` Improvement
Tree Algorithm
iv. If feedback is idle or successful, and (k)=R
T(k+1)= T(k)+ (k)(k+1)= min[0, k+1- T(k+1)]
(k+1)=ROptimal 0 =2.6
0.4871=throughput
Tree Algorithm
Tree Algorithm Markov Chain
(L,i) = system has status L and have been i splits (L:status , i:how many counts )
(R,i) = system has status R and have been i splits
Tree Algorithm
Tree Algorithm Whenever success at right side
finish CRI(Collision Resolution Interval) initial interval = 0
In state (R,0): Let Gi=E(number of packets in an interval
that has been split i times) =*(length of the interval) =* 0 *2-I
G0= 0 , G1=2-10 …………
PR,0=e- G0 + G0 e- G0 =(1+ G0)e- G0
Tree Algorithm In state (L,1) (XL:#of arrivals in left
side)
0
11
G-0
G-G-1
1,
e)1(1
)e-)(1e(G
2
11
2
2,1
2|1
G
XXP
XPXP
XXP
XXXP
XXXPP
RL
RL
RL
RLL
RLLL
Tree Algorithm
1
1
G-
G-1
1,
e1
eG
1
1
1
1,1
1|1
2,1|1
R
R
R
RR
LR
RLLRR
XP
XP
XP
XXP
XXP
XXXXPP
Tree Algorithm In general
)24.4(1
)23.4()1(1
)1(
,
1, 1
i
i
i
ii
G
Gi
iR
Gi
GGi
iL
e
eGP
eG
eeGP
Tree Algorithm
otherwise 0
visitedis i)(L, if 1i) x(L, where
x(R,2) x(R,1)
x(L,2)x(L,1)1
E(k)) find( CRP ain slots ofnumber k
(R,0) to visitsobetween tw interval the
CRP
Tree Algorithm
iRiL
iL
R
i
i
PiRPPiLPiLP
PiLPiRP
PLP
iRPiRP
iLPiLPwhere
iRxPiLxP
iRxEiLxEkE
,,
,
0,
1
1
1),(1),()1,(
),(),(
1)1,(
(R,0) toreturning before visitedis ),(),(
(R,0) toreturning before visitedis ),(),(
)),(()),((1
)),(()),((1)(
Tree Algorithm We next evaluate the change in T(k) from
one CRP to the next(how fast it move?)
Assume that the initial allocation interval is of size 0.I.e.[T(k), T(k)+0]
k
k
0
T(k)
T(k)
Return to W. int
Tree Algorithm The change is at most 0
If the left hand interval has collisions, the corresponding right hand interval is returned to the waiting interval
Let f be the fraction of 0 returned to the waiting interval over a CRP, then 0 (1-f) is the change in T(k)
Tree Algorithm
))(1()(
))(in (change-CRP) of(length
))( backlog in time change(D
(4.30) ),(2),(|
),()),(|()(
)intervalsright left()eG2(1-1
)eG(1-1
2 containsright &left |2contains intervalleft ),(|
0
1
1
2G-i
G-i
i
i
fEkE
kTEE
kTkE
iLPiLeP
iLPiLfEfE
PiLeP
i
i
i
Tree Algorithm
0
0
0
0
offunction is r.h.sin everything
offunction is while offunction are
(4.32) )(
))(1(
))(1( )(
stable" 0D if
ii GGE(f),E(k)
kE
fE
fEkE
Tree Algorithm
Right -hand-side is maximized at 0 =1.266 choosing 0=2.6 , =0.4871
Condition for negative D is satisfied for all <0.4871
I.e. max. throughput is 0.4871
0.4871
1.266 0
4.4.1 CSMA slotted ALOHA Focus on throughput & stability
analysis Slotted system, length of slot = Packet Tx time = 1
Tx time = L/C Propagation and detection delay <<1
Otherwise CSMA doesn't make sense 0,1,e feedback with max.delay
CSMA slotted ALOHA If a packet arrives during an idle
slot, it is transmitted at the beginning of the next slot
A packet is considered backlogged if It arrives during a transmission , or It was involved in a collision
CSMA slotted ALOHA Each backlogged packet is re-
transmission with probability qr<<1 after each subsequent idle slot
1 1
I II
Earliest time at which another Tx can occur
Trans. Or collision
CSMA slotted ALOHA Throughput analysis
State transition time = ends of idle slot
Time between transition = +1 if success or collision if idle
Let Tn=time until the next transition given that n backlogged packets
I
xn backlogged packets Next idle slot
Tn
CSMA slotted ALOHA
nr
nr
qeP
qe
PP
)1(1busyslot next
)1(
itnot transm do packets backlogged
slot, in this arrival noidleslot next
CSMA slotted ALOHA
1
arrival new 0arrival new 1exactly
)1()1(
)in ion transmisssuccessful(1)in departures ofnumber (
)1(1)in arrivals ofnumber (
)1(1
))1(1)(1()1()(
nrr
nr
nn
nrn
nr
nr
nrn
qnqeqe
TPTE
qeTE
qe
qeqeTE
CSMA slotted ALOHA
nr
ngngn
nqnr
nrr
nrr
nr
nr
nn
n
Tnqng
engeD
eqqq
qnqeqeqe
TETE
D
r
in Tx ofnumber expected)( where
)()1(
)1()1( , 1 since
)1()1()1(1
)in departure ofnumber ()in arrivals ofnumber (
drift expected
)()(
1
1
CSMA slotted ALOHA
)n transitiostate ofduration (1
)n transitiostateper departure ofnumber ( )(
0Dstability,For
)(
)(
n
Ee
Eengng
ng
CSMA slotted ALOHA
CSMA slotted ALOHA
g(n)
Slope= qr
n
4.4.3 CSMA Unslotted ALOHA
Unslotted system After a packet arrival if the channel is sense
d idle, transmission begins immediately Each backlogged packet
Re-transmission are repeatedly attempted at random times separated by independent exp. Delay with pdf f (0)=xe-x 0 E()=1/x
CSMA Unslotted ALOHA Detection delay =
Let In= idle period, given n backlogged packets. G(n)=attempt rate during In =+nx
n backlogged packet
Next transmissionsbusy
I
CSMA Unslotted ALOHA
New packet started
P(collision)=1-e-
G(n)
Attempt rate =+nx
CSMA Unslotted ALOHA
Previously backlogged packet started
P(collision)=1-e-G(n-
1)
Attempt rate =+ (n-1)x
CSMA Unslotted ALOHA Assume x very small, then
e- G(n) e- G(n-1), and in both cases , P(succ) = e- G(n)
idle idle
I B
Expected duration =[1/G(n)]+1+
CSMA Unslotted ALOHA
2
11)( when
21
1rate departure max.
1)(
1rate(n) Departure
)(
nG
nG
e nG
CSMA Unslotted ALOHA Unslotted CSMA is also unstable
How does on stabilized it?
4.4.2 Pseudo-Bayesian for CSMA slotted ALOHA
All packets are considered backlogged
At the end of each idle slot, each backlogged packet is independently transmitted with probability qr
backlog estimated theis where
2,2
min)(
n
nnqr
Pseudo-Bayesian for CSMA slotted ALOHA
At the end of each slot, each node updates its estimate by
collision if )1(2
success if )1()(1
idle if )(1
1
k
krk
krk
k
n
nqn
nqn
n
Pseudo-Bayesian for CSMA slotted ALOHA
!
)2(|.2
!
)(1
||.1
mean on with distributiPoisson is Suppose
)2(
)(1
j
enCjnP
j
enqn
SjnPIjnP
nn
k
krk
njk
kk
nqnj
krk
kkkk
kk
Pseudo-Bayesian for CSMA slotted ALOHA
Delay analysis of this protocol Let Wi be the delay from the i-th arriva
l until the beginning of the i-th success transmission
Let ni be the number of backlogged packets the instant prior to i-th arrival, excluding the possible success transmission
Pseudo-Bayesian for CSMA slotted ALOHA
in
jijii ytRW
1
Ri
i-th departureWi
i-th arrivalNi backlogged
1st succ
2nd succ
Ni-th
succ
yi
Pseudo-Bayesian for CSMA slotted ALOHA
Where Ri =residual time until the end of the next idle slot tj =time for (j-1)th success transmission until the
j-th success transmission yi =time for nith success transmission until the be
ginning of the i-th success transmission Assume tj are iid.(in fact, not, nj,more collisi
oninfluence tj ) E(t)=E(y)+(1+)
Pseudo-Bayesian for CSMA slotted ALOHA
Averaging over all I and by Little`s Formula
To simplify analysis, we assume number of attempted transmission in an interval is Poisson with mean g
(4.45) )(1
)()(
tE
yEREW
Pseudo-Bayesian for CSMA slotted ALOHA
2)1(2
)1(2
1
)(2
1)(
2
1)(
2
)()|()()|()()|()(
)1(1
)1()(
(4.44) 1
)(
)(1)1()1())(()(
CPSPIP
CPCRESPSREIPIRERE
ge
etEE(y)
ge
etE
tEgeegetEetE
g
g
g
g
gggg
Pseudo-Bayesian for CSMA slotted ALOHA
(4.48) ) 21(12
22
minimize 2
minimizingby minimized is
(4.47) )(12
121
0
)1()1(1)(
min
2
W
E(t)g
E(t)W
tE
β)(E(t)β)λ(W
eeCP
4.5.2 Slotted CSMA/CD (Ethernet Protocol)
Minislots of duration If minislot is idle, all nodes wait until
beginning of next minislot If exactly 1 node transmits in minislot, all
other nodes detect this transmission within and keep quiet until they detect end of transmission
If 2 or more nodes transmit, then these nodes detect each others transmission within and cease transmitting. Then the next idle slot ends after 2
Slotted CSMA/CD (Ethernet Protocol)
B
B
B
2
In
In
1
Idle
collision
success
In:interval between ends of idle slots
Slotted CSMA/CD (Ethernet Protocol)
0)()(
cycle onein departure ofnumber average -
cycle onein arrivals ofnumber average
backloggedn Drift when
)(12
)()1()(
)(
)()(
)()(
ngn
ngng
ngngn
engIE
enge
engeIE
Slotted CSMA/CD (Ethernet Protocol)
77.0)( when 31.31
1
, )( where
(4.65) ))(1(1)(
)(
or
max
)()(
)(
ng
nqng
engeng
eng
r
ngng
ng
Unslotted CSMA/CD When unbacklogged node has a packet
If it senses the channel idle, it transmits immediately
If it senses the channel busy, it becomes backlogged
Backlogged nodes choose a backlogged delay which is exponentially distributed then sense the channel again
Unslotted CSMA/CD
B
2 collision
Everyone will sense channel idle
y
Next packet ready to be transmitted
Success transmission
Unslotted CSMA/CD
g
g
ecollisionP
esuccessP
collisionzE
successzE
gyE
xE
zEyExEIE
1)(
)(
2)|(
1)|(
ones backlogged & arrival new including 1
)(
)(
)()()()(
Unslotted CSMA/CD
6
113 when
2.61
1
)1(21
max
gS
eeg
eS
throughput
gg
g