fumie costen, peter n green fumie.costen@manchester.ac.uk...

Post on 09-May-2020

8 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Queuing Theory

Fumie Costen, Peter N Greenfumie.costen@manchester.ac.uk

http://staff.cs.manchester.ac.uk/˜fumie/

May 6, 2020

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory1 / 195

Table of Contents

1 Setting a scenario for a queueing system2 Characterisation of a queueing system3 Markov chain4 Poisson Process5 Little’s Law6 Average number and average time7 Kendall’s notation8 M/M/19 State transition diagram of M/M/2, M/M/3

10 Example problems11 Tutorial: Exam preparation

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory2 / 195

Lecture 1Setting a scenario for a

queueing system

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory3 / 195

Dog Massage Parlour visit on foot

https://lostdogsillinois.org/categories/friendly-lost-dog-strategies/

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory4 / 195

Dog Massage Parlour visit by bus

https://www.thedodo.com/close-to-home/nova-scotia-kennel-transports-dogs-in-school-bus

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory5 / 195

Dog Massage Parlour visit by train

https://thelondog.com/dog-adventure-dog-friendly-epping-ongar-historical-steam-railway-london/

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory6 / 195

Time Tα: Dogs enter a Dog Massage Parlour

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory7 / 195

Dogs list the locations for massage and pay forthe massage fee appropriate for the request

https://www.akc.org/expert-advice/health/people-pay-families-vet-bills-can/

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory8 / 195

Dogs in the waiting room at Dog Massage Parlour

http://crazyhyena.com/funny-dogs-sitting-on-chairs-photo_en

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory9 / 195

Time Tβ: Dog A meets a masseur 1

https://www.pawshake.com.au/blog/introducing-dogs-each-other

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory10 / 195

Another dog B meets another masseur 2

https://www.yourdog.co.uk/dog-care-and-advice/your-rescue-dog/preparing-for-another-dog/Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory11 / 195

Dogs receive the massage service at DogMassage Parlour from head to tail

https://tenor.com/view/dogs-dog-massage-cuddle-doggo-massage-gif-12030886

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory12 / 195

Time Tγ: Dog leaves the parlour after massage orby being blocked(= the parlour was full)

https://www.somethingwagging.com/farewell-for-now/

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory13 / 195

Characterisation of aqueueing system

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory14 / 195

Queue characteristics

I arrival pattern of dogs to the massageparlour

I service pattern of the massage parlourI number of masseursI system capacityI queue disciplines

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory15 / 195

Queue characteristics

Arrival pattern of dogs ' the timebetween successive dog arrivals to theparlour

I Known exactly ( = deterministic )I Random variable whose probability distribution is

presumed known

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory16 / 195

Queue characteristics

Service pattern of massage parlour ' thetime required by one masseur tomassage one dog

I Known exactly ( = deterministic )I Random variable whose probability distribution is

presumed known

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory17 / 195

Queue characteristics

System capacity ' the maximumnumber of dogs, both those beingmassaged and those in the waiting roomat the same time

I Infinite capacity = infinite number of chairs in thewaiting room and/or infinite number of masseurs.

I Finite capacity = a limited number of chairs to wait andmasseurs.The arriving dog is forced to go home whenthere is no spare chair to wait ( the system isfull )

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory18 / 195

Queue characteristics

Queue disciplines ' the order in whichdogs are served

I First-in, first-outI Last-in, first-outI Priority basisI Random

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory19 / 195

Measures of effectiveness of a queuing system insteady state

I Average number of dogs waitingI Average number of dogs massaged or waitingI Average time a dog waitsI Average time a dog is massaged or waitingI Probability that a dog spends more than t units of time

in the waiting roomI Probability that a dog spends more than t units of time

in the waiting room or in the massage room

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory20 / 195

Markov chain

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory21 / 195

A dog enters parlour at 1:10. Is it awake at 1:20?

A dog enters to the waiting room awake.When the dog is awake now, the dog has

I 80 % of probability of being awakeI 20 % of probability of being asleep

10 minutes later.When the dog is asleep now, it has

I 60 % of probability of being asleepI 40 % of probability of being awake

10 minutes later.Markov chain to model this ??

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory22 / 195

A dog enters parlour at 1:10. Is it awake at 1:20?A dog enters to the waiting room awake.When the dog is awake now, the dog has

I 80 % of probability of being awakeI 20 % of probability of being asleep

10 minutes later.When the dog is asleep now, the dog has

I 60 % of probability of being asleepI 40 % of probability of being awake

10 minutes later.

wake

sleep

0.8 0.6

0.4

0.2

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory23 / 195

Is a dog awake at 1:20 ?: Markov chain

wake

sleep

0.8 0.6

0.4

0.2

P t=1:20w = 0.8P t=1:10

w + 0.4P t=1:10s

P t=1:20s = 0.2P t=1:10

w + 0.6P t=1:10s

Pw : Probability of the dog being awakePs : Probability of the dog being asleep

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory24 / 195

Markov chain = memoryless

wake

sleep

0.8 0.6

0.4

0.2

P t=1:20w = 0.8P t=1:10

w + 0.4P t=1:10s

P t=1:20s = 0.2P t=1:10

w + 0.6P t=1:10s

P t=1:20w and P t=1:20

s depend on P t=1:10w and P t=1:10

sbut do not depend on P t=1:00

w , P t=1:00s , or any earlier

probabilities.⇓

The Markov chain is memorylessFumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory25 / 195

The dog is awake with 80% of probability at 1:20

wake

sleep

0.8 0.6

0.4

0.2

P t=1:20w = 0.8P t=1:10

w + 0.4P t=1:10s

P t=1:20s = 0.2P t=1:10

w + 0.6P t=1:10s

(P t=1:20

wP t=1:20

s

)=

(0.8 0.40.2 0.6

)(P t=1:10

wP t=1:10

s

), M

(P t=1:10

wP t=1:10

s

)

As we know P t=1:10w = 1,P t=1:10

s = 0(

P t=1:20w

P t=1:20s

)=

(0.8 0.40.2 0.6

)(10

)=

(0.80.2

)

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory26 / 195

Probability that the dog is awake at infinite time ?

wake

sleep

0.8 0.6

0.4

0.2

Solution 1:(

P t=1:20w

P t=1:20s

)= M

(P t=1:10

wP t=1:10

s

)

(P t=1:30

wP t=1:30

s

)= M

(P t=1:20

wP t=1:20

s

)= M2

(P t=1:10

wP t=1:10

s

)

(P t=1:40

wP t=1:40

s

)= M

(P t=1:30

wP t=1:30

s

)= M2

(P t=1:20

wP t=1:20

s

)= M3

(P t=1:10

wP t=1:10

s

)

...

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory27 / 195

Probability that the dog is awake at infinite time ?

wake

sleep

0.8 0.6

0.4

0.2

Solution 2: In the future(=steady-state), we can safely

assume(

P t=∞+1w

P t=∞+1s

)=

(P t=∞

wP t=∞

s

). Thus

(P t=∞

wP t=∞

s

)= M

(P t=∞

wP t=∞

s

)

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory28 / 195

Probability of being awake at infinite time is 23

wake

sleep

0.8 0.6

0.4

0.2

Solution 2 continued:(P t=∞

wP t=∞

s

)= M

(P t=∞

wP t=∞

s

)=

(0.8 0.40.2 0.6

)(P t=∞

wP t=∞

s

)

The dog is one of two states =⇒ P t=∞w + P t=∞

s = 1

Thus P t=∞w =

23,P t=∞

s =13

.Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory29 / 195

Poisson Process

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory30 / 195

When will the next dog arrive to the parlour afterthe arrival of one dog ?

No idea because there is NO relationshipbetween dogs

⇓The history of the time of arrival does not tell the future

arrival times⇓

called Memoryless⇓

The time of arrivals are modeled by a Poisson ProcessFumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory31 / 195

Poisson process :Arrival times and interarrival times

time1:15 1:35 1:45 2:15 2:45 2:55 3:15

interarrival times

arrival times

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory32 / 195

Poisson process

time1:15 1:35 1:45 2:15 2:45 2:55 3:15

interarrival times

I λ dogs arrive in 1 unit time(say second or hour )in average

⇓arrival rate is λ

I The average interarrival time is 1λ

I The probability of k dogs’ arrival within time τ (in unit

time) is P =(λτ)ke−λτ

k!based on the Poisson distribution

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory33 / 195

Poisson process

time1:15 1:35 1:45 2:15 2:45 2:55 3:15

interarrival times

arrival times

Poisson distributed number k dogswhich visit the parlour in 1 hour

Probabilityλke−λ

k!of k dogs arriving/hour with

the average number λ = 3 of dogs’ arrival per hour

0

0.05

0.1

0.15

0.2

0 2 4 6 8 10

3**x*exp(-3)/gamma(x+1) k

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory34 / 195

Poisson process

time1:15 1:35 1:45 2:15 2:45 2:55 3:15

interarrival times

arrival times

Probability 1− e−λt of exponentially distributedinterarrival times [hour] less than t hours with the meanof interarrival times of 1

λ= 1

3

0

0.2

0.4

0.6

0.8

1

0 0.5 1 1.5 2

1-exp(-3*x)

tFumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory35 / 195

Property of Poisson process: Multiple Poissonprocess are merged into a single process which isalso Poisson

λ1 dogsarrive per secon foot

λ2 dogsarrive per secby train

λ3 dogsarrive per secby aeroplane

λ4 dogsarrive per secby bus

λ =

4∑

k=1

λk dogs

arrive per sec

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory36 / 195

Lecture 2Little’s Law

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory37 / 195

Little’s Law N = λ · T : Example 1

I N : average number of dogs in the systemI λ : the arrival rate of dogs [ (number of dogs arriving )/

(unit time) ]I T : average time of a dog’s stay in the system

Example: Assuming infinite number of waiting chairs,I Dogs arrive at the rate of 8(= λ) dogs per hourI They wait 15(= T ) minutes in average before they meet

a masseurThe average number of dogs in the waiting room N is

8× 1560

=860× 15 = 2 dogs

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory38 / 195

Little’s Law N = λ · T : Example 2

I N : average number of dogs in the systemI λ : the arrival rate of dogs [ (number of dogs arriving )/

(unit time) ]I T : average time of a dog’s stay in the system

Example: Assuming infinite number of masseursI Dogs arrive at the rate of 8(= λ) dogs per hourI They have 30(= T ) minute of massage time in average

The average number of dogs in the massage room N is

8× 3060

= 4 dogs

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory39 / 195

Little’s Law N = λ · T : Example 3

I N : average number of dogs in the systemI λ : average number of dogs massaged within an unit

time [ (number of dogs massaged )/ (unit time) ]I T : average time of a dog’s stay in the system

