Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks

Queuing Networks

Florence Perronnin

Polytech’Grenoble - UGA

March 23, 2017

F. Perronnin (UGA) Queuing Networks March 23, 2017 1 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Outline

1 Introduction to Queuing Networks

2 Refresher: M/M/1 queue

3 Reversibility

4 Open Queueing Networks

5 Closed queueing networks

6 Multiclass networks

7 Other product-form networks

F. Perronnin (UGA) Queuing Networks March 23, 2017 2 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Introduction to Queuing Networks

Single queues have simple results They are quite robust to slight model variations We may have multiple contention resources to model:

I servers I communication links I databases with various routing structures. Queuing networks are direct results for interaction of classical single queues with probabilistic or static routing.

F. Perronnin (UGA) Queuing Networks March 23, 2017 3 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Outline

1 Introduction to Queuing Networks

2 Refresher: M/M/1 queue

3 Reversibility

4 Open Queueing Networks

5 Closed queueing networks

6 Multiclass networks

7 Other product-form networks

F. Perronnin (UGA) Queuing Networks March 23, 2017 4 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Refresher: M/M/1

 Infinite capacity  λµ   Poisson(λ) arrivals Exp(µ) service times M/M/1 queue FIFO discipline Definition λ ρ = µ is the traffic intensity of the queueing system.

λ λ λ λ λλ

i−1 i+1 . .. 0 1 ... i

µ µ µ µµ µ

Number of clients X (t) in the system follows a birth and death process.

F. Perronnin (UGA) Queuing Networks March 23, 2017 5 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Results for M/M/1 queue

1 Stable if and only if ρ < 1 i 2 Clients follow a geometric distribution ∀i ∈ N, πi = (1 − ρ)ρ ρ 3 E Mean number of clients [X ] = (1−ρ)

4 E 1 Average response time [T ] = µ−λ

1000 response time M/M/1 900

800

700

600

500

400 response time 300

200

100

0 0 0.2 0.4 0.6 0.8 1 traffic load

F. Perronnin (UGA) Queuing Networks March 23, 2017 6 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks M/M/1/K In reality, buffers are finite: M/M/1/K is a queueing system with blocking.

λµ

K

λ λ λ λ

K−1 0 1 ... K

µ µ µ µ

Results for M/M/1/K queue Geometric distribution with finite state space

(1 − ρ)ρi π(i) = 1 − ρK+1

F. Perronnin (UGA) Queuing Networks March 23, 2017 7 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks M/M/c

1 µ λ λ λ λ λ 2 µ i c c . . . c . . iµ cµ cµ cµ c µ

