lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume...
Transcript of lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume...
Eytan ModianoSlide 1
M/G/1 Queues
Eytan ModianoMassachusetts Institute of Technology
Eytan ModianoSlide 2
M/G/1 QUEUE
• Poisson arrivals at rate λ
• Service time has arbitrary distribution with given E[X] and E[X2]– Service times are independent and identically distributed (IID)– Independent of arrival times– E[service time] = 1/µ– Single Server queue
M/G/1Poisson arrivals
General independentService times
Eytan ModianoSlide 3
Pollaczek-Khinchin (P-K) Formula
where ρ = λ/µ = λE[X] = line utilization
From Little’s Theorem,
NQ = λW
T = E[X] + W
N = λT= NQ + ρ
W =!E[X 2 ]
2(1" #)
Eytan ModianoSlide 4
M/G/1 EXAMPLES
• Example 1: M/M/1
E[X] = 1/µ ; E[X2] = 2/µ2
•Example 2: M/D/1 (Constant service time 1/µ)
E[X] = 1/µ ; E[X2] = 1/µ2�
W =!
µ 2(1" # )=
#
µ(1" # )
�
W =!
2µ 2(1" # )=
#
2µ(1" # )
Eytan ModianoSlide 5
Proof of Pollaczek-Khinchin (P-K) formula
• Let Wi = waiting time in queue of ith arrivalRi = Residual service time seen by i (i.e., amount of time for current customer receiving service to be done)
Ni = Number of customers found in queue by i
• E[Wi] = E[Ri] + E[X]E[Ni] = R + NQ/µ– Here we have used the PASTA property plus the independent service time property
• W = R + λW/µ ⇒ W = R/(1-ρ)– Using little’s formula
�
Wi = Ri + X jj = i! Ni
i!1
"
i arrivesRi Xi-3 Xi-2 Xi-1 Xi
timeNi =3
Wi
Eytan ModianoSlide 6
What is R?(Time Average Residual Service Time)
Residual Service Time R(t)
X
X
X
X
X
X
X
X
1
1
2
2
3
3
4
4 time →
Let M(t) = Number of customers served by time tE[R(t)] = 1/t (sum of area in triangles)
�
Rt
=1
tR(! )d!
0
t
" =1
t
Xi
2
2i=1
M( t )
# =M(t )
2t
Xi
2
M(t )i=1
M( t )
#
�
As t ! " , M(t)
t= Average departure rate = Average arrival rate = #
�
M(t )
t
Xi
2
M(t )i= 1
M( t )
! = E X2[ ] " R =
#E X2[ ]
2
Eytan ModianoSlide 7
E[Wi] = E[Ri] + E[X]E[Ni] = R + NQ/m = R/(1-r)
M/G/1 Queue with Vacations
• Useful for polling and reservation systems (e.g., token rings)• When the queue is empty, the server takes a vacation• Vacation times are IID and independent of service times and arrival times
– If system is empty after a vacation, the server takes another vacation– The only impact on the analysis is that a packet arriving to an empty system
must wait for the end of the vacation
i arrivesVi Xi-3 Xi-2 Xi-1 Xi
timeNi =3
Wi
�
Wi = Ri + X jj = i! Ni
i!1
"
Eytan ModianoSlide 8
Average Residual Service Time(with vacations)
– Where L(t) is the number of vacations taken up to time t– M(t) is the number of customers served by time t
�
Rt =1
tR(! )d!
0
t
" =1
t
Xi2
2+
Vj2
2+
j =1
L( t )
#i=1
M( t )
#$
%
&
&
'
(
)
)
=M(t )
2t
Xi2
M(t )+L(t )
2ti=1
M( t )
#Vj2
L(t )j =1
L( t )
#
�
R = limt!"
M(t )
t
E[X2]
2 +
L(t )
t
E[V2]
2
Residual Service Time R(t)
X
X
X
X
X
X
X
X
1
1
2
2
3
3
4
4 time →
V1
V1
Eytan ModianoSlide 9
Average Residual Service Time(with vacations)
• Let I = 1 if system is on vacation and I = 0 if system is busy• Little’s Theorem ⇒
E[I] = P(system idle) = 1-ρ = λv E[V]
⇒ λv = (1-ρ)/E[V]
• Hence,
(recall W = R/(1-ρ))
�
As t ! " , M(t)
t! # and
L(t)
t! #
v= vacation rate
�
W =!E[X 2]
2(1" # )+E[V
2]
2E[V]�
R =!E[X 2]
2+(1" # )E[V 2]
2E[V]
Eytan ModianoSlide 10
Example: Slotted M/D/1 system
• Transmission can begin only at start of a slot
• If system is empty at the start of a slot, server not available for the duration of theslot (vacation)
• E[X] = E[v] = 1/µ• E[X2] = E[v2] = 1/µ2
• Notice that an average of 1/2 slot is spent waiting for the start of a slot
1/µ
Each slot = one packet transmission time = 1/µ
W =! / µ 2
2(1" ! /µ)+1/ µ 2
2 /µ=
! /µ
2(µ " !)+1/µ
2
= WM /D /1
+ E[X]/ 2
Eytan ModianoSlide 11
FDM EXAMPLE
• Assume m Poisson streams of fixed length packets of arrival rate λ/m eachmultiplexed by FDM on m subchannels. Total traffic = λ
Suppose it takes m time units to transmit a packet, so µ=1/m.
The total system load: ρ = λ
• We have an M/D/1 system W=λE[x2]/2(1-ρ)
User 2
User m
User 1 SLOT for User 1
SLOT for User 2
SLOT for User m
FDM Frames
SLOT for User m
IDLE
IDLE
�
WFDM
=! /m( )m 2
2(1" # )=
#m
2(1" # )
Eytan ModianoSlide 12
Slotted FDM
• Suppose now that system is slotted and transmissions start only on m time unitboundaries.
• This is M/D/1 with vacations– Server goes on vacation for m time units when there is nothing to transmit
E[V] = m; E[V2] = m2.
WSFDM = WFDM + E[V2]/2E[V]
= WFDM + m/2
User 2
User m
User 1 SLOT for User 1
SLOT for User 2
SLOTTED FDM Frames
SLOT for User m
SLOT for User 2
Vacation for User m
Eytan ModianoSlide 13
TDM EXAMPLE
• TDM with one packet slots is the same– A session has to wait for its own slot boundary
W = R/(1-ρ)
slot 1 slot 2 slot m. . .TDM Frame
slot m
�
W =!E[X 2]
2(1" # )+E[V
2]
2E[V]�
R =!E[X 2]
2+(1" # )E[V 2]
2E[V]
Eytan ModianoSlide 14
TDM EXAMPLE
• Therefore, WTDM = WFDM + m/2
• Adding the packet transmission time, TDM comes out best becausetransmission time is 1 instead of m
TFDM = [WFDM ] + m
TSFDM = [WFDM + m/2]+m
TTDM = [WFDM + m/2]+1
= TFDM - [m/2-1]