Example:I 40(= N) dogs are currently being massagedI The average massage time for a dog is 20(= T ) minutes

The average number of dogs massaged in a minute λ is4020

= 2 dogs per minute.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory40 / 195

Little’s Law N = λ · T

Question :I A dog massage parlour has 10 masseursI All masseurs are currently busy.I The average time of massage time is 15 minutesI 8 dogs are waiting for the massage and you join this

waiting queue.How long do you have to wait to meet a masseur ?

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory41 / 195

Little’s Law N = λ · TQuestion :

I A dog massage parlour has 10 masseursI All masseurs are currently busy.I The average time of massage time is 15 minutesI 8 dogs are waiting for the massage and you join this

waiting queue.How long do you have to wait to meet a masseur ?

Hint

I How many dogs complete the massage and leave theparlour per minute ?

I How many dogs have to leave the parlour before yourturn?

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory42 / 195

Little’s Law N = λ · TQuestion :A dog massage parlour has 10 masseurs and allmasseurs are currently busy. 8 dogs are waiting for themassage and you join the waiting queue. How long do youhave to wait to meet a masseur assuming that the averagetime of massage time is 15 minutes ?Answer:

I The number of the dogs receiving a massage : N = 10I Time taken to massage a dog : T = 15 minutes

⇓N = λT

I The number of the dogs which complete the massageper minute : λ = 10

15 = 23 dogs/minute

I 8 dogs have to leave the massage parlour before youare served. =⇒ So you need to wait

8waiting dogs23 dogs massaged per minute

= 12 minutes

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory43 / 195

Average number andaverage time

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory44 / 195

Average Massage time 1µ

Massage time depends on the request of each dog andthe size of the dog

⇓This module assumes that the massage time is

exponentially distributed with mean 1µ

[(unit time)/ dog]µ : number of dogs massaged per unit time

⇓We use µ and λ to relate

I average number N of dogs waiting/massagedI average number Q of dogs waitingI average time W of waitingI average time T of being in the system

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory45 / 195

average number Q of dogs waiting

average massage time 1µ

average time Wof dogs waiting

utilization ρ

average number N of dogs waiting and currently being massaged

average time T in the system

waiting room massage room with 1 masseur

N = λT ; Q = λW ; T = W +1µ

; T , Tγ − Tα ; W , Tβ − Tα

ρ = N −Q = λT − λW = λT − λ(T − 1µ) =

λ

µ

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory46 / 195

Kendall’s notation

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory47 / 195

Kendall’s notation

Kendall’s notation v/w/x/y/z is used to specify a queue’s characteristics.

I v : arrival patternI w : service patternI x : number of available masseursI y : system capacityI z : queue discipline

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory48 / 195

Standard system description notation commonlyused in queuing theory

I Poisson arrival process(exponentially distributedinterarrival times) is denoted by M

I Exponential distribution of massage time (service time)is denoted by M

I Number of masseurs is m

⇒ M/M/m

M can be changed to G for general distribution ofinterarrival time or D for deterministic interarrival times

M can be changed to G for general distribution of massagetime or D for deterministic distribution of massage time

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory49 / 195

Lecture 3M/M/1

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory50 / 195

M/M/1 System: State of a system

steady State 00 dog in the system

steady State 11 dog in the system

System =waiting room+massage room

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory51 / 195

M/M/1 System: Probability of each state

steady State 00 dog in the systemP0: Probability of0 dog in the system

steady State 11 dog in the systemP1: Probability of1 dog in the system

P0, P1, P2, · · · are the probability that the system is in the

state 0, 1, 2, · · · and∞∑

k=0

Pk = 1

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory52 / 195

M/M/1 System: Transition of state (state transitiondiagram/ Markov chain )

arrival rate λ

departure rate µ

steady State 00 dog in the systemP0: Probability of0 dog in the system

steady State 11 dog in the systemP1: Probability of1 dog in the system

Transition from i to i+1 occurs when a dog arrives.Transition from i to i−1 occurs when a dog leaves.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory53 / 195

M/M/1 System: Speed of transition

arrival rate λ

departure rate µ

steady State 00 dog in the systemP0: Probability of0 dog in the system

steady State 11 dog in the systemP1: Probability of1 dog in the system

1 dog move from State 0 to State 1 at P0 · λ speed

1 dog move from State 1 to State 0 at P1 · µ speed

Transition from i to i+1 occurs when a dog arrives.Transition from i to i−1 occurs when a dog leaves.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory54 / 195

M/M/1 System: Steady state

arrival rate λ

departure rate µ

steady State 00 dog in the systemP0: Probability of0 dog in the system

steady State 11 dog in the systemP1: Probability of1 dog in the system

1 dog move from State 0 to State 1 at P0 · λ speed

1 dog move from State 1 to State 0 at P1 · µ speed

The steady state exists when the transition speed from i toi+1 = transition speed from i+1 to i. Example: P0 · λ = P1 · µ

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory55 / 195

M/M/1 System: local balance equations tocalculate steady state probability

λ

µ

λ λ λ

µ µ µ

S0 S1 S2 S3

P0 · λ = P1 · µ =⇒ P1 =λ

µP0

P1 · λ = P2 · µ =⇒ P2 =λ

µP1 =

µ

)2

P0

P2 · λ = P3 · µ =⇒ P3 =λ

µP2 =

µ

)3

P0

...

Pi =

µ

)i

P0

P0 + P1 + P2 + · · ·+ P∞ = 1Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory56 / 195

M/M/1 System: local balance equations tocalculate steady state probability

λ

µ

λ λ λ

µ µ µ

S0 S1 S2 S3

Pi =

µ

)i

P0

P0 + P1 + P2 + · · ·+ P∞ = 1

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory57 / 195

M/M/1 System: Steady state probability, time and

number of dogs under∣∣∣λµ∣∣∣ < 1

λ

µ

λ λ λ

µ µ µ

S0 S1 S2 S3

P0 = 1− λ

µ; Pi =

µ

)i

·(

1− λ

µ

)

N = P0 · 0 + P1 · 1 + P2 · 2 + · · ·+ P∞ · ∞ =λµ

1− λµ

Q = N − ρ = N − λ

µ; T =

; W =Qλ

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory58 / 195

State transition diagram ofM/M/2, M/M/3

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory59 / 195

M/M/2 System: state transition diagram

S0 S1 S2 S3

λ

µ

λ λ λ

2µ 2µ 2µWe use 1 masseur for the transition from S1 to S0. We use 2masseurs for the transition from Si+1 to Si for 1 ≤ i where thetransition speed doubles.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory60 / 195

M/M/2 System: local balance equations tocalculate steady state probability

S0 S1 S2 S3

λ

µ

λ λ λ

2µ 2µ 2µP0 · λ = P1 · µ =⇒ P1 =

λ

µP0

P1 · λ = P2 · 2µ =⇒ P2 =λ

2µP1 =

12

µ

)2

P0

P2 · λ = P3 · 2µ =⇒ P3 =λ

2µP2 =

122

µ

)3

P0

...

Pi =1

2i−1

µ

)i

P0

P0 + P1 + P2 + · · ·+ P∞ = 1Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory61 / 195

M/M/2 System: local balance equations tocalculate steady state probability

S0 S1 S2 S3

λ

µ

λ λ λ

2µ 2µ 2µAn , P0 + P1 + P2 + P3 · · ·Pn

= P0 +λ

µP0 +

12λ2

µ2 P0 +122

λ3

µ3 P0 + · · ·1

2n−1

µ

)n

P0

λ

2µAn =

λ

2µP0 +

12λ2

µ2 P0 +122

λ3

µ3 P0 +123

λ4

µ4 P0 + · · ·+12n

µ

)n+1

P0

An −λ

2µAn = P0 +

λ

µP0 −

λ

2µP0 −

12n

µ

)n+1

P0

∴ An =1 + λ

2µ − 12n

(λµ

)n+1

1− λ2µ

P0

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory62 / 195

M/M/2 System: local balance equations tocalculate steady state probability

S0 S1 S2 S3

λ

µ

λ λ λ

2µ 2µ 2µ

∴ An =1 + λ

2µ − 12n

(λµ

)n+1

1− λ2µ

P0

limn→∞

An =(1 + λ

2µ)P0

1− λ2µ

= 1( whenλ

2µ< 1)

∴ P0 =1− λ

1 + λ2µ

; P1 =λ

µP0 =

λ

µ·

1− λ2µ

1 + λ2µ

P2 =12

µ

)2

·1− λ

1 + λ2µ

; P3 =122

µ

)3

·1− λ

1 + λ2µ

; · · ·

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory63 / 195

M/M/3 System: state transition diagram

S0 S1 S2 S3

λ

µ

λ λ λ

2µ 3µ 3µWe use 1 masseur for the transition from S1 to S0. We use 2masseurs for the transition from S2 to S1 where the transitionspeed doubles. We use 3 masseurs for the transition fromSi+1 to Si for 2 ≤ i where the transition speed triples.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory64 / 195

Summary (Formula) of M/M/1, M/M/2 System

M/M/1 M/M/2The value of ρ λ

µλ

Number of dogs in the waiting room Q ρ2

1−ρ2ρ3

1−ρ2

Number of dogs in the system N ρ1−ρ

2ρ1−ρ2

Average waiting time W ρµ(1−ρ)

ρ2

µ(1−ρ2)

Average time in the system T 1µ(1−ρ)

1µ(1−ρ2)

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory65 / 195

Example problems

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory66 / 195

Lecture 4

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory67 / 195

M/M/1 System: Example1Dogs arrive at a massage parlour per hour in Poissonfashion with arrival event rate of λ. The parlour has aninfinite number of chairs in the waiting room and only onemasseur. Each dog requires an exponentially distributedmassage time with a mean of 30 minutes.

1 When the total time for a dog in the system(waitingroom +massage room) , which is called an averageresponse time, is 2 hours, how many dogs per hour canbe handled ?

2 Calculate the average waiting time3 Calculate the average number of dogs in the system4 Calculate the utilisation of the system5 What is the probability of the system being empty6 For an increase of λ with 11.1 % how much will the

response time increase ?Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory68 / 195

M/M/1 System: Example1Dogs arrive whose rate is λ. One masseur presents. Themassage time is 30 minutes in average.

1 When the total time for a dog in the system(waitingroom +massage room) , which is called an averageresponse time, is 2 hours, how many dogs per hour canbe handled ?

Exponential massage time with rateµ = 1

30minutes = 13060 hours

= 2 is given.

From the “formula” table for M/M/1, the average time in thesystem T is 1

µ(1−ρ) .

T =1

µ(1− ρ) =1

µ(1− λµ)=

1µ− λ

∴ λ = µ− 1T= 2− 1

2= 1.5 dogs per hour can be handled.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory69 / 195

M/M/1 System: Example1