Results for M/M/c queue Stability condition λ < cµ. λ where ρ = µ and with ( ρi Cρ,c i! if i ≤ c 1 π(i) = i 1 ρ  Cρ,c = i c Cρ,c c! c if i > c Pc−1 ρ ρ 1 i=0 i! + c! 1−ρ/c

F. Perronnin (UGA) Queuing Networks March 23, 2017 8 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks

F. Perronnin (UGA) Queuing Networks March 23, 2017 9 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Outline

1 Introduction to Queuing Networks

2 Refresher: M/M/1 queue

3 Reversibility

4 Open Queueing Networks

5 Closed queueing networks

6 Multiclass networks

7 Other product-form networks

F. Perronnin (UGA) Queuing Networks March 23, 2017 10 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Reversibility

Definition A continuous-time Markov chain X (t) is time-reversible if and only if there 2 exist a probability distribution π such that ∀(i, j) ∈ E , πi qij = πj qji

Theorem the π distribution is also the stationary distribution.

Proof Check the balance equations.

F. Perronnin (UGA) Queuing Networks March 23, 2017 11 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Reversibility

Proposition An ergodic birth and death process is time-reversible.

Proof

λ λi−1 λi λi+1 λ0 λ1 i−2

i−1 i+1 . .. 0 1 ... i

µ µ µ µi+2 µ1 µ2 i−1 i i+1

By induction:

1 π0λ0 = π1µ1

2 Suppose πi−1λi−1 = πi µi . Then πi (λi + µi ) = πi+1µi+1 + πi−1λi−1 Which gives πi λi = πi+1µi+1.

F. Perronnin (UGA) Queuing Networks March 23, 2017 12 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Burke’s theorem

Theorem The output process of an M/M/s queue is a Poisson process that is independent of the number of customers in the queue.

Sketch of Proof.

λ

i i+1

µ

X (t) increases by 1 at rate λπi (Poisson process λ). Reverse process increases by 1 at rate µπi+1= λπi by reversibility.

F. Perronnin (UGA) Queuing Networks March 23, 2017 13 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Outline

1 Introduction to Queuing Networks

2 Refresher: M/M/1 queue

3 Reversibility

4 Open Queueing Networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues

5 Closed queueing networks

6 Multiclass networks

7 OtherF. Perronnin product-form (UGA) networks Queuing Networks March 23, 2017 14 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Tandem queues

    λ  µ  µ  1  2

Let X1 and X2 denote the number of clients in queues 1 and 2 respectively. Lemma

X1 and X2 are independent rv’s.

Proof Arrival process at queue 1 is Poisson(λ) so future arrivals are independent of X1(t). By time reversibility X1(t) is independent of past departures. Since these departures are the arrival process of queue 2, X1(t) and X2(t) are independent.

F. Perronnin (UGA) Queuing Networks March 23, 2017 15 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Tandem queues

Theorem The number of clients at server 1 and 2 are independent and

 λ n1  λ   λ n2  λ  P(n1, n2) = 1 − 1 − µ1 µ1 µ2 µ1

Proof

By independence of X1 and X2 the joint probability is the product of M/M/1 distributions.

This result is called a product-form result for the tandem queue. This product form also appears in more general networks of queues.

F. Perronnin (UGA) Queuing Networks March 23, 2017 16 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Acyclic networks Example of a feed-forward network:

0 0 λi  λk     pik   µi  µk  p pk0 il pi0 0 0 jk λl   λj  p       µl  µj    p jl pl0 pj0 Exponential service times Routing matrix: output of i is routed to j with   0 pij pik pil probability pij  pji 0 pjk pjl  external traffic arrives at i with rate λ0 R =   i  pki pkj 0 pjl  packets exiting queue i leave the system pli plj plk 0 with probability pi0.

F. Perronnin (UGA) Queuing Networks March 23, 2017 17 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Decomposition of a Poisson Process

Problem N(t) Poisson process with rate λ Z(n) sequence of iid rv’s ∼ Bernoulli(p) independent of N. Suppose the nth trial is performed at the nth arrival of the Poisson process.

Result

Resulting process M(t) Poisson(λ) p of successes is Bernoulli Poisson(λp) Poisson(λp). 1−p Process of failures L(t) is Poissonλ(1 − p) and Poisson(λ(1 − p)) is independent of M(t).

F. Perronnin (UGA) Queuing Networks March 23, 2017 18 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Acyclic networks

0 0 λi  λk     pik   µi  µk Total arrival rate at node i: λ  p pk0 i il pi0 (1 ≤ i ≤ K). λ0 0 jk l   λj  p       µl  µj    p jl pl0 pj0 No feedback: using Burke theorem, all internal flows are Poisson! Thus we can consider K independent M/M/1 queues with Poisson arrivals with rate λi , where K 0 X 0 λi = λi + λj pji i.e. ~Λ = ~Λ + ~ΛR in matrix notation. j=0

Stability condition

All queues must be stable independently: λi < µi , ∀i = 1, 2,..., K.

F. Perronnin (UGA) Queuing Networks March 23, 2017 19 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Backfeeding

Example Switch transmitting frames with random errors. A NACK is sent instantaneously if the frame is incorrect. Frame success probability is p. Arrivals ∼ Poisson(λ0) Frame transmission times ∼ Exp (µ)

 0  p λ  µ 

1−p

F. Perronnin (UGA) Queuing Networks March 23, 2017 20 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Backfeeding

 0  p λ  µ 

1−p

Remark Arrivals are not Poisson anymore!

Result The departure process is still Poisson with rate λp.

Proof in [Walrand, An Introduction to Queueing Networks, 1988].

F. Perronnin (UGA) Queuing Networks March 23, 2017 21 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Backfeeding: steady-state

 0  p λ  µ 

1−p Balance equations: π(0)λ0 = µpπ(1) π(n)(λ0 + pµ) = λ0π(n − 1) + µpπ(n + 1), n > 0 Actual arrival rate λ = λ0 + (1 − p)λ, so λ0 = λp which gives π(0)λ = µπ(1) π(n)(λ + µ) = λπ(n − 1) + µπ(n + 1), n > 0 M/M/1! The unique solution is:  λ λn  λ0   λ0 n π(n)= 1 − = 1 − µ µ pµ pµ

F. Perronnin (UGA) Queuing Networks March 23, 2017 22 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Jackson networks: example

0 0 λi  λk   p   µi ik  µk   p pi0 k0 pjk pji pii λ0 0 p l   λj  il     µ  µj  l  pjl   pl0 pj0 pjj plj

Backfeeding allowed.

F. Perronnin (UGA) Queuing Networks March 23, 2017 23 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Jackson networks

Theorem (Jackson, 1957)

If λi < µi (stability condition), ∀i = 1, 2,... K then

K    ni Y λi λi K π(n~) = 1 − ∀n~ = (n1,..., nK ) ∈ N . µi µi i=1

where λ1, . . . , λK are the unique solution of the system

K 0 X λi = λi + λj pji j=0

Product form even with backfeeding!

F. Perronnin (UGA) Queuing Networks March 23, 2017 24 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Jackson networks: sketch of proof

Derive balance equations:

K K ! K X 0 X 1 X 1 0 π(n~) λi + [ni >0]µi = [ni >0]λi π(n~ − e~i ) i=1 i=1 i=1 K X + pi0µi π(n~ + e~i ) i=1 K K X X + 1 pij µi π(n~ + e~i − e~j ) [nj >0] i=1 j=1

K    ni Y λi λi Then check that π(n~) = 1 − satisfies the balance µi µi i=1 0 PK equations with λi = λi + j=0 λj pji .

F. Perronnin (UGA) Queuing Networks March 23, 2017 25 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Jackson networks: example

Example Switches transmitting frames with random errors.

server 1 server 2 server K   0    λ     p  µ µ .. . µ   

1−p

0 Traffic equations give λi = λi−1 for i ≥ 2 and λ1 = λ + (1 − p)λK .The λ0 unique solution is clearly λi = p for 1 ≤ i ≤ K. Apply Jackson’s theorem:

 λ0 K  λ0 n1+...+nK π(n~) = 1 − ∀n~ = (n ,..., n ) ∈ NK . pµ pµ 1 K

F. Perronnin (UGA) Queuing Networks March 23, 2017 26 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Jackson networks: example (Continued)

Example Switches transmitting frames with random errors.

server 1 server 2 server K   0    λ     p  µ µ .. . µ   

1−p

Using M/M/1 results for each queue we get the mean number of frames E λ0 at each queue [Xi ] = pµ−λ0 The expected transmission time of a frame is therefore (Little)

K 1 1 X K E [T ] = E [X ] = E [X ] = λ0 λ0 i pµ − λ0 i=1

F. Perronnin (UGA) Queuing Networks March 23, 2017 27 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Tandem queues Acyclic networks Backfeeding Jackson networks Open networks of M/M/c queues Networks of M/M/c queues

Theorem

Consider an open network of K M/M/ci queues. Let µi (n) = µi min(n, ci ) µi and ρi = . λi Then if ρi < ci for all 1 ≤ i ≤ K then

K n Y  λ i  π(n~) = C i ∀n~ = (n ,..., n ) ∈ NK i Qni 1 K µi (m) i=1 m=1

where (λ1, . . . , λK ) is the unique positive solution of the traffic equations

−1 K ci −1 ci ! 0 X X ρi ρi λi = λi + λj pji , and where Ci = + i! ci !(1 − ρi /ci ) j=0 m=1

F. Perronnin (UGA) Queuing Networks March 23, 2017 28 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Outline

1 Introduction to Queuing Networks

2 Refresher: M/M/1 queue

3 Reversibility

4 Open Queueing Networks

5 Closed queueing networks

6 Multiclass networks

7 Other product-form networks

F. Perronnin (UGA) Queuing Networks March 23, 2017 29 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Closed Queueing Networks Definition A closed system is a system in which the number of clients is a constant variable.

Example

   µ  1

    µ   2  

The traffic equations are linearly dependent!

K X λi = λj pji , 1 ≤ i ≤ K j=0

Therefore the previous Jackson theorem cannot be applied and does not yield the correct result. F. Perronnin (UGA) Queuing Networks March 23, 2017 30 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Jackson theorem for closed networks

Consider a closed queueing system with K queues and N clients. K Define by S(N, K) the set of vectors n~ = (n1,... nk ) ∈ N such that n1 + ... + nK = N. Theorem (Closed Jackson networks)

Let (λ1, . . . , λK ) be an arbitrary non-zero solution of the traffic equation PK λi = j=0 λj pji , 1 ≤ i ≤ K. Then for all n~ ∈ S(N, K),

K  ni K  ni 1 Y λi X Y λi π(n~) = , C(N, K) = C(N, K) µi µi i=1 n~∈S(N,K) i=1

Not a product-form!

F. Perronnin (UGA) Queuing Networks March 23, 2017 31 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Performance indexes

A typical performance metric is the expected queue length E [Xi ] at node i. Expected queue length N  k X λi C(N − k, K) E [Xi ] = µi C(N, K) k=1

Sketch of Proof: N E P For a −valued r.v we have: [Xi ] = k≥1 P(Xi ≥ k) X X P(Xi ≥ k) = π(n~) = ...

n~∈S(N,K),ni ≥k n~∈S(N,K),ni ≥k λ k C(N − k, K) = i (1) µi C(N, K)

F. Perronnin (UGA) Queuing Networks March 23, 2017 32 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Performance indexes

One may also be interested in the utilization at node i, i.e. the probability that node i is non-empty. Utilization

λi C(N − K, K) Ui = 1 − P(Xi = 0) = µi C(N, K)

Proof

Note that P(Xi = k) = P(Xi ≥ k) − P(Xi ≥ k − 1) and apply (1) with k = 0.

F. Perronnin (UGA) Queuing Networks March 23, 2017 33 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Convolution algorithm

Computing the normalization factor C(N, K) is a heavy task!

k  ni n k  ni X Y λi X X Y λi C(n, k) = = µi µi n~∈S(n,k) i=1 m=0 n~ ∈ S(n, k) i=1 nk = m

n  m k−1  ni X λk X Y λi = µk µi m=0 n~∈S(n−m,k−1) i=1

Convolution algorithm (Buzen,1973)

n n  m (  λ  X λk C(n, 1) = 1 C(n, k) = C(k−m, k−1) and µ1 µ m=0 k C(0, k) = 1, ∀1 ≤ i ≤ K

F. Perronnin (UGA) Queuing Networks March 23, 2017 34 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Outline

1 Introduction to Queuing Networks

2 Refresher: M/M/1 queue

3 Reversibility

4 Open Queueing Networks

5 Closed queueing networks

6 Multiclass networks

7 Other product-form networks

F. Perronnin (UGA) Queuing Networks March 23, 2017 35 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Multiclass Networks Definition

0 λi,1    p(i,1)→0 p   µ (i,1)→(k,1)  µ p  i  k (k,1)→0

p(j,2)→(i,1) p(i,1)→(l,2)

0   p λj,1   (l,2)→0  p(j,2)→(l,2)   µ  µ  l  j   p(j,1)→(l,2)

p(l,2)→(j,2)

F. Perronnin (UGA) Queuing Networks March 23, 2017 36 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Multiclass Networks Definition

K < ∞ nodes and R < ∞ classes Customer at node i in class r will go to node j with class s with probability p(i,r);(j,s)

(i, r) and (j, s) belong to the same subchain if p(i,r);(j,s) > 0 FIFO discipline and exponential service times

Definition 0 A subchain is open iff there exist one pair (i, r) for which λ(i,r) > 0.

Definition A mixed system contains at least one open subchain and one closed subchain.

F. Perronnin (UGA) Queuing Networks March 23, 2017 37 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Multiclass Networks Definition

The state of a multiclass network may be characterized by the number of customers of each class at each node ~ ~ ~ ~ ~ Q(t) = (Q1(t), Q2(t),..., QK (t)) with Qi (t) = (Qi1(t)),..., QiR(t))

Problem Q~ (t) is not a CMTC!

To see why, consider the FIFO discipline: how do you know the class of the next customer?

F. Perronnin (UGA) Queuing Networks March 23, 2017 38 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks Multiclass Networks Definition

~ Define Xi (t) = (Ii1(t),..., IiQi (t)(t)) with Iij (t) the class of the jth customer at node i. Proposition X~ (t) is a CMTC!

Solving the balance equations for X gives a product-form solution. The steady-state distribution of X~ (t) also gives the distribution of Q~ (t) by aggregation of states.

F. Perronnin (UGA) Queuing Networks March 23, 2017 39 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks BCMP networks Outline

1 Introduction to Queuing Networks

2 Refresher: M/M/1 queue

3 Reversibility

4 Open Queueing Networks

5 Closed queueing networks

6 Multiclass networks

7 Other product-form networks Other service disciplines BCMP networks

F. Perronnin (UGA) Queuing Networks March 23, 2017 40 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks BCMP networks Other queueing networks Limitations of Jackson networks

Jackson networks imply FIFO discipline probabilistic routing These assumptions can be relaxed using BCMP and Kelly networks.

F. Perronnin (UGA) Queuing Networks March 23, 2017 41 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks BCMP networks BCMP networks [Baskett, Chandy, Muntz and Palacios 1975]

Definition BCMP networks are multiclass networks with exponential service times and ci servers at node i. Service disciplines may be: FCFS Infinite Server LCFS BCMP networks also have product-form solution!

F. Perronnin (UGA) Queuing Networks March 23, 2017 42 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks BCMP networks BCMP networks Definitions

Consider an open/closed/mixed BCMP network with K nodes and R classes in which each node is either FIFO,PS,LIFO or IS. Define

λir ρir = for LIFO, IS and PS nodes µir λir ρir = for FIFO nodes µi 0 X λir = λir + λjs p(i,r);(j,s) for any (i, r) of each open subchain Ek

(j,s)∈Ek X λir = λjs p(i,r);(j,s) for any (i, r) of each closed subchain Em

(j,s)∈Em

F. Perronnin (UGA) Queuing Networks March 23, 2017 43 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks BCMP networks BCMP networks Main result

Theorem The steady-state distribution is given by: for all n~ in state space S,

K K 1 Y X Y π(n~) = f (n~ ) with G = f (n~ ) G i i i i i=1 n~∈S i=1

with n~ = (n~1,..., n~K ) ∈ S and n~i = (ni1,..., niR ), if and only if (stability X condition for open subchains) ρir < 1, ∀1 ≤ i ≤ K.

r:(i,r)∈ any open Ek

Moreover, fi (n~i ) has an explicit expression for each service discipline.

F. Perronnin (UGA) Queuing Networks March 23, 2017 44 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks BCMP networks BCMP networks Main result

|ni | R nir Y 1 Y ρir FIFO fi (n~i ) = |ni |! with αj (j) = min(ci , j). αi (j) nir ! j=1 r=1 R n Y ρ ir PS or LIFO f (n~ ) = |n |! ir i i i n ! r=1 ir R n Y ρ ir IS f (n~ ) = ir i i n ! r=1 ir

F. Perronnin (UGA) Queuing Networks March 23, 2017 45 / 46 Intro Refresher Reversibility Open networks Closed networks Multiclass networks Other networks BCMP networks Extensions

the BCMP product form result may be extended to the following cases: state-dependent routing probabilities arrivals depending on the number of customers in the corresponding subchain

F. Perronnin (UGA) Queuing Networks March 23, 2017 46 / 46