Professional Documents
Culture Documents
Model of a Queue
Arrivals Departures
Server(s)
Waiting
Position
s
A “Queue” is basically a model of a node providing service where
arrivals come at possibly random times and ask for service of
possibly random length from the one or more servers that may be
present in the queue. A Computer Network may then be modelled
as a set of interconnected queues, i.e. a “Queuing Network”
Input Specifications for a
Queue
Transient Analysis
• Server Utilization/Occupancy
or
• Buffer Utilization/Occupancy
Equilibrium Analysis
• Total Revenue obtained
• Total Revenue lost
Mean Results
• Customer Satisfaction (Grade
of Service) or
Probability
Distributions
General approach to the study of queues
and queueing networks
Single
Arrivals
Server
with an
average
arrival Service rate
rate of at the server
Infinite Buffer
(infinite number
of waiting
positions)
Assume that, as t0 Arrival Process
Mean Inter-arrival time
P{one arrival in time t} = t 1
=
P{no arrival in time t} =1- t
P{more than one arrival in time t} = O((t)2) = 0
Service Process
P{one departure in time t} = t 1
Mean Service time =
P{no departure in time t} =1- t
P{more than one departure in time t} = O((t)2) = 0
N>0 (1.2)
dp0 (t )
p0 (t ) p1 (t ) N=0 (1.3)
dt
dpN (t )
( ) p N (t ) p N 1 (t ) p N 1 (t ) N>0 (1.4)
dt
dpi (t )
0
dt
and
p1=p0
pN+1=(1+)pN - pN-1 = pN = N+1p0 N1 (1.5)
Applying the Normalization Condition p
i 0
i 1 we get
pi i (1 ) i = 0, 1, ……, (1.6)
N ip i (1 ) 1
i 0
i
i 0
i (1.7)
2
N q (i 1) pi (1 p0 ) (1.8)
i 1 1 1 1
Mean Performance Parameters of the Queue
(k 1) 1
W
k 0
pk
(1 ) (1.9)
1
Wq W (1.10)
(1 )
Mean Performance Parameters of the Queue (continued)
k
Wq p
k 0
k
(1 )
•Summary Review
One can also choose the time points t1,…….., tn …. (where the
process X(t) is examined) in different ways.
Markov Processes
for any choice of time instants ti, i=1,……, n where tj>tk for
j>k
P{Xn+1=j | Xn=i}
Semi-Markov Processes
In these processes, the distribution of time spent in
a state can have an arbitrary distribution but the
one-step memory feature of the Markovian property
is retained.
Discrete-Time Markov Chains
pij( m) P{ X n m j | X n i}
k
pik( m1) pkj m= 2, 3,…...
and
pj p pi
i ij
j Balance Equations
p
i
i 1 Normalization
Condition
If the current state (at time instant n) is Xn=i, then the state
at the next instant can only be Xn+1 = (i+1), i or (i-1).
Note that states are represented as integer-valued without
loss of generality.
2 2 2
3
k-1 k-1
k k k
k+1 k+1
p0 (t t ) p0 (t )[1 0 t ] p1 (t ) 1t
pk (t t ) pk (t )[1 (k k )t ] pk 1 (t )k 1t pk 1 (t ) k 1t
p (t ) 1
k 0
k
t0
dp0 (t )
0 p0 (t ) 1 p1 (t )
dt
dpk (t ) (2.6)
(k k ) pk (t ) k 1 pk 1 (t ) k 1 pk 1 (t )
dt
p
k 0
k (t ) 1
We can now obtain the equilibrium solutions by setting
dpi (t )
0 i
dt
p
i 0
i 1
is satisfied.
This yields the following equations to be solved for
the state probabilities under equilibrium conditions-
0 p0 = 1 p1 k=0
k-1 pk--1 + k+1 pk+1= (k+k)pk k=1,2,3,……,
p
i 0
i 1 Product Form Solution
k 1 i
pk p0
i 0 i 1
(2.7)
The solution is -
1
p0 k 1
i (2.8)
1
k 1 i 0 i 1
Instead of writing differential equations, one can obtain the
solution in a simpler fashion by directly considering flow
balance for each state.
The solution for this will be the same as that obtained earlier
In general, the equations expressing flow balance
in a Birth-Death Chain of this type will be -
k 1 i
k 0 i 0
i 1
(a) All states are transient, if
and only if =, <
(b) All states recurrent null, if
and only if =, =
(c) All states ergodic, if and
1 only if <, =
k 1
i
k 0
k Equilibrium State Distribution will
i 1
i 0
exist only for the case where all the
states are ergodic and hence, the chain
itself is also ergodic
Analyzing M/M/-/- Type Queues
(under equilibrium conditions)
M exponential
A Inter-arrival time distribution D deterministic
B Service time distribution Ek Erlangian (order k)
G general
C Number of servers
D Maximum number of jobs that can be there
in the system (waiting and in service)
Default for infinite number of waiting
positions
E Queueing Discipline (FCFS, LCFS, SIRO
etc.), Default is FCFS
N=W (2.9)
Nq=Wq (2.10)
N
(t
)
increments by
one
Time t
Area(t )
Average Time W spent in system = lim t
(t )
Area(t ) (t ) Area(t )
Average Number N in system = limt limt
t t (t )
(t )
Since, limt Therefore, N=W
t
The PASTA Property
“Poisson Arrivals See Time Averages”
For <1
k k k
pk p0 p0 k
k 0 k 0
k 1, 2, 3,....... p0 (1 )
Using
N 1
N
i 0
ipi
i 0
i i (1 )
1
W
(1 )
Little’s
Result
Using
1 2
Wq W N q Wq Little’s
(1 ) (1 ) Result
M/M/1/ Queue with Discouraged Arrivals
k 0 k 0
p0 exp( ) (2.15)
k 1, 2, 3,.......
N kpk eff k pk 1 exp( )
k 0 k 0
N
W Little’s Effective Arrival
eff 2 Result
1 exp( ) Rate
M/M/1/ Queue with Discouraged Arrivals
In this case, PASTA is not applicable as the overall arrival process
is not Poisson
i
r = P{arriving customer sees r in system / 1
P{Ei } pi e
(before joining the system)} i!
Let E be the event of an arrival in (t, t+t)
Ei is the event of the system being in state i t
P{E | Ei }
i 1
r 1
1 e /
k 1
r
(r 1)! 1 e /
W
k
2 (1 e / )
k 0
M/M/m/ Queue
(m servers, infinite number of waiting positions)
k k k k 0 k (m 1)
m km
k
For = / < m p k p0 for k m
k!
(2.16)
k
p0 k m
for k m
m!m
Erlang’s 1
C-Formula m1 k m m
p0
k 0 k!
m!( m )
(2.17)
m m
P{queueing} =
k m
pk C (m, ) p0
m!(m )
(2.18)
M/M/m/m Queue
(m server loss system, no waiting)
k km
0 otherwise ( Blocking or Loss Condition )
k k 0k m
0 otherwise
k
p k p0 for k m
For k! (2.19)
0 otherwise
1
p0 (2.20)
m
k
k!
k 0
M/M/m/m Queue
(m server loss system, no waiting)
m
B(m, ) p0 Erlang’s B-Formula (2.21)
m!
B(m 1, )
B(m, ) m (2.22)
B(0, ) 1 B(m 1, )
1
m
M/M/1/K Queue
(single server queue with K-1 waiting positions)
k kK
0 otherwise ( Blocking or Loss Condition)
k kK
0 otherwise
pk p0 k for k K (2.23)
For
0 otherwise
(1 )
p0 (2.24)
(1 K 1 )
M/M/1/-/K Queue
(single server, infinite number of waiting positions, finite customer
population K )
k ( K k ) kK
0 otherwise ( Blocking or Loss Condition)
k kK
0 otherwise
K!
pk p0 k
k=1,.….,K (2.25)
For ( K k )!
1
p0 (2.26)
K
K!
k 0
k
( K k )!
Departure Process from a M/M/m/ Queue
(2, 1)
(0,0) (1, 1)
1
State Transition
1 2
2 Diagram of the
(1, 2) (2, 2) System
Method of Stages
p 00 2 p12
( 1 ) p11 p 00 2 p 22
Balance Equations ( 2 ) p12 1 p11 (2.38)
for the System ( 1 ) p 21 p11 2 p 32
( 2 ) p 22 p12 1 p 21
etc.......
i
LB ( s) 0
Exit
j
i
LB ( s) (1 1 ) 1 ...... j 1 (1 j )
j i 1 s i
Method of Stages
0.5 1
0.5 2
Service Facility
k 1
( )
k 1
pk z k
z
k 1
p k 1 z k 1 i k i
p
k 1 i 0
z k
Simplifying, ( )[P( z ) p 0 ] [ P( z ) p 0 p1 z ] P( z ) ( z )
z
we get
p 0 (1 z )
P( z )
(1 z ) z[1 ( z )]
Define as the offered traffic
Note that, P(1)=1 is effectively the same as the Normalization
Condition. Using this, we get -
p0 1
Therefore
(1 )(1 z ) (2.42)
P( z )
(1 z ) z[1 ( z )]
We can invert P(z) or expand it as a power series in zi i=0,1,… to
get the state probability distribution. The mean number N in
the system may be directly calculated from P(z) as -
dP( z ) ( 2 )
N (2.43)
dz z 0 2(1 )
The M[X]/-/-/K Queue
Batch Arrival Queue with Finite Capacity
For operating queues of this type, one must also specify the batch
acceptance strategy to be followed if a batch of size k or more
arrrives in a system where the number of waiting positions available is
less than k.
Class 1 Class P
jobs jobs
1 2 P
P Priority Classes
Class P Highest Priority Class
Class 1 Lowest Priority Class
Poisson Process N
Average Rate p i 1
pj Poisson i 1
Rate pj
pN Poisson
Rate pN
p Under equilibrium
Q1 conditions, average flow
leaving the queue will
equal the average flow
1-p Q3 entering the queue.
(1-p) (1-p)
Poisson Process
Average Rate 1+2
Poisson Process
Average Rate 2
0.4 0.6
External arrivals with rates 1
and 2 from Poisson processes
0.4
Q3
Probabilistic routing with the
routing probabilities as shown
• Applying flow balance to each queue, we get
K
1
j 1
p ij = P{a job served at Qi exits from the network}
Arrival Process of Jobs to Qi
= [External Arrivals, if any, to Qi]
K
j 1
Jobs which finish service at Qj and are then
routed to Qi for the next stage of service
K
P(n~) P(n1 ,......, n K ) p
j 1
j (n j )
(5.4)
j
j mj
j
• Once flow balance has been solved, the individual queues may be
considered in isolation.
• The queues behave as if they are independent of each other (even
though they really are not independent of each other) and the joint
state distribution may be obtained as the continued product of the
individual state distributions (product-form solution)
• The flows entering the individual queues behave as if they are
Poisson, even though they may not really be Poisson in nature (i.e. if
there is feedback in the network).
K
Total Throughput =
j 1
j (5.5)
j
Average traffic load at node j (i.e. Qj) = j (5.6)
j
j
Visit Count to node j = V j (5.7)
These may also be obtained by directly solving the
following K linear equations -
j K
Vj
V p
i 1
i ij
j =1,……, K (5.8)
Average number of jobs at node j = N j kp
k 0
j (k ) (5.9)
K
Average number of jobs in system = N N
j 1
j
(5.10)
Mean Sojourn Time (W): The mean total time spent in the system
by a job before it leaves the network.
N K Nj
W
j 1
(5.11)
Example: Open Jackson Network
(1 p1 )
1 2
p1 p1
1 1 p1 =1p1
Q1
(1 p1 )
M/M/1
p2 1 2
1 p1 2 p1
p1+p2=1
2
N 1 2
Mean Sojourn Time W
(1 1 ) (1 2 )