Dogs arrive whose rate is λ. One masseur presents. Themassage time is 30 minutes in average.

2 Calculate the average waiting time

From the “formula” table for M/M/1, the average waitingtime W is

W =ρ

µ(1− ρ) =λ

µ(µ− λ) =1.5

2(2− 1.5)= 1.5 hours

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory70 / 195

M/M/1 System: Example1

Dogs arrive whose rate is λ. One masseur presents. Themassage time is 30 minutes in average.

3 Calculate the average number of dogs in the system

From the “formula” table for M/M/1, the average number ofdogs in the system (both waiting room and massage room)N is

N =ρ

1− ρ =λ

µ− λ =1.5

2− 1.5= 3 dogs

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory71 / 195

M/M/1 System: Example1

Dogs arrive whose rate is λ. One masseur presents. Themassage time is 30 minutes in average.

4 Calculate the utilisation of the system

From the figure of average number and average time forM/M/1, the utilisation ρ is

ρ =λ

µ=

1.52

= 0.75

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory72 / 195

M/M/1 System: Example1

Dogs arrive whose rate is λ. One masseur presents. Themassage time is 30 minutes in average.

5 What is the probability of the system being empty

From the figure of steady state probability for M/M/1, P0 isprobability of the system being empty.

P0 = 1− λ

µ= 1− 1.5

2= 0.25

So the probability of the system being empty is 25 %

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory73 / 195

M/M/1 System: Example1

Dogs arrive whose rate is λ. One masseur presents. Themassage time is 30 minutes in average.

6 For an increase of λ with 11.1 % how much will theresponse time increase ?

λ is changed to λ = 1.5× 1.111 = 1.6665. Using this newvalue of λ and the “formula” table for M/M/1, the averagetime in the system T is 1

µ(1−ρ) .

T =1

µ(1− ρ) =1

µ(1− λµ)=

1µ− λ =

12− 1.6665

= 2.9985

∴ the increase is2.9985− 2

2= 0.49925

Thus T increases 49.9%

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory74 / 195

M/M/1 System: Example2

2 dogs arrive at the parlour at each arrival event and thearrival events are modelled with Poisson distribution witharrival event rate of λ. Each dog requires an exponentially

distributed massage time with a mean of1µ

. There is 1

masseur in the parlour with infinite number of chairs in thewaiting room

1 Draw the state diagram2 List the local balance equations

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory75 / 195

M/M/1 System: Example22 dogs arrive at the parlour at each arrival event and thearrival events is modelled with Poisson distribution witharrival event rate of λ. Each dog requires an exponentially

distributed massage time with a mean of1µ

. There is 1

masseur in the parlour.

Sk+1SkS3S2S1S0

λ λ λ λ

µµµµµ µ

λ

P0 · λ = P1 · µ λPk−1 + λPk = µPk+1for k ≥ 1

A state S defines the number of dogs in the systemFumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory76 / 195

M/M/1 System: Example3I Dogs arrive to a massage parlour in groups of 1 and 2

dogs. The number of customers per group isindependent and identically distributed.

I The massage parlour has only one masseur. There isonly one chair in the waiting room.

I If a group of dogs does not fit into the system, none ofthe members of the group joins the queue.

I The average number of arriving dogs is 8 dogs per hour.The interarrival time between groups is exponentiallydistributed.

I 50 % of dogs arrive in a group of 1. 50 % of dogs arrivein a group of 2.

I Each dog requires an exponentially distributedmassage time with a mean of 30 minutes.

I The probabilities that a random arriving group contains1 and 2 dogs are q1 and q2 and the Poisson grouparrival rate is λG

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory77 / 195

M/M/1 System: Example31 What are the average rate of arrivals for a group of 1

and 22 What are the average rate of arrivals for dogs

belonging to a group of 1 and a group of 2.3 Calculate the number of dogs arriving in a group of 24 Calculate q1, q2 and λG5 Draw the state transition diagram6 List and solve the local balance equations7 Calculate the probability that the system is full8 Calculate the average number of dogs in the system9 Calculate the probability that groups of 1 are blocked

10 Calculate the probability that groups of 2 are blocked11 Calculate the probability that a random dog is blocked12 Calculate the effective arrival rate of dogs13 Calculate the time a dog is in the system in average14 Calculate the average waiting time

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory78 / 195

M/M/1 System: Example3

A group of 1 or 2 dogs arrive to the parlour which has 1masseur and 1 waiting chair. 8 dogs arrive per hour. 50 % ofthem are in a group of 2. Massage time is 30 minutes.

1 What are the average rate of arrivals for a group of 1and 2 when the probabilities that a random arrivinggroup contains 1 and 2 dogs are q1 and q2 and thePoisson group arrival rate is λG

Based on the property of Poisson process the arrival rate ofa group of 1 is λG · q1 and the arrival rate of a group of 2 isλG · q2.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory79 / 195

M/M/1 System: Example3

A group of 1 or 2 dogs arrive to the parlour which has 1masseur and 1 waiting chair. 8 dogs arrive per hour. 50 % ofthem are in a group of 2. Massage time is 30 minutes.

2 What are the average rate of arrivals for dogsbelonging to a group of 1 and a group of 2.

A group of 1 has the arrival rate of λG · q1. Thus the dogswho belong to a group of 1 have the arrival rate of λG ·q1 ·1.A group of 2 has the arrival rate of λG · q2. Thus the dogswho belong to a group of 2 have the arrival rate of λG ·q2 ·2.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory80 / 195

M/M/1 System: Example3

A group of 1 or 2 dogs arrive to the parlour which has 1masseur and 1 waiting chair. 8 dogs arrive per hour. 50 % ofthem are in a group of 2. Massage time is 30 minutes.

3 Calculate the number of dogs arriving in a group of 2

As the average number of arriving dogs is 8 dogs per hourand 50 % of them belong to a group of 2. So 8× 0.5 = 4dogs in a group of 2 arrive.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory81 / 195

M/M/1 System: Example3

A group of 1 or 2 dogs arrive to the parlour which has 1masseur and 1 waiting chair. 8 dogs arrive per hour. 50 % ofthem are in a group of 2. Massage time is 30 minutes.

4 Calculate q1, q2 and λG

The dogs who belong to a group of 2 have the arrival rateof λG · q2 · 2 and 4 dogs arrive in a group of 2. Thus we canobtain

λG · q2 · 2 = 4λG · q1 · 1 = 4

q1 + q2 = 1

These three equations give us q1 =23

, q2 =13

, and λG = 6

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory82 / 195

M/M/1 System: Example3A group of 1 or 2 dogs arrive to the parlour which has 1masseur and 1 waiting chair. 8 dogs arrive per hour. 50 % ofthem are in a group of 2. Massage time is 30 minutes.

5 Draw the state transition diagram

λG · q2

λG · q1 λG · q1S0 S1 S2

µ µ

λGλG·q2

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory83 / 195

M/M/1 System: Example3A group of 1 or 2 dogs arrive to the parlour which has 1masseur and 1 waiting chair. 8 dogs arrive per hour. 50 % ofthem are in a group of 2. Massage time is 30 minutes.

6 List and solve the local balance equationsλG · q1P0 + λG · q2P0 = µP1

λG · q1P1 + λG · q2P0 = µP2

P0 + P1 + P2 = 1

Exponential massage time with rateµ = 1

30minutes = 13060 hours

= 2 is given. As λG = 6, q1 = 23 , q2 = 1

3 ,the local balance equations become

4P0 + 2P0 = 2P1

4P1 + 2P0 = 2P2

P0 + P1 + P2 = 1

Thus we obtain P0 = 111 , P1 = 3

11 , P2 = 711 .

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory84 / 195

M/M/1 System: Example3

A group of 1 or 2 dogs arrive to the parlour which has 1masseur and 1 waiting chair. 8 dogs arrive per hour. 50 % ofthem are in a group of 2. Massage time is 30 minutes.

7 Calculate the probability that the system is full

The probability that the system is full as seen by anindependent observer is simply P2 which is 7

11 , i.e., about 64percent.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory85 / 195

M/M/1 System: Example3

A group of 1 or 2 dogs arrive to the parlour which has 1masseur and 1 waiting chair. 8 dogs arrive per hour. 50 % ofthem are in a group of 2. Massage time is 30 minutes.

8 Calculate the average number of dogs in the system

The average number of dogs in the system is

0 · P0 + 1 · P1 + 2 · P2 = 1 · 311

+ 2 · 711

=1711' 1.5 dogs

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory86 / 195

M/M/1 System: Example3

A group of 1 or 2 dogs arrive to the parlour which has 1masseur and 1 waiting chair. 8 dogs arrive per hour. 50 % ofthem are in a group of 2. Massage time is 30 minutes.

9 Calculate the probability that groups of 1 are blocked

This happens only when the system is full. So the probabilityis P2, i.e., about 64 percent.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory87 / 195

M/M/1 System: Example3

A group of 1 or 2 dogs arrive to the parlour which has 1masseur and 1 waiting chair. 8 dogs arrive per hour. 50 % ofthem are in a group of 2. Massage time is 30 minutes.

10 Calculate the probability that groups of 2 are blocked

This happens when the system is full or one dog is in the

system. So the probability is P2 + P1 =7

11+

311

=1011

, i.e.,

about 91 percent.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory88 / 195

M/M/1 System: Example3

A group of 1 or 2 dogs arrive to the parlour which has 1masseur and 1 waiting chair. 8 dogs arrive per hour. 50 % ofthem are in a group of 2. Massage time is 30 minutes.

11 Calculate the probability that a random dog is blocked

An arriving dog in general belongs to groups 1 and 2 withprobability of 50 % each. So a random dog is blocked with( the probability of being in the group of 1 ) × (theprobability of the group of 1 being blocked)+ (the probability of being in the group of 2 ) × (theprobability of the group of 2 being blocked).

0.5 · 711

+ 0.5 · 1011

=1722' 77%

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory89 / 195

M/M/1 System: Example3A group of 1 or 2 dogs arrive to the parlour which has 1masseur and 1 waiting chair. 8 dogs arrive per hour. 50 % ofthem are in a group of 2. Massage time is 30 minutes.

12 Calculate the effective arrival rate of dogs

The nominal arrival rate (dogs arrival rate) is different fromthe effective arrival rate(the rate at which dogs enter theparlour). In the state diagram the dogs depart from thestate S0 with the rate of λG · q1 and λG · q2 and 2 dogs movefrom S0 to S2. The dogs depart from the state S1 with the rateof λG · q1. The probability of S0 and S1 are P0 and P1. Thusthe effective arrival rate of dogs is

P0 · (1 · λG · q1 + 2 · λG · q2) + P1 · 1 · λG · q1

=1

11(6 · 2

3+ 2 · 6 · 1

3) +

311· 1 · 6 · 2

