lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume...

14
Eytan Modiano Slide 1 M/G/1 Queues Eytan Modiano Massachusetts Institute of Technology

Transcript of lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume...

Page 1: lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume m Poisson streams of fixed length packets of arrival rate λ/m each multiplexed

Eytan ModianoSlide 1

M/G/1 Queues

Eytan ModianoMassachusetts Institute of Technology

Page 2: lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume m Poisson streams of fixed length packets of arrival rate λ/m each multiplexed

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

Page 3: lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume m Poisson streams of fixed length packets of arrival rate λ/m each multiplexed

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" #)

Page 4: lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume m Poisson streams of fixed length packets of arrival rate λ/m each multiplexed

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" # )

Page 5: lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume m Poisson streams of fixed length packets of arrival rate λ/m each multiplexed

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

Page 6: lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume m Poisson streams of fixed length packets of arrival rate λ/m each multiplexed

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

Page 7: lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume m Poisson streams of fixed length packets of arrival rate λ/m each multiplexed

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

"

Page 8: lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume m Poisson streams of fixed length packets of arrival rate λ/m each multiplexed

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

Page 9: lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume m Poisson streams of fixed length packets of arrival rate λ/m each multiplexed

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]

Page 10: lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume m Poisson streams of fixed length packets of arrival rate λ/m each multiplexed

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

Page 11: lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume m Poisson streams of fixed length packets of arrival rate λ/m each multiplexed

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" # )

Page 12: lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume m Poisson streams of fixed length packets of arrival rate λ/m each multiplexed

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

Page 13: lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume m Poisson streams of fixed length packets of arrival rate λ/m each multiplexed

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]

Page 14: lectures 8 (MG1)web.mit.edu/modiano/www/6.263/lec8.pdfEytan Modiano Slide 11 FDM EXAMPLE • Assume m Poisson streams of fixed length packets of arrival rate λ/m each multiplexed

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]