introduction to network performance and queuing theory
TRANSCRIPT
Introduction to Markov Chains, Queuing Theory,
and Network Performance
Marceau Coupechoux
Telecom ParisTech, departement Informatique et Reseaux
IT.2403 Modelisation et Performance des Reseaux
February 8, 2011
Outlines
1. Network Performance
2. Mathematical Background
3. Markov Chains
4. Formalism of Queuing Theory
5. Simple Queues
6. Erlang B and C laws
7. Networks of Queues
51
Formalism of Queuing Theory
1. Arrival process and service time
2. Buffer mechanism
3. Kendall notation
4. Multi-class queues
5. Networks of queues
6. Performance parameters
7. Stability
8. Little law
9. Distributions at arrival and departure instants
52
Formalism of Queuing Theory
Simple Queue
customers
Arrival process
Buffer
ServerDeparture of
Arrivals
• How do customers arrive ?
• Example: the inter-arrival times are constant
• Simple case: the inter-arrival times between customers are iid random variables
• Poisson arrivals: inter-arrival times are exponentially distributed
53
Formalism of Queuing Theory
Simple Queue
customers
Arrival process
Buffer
ServerDeparture of
Service time
• How are customers served ?
• Are there more than one server ?
• How much time will the service take (service time distribution) ?
• Simple case: service times are iid random variables
• Exponential service: service time is exponentially distributed
54
Formalism of Queuing Theory
Simple Queue
customers
Arrival process
Buffer
ServerDeparture of
Buffer mechanism
• How customers are stacked in the buffer and how customers are taken out of the bufferby the server
• FIFO: first in first out = FCFS : first come first served
• LIFO: last in first out
• RANDOM
• Round Robin: cyclic mechanism
• etc
55
Formalism of Queuing Theory
Simple Queue
customers
Arrival process
Buffer
ServerDeparture of
Kendall notation
• Queue A/B/C/K/m/Z
• A: inter-arrival distribution
• B: service distribution
• C: number of servers
• K: buffer capacity (default ∞)
• m: customer population (default ∞)
• Z: buffer mechanism (default FIFO)
56
Formalism of Queuing Theory
Simple Queue
customers
Arrival process
Buffer
ServerDeparture of
A and B distributions can be :
• M: exponential
• G: generic
• D: constant
• Ek: Erlang-k
• Hk: Hyperexponential-k
• Ck: Cox-k
• etc
57
Formalism of Queuing Theory
Multi-class queues
• Customers of different classes can experience different arrival process, or service times...
Service distribution 2
Arrival process 1
Arrival process 2
Service distribution 1
58
Formalism of Queuing Theory
Network of queues
• Several connected simple queues
• Open networks: customers can leave the system and are coming from the outside
p12
1
2
3p01
p02
p13
p23 p20
• Closed networks: finite population, customers can’t leave the system
3
1
2
59
Formalism of Queuing Theory
Packet network
• Is modeled by a network of queues
• A network node: arrival buffer + processing time + sending buffers
• A transmission link: transmission time + propagation time
Transmission
...
...
Reception buffer
Processing
Sending buffer
Propagation
60
Formalism of Queuing Theory
Performance parameters
Departures
Queuing System
XeQ
R
Xs
Arrivals
R1
tT0
N(t)
A1 D1A2 D2
R2
• Ak: arrival instant of the kth customer in the system
• Dk: departure instant of the kth customer in the system
• Rk = Dk −Ak: time spent in the system by the kth customer
• T (n, T ): time during which the system has n customers :∑∞n=0 T (n, T ) = T
• A(T )/D(T ): number of arrivals/departures in [0;T ]
61
Formalism of Queuing Theory
Performance parameters
• Input load: Xe(T ) = A(T )/T
• Throughput: Xs(T ) = D(T )/T
• Mean number of customers: Q(T ) = 1T
∑∞n=0 nT (n, T )
• Mean time spent in the system: R(T ) = 1A(T )
∑A(T )k=1 Rk
• Utilization ratio: U(T ) = 1− T (0, T )/T
62
Formalism of Queuing Theory
Stability
• A system is stable iff the input load equals the throughput in the stationary regime
• i.e. limT→∞Xe(T ) = limT→∞Xs(T )
• or limT→∞D(T )A(T ) = 1
• A mono-class open networks of queues is stable iff all queues of the network are stable
• A finite population system is always stable
63
Formalism of Queuing Theory
Little law
• For a stable system in stationary regime :
Q = RX
Qs=U=SX=Sl
l X
R
l
l
X
X
Qw
Q
WQs
S
Q=RX=Rl
Qw=WX=Wl
64
Formalism of Queuing Theory
Distributions at arrival and departure instants
• A(n, T ): number of customers who find n customers in the system at their arrival
• D(n, T ): number of customers who leave n customers in the system at their departure
• P (n, T ) = T (n, T )/T : proportion of time during which there are n customers in thesystem
• Pa(n, T ) = A(n, T )/A(T ): proportion of clients that find n customers in the system
• Pd(n, T ) = D(n, T )/D(T ): proportion of clients that leave n customers in the system
• p(n) = limT→∞ P (n, T ): stationary probability to have n customers in the system
• pa(n) = limT→∞ Pa(n, T ): stationary probability for a client to find n customers
• pd(n) = limT→∞ Pd(n, T ): stationary probability for a client to leave n customers
65
Formalism of Queuing Theory
Properties
• In a (stable and ergodic) system where customers arrive or leave one by one:
pa(n) = pd(n)
• In a system with Poisson arrivals:
pa(n) = p(n)
66
Simple Queues
1. M/M/1
(a) Definition
(b) Associated CTMC
(c) Stability
(d) Analysis
2. M/M/1/K
(a) Definition
(b) Associated CTMC
(c) Stability
(d) Analysis
3. Markovian queues
67
Simple Queues
M/M/1, Definition
• Infinite capacity
• A single server
• Poisson arrivals of rate λ
• Exponential service time of rate µ
68
Simple Queues
M/M/1, Associated DTMC
• Generic method: Find the ”right” state description → stochastic process → analysis →performance parameters
• What is a ”right” state description ? The knowledge of the present state is sufficient
to predict the evolution of the system = the generated stochastic process is a Markov
chain
• State description for the M/M/1: {n(t)}t≥0
69
Simple Queues
M/M/1, Associated DTMC
• Stochastic process with discrete state space and continuous time
• Memoryless property of the service time: it is not necessary to know for how long timethe service has started to predict the remaining service time
• Memoryless property of the inter-arrival law: it is not necessary to know when the lastcustomer arrived to predict the arrival of the next one
70
Simple Queues
M/M/1, Stability
• Stability condition:
λ < µ
ρ =λ
µ< 1
• ρ is referred to as the traffic intensity
71
Simple Queues
M/M/1, Analysis
• We assume that the system is stable
• Three methods to derive the stationary (or steady-state) probabilities:
• (1) Solve pQ = 0 and∑∞n=0 p(n) = 1
• (2) Solve the state equations: for each state, input flow=output flow
• (3) Solve the border equations
72
Simple Queues
M/M/1, Analysis
• pQ = 0
Q =
−λ λ 0 ... ... ...µ −(λ+ µ) λ 0 ... ...0 µ −(λ+ µ) λ 0 ...... 0 µ −(λ+ µ) λ 0... ... 0 µ −(λ+ µ) λ... ... ... 0 µ ...
73
Simple Queues
M/M/1, Analysis
• state equations: input flow=output flow
p(0)λ = p(1)µ
p(1)(λ+ µ) = p(0)λ+ p(2)µ
...
p(n)(λ+ µ) = p(n− 1)λ+ p(n+ 1)µ for all n ≥ 1
74
Simple Queues
• border equations:
p(0)λ = p(1)µ
p(1)λ = p(2)µ
...
p(n)λ = p(n+ 1)µ for all n ≥ 0
• p(n) = ρp(n− 1)
• p(n) = ρnp(0)
75
Simple Queues
• border equations:
p(0)λ = p(1)µ
p(1)λ = p(2)µ
...
p(n)λ = p(n+ 1)µ for all n ≥ 0
• Normalization : p(0) = 1∑∞n=0 ρ
n = 1− ρ
• Thus, for ρ < 1, ∀n ≥ 0 p(n) = (1− ρ)ρn
76
Simple Queues
M/M/1, Performance parameters
• Throughput:
X = Proba[queue non empty]µ =∞∑n=1
p(n)µ = ρµ = λ
• Server utilization:
U = 1− p(0) = ρ =λ
µ
• Average number of customers:
Q =∞∑n=1
np(n) =ρ
1− ρ
• Average time spent by a customer in the system (Little law):
R =Q
X=
1
µ(1− ρ)=
1
µ+
ρ
µ(1− ρ)
77
Simple Queues
M/M/1, Performance parameters
• Q and R:
78
Simple Queues
M/M/1/K, Definition
• The system (buffer and server) is limited to K customers
• A single server
• Poisson arrivals of rate λ
• Exponential service time of rate µ
79
Simple Queues
M/M/1/K, Associated CTMC
• State description: {n(t)}t≥0
• Stochastic process with continuous time and discrete state space
• At a given time, when there is 0 < n(t) < K customers in the system, both inter-arrivaland service times are memoryless
80
Simple Queues
M/M/1/K, Stability
• The system is limited → the system is always stable
81
Simple Queues
M/M/1/K, Analysis
• Border equations:
∀n, 1 ≤ n ≤ K, p(n− 1)λ = p(n)µ
∀n, 1 ≤ n ≤ K, p(n) = ρp(n− 1)
∀n, 0 ≤ n ≤ K, p(n) = ρnp(0)
• Normalization:
p(0) =1∑K
n=0 ρn
=1− ρ
1− ρK+1
82
Simple Queues
M/M/1/K, Performance parameters
• Throughput X: two methods
• (1) Departure rate from the server:
Xs = Proba[queue not empty]µ = (1− p(0))µ =ρ− ρK+1
1− ρK+1µ
83
Simple Queues
M/M/1/K, Performance parameters
• Throughput X: two methods
• (2) Arrivals in the system (not lost):
Xe = Proba[queue not full when a customer arrives]λ
=K−1∑n=0
pa(n)λ
=K−1∑n=0
p(n)λ
=1− ρK
1− ρK+1λ
84
Simple Queues
M/M/1/K, Performance parameters
• Server utilization U :
U = 1− p(0) = ρ1− ρK
1− ρK+1
• Average number of customers Q:
Q =K∑n=0
np(n) =ρ
1− ρ×
1− (K + 1)ρK +KρK+1
1− ρK+1
85
Simple Queues
M/M/1/K, Performance parameters
• Average time spent by a customers in the system: 2 possible parameters
• (1) Time spent by a customers admitted in the system: R = Q/X
• (2) Time spent by all customers trying to enter the system: RT = Q/λ
86
Simple Queues
Markovian queues, Definition
• Infinite buffer
• A single server
• Inter-arrival and service times law are memoryless and depends on the number of cus-tomers in the system
• When there are n customers in the system at a given time instant:
• - the arrival time of the next customer follows an exponential law of rate λ(n)
• - the service time follows an exponential law of rate µ(n)
87
Simple Queues
Markovian queues, Associated CTMC
• State description: {n(t)}t≥0
• Stochastic process with continuous time and discrete state space
88
Simple Queues
Markovian queues, Stability
• Stability condition:
p(0) > 0
1
1 +∑∞n=1
(∏nk=1
λ(k−1)µ(k)
) > 0
∞∑n=1
n∏k=1
λ(k − 1)
µ(k)
<∞
89
Simple Queues
Markovian queues, Analysis
• Border equations:
∀n > 0, p(n− 1)λ(n− 1) = p(n)µ(n)
p(n) =n∏
k=1
λ(k − 1)
µ(k)p(0)
• Normalization:
p(0) =1
1 +∑∞n=1
(∏nk=1
λ(k−1)µ(k)
)
90
Simple Queues
Markovian queues, Performance parameters
• Throughput X: 2 methods
• (1) At the exit of the system:
X =∞∑n=1
p(n)µ(n)
• (2) At the entrance of the system:
X =∞∑n=0
pa(n)λ(n) =∞∑n=0
p(n)λ(n)
• Average number of customers in the system Q:
Q =∞∑n=1
np(n)
• Average time spent by a customer in the system R: R = Q/X
91
Erlang B and C laws
Telephonic traffic
N junctions/time−slots
Base−stationSwitch
• Main issue: find the right number of servers associated to a given quality of service(QoS)
• Traffic a of a server (ITU-T E-100) : average proportion of occupation time of theserver (t is the occupation time between 0 and T , T is the observation time) :
a =t
T
• a is in Erlangs
• US : Cent Call Second (CCS) is the occupation of a machine during 100s per hour
1CCS = 100/3600 = 1/36Erlangs
92
Erlang B and C laws
Telephonic traffic
M1T
...ML
• Traffic of a group of L servers:
A =
∑i tMi
T≤ LErlangs
• Identical servers, with n: mean number of occupation periods in T and τ : mean occu-pation time of a server:
A =nτ
T
• Ergodicity: statistics of the group at a given time and statistics of a given server in timeare equal
• with x: mean number of occupied servers at a given time and the ergodicity property:
x
L= a
93
Erlang B and C laws
Erlang B model, assumptions
• We consider S servers serving phone calls
• Calls arrive according to a Poisson law of rate λ, λ does not depend on the number of
occupied servers (infinite population assumption)
• Calls that cannot be served are lost
• Service time is distributed according to a decreasing exponential law of rate µ
94
Erlang B and C laws
Erlang B, markov chain
• The system is modeled with a M/M/S/S.
• Stationary probabilities are given by :
p(n) = ρn/n!p(0) and p(0) =
S∑k=0
ρk/k!
−1
with ρ = λ/µ
• Blocking probability is given by :
Pb = p(S) =ρS/S!∑Sk=0
ρk
k!
95
Erlang B and C laws
Erlang B law is not linear:
96
Erlang B and C laws
Erlang B law is not linear:
97
Erlang B and C laws
A recursive definition of the blocking probability:
Pb(S + 1) =ρPb(S)
S + 1 + ρPb(S).
An approximation of the inverse of the Erlang B law (Claude Rigault ENST) :
If E1,S(A) = ε = 10−k then S ≈ A+ k√A
• Example: consider a traffic of A = 100 Erlangs
• What is the number of junctions to install in order that the probability of lost call is less
than ε = 10−4?
• N ≈ 140 servers
98
Erlang B and C laws
Erlang C model, assumptions
• We consider S servers serving phone calls
• Calls arrive according to a Poisson law of rate λ, λ does not depend on the number of
occupied servers (infinite population assumption)
• Calls that cannot be served are put in an infinite buffer, discipline is FIFO
• Service time is distributed according to a decreasing exponential law of rate µ
99
Erlang B and C laws
Erlang C, markov chain
• The system is modeled with a M/M/S/∞.
• Stationary probabilities are given by :
p(n) = ρn/n!p(0) for 0 ≤ n ≤ S − 1,
p(n) = ρn/(S!Sn−S)p(0) for n ≥ S,
p(0) =
S−1∑k=0
ρk/k! +ρS/S!
1− ρ/S
−1
with ρ = λ/µ
100
Erlang B and C laws
Erlang C, waiting probability
Pw =∑n≥S
p(n)
=∑n≥S
ρS
S!
ρn−S
Sn−Sp(0)
=ρS
S!
S
S − ρp(0)
=
ρS
S!SS−ρ∑S−1
k=0 ρk/k! + ρS/S!
1−ρ/S
.
101
Erlang B and C laws
Erlang C, some useful results
• Mean number of customers:
Q = Pwρ/S
1− ρ/S
• Mean waiting time
W =Pw
λ
ρ/S
1− ρ/S
• Distribution of the waiting time:
P [T > t] = Pw exp(−Sµt(1− ρ/S))
102
Erlang B and C laws
Erlang C law is not linear:
103
Networks of Queues
1. Definition of the Jackson networks
2. Stability
3. Visit rates
4. Analysis and Jackson theorem
5. Performance parameters
104
Networks of Queues
Definition of the Jackson networks
• Open network
• M stations
• A single class of customers
• Poisson arrivals of rate λ
• For each station: a single server, an unlimited FIFO buffer, an exponential service time
of rate µi
• Probabilistic routing: p0i=probability that a customers arriving in the network goes to
station i; pij=probability that a customer leaving station i goes to station j; pi0=probability
that a customer leaving station i goes out of the system
∀i, 0 ≤ i ≤M,M∑j=0
pij = 1
105
Networks of Queues
Example of Jackson network
106
Networks of Queues
Stability
• Let ei the average number of times that a customer visits station i during its journey in
the system
• ei is the visit rate of station i
• Arrival rate of customers in the network: λ
• Arrival rate of customers in station i: λi = eiλ
• Stability condition:
∀i = 1, ...,M, λi < µi
107
Networks of Queues
Visit rates
• The traffic λi at station i is made of :
• (1) the outside traffic: λp0i
• (2) the traffic coming from station j: λjpji for all stations j = 1, ...,M
λi = λp0i +M∑j=1
λjpji
• With λi = eiλ:
ei = p0i +M∑j=1
ejpji
108
Networks of Queues
Analysis
• State description: {n(t) = [n1(t), ..., nM(t)]}
• Stochastic process with continuous time and discrete state space
• At a given instant, there is ni(t) customers in station i
• - arrivals are Poisson → memoryless
• - service times are exponential → memoryless
• - routing is probabilistic → memoryless
109
Networks of Queues
Jackson theorem
• For a stable Jackson network:
p(n) =M∏i=1
pi(ni)
• pi(ni) is the steady-state probability of a M/M/1 with arrival rate λi and service rate µi
• pi(ni) = (1− ρi)ρnii
• with ρi = λi/µi
110
Networks of Queues
Performance parameters
• For station i:
Xi = λi Qi =ρi
1− ρiRi =
QiXi
=1
µi − λiUi = ρi
• For the network:
X = λ Q =M∑i=1
Qi
R =Q
X=Q
λ=
M∑i=1
Qiλ
=M∑i=1
eiQiλi
=M∑i=1
eiRi
111