3=

2011' 1.8 dogs

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory90 / 195

M/M/1 System: Example3

A group of 1 or 2 dogs arrive to the parlour which has 1masseur and 1 waiting chair. 8 dogs arrive per hour. 50 % ofthem are in a group of 2. Massage time is 30 minutes.

13 Calculate the time a dog is in the system in average

The Little’s law is N = λT . The value of λ is 2011 . The value of N

is 1711 .

T =Nλ

=1720.

So a dog is in the system for 0.85 hours or 51 minutes.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory91 / 195

M/M/1 System: Example3

A group of 1 or 2 dogs arrive to the parlour which has 1masseur and 1 waiting chair. 8 dogs arrive per hour. 50 % ofthem are in a group of 2. Massage time is 30 minutes.

14 Calculate the average waiting time

As we know that the duration of the massage is 30 minutesand the total time when a dog is in the system(waitingroom + massage room) is 51 minutes. So the averagewaiting time is 51− 30 = 21 minutes

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory92 / 195

Lecture 5

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory93 / 195

M/M/2 System: Example1

Dogs arrive at a massage parlour per hour in Poissonfashion with arrival event rate of λ. The parlour has aninfinite number of chairs in the waiting room and twomasseurs. Each dog requires an exponentially distributedmassage time with a mean of 30 minutes.

1 When the total time for a dog in the system(waitingroom +massage room) , which is called an averageresponse time, is 2 hours, how many dogs per hour canbe handled ?

2 What is the probability of both masseurs being busy

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory94 / 195

M/M/2 System: Example1

Dogs arrive at a massage parlour per hour in Poissonfashion with arrival event rate of λ. The parlour has aninfinite number of chairs in the waiting room and twomasseurs. Each dog requires an exponentially distributedmassage time with a mean of 30 minutes.

1 When the total time for a dog in the system(waitingroom +massage room) , which is called an averageresponse time, is 2 hours, how many dogs per hour canbe handled ?

Exponential massage time with rateµ = 1

30minutes = 13060 hours

= 2 is given.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory95 / 195

M/M/2 System: Example1Dogs arrive at a massage parlour per hour in Poissonfashion with arrival event rate of λ. The parlour has aninfinite number of chairs in the waiting room and twomasseurs. Each dog requires an exponentially distributedmassage time with a mean of 30 minutes.

1 When the total time for a dog in the system(waitingroom +massage room) , which is called an averageresponse time, is 2 hours, how many dogs per hour canbe handled ?

From the “formula” table for M/M/2, the average time in thesystem T is 1

µ(1−ρ2)where ρ = λ

T =1

µ(1−(λ

)2)

; ∴ 2 =1

2(1−(λ

2·2

)2)

∴ λ =√

12 = 3.464dogs per hour can be handled

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory96 / 195

M/M/2 System: Example1Dogs arrive at a massage parlour per hour in Poissonfashion with arrival event rate of λ. The parlour has aninfinite number of chairs in the waiting room and twomasseurs. Each dog requires an exponentially distributedmassage time with a mean of 30 minutes.

2 What is the probability of both masseurs being busy

The probability of both masseurs being busy isP2 + P3 + P4 + · · ·+ P∞ = 1− P0 − P1

From the figure of steady state probability for M/M/2,

P0 =1− λ

1 + λ2µ

=1−

√12

2·2

1 +√

122·2

' 0.072 ; P1 =λ

µ·

1− λ2µ

1 + λ2µ

' 0.124

1− P0 − P1 ' 0.804

So the probability of both masseurs being busy is 80 %

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory97 / 195

M/M/m System: Example1

5 dogs arrive at a massage parlour per hour in Poissonfashion and the mean massage time is 30 minutes. Thereare 3 masseurs in the parlour. Each dog is assigned to 1masseur at his arrival. When all 3 masseurs are busy, theincoming dogs are all forced to go home. Each masseurremain assigned to a dog for the dog’s entire massagetime which is of exponentially distributed time duration.

1 Draw the state diagram2 Determine the probability of a dog forced to go home3 How many dogs are forced to go home per hour

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory98 / 195

M/M/m System: Example1

5 dogs arrive at a massage parlour per hour in Poissonfashion and the mean massage time is 30 minutes. Thereare 3 masseurs in the parlour. Each dog is assigned to 1masseur at his arrival. When all 3 masseurs are busy, theincoming dogs are all forced to go home. Each masseurremain assigned to a dog for the dog’s entire massagetime which is of exponentially distributed time duration.

I Poisson arrivals with rate λ = 5 dogs per hourI Exponential massage time with rateµ = 1

30minutes = 13060 hours

= 2

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory99 / 195

M/M/m System: Example15 dogs arrive at a massage parlour per hour in Poissonfashion and the mean massage time is 30 minutes. Thereare 3 masseurs in the parlour. Each dog is assigned to 1masseur at his arrival. When all 3 masseurs are busy, theincoming dogs are all forced to go home. Each masseurremain assigned to a dog for the dog’s entire massagetime which is of exponentially distributed time duration.

1 Draw the state diagram

S0 S1 S2 S3

λ

3µ2µµ

λ λ

A state S defines the number of dogs in the system. Whenwe move from S2 to S1 we use 2 masseurs and thus thespeed to move from S2 to S1 is twice of that from S1 to S0.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory100 / 195

M/M/m System: Example1

S0 S1 S2 S3

λ

3µ2µµ

λ λ

The local balance equations:Yellow line: λP0 = µP1; Orange: λP1 = 2µP2; Pink: λP2 = 3µP3

P0 + P1 + P2 + P3 = 1

∴ P0 +λ

µP0 +

λ

2µλ

µP0 +

λ

3µλ

2µλ

µP0 = 1

∴ P0 =1

1 + λµ+ λ2

2µ2 +λ3

3·2·µ3

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory101 / 195

M/M/m System: Example1

S0 S1 S2 S3

λ

3µ2µµ

λ λ

2 Determine the probability of a dog forced to go homeYellow line: λP0 = µP1; Orange: λP1 = 2µP2; Pink: λP2 = 3µP3

P0 =1

1 + λµ+ λ2

2µ2 +λ3

3·2·µ3

The blocking probability is the probability that the parlourdoes not accept new dogs, i.e., the probability of thesystem being in state 3. P3 = λ

3µλ

2µλµP0 ' 0.282167

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory102 / 195

M/M/m System: Example1

S0 S1 S2 S3

λ

3µ2µµ

λ λ

3 How many dogs are forced to go home per hour

P3 = λ3µ

λ2µ

λµP0 ∼ 0.282167

The rate of rejected dogs isarrival rate × blocking probability =λ · P3 ' 1.41084 dogs per hour.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory103 / 195

M/M/m System: Example2

Papillon others

A dog massage parlour has 3 masseurs. 1 masseur isreserved for Papillon( butterfly in French) and the rest of 2masseurs are available for any type of dogs.

1 Papillon arrives at the parlour per hour in Poisson fashionand 4 other type of dogs arrive per hour in Poisson fashion.The mean massage time is 30 minutes. Each dog isassigned to 1 masseur at his arrival. Each masseur remainassigned to a dog for the dog’s entire massage time whichis of exponentially distributed time duration. There is nowaiting room at the parlour.

1 Draw the state diagram2 Determine probability of Papillons forced to go home3 Determine the probability of other dogs forced to go

home4 What is the average number of dogs in the system

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory104 / 195

M/M/m System: Example2

A dog massage parlour has 3 masseurs. 1 masseur isreserved for Papillon and the rest of 2 masseurs areavailable for any type of dogs.1 Papillon arrives at the parlour per hour in Poisson fashion.4 other type of dogs arrive per hour in Poisson fashion. Themean massage time is 30 minutes. Each dog is assigned to1 masseur at his arrival. Each masseur remain assigned to adog for the dog’s entire massage time which is ofexponentially distributed time duration. There is no waitingroom at the parlour.

1 Draw the state diagram2 Determine probability of Papillons forced to go home3 Determine probability of other dogs forced to go home4 Determine the average number of dogs in the system

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory105 / 195

M/M/m System: Example2

A dog massage parlour has 3 masseurs. 1 masseur isreserved for Papillon and the rest of 2 masseurs areavailable for any type of dogs. 1 Papillon arrives at theparlour per hour in Poisson fashion. 4 other type of dogsarrive per hour in Poisson fashion. The mean massage timeis 30 minutes. Each dog is assigned to 1 masseur at hisarrival. Each masseur remain assigned to a dog for thedog’s entire massage time which is of exponentiallydistributed time duration. There is no waiting room at theparlour.

I Poisson arrivals with rate λb = 1 Papillon per hourI Poisson arrivals with rate λr = 4 other dogs per hourI Exponential massage time with rateµ = 1

30minutes = 13060 hours

= 2

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory106 / 195

M/M/m System: Example2A dog massage parlour has 3 masseurs. 1 masseur isreserved for Papillon and the rest of 2 masseurs areavailable for any type of dogs. 1 Papillon arrives at theparlour per hour in Poisson fashion and 4 other type of dogsarrive per hour in Poisson fashion. The mean massage timeis 30 minutes.

1 Draw the state diagram

S3S2S1S0

3µ2µ

λb + λr λbλb + λr λb + λr

λr

µ

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory107 / 195

M/M/m System: Example2: local balanceequations

S3S2S1S0

3µ2µ

λb + λr λbλb + λr λb + λr

λr

µ

Yellow line: (λb + λr)P0 = µP1; Orange: (λb + λr)P1 = 2µP2;Pink: λbP2 = 3µP3

P0 + P1 + P2 + P3 = 1

∴ P0 +λb + λr

µP0 +

λb + λr

2µλb + λr

µP0 +

λb

3µλb + λr

2µλb + λr

µP0 = 1

∴ P0 =1

1 + λb+λrµ

+ (λb+λr )2

2µ2 + λb(λb+λr )2

3·2·µ3

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory108 / 195

M/M/m System: Example2

S3S2S1S0

3µ2µ

λb + λr λbλb + λr λb + λr

λr

µ

2 Determine the probability of Papillons forced to gohome

Yellow line: (λb + λr)P0 = µP1; Orange: (λb + λr)P1 = 2µP2;Pink: λbP2 = 3µP3

P0 =1

1 + λb+λrµ

+ (λb+λr )2

2µ2 + λb(λb+λr )2

3·2·µ3

When the system is in state 3, Papillons are blocked fromthe system.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory109 / 195

M/M/m System: Example2

S3S2S1S0

3µ2µ

λb + λr λbλb + λr λb + λr

λr

µ

2 Determine the probability of Papillons forced to gohome

P0 =1

1 + λb+λrµ

+ (λb+λr )2

2µ2 + λb(λb+λr )2

3·2·µ3

' 0.139942

When the system is in state 3, Papillons are blocked fromthe system. So the blocking probability of Papillons is

P3 =λb(λb + λr)

2

3 · 2 · µ3 P0 = 0.0728863

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory110 / 195

M/M/m System: Example2

S3S2S1S0

3µ2µ

λb + λr λbλb + λr λb + λr

λr

µ

3 Determine the probability of other dogs forced to gohome

When the system is in state 2 and 3, other dogs are blockedfrom the system. So the blocking probability of other dogs is

P2 + P3 =(λb + λr)

2

2µ2 P0 + P3 ' 0.437319 + 0.0728863 ' 0.510205

This is the same as

1− P0 − P1 = 1− P0 −λb + λr

µP0 = 1− 3.5P0 ' 0.510203

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory111 / 195

M/M/m System: Example2

S3S2S1S0

3µ2µ

λb + λr λbλb + λr λb + λr

λr

µ

4 Determine the average number of dogs in the systemWe can calculate the average number of dogs in thesystem1 · P1 + 2 · P2 + 3 · P3

P1 =λb + λr

µP0 = 0.349855

Thus

P1 + 2 · P2 + 3 · P3 = 0.349855 + 2 · 0.437319 + 3 · 0.0728863 = 1.44315

1.44315 dogs in the system in average.Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory112 / 195

Tutorial: Exam preparation

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory113 / 195

Prep1

In a computer network there is a network node which hasone input link and one output link. The network node canstore infinite number of packets. The packets arrive to thenetwork node with the average number of arriving packetsof 30 packets per second. The packets wait 2 seconds inaverage before they move to the output link.

How many packets are stored in average ?

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory114 / 195

Prep1

In a computer network there is a network node which hasone input link and two output links. The network node canstore infinite number of packets. The packets arrive to thenetwork node with the average number of arriving packetsof 30 packets per second. The packets wait 0.5 seconds inaverage before they move to the output link.How many packets are stored in average ?

I λ : the arrival rate of packets = 30 per secondI T : the average time of a packet in the queue ( stored )

is 0.5 seconds

The average number of packets stored N is

30 · 0.5 = 15 packets

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory115 / 195

Prep2

In a computer network there is a network node which hasone input link and infinite number of output links. Eachoutput link has a transmission rate of 1M bits per second.The packets arrive to the network node with the averagenumber of arriving packets of 20 packets per second. Thepackets have exponentially distributed size with a mean of300 K bits.

How many packets are in the output link, being transmittedin average ?

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory116 / 195

Prep2In a computer network there is a network node which hasone input link and infinite number of output links. Eachoutput link has a transmission rate of 1M bits per second.The packets arrive to the network node with the averagenumber of arriving packets of 20 packets per second. Thepackets have exponentially distributed size with a mean of300 K bits. How many packets are in the output link, beingtransmitted in average ?

I λ : the arrival rate of packets = 20 per secondI T : the average time of a packet being transmitted in the

output link is (packet length)/(transmission rate) =300000/1000000 = 3/10

The average number of packets N in the output link is

20 · 310

= 6 packets

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory117 / 195

Prep3

In a computer network there is a network node which hasone input link and infinite number of output links. Eachoutput link has a transmission rate of 2M bits per second.There are 9 packets in the output link being transmitted inaverage. The packets have exponentially distributed sizewith a mean of 300 K bits.

How many packets get out of the output links in averageper second ?

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory118 / 195

Prep3In a computer network there is a network node which hasone input link and infinite number of output links. Eachoutput link has a transmission rate of 2M bits per second.There are 9 packets in the output link being transmitted inaverage. The packets have exponentially distributed sizewith a mean of 300 K bits.How many packets get out of the output links in averageper second ?

I N : 9 (=N) packets are in the output linkI T : the average time of a packet being transmitted in the

output link is (packet length)/(transmission rate) =300000/2000000 = 3/20

The average number of packets λ getting out of the outputlink is

93/20

= 60 packets per second

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory119 / 195

Prep4

In a computer network there is a network node which hasone input link and 10 output links. Each output link has atransmission rate of 3M bits per second. All output links arecurrently busy, having one packet for transmission. Thereare 5 packets currently stored in the queue. The packetshave exponentially distributed size with a mean of 600 Kbits.

When a new packet join the queue, how long does it haveto be stored in the queue ?

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory120 / 195

Prep4

In a computer network there is a network node which hasone input link and 10 output links. Each output link has atransmission rate of 3M bits per second. All output links arecurrently busy, having one packet for transmission. Thereare 5 packets currently stored in the queue. The packetshave exponentially distributed size with a mean of 600 Kbits.

When a new packet join the queue, how long does it haveto be stored in the queue ?Step 1: how many packets get out of the output link persecond in average ?

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory121 / 195

Prep4In a computer network there is a network node which hasone input link and 10 output links. Each output link has atransmission rate of 3M bits per second. All output links arecurrently busy, having one packet for transmission. Thereare 5 packets currently stored in the queue. The packetshave exponentially distributed size with a mean of 600 Kbits. Step 1: how many packets get out of the output linkper second in average ?

I the number of packets currently in the output link :N = 10

I T : the average time of a packet in the output link beingtransmitted is (packet length)/(transmission rate) =600000/3000000 = 1/5 seconds

The number of packets which get out of the output link persecond λ = N

T = 101/5 = 50

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory122 / 195

Prep4

In a computer network there is a network node which hasone input link and 10 output links. Each output link has atransmission rate of 3M bits per second. All output links arecurrently busy, having one packet for transmission. Thereare 5 packets currently stored in the queue. The packetshave exponentially distributed size with a mean of 600 Kbits. Step 2: how many packets have to get out of theoutput link before a new packet gets into the output link ?

⇓As 5 packets are currently stored, these 5 packets can getinto the output link only when 5 packets, which arecurrently in the output link, get out of the output link.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory123 / 195

Prep4

When a new packet join the queue, how long does it haveto be stored in the queue ?

I The number of packets which get out of the output linkper second λ = N/T = 50

I 5 packets have to leave the output link before a newpacket gets into the output link.

number of packets to leave the output linknumber of packets to leave the output link per second

=5

50= 0.1seconds

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory124 / 195

Prep5:Q1

In a computer network there is a network node which hasone input link and 1 output link. It can store an infinitenumber of packets. Each output link has a transmission rateof 3M bits per second. Packets arrive at the network nodeper second in Poisson fashion with arrival event rate of λ.The packets have exponentially distributed size with amean of 600 K bits.

Q1: When the total time for a packet in the system( beingstored in the storage and being sent in the output link ) is 5

10seconds, how many packets per second can get out of theoutput link ?

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory125 / 195

Prep5:Q11 input link and 1 output link. Infinite storage. A transmissionrate of 3M bits/second. Packet size of 600 K bits.Q1: When the total time for a packet in the system( beingstored in the storage and being sent in the output link ) is 5

10seconds, how many packets per second can get out of theoutput link ?Tout : the average time of a packet in the output link beingtransmitted is (packet length)/(transmission rate) =600K/3M seconds.So the departure rate µ = 1/Tout = 3M/600K.As the interarrival times and service time are exponentiallydistributed and the number of the output link is 1, thisproblem is M/M/1 in Kendall’s notation. From the formulatable for M/M/1 the average time in the system is T = 1

µ−λ

∴ λ = µ− 1T= 3000000/600000− 1

5/10= 3 packets/sec

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory126 / 195

Prep5:Q2

In a computer network there is a network node which hasone input link and 1 output link. It can store an infinitenumber of packets. Each output link has a transmission rateof 3M bits per second. Packets arrive at the network nodeper second in Poisson fashion with arrival event rate of λ.The packets have exponentially distributed size with amean of 600 K bits.

Q2:Calculate the average waiting time

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory127 / 195

Prep5:Q2In a computer network there is a network node which hasone input link and 1 output link. It can store an infinitenumber of packets. Each output link has a transmission rateof 3M bits per second. Packets arrive at the network nodeper second in Poisson fashion with arrival event rate of λ.The packets have exponentially distributed size with amean of 600 K bits.

Q2:Calculate the average waiting time

From the formula table for M/M/1 the average waiting timeW

W =λ

µ(µ− λ) =3

5(5− 3)= 0.3 seconds

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory128 / 195

Prep5:Q3

In a computer network there is a network node which hasone input link and 1 output link. It can store an infinitenumber of packets. Each output link has a transmission rateof 3M bits per second. Packets arrive at the network nodeper second in Poisson fashion with arrival event rate of λ.The packets have exponentially distributed size with amean of 600 K bits.

Q3:Calculate the average number of packets in the system

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory129 / 195

Prep5:Q3In a computer network there is a network node which hasone input link and 1 output link. It can store an infinitenumber of packets. Each output link has a transmission rateof 3M bits per second. Packets arrive at the network nodeper second in Poisson fashion with arrival event rate of λ.The packets have exponentially distributed size with amean of 600 K bits.

Q3:Calculate the average number of packets in the system

From the formula table for M/M/1 the average number ofpackets in the system N is

N =λ

µ− λ =3

5− 3= 1.5 packets

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory130 / 195

Prep5:Q4

In a computer network there is a network node which hasone input link and 1 output link. It can store an infinitenumber of packets. Each output link has a transmission rateof 3M bits per second. Packets arrive at the network nodeper second in Poisson fashion with arrival event rate of λ.The packets have exponentially distributed size with amean of 600 K bits.

Q4: Calculate the utilisation of the system

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory131 / 195

Prep5:Q4

In a computer network there is a network node which hasone input link and 1 output link. It can store an infinitenumber of packets. Each output link has a transmission rateof 3M bits per second. Packets arrive at the network nodeper second in Poisson fashion with arrival event rate of λ.The packets have exponentially distributed size with amean of 600 K bits.

Q4: Calculate the utilisation of the system

From the figure of average number and average time forM/M/1, the utilisation ρ is

ρ =λ

µ=

35= 0.6

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory132 / 195

Prep5:Q5

In a computer network there is a network node which hasone input link and 1 output link. It can store an infinitenumber of packets. Each output link has a transmission rateof 3M bits per second. Packets arrive at the network nodeper second in Poisson fashion with arrival event rate of λ.The packets have exponentially distributed size with amean of 600 K bits.

Q5: What is the probability of the system being empty

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory133 / 195

Prep5:Q5In a computer network there is a network node which hasone input link and 1 output link. It can store an infinitenumber of packets. Each output link has a transmission rateof 3M bits per second. Packets arrive at the network nodeper second in Poisson fashion with arrival event rate of λ.The packets have exponentially distributed size with amean of 600 K bits.

Q5: What is the probability of the system being empty

From the figure of steady state probability for M/M/1 P0 isthe probability of the system being empty.

P0 = 1− λ

µ= 1− 3

5= 0.4

So the probability of the system being empty is 40 %Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory134 / 195

Prep5:Q6

In a computer network there is a network node which hasone input link and 1 output link. It can store an infinitenumber of packets. Each output link has a transmission rateof 3M bits per second. Packets arrive at the network nodeper second in Poisson fashion with arrival event rate of λ.The packets have exponentially distributed size with amean of 600 K bits.

Q6: For an increase of λ with 25 % how much will theresponse time increase

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory135 / 195

Prep5:Q6

1 input link and 1 output link. Infinite storage. A transmissionrate of 3M bits/second. Packet size of 600 K bits.

Q6: For an increase of λ with 25 % how much will theresponse time increase

λ is changed to λ = 3× 1.25 = 3.75. Using this new value ofλ and the formula table for M/M/1, the average time in thesystem T is

T =1

µ− λ =1

5− 3.75= 0.8

∴ the increase is0.8− 0.5

0.5= 0.6 ∴ T increases 60 %

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory136 / 195

Prep6

In a computer network there is a network node which hasone input link and 1 output link. It can store an infinitenumber of packets. The output link has a transmission rateof 9M bits per second. 2 packets arrive at the network nodeat each arrival event and the arrival events are modelledwith Poisson distribution with arrival event rate of 40. Thepackets have exponentially distributed size with a mean of300 K bits.

Draw the state diagram and list the local balanceequations

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory137 / 195

Prep6

1 input link and 1 output link. A transmission rate of 9M bitsper second. 2 packets arrive together. The pair arrival rateof 40. Packet length is 300K bits

Draw the state diagram and list the local balanceequations

I λ = 40I Tout : the average time of a packet in the output link

being transmitted is (packet length)/(transmission rate)= 300K/9M seconds.So the departure rate µ = 1/Tout = 9M/300K=30.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory138 / 195

Prep61 input link and 1 output link. A transmission rate of 9M bitsper second. 2 packets arrive together. The pair arrival rateof 40. Packet length is 300K bits Draw the state diagramand list the local balance equations

Sk+1SkS3S2S1S0

λ λ λ λ

µµµµµ µ

λ

P0 · λ = P1 · µ λPk−1 + λPk = µPk+1for k ≥ 1

A state S defines the number of packets in the system

where λ = 40, µ = 30Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory139 / 195

Prep7

In a computer network there is a network node which hasone input link and one output link. The output link has atransmission rate of 1.2M bits per second. The networknode can store 1 packet. Packets arrive to the networknode in batches of 1 and 2 packets. The number of packetsper batch is independent and identically distributed. If abatch of packets does not fit into the system, none of thepackets of the batch joins the queue. The average numberof arriving packets is 8 packets per second. The ratio ofeach batch in the arriving packets is shown in Table 1. Theinterarrival time between batches is exponentiallydistributed. The packets have exponentially distributed sizewith a mean of 600 K bits.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory140 / 195

Prep7

one input link and one output link. A transmission rate of1.2M bits per second. 1 packet can be stored. Packetsarrive in batches of 1 and 2 packets. The number of arrivingpackets is 8 packets per second. The ratio of each batch inthe arriving packets is shown in Table 1. Packet size is 600 Kbits.

Number ofpackets in abatch

average number of arrivingpackets belonging to the batch

average number of arriving packets1 1

22 1

2Table 1

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory141 / 195

Prep7:Q1one input link and one output link. A transmission rate of1.2M bits per second. 1 packet can be stored. Packetsarrive in batches of 1 and 2 packets. The number of arrivingpackets is 8 packets per second. The ratio of each batch inthe arriving packets is shown in Table 1. Packet size is 600 Kbits.

Number ofpackets in abatch

average number of arrivingpackets belonging to the batch

average number of arriving packets1 1

22 1

2Table 1

What are the average rate of arrivals for a batch of 1 and 2when we assume

I Probabilities that a random arriving batch contains 1and 2 packets are q1 and q2

I The Poisson batch arrival rate is λ?

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory142 / 195

Prep7:Q1one input link and one output link. A transmission rate of1.2M bits per second. 1 packet can be stored. Packetsarrive in batches of 1 and 2 packets. The number of arrivingpackets is 8 packets per second. The ratio of each batch inthe arriving packets is shown in Table 1. Packet size is 600 Kbits.What are the average rate of arrivals for a batch of 1 and 2when we assume

I Probabilities that a random arriving batch contains 1and 2 packets are q1 and q2

I The Poisson batch arrival rate is λ?λ batches arrive per second. But q1 × 100 percent of λbatches belong to batch 1.The arrival rate of batch 1 is λ · q1

The arrival rate of batch 2 is λ · q2

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory143 / 195

Prep7:Q2one input link and one output link. A transmission rate of1.2M bits per second. 1 packet can be stored. Packetsarrive in batches of 1 and 2 packets. The number of arrivingpackets is 8 packets per second. The ratio of each batch inthe arriving packets is shown in Table 1. Packet size is 600 Kbits.

Number ofpackets in abatch

average number of arrivingpackets belonging to the batch

average number of arriving packets1 1

22 1

2Table 1

What are the average rate of arrivals for packets belongingto a batch of 1 and a batch of 2 when we assume

I Probabilities that a random arriving batch contains 1and 2 packets are q1 and q2

I The Poisson batch arrival rate is λ?

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory144 / 195

Prep7:Q2one input link and one output link. A transmission rate of1.2M bits per second. 1 packet can be stored. Packetsarrive in batches of 1 and 2 packets. The number of arrivingpackets is 8 packets per second. The ratio of each batch inthe arriving packets is shown in Table 1. Packet size is 600 Kbits.What are the average rate of arrivals for packets belongingto a batch of 1 and a batch of 2 when we assume

I Probabilities that a random arriving batch contains 1and 2 packets are q1 and q2

I The Poisson batch arrival rate is λA batch of 2 has the arrival rate of λ · q2. The batch of 2 has2 packets. Thus the packets which belong to a batch of 2have the arrival rate of 2 · λ · q2. A batch of 1 has the arrivalrate of λ · q1. The batch of 1 has 1 packet. Thus the packets,which belong to a batch of 1, have the same arrival rate asthe arrival rate of a batch of 1: λ · q1.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory145 / 195

Prep7:Q3one input link and one output link. A transmission rate of1.2M bits per second. 1 packet can be stored. Packetsarrive in batches of 1 and 2 packets. The number of arrivingpackets is 8 packets per second. The ratio of each batch inthe arriving packets is shown in Table 1. Packet size is 600 Kbits.

Number ofpackets in abatch

average number of arrivingpackets belonging to the batch

average number of arriving packets1 1

22 1

2Table 1

Calculate the number of packets arriving in a batch of 1and 2 per second

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory146 / 195

Prep7:Q3

Number ofpackets in abatch

average number of arrivingpackets belonging to the batch

average number of arriving packets1 1

22 1

2Table 1

Calculate the number of packets arriving in a batch of 1and 2 per secondAs the average number of arriving packets is 8 packets persecond and 50 % of them belong to a batch of 2.So 8 × 0.5 = 4 packets in a batch of 2 arrive per second.Similarly 50 % of them belong to a batch of 1.So 8 × 0.5 = 4 packets in a batch of 1 arrive per second.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory147 / 195

Prep7:Q4

one input link and one output link. A transmission rate of1.2M bits per second. 1 packet can be stored. Packetsarrive in batches of 1 and 2 packets. The number of arrivingpackets is 8 packets per second. The ratio of each batch inthe arriving packets is shown in Table 1. Packet size is 600 Kbits.

Number ofpackets in abatch

average number of arrivingpackets belonging to the batch

average number of arriving packets1 1

22 1

2Table 1

Calculate q1, q2 and λ

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory148 / 195

Prep7:Q4one input link and one output link. A transmission rate of1.2M bits per second. 1 packet can be stored. Packetsarrive in batches of 1 and 2 packets. The number of arrivingpackets is 8 packets per second. The ratio of each batch inthe arriving packets is shown in Table 1. Packet size is 600 Kbits.Calculate q1, q2 and λq1 and q2 shall satisfy q1 + q2 = 1. The arrival rate ofpackets which belong to a batch of 2 is 2λ · q2 and 4packets in a batch of 2 arrive per second.

2λ · q2 = 4

Similarly

λ · q1 = 4

Thus we obtain q1 = 23 ,q2 = 1

3 , λ = 6Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory149 / 195

Prep7:Q5In a computer network there is a network node which hasone input link and one output link. The output link has atransmission rate of 1.2M bits per second. The networknode can store 1 packet. Packets arrive to the networknode in batches of 1 and 2 packets. The number of packetsper batch is independent and identically distributed. If abatch of packets does not fit into the system, none of thepackets of the batch joins the queue. The average numberof arriving packets is 8 packets per second. The ratio ofeach batch in the arriving packets is shown in Table 1. Theinterarrival time between batches is exponentiallydistributed. The packets have exponentially distributed sizewith a mean of 600 K bits.

Calculate the exponential service rate

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory150 / 195

Prep7:Q5

one input link and one output link. A transmission rate of1.2M bits per second. 1 packet can be stored. Packetsarrive in batches of 1 and 2 packets. The number of arrivingpackets is 8 packets per second. The ratio of each batch inthe arriving packets is shown in Table 1. Packet size is 600 Kbits.

Calculate the exponential service rate

Tout : the average time of a packet in the output link beingtransmitted is(packet length)/(transmission rate) = 600K/1.2M seconds.So the exponential service rate µ = 1/Tout = 1.2M/600K=2

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory151 / 195

Prep7:Q6

one input link and one output link. A transmission rate of1.2M bits per second. 1 packet can be stored. Packetsarrive in batches of 1 and 2 packets. The number of arrivingpackets is 8 packets per second. The ratio of each batch inthe arriving packets is shown in Table 1. Packet size is 600 Kbits.

Number ofpackets in abatch

average number of arrivingpackets belonging to the batch

average number of arriving packets1 1

22 1

2Table 1

Draw the state transition diagram

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory152 / 195

Prep7:Q6one input link and one output link. A transmission rate of1.2M bits per second. 1 packet can be stored. Packetsarrive in batches of 1 and 2 packets. The number of arrivingpackets is 8 packets per second. The ratio of each batch inthe arriving packets is shown in Table 1. Packet size is 600 Kbits. Draw the state transition diagram

λ · q2

λ · q1S0 S1 S2

µ µ

λλ · q1

λ·q

2

Si is the state where i packets exist in the network nodeFumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory153 / 195

Prep7:Q7

In a computer network there is a network node which hasone input link and one output link. The output link has atransmission rate of 1.2M bits per second. The networknode can store 1 packet. Packets arrive to the networknode in batches of 1 and 2 packets. The number of packetsper batch is independent and identically distributed. If abatch of packets does not fit into the system, none of thepackets of the batch joins the queue. The average numberof arriving packets is 8 packets per second. The ratio ofeach batch in the arriving packets is shown in Table 1. Theinterarrival time between batches is exponentiallydistributed. The packets have exponentially distributed sizewith a mean of 600 K bits.

List and solve the local balance equations

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory154 / 195

Prep7:Q7List and solve the local balance equations

λ · q2

λ · q1S0 S1 S2

µ µ

λλ · q1

λ·q

2λ · q1P0 + λ · q2P0 = µP1

λ · q1P1 + λ · q2P0 = µP2

P0 + P1 + P2 = 1

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory155 / 195

Prep7:Q7List and solve the local balance equations

λ · q2

λ · q1S0 S1 S2

µ µ

λλ · q1

λ·q

2

λ · q1P0 + λ · q2P0 = µP1

λ · q1P1 + λ · q2P0 = µP2

P0 + P1 + P2 = 1

When we solve the simultaneous equations with(λ,q1,q2, µ) = (6, 2/3, 1/3, 2)we obtain (P0,P1,P2) = (1/11, 3/11, 7/11)

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory156 / 195

Prep7:Q8

In a computer network there is a network node which hasone input link and one output link. The output link has atransmission rate of 1.2M bits per second. The networknode can store 1 packet. Packets arrive to the networknode in batches of 1 and 2 packets. The number of packetsper batch is independent and identically distributed. If abatch of packets does not fit into the system, none of thepackets of the batch joins the queue. The average numberof arriving packets is 8 packets per second. The ratio ofeach batch in the arriving packets is shown in Table 1. Theinterarrival time between batches is exponentiallydistributed. The packets have exponentially distributed sizewith a mean of 600 K bits.

Calculate the probability that the system is full

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory157 / 195

Prep7:Q8one input link and one output link. A transmission rate of1.2M bits per second. 1 packet can be stored. Packetsarrive in batches of 1 and 2 packets. The number of arrivingpackets is 8 packets per second. The ratio of each batch inthe arriving packets is shown in Table 1. Packet size is 600 Kbits.

Calculate the probability that the system is full

We’ve got (P0,P1,P2) = (1/11, 3/11, 7/11)

The probability that the system is full as seen by anindependent observer is simply P2 which is 7

11 , i.e., about 64percent.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory158 / 195

Prep7:Q9

In a computer network there is a network node which hasone input link and one output link. The output link has atransmission rate of 1.2M bits per second. The networknode can store 1 packet. Packets arrive to the networknode in batches of 1 and 2 packets. The number of packetsper batch is independent and identically distributed. If abatch of packets does not fit into the system, none of thepackets of the batch joins the queue. The average numberof arriving packets is 8 packets per second. The ratio ofeach batch in the arriving packets is shown in Table 1. Theinterarrival time between batches is exponentiallydistributed. The packets have exponentially distributed sizewith a mean of 600 K bits.

Calculate the average number of packets in the system

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory159 / 195

Prep7:Q9

one input link and one output link. A transmission rate of1.2M bits per second. 1 packet can be stored. Packetsarrive in batches of 1 and 2 packets. The number of arrivingpackets is 8 packets per second. The ratio of each batch inthe arriving packets is shown in Table 1. Packet size is 600 Kbits.

Calculate the average number of packets in the system

We’ve got (P0,P1,P2) = (1/11, 3/11, 7/11)

The average number of packets in the system is

1 · P1 + 2 · P2 = 1 · 311

+ 2 · 711

=1711' 1.5 packets at any time

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory160 / 195

Prep7:Q10

In a computer network there is a network node which hasone input link and one output link. The output link has atransmission rate of 1.2M bits per second. The networknode can store 1 packet. Packets arrive to the networknode in batches of 1 and 2 packets. The number of packetsper batch is independent and identically distributed. If abatch of packets does not fit into the system, none of thepackets of the batch joins the queue. The average numberof arriving packets is 8 packets per second. The ratio ofeach batch in the arriving packets is shown in Table 1. Theinterarrival time between batches is exponentiallydistributed. The packets have exponentially distributed sizewith a mean of 600 K bits.

Calculate the probability that batches of 1 are blocked

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory161 / 195

Prep7:Q10

Calculate the probability that batches of 1 are blockedλ · q2

λ · q1S0 S1 S2

µ µ

λλ · q1

λ·q

2We’ve got (P0,P1,P2) = (1/11, 3/11, 7/11)This happens only when the system is full. So the probabilityis P2, i.e., about 64 percent.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory162 / 195

Prep7:Q11

In a computer network there is a network node which hasone input link and one output link. The output link has atransmission rate of 1.2M bits per second. The networknode can store 1 packet. Packets arrive to the networknode in batches of 1 and 2 packets. The number of packetsper batch is independent and identically distributed. If abatch of packets does not fit into the system, none of thepackets of the batch joins the queue. The average numberof arriving packets is 8 packets per second. The ratio ofeach batch in the arriving packets is shown in Table 1. Theinterarrival time between batches is exponentiallydistributed. The packets have exponentially distributed sizewith a mean of 600 K bits.

Calculate the probability that batches of 2 are blocked

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory163 / 195

Prep7:Q11Calculate the probability that batches of 2 are blocked

λ · q2

λ · q1S0 S1 S2

µ µ

λλ · q1

λ·q

2We’ve got (P0,P1,P2) = (1/11, 3/11, 7/11)This happens when the system is full or one packet is in the

system. So the probability is P2 + P1 =7

11+

311

=1011

, i.e.,

about 91 percent.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory164 / 195

Prep7:Q12

In a computer network there is a network node which hasone input link and one output link. The output link has atransmission rate of 1.2M bits per second. The networknode can store 1 packet. Packets arrive to the networknode in batches of 1 and 2 packets. The number of packetsper batch is independent and identically distributed. If abatch of packets does not fit into the system, none of thepackets of the batch joins the queue. The average numberof arriving packets is 8 packets per second. The ratio ofeach batch in the arriving packets is shown in Table 1. Theinterarrival time between batches is exponentiallydistributed. The packets have exponentially distributed sizewith a mean of 600 K bits.

Calculate the probability that a random packet is blocked

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory165 / 195

Prep7:Q12Calculate the probability that a random packet is blockedλ · q2

λ · q1S0 S1 S2

µ µ

λλ · q1

λ·q

2

We’ve got (P0,P1,P2) = (1/11, 3/11, 7/11)An arriving packet in general belongs to batches 1 and 2with probability of 50 % each. So a random packet isblocked with the probability of50% × the probability of the batch of 1 being blocked +50% × the probability of the batch of 2 being blocked.

0.5 · 711

+ 0.5 · 1011

=1722

=' 77%

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory166 / 195

Prep7:Q13

In a computer network there is a network node which hasone input link and one output link. The output link has atransmission rate of 1.2M bits per second. The networknode can store 1 packet. Packets arrive to the networknode in batches of 1 and 2 packets. The number of packetsper batch is independent and identically distributed. If abatch of packets does not fit into the system, none of thepackets of the batch joins the queue. The average numberof arriving packets is 8 packets per second. The ratio ofeach batch in the arriving packets is shown in Table 1. Theinterarrival time between batches is exponentiallydistributed. The packets have exponentially distributed sizewith a mean of 600 K bits.

Calculate the effective arrival rate of packets

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory167 / 195

Prep7:Q13Calculate the effective arrival rate of packetsλ · q2

λ · q1S0 S1 S2

µ µ

λλ · q1

λ·q

2

We’ve got (P0,P1,P2) = (1/11, 3/11, 7/11)The effective arrival rate is the rate at which packets enterthe system.In the state diagram packets depart from the state S0 withthe rate of λ · q1 and λ · q2 and 2 packets move from S0 toS2. Packets depart from the state S1 with the rate of λG · q1.The effective arrival rate of packets is

P0 · (1 · λ · q1 + 2 · λ · q2) + P1 · 1 · λ · q1 = 20/11 ' 1.8 packetsFumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory168 / 195

Prep7:Q14

In a computer network there is a network node which hasone input link and one output link. The output link has atransmission rate of 1.2M bits per second. The networknode can store 1 packet. Packets arrive to the networknode in batches of 1 and 2 packets. The number of packetsper batch is independent and identically distributed. If abatch of packets does not fit into the system, none of thepackets of the batch joins the queue. The average numberof arriving packets is 8 packets per second. The ratio ofeach batch in the arriving packets is shown in Table 1. Theinterarrival time between batches is exponentiallydistributed. The packets have exponentially distributed sizewith a mean of 600 K bits.

Calculate the time a packet is in the system in average

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory169 / 195

Prep7:Q14

Calculate the time a packet is in the system in average

The rate at which packets enter the system ( = the effectivearrival rate ) is 20/11 which is the arrival rate for Little’s Law.N for Little’s Law is the average number of packets in thesystem which is 17/11(Prep7:Q9)

Asnumber of packets in the system = arrival rate × time in thesystemT = (number of packets in the system)/(arrival rate) =(17/11)/(20/11) = 17/20 seconds

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory170 / 195

Prep7:Q15

In a computer network there is a network node which hasone input link and one output link. The output link has atransmission rate of 1.2M bits per second. The networknode can store 1 packet. Packets arrive to the networknode in batches of 1 and 2 packets. The number of packetsper batch is independent and identically distributed. If abatch of packets does not fit into the system, none of thepackets of the batch joins the queue. The average numberof arriving packets is 8 packets per second. The ratio ofeach batch in the arriving packets is shown in Table 1. Theinterarrival time between batches is exponentiallydistributed. The packets have exponentially distributed sizewith a mean of 600 K bits.

Calculate the average waiting time

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory171 / 195

Prep7:Q15one input link and one output link. A transmission rate of1.2M bits per second. 1 packet can be stored. Packetsarrive in batches of 1 and 2 packets. The number of arrivingpackets is 8 packets per second. The ratio of each batch inthe arriving packets is shown in Table 1. Packet size is 600 Kbits.

Calculate the average waiting time

The time in the system is 17/20 seconds.The average time of a packet in the output link beingtransmitted is 1/2 seconds(Prep7:Q5)

The average waiting time is (the time in the system )− (theaverage time of a packet in the output link). So

1720− 1

2=

720

secondsFumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory172 / 195

Prep8:Q1

In a computer network there is a network node which hasone input link and two output links. The output link has atransmission rate of 1M bits per second. The network nodecan store infinite number of packets. Packets arrive to thenetwork node per second in Poisson fashion with arrivalevent rate of λ. The packets have exponentially distributedsize with a mean of 500 K bits.

When the total time for a packet in the system is 0.8seconds, how many packets per second can be handled ?

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory173 / 195

Prep8:Q1one input link and two output links. A transmission rate of1M bits per second. The number of arriving packets is λpackets per second. Packet size is 500 K bits.

When the total time for a packet in the system is 0.8seconds, how many packets per second can be handled ?

This is M/M/2 problem. From the formula table for M/M/2,the average time in the system is T = 1

µ

(1−( λ

2µ)2) . T is given

as 0.8 seconds. We need to find µ.Tout : the average time of a packet in the output link beingtransmitted is(packet length)/(transmission rate) = 500K/1M seconds.So the exponential service rate µ = 1/Tout = 1M/500K=2

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory174 / 195

Prep8:Q1one input link and two output links. A transmission rate of1M bits per second. The number of arriving packets is λpackets per second. Packet size is 500 K bits.

When the total time for a packet in the system is 0.8seconds, how many packets per second can be handled ?

This is M/M/2 problem. From the formula table for M/M/2,the average time in the system is T = 1

µ

(1−( λ

2µ)2) . T is given

as 0.8 seconds. The exponential service rate µ = 1/Tout =1M/500K=2

∴ λ = 2µ

√1− 1

T · µ =√

6 packets per second can be handled

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory175 / 195

Prep8:Q2

In a computer network there is a network node which hasone input link and two output links. The output link has atransmission rate of 1M bits per second. The network nodecan store infinite number of packets. Packets arrive to thenetwork node per second in Poisson fashion with arrivalevent rate of λ. The packets have exponentially distributedsize with a mean of 500 K bits.

What is the probability of both output lines being busy ?

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory176 / 195

Prep8:Q2In a computer network there is a network node which hasone input link and two output links. The output link has atransmission rate of 1M bits per second. The network nodecan store infinite number of packets. Packets arrive to thenetwork node per second in Poisson fashion with arrivalevent rate of λ. The packets have exponentially distributedsize with a mean of 500 K bits.

What is the probability of both output lines being busy ?

The probability of both output lines being busy isP2 + P3 + P4 + · · ·+ P∞ = 1− P0 − P1

From the figure of steady state probability for M/M/2,

P0 =1− λ

1 + λ2µ

; P1 =λ

µ·

1− λ2µ

1 + λ2µ

;∴ 1− P0 − P1 =3

4 +√

6' 0.47

So the probability of both output lines being busy is 47 %Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory177 / 195

Prep9:Q1

In a computer network there is a network node which hasone input link and three output links. The output link has atransmission rate of 0.6M bits per second. The networknode can not store packets. Packets arrive to the networknode per second in Poisson fashion with arrival event rateof 20. The packets have exponentially distributed size witha mean of 300 K bits.

Draw the state diagram

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory178 / 195

Prep9:Q1

In a computer network there is a network node which hasone input link and three output links. The output link has atransmission rate of 0.6M bits per second. The networknode can not store packets. Packets arrive to the networknode per second in Poisson fashion with arrival event rateof 20. The packets have exponentially distributed size witha mean of 300 K bits.

Draw the state diagram

I Poisson arrivals with rate λ = 20 packets per secondI What about the exponential service rate ?

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory179 / 195

Prep9:Q1

one input link and three output links. A transmission rate of0.6M bits per second. The number of arriving packets is 20packets per second. Packet size is 300 K bits.

Draw the state diagram

I Poisson arrivals with rate λ = 20 packets per secondI Tout : the average time of a packet in the output link

being transmitted is(packet length)/(transmission rate) = 300K/0.6Mseconds.So the exponential service rate µ = 1/Tout = 0.6M/300K=2

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory180 / 195

Prep9:Q1one input link and three output links. A transmission rate of0.6M bits per second. The number of arriving packets is 20packets per second. Packet size is 300 K bits.

Draw the state diagram

S0 S1 S2 S3

λ

3µ2µµ

λ λ

where A state S defines the number of packets in thesystem and λ = 20, µ = 2

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory181 / 195

Prep9:Q2

In a computer network there is a network node which hasone input link and three output links. The output link has atransmission rate of 0.6M bits per second. The networknode can not store packets. Packets arrive to the networknode per second in Poisson fashion with arrival event rateof 20. The packets have exponentially distributed size witha mean of 300 K bits.

Determine the probability of a packet to be blocked

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory182 / 195

Prep9:Q2Determine the probability of a packet to be blocked

S0 S1 S2 S3

λ

3µ2µµ

λ λ

The local balance equations:Yellow line: λP0 = µP1; Orange: λP1 = 2µP2; Pink: λP2 = 3µP3

P0 + P1 + P2 + P3 = P0 +λ

µP0 +

λ

2µλ

µP0 +

λ

3µλ

2µλ

µP0 = 1

∴ P0 =1

1 + λµ+ λ2

2µ2 +λ3

3·2·µ3

P3 = λ3µ

λ2µ

λµP0 = 500

683 ' 73%Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory183 / 195

Prep9:Q3

In a computer network there is a network node which hasone input link and three output links. The output link has atransmission rate of 0.6M bits per second. The networknode can not store packets. Packets arrive to the networknode per second in Poisson fashion with arrival event rateof 20. The packets have exponentially distributed size witha mean of 300 K bits.

How many packets are blocked per second ?

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory184 / 195

Prep9:Q3

In a computer network there is a network node which hasone input link and three output links. The output link has atransmission rate of 0.6M bits per second. The networknode can not store packets. Packets arrive to the networknode per second in Poisson fashion with arrival event rateof 20. The packets have exponentially distributed size witha mean of 300 K bits.

How many packets are blocked per second ?

Arrival rate × blocking probability = λ · P3 = 20 · 500683 ' 15

packets per second.

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory185 / 195

Prep10:Q1

In a computer network there is a network node which hastwo input links and three output links. One output link isreserved for one particular input link and the rest of twooutput links are available to packets from both input links.All packets arrive to the network node according to aPoisson process with rate λp = 125 packets per second forthe packets from the particular input link and λo = 50packets per second for the packets from the other ordinaryinput link. Each output link has a transmission rate of 9Mbits per second. The network node can not store packets.The packets have exponentially distributed size with amean of 300K bits.

Draw the state diagram

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory186 / 195

Prep10:Q1one particular input link and another ordinary input link. 1output link only for the particular input link and 2 otheroutput links. λp = 125, λo = 50. output link 9M bits/s.message size 300K bits

Draw the state diagram

I Poisson arrivals with rate λp = 125 packets from theparticular input link

I Poisson arrivals with rate λo = 50 packets from theordinary input link

I Tout : the average time of a packet in the output linkbeing transmitted is(packet length)/(transmission rate) = 300K/9M seconds.So the exponential service rate µ = 1/Tout = 9M/300K=30

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory187 / 195

Prep10:Q1one particular input link and another ordinary input link. 1output link only for the particular input link and 2 otheroutput links. λp = 125, λo = 50. output link 9M bits/s.message size 300K bits

Draw the state diagram

λp + λoλp + λoS3S2S1S0

3µ2µ

λp + λo λp

λo

µ

A state S defines the number of packets in the system.λp = 125, λo = 50, µ = 30

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory188 / 195

Prep10:Q2In a computer network there is a network node which hastwo input links and three output links. One output link isreserved for one particular input link and the rest of twooutput links are available to packets from both input links.All packets arrive to the network node according to aPoisson process with rate λp = 125 packets per second forthe packets from the particular input link and λo = 50packets per second for the packets from the other ordinaryinput link. Each output link has a transmission rate of 9Mbits per second. The network node can not store packets.The packets have exponentially distributed size with amean of 300K bits.

Determine the probability of packets from the particularinput link to be blocked

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory189 / 195

Prep10:Q2Determine the probability of packets from the particularinput link to be blocked

λp + λoλp + λoS3S2S1S0

3µ2µ

λp + λo λp

λo

µ

Production of the local balance equations:Yellow line: (λp + λo)P0 = µP1

Orange: (λp + λo)P1 = 2µP2Pink: λpP2 = 3µP3and P0 + P1 + P2 + P3 = 1

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory190 / 195

Prep10:Q2Determine the probability of packets from the particularinput link to be blocked

λp + λoλp + λoS3S2S1S0

3µ2µ

λp + λo λp

λo

µ

Solution of the local balance equations:

P0 =1

1 + λp+λoµ

+ (λp+λo)2

2µ2 + λp(λp+λo)2

3·2·µ3

At S3, the packets from

the particular input line are blocked.

P3 =λp(λp + λo)

2

3 · 2 · µ3 P0 = 0.497717

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory191 / 195

Prep10:Q3

In a computer network there is a network node which hastwo input links and three output links. One output link isreserved for one particular input link and the rest of twooutput links are available to packets from both input links.All packets arrive to the network node according to aPoisson process with rate λp = 125 packets per second forthe packets from the particular input link and λo = 50packets per second for the packets from the other ordinaryinput link. Each output link has a transmission rate of 9Mbits per second. The network node can not store packets.The packets have exponentially distributed size with amean of 300K bits.

Determine the probability of packets from the ordinaryinput link to be blocked

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory192 / 195

Prep10:Q3Determine the probability of packets from the ordinaryinput link to be blocked

λp + λoλp + λoS3S2S1S0

3µ2µ

λp + λo λp

λo

µ

Solution of the local balance equations:

P0 =1

1 + λp+λoµ

+ (λp+λo)2

2µ2 + λp(λp+λo)2

3·2·µ3

At S3 and S2, the packets

from the ordinary input line are blocked.

P2 + P3 = 1− P0 − P1 = 1− P0 −λp + λo

µP0 = 1− 41

6P0 ' 0.856073

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory193 / 195

Prep10:Q4

In a computer network there is a network node which hastwo input links and three output links. One output link isreserved for one particular input link and the rest of twooutput links are available to packets from both input links.All packets arrive to the network node according to aPoisson process with rate λp = 125 packets per second forthe packets from the particular input link and λo = 50packets per second for the packets from the other ordinaryinput link. Each output link has a transmission rate of 9Mbits per second. The network node can not store packets.The packets have exponentially distributed size with amean of 300K bits.

Determine the average number of packets in the system

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory194 / 195

Prep10:Q4one particular input link and another ordinary input link. 1output link only for the particular input link and 2 otheroutput links. λp = 125, λo = 50. output link 9M bits/s.message size 300K bitsDetermine the average number of packets in the system

λp + λoλp + λoS3S2S1S0

3µ2µ

λp + λo λp

λo

µ

We can calculate the average number of packets in thesystem:1 · P1 + 2 · P2 + 3 · P3 = 3− 2281

72 P0 = 2.33273 packets in thesystem in average ∵ P1 + 2P2 + 3(1 − P0 − P1 − P2) = 3 − P0 − 2P1 − P2 =

3 − P0 − 2λp+λoµ

P0 −(λp+λo)

2

2µ2 P0 = 3 − 228172 P0

Fumie Costen, Peter N Green fumie.costen@manchester.ac.uk http://staff.cs.manchester.ac.uk/˜fumie/ () Queuing Theory195 / 195

top related