Escolar Documentos
Profissional Documentos
Cultura Documentos
M/M/* Queues
These slides are created by Dr. Yih Huang of George
Mason University. Students registered in Dr.
Huang's courses at GMU can make a single
machine-readable copy and print a single copy of
each slide for their own reference, so long as each
slide contains the copyright statement, and GMU
facilities are not used to produce paper copies.
Permission for any other use, either in machinereadable or printed form, must be obtained from
the author in writing.
CS 756
Introduction
Queueing theory provides a mathematical
basis for understanding and predicting the
behavior of communication networks.
Basic Model
Arrivals
Departures
Queue
CS 756
Server
Major parameters:
interarrival-time distribution
service-time distribution
number of servers
queueing discipline (how customers are taken
from the queue, for example, FCFS)
number of buffers, which customers use to wait
for service
A common notation: A/B/m, where m is the
number of servers and A and B are chosen from
M: Markov (exponential distribution)
D: Deterministic
G: General (arbitrary distribution)
CS 756
System State
Due to the memoryless property of the
exponential distribution, the entire state of
the system, as far as the concern of
probabilistic analysis, can be summarized by
the number of customers in the system, i.
the past/history (how we get here) does
not matter
When a customer arrives or departs, the
system moves to an adjacent state (either i+1
or i-1).
CS 756
In equilibrium,
i+1
CS 756
The rate of
movements in
both directions
should be equal
6
P1 = P2
P 2 = P3
Solve
P2 =
= P0
= ( P0 ) = 2 P 0
P
P
= k
What is ?
CS 756
Since
k =0
Pk =
k =0
P
k
=1
we have
1
1
=1
= 1 .
That is, Pk = k (1 ).
Note that must be less than 1, or else the
system is unstable.
CS 756
k =0
kP k = (1 )
k k = ?
k =0
CS 756
W=
=
Average number of customers in queue:
2
N Q = W =
1
CS 756
10
Applications
Consider 24 computer users, each of which
produces in average 48 packets per second.
For every customer, the interarrival times of
his packets are exponentially distributed.
The lengths of packets are also
exponentially distributed, with mean 125
bytes.
CS 756
11
Scenario 1
Users share a T1 line using the standard T1
time-division multiplexing.
Assume that each user is associated with an
infinite buffer (that is, queue).
In a T1 line, it takes 1/8000 seconds to
deliver (or serve) each byte.
However, due to their variable lengths, the
delivery (or service) times of packets are
still exponentially distributed.
The average service rate = ?
CS 756
12
Packet
Arrivals
Queue
We have
Server,
1/24th of
the T1 line
48
= 75%
64
0.75
=3
1 0.75
1
1
T=
=
42msec
64 48 24
N=
CS 756
13
Scenario 2
Users share a 1.544 Mbps line through an IP
router.
Packets
from
24 users
The entire
T1 as the
server
CS 756
14
= 48 / 64 = 75%
T=
1
1
=
2.4 msec
1536 1152 384
15
Discussion
Flaws in the analysis ?
Still such a drastic difference in results
convincingly reveals the inefficiency of
TDM.
This partly explains the momentum toward
using the Internet as the universal
information infrastructure.
In general, allowing customers to share a
pool of resources is far more efficient than
allocating a fixed portion to each customers.
CS 756
16
Arrivals
Departs
Queue
m
Servers
17
m+1
Balance equations:
Pi 1 =
CS 756
i Pi ,
for i
m Pi ,
for
i>m
18
Solution
i
Pi =
(mp)
,
P0
i!
for i m
m
,
P0
m!
for i > m
.
m
P0 =
m 1 (m )i
i =0
i!
( m ) m
+ m!(1 )
CS 756
19
PQ = P i
i=m
P0 m
=
m!
i=m
(m )
= P0
m!
i m
i =m
(m )
= P0
m!(1 )
20
10
NQ =
(i m ) Pi =
i =m
i Pi + m
i =0
i +m
m
= i P0
m!
i =0
( m )
= P0
m!
i i
i =0
( m )
= P0
2
m!
(1 )
m
= PQ
CS 756
21
+W =
PQ
1
PQ
= +
(1 ) m
CS 756
PQ
PQ
+
= m +
m
1
22
11
23
Analysis
K- 1
Noticing that
i P0 ,
for 0 i K
0,
for i > K
K
i =0
P0 =
CS 756
Pi = 1
we have
1
1 K +1
24
12
Poisson Process
Let random variable N be a counter of the
number of occurrences of a particular type
of events. Clearly, the value of N increases
over time. Let N (t ) be the value of N at time
t. Moreover, if N (0) = 0 , N (t ) is said to be a
counting process.
The counting process N (t ) is said to be a
Poisson process having rate if the number
of events in any interval of length t is
Poisson distributed with mean t. That is,
for all s, t 0
n
P{N ( t + s ) N ( s) = n} = et
( t )
,
n!
n = 0,1,...
CS 756
25
Discussion
The interarrival times of a Poisson process with
rate is exponentially distributed with average 1 /
The reverse is also true: if the interarrival times of
events are exponentially distributed with average 1 /
then the event counting process is Poisson with
rate .
Thus, the customer arrival processes of M/M/*
queueing systems are Poisson.
A Poisson customer count and exponentially
distributed customer interarrival times are the two
sides of the coin.
CS 756
26
13
27
Application
We know that the customer arrivals at a
barbershop form Poisson process with
average rate of 10 customers per hour.
Among the customers, 40% are males and
60% are females.
Then the interarrival times of male
customers are exponentially distributed with
an average rate of 4 per hour.
The interarrival times of female customers
are exponentially distributed with an average
rate of 6 per hour.
CS 756
28
14
Exercise
Consider the router configuration below.
Port 1
40%
2000
Packets
Per sec.
1Mbps
Port 0
60%
Port 2
2Mbps
29
Questions
Argue that queues A and B are independent
M/M/1 systems.
Compute the average length of queue A in
bits.
For a packet destined for port 2, compute its
expected time at the router (including
transmission time).
CS 756
30
15
CS 756
31
X = min{ X 1 , X 2}
1 + 2
CS 756
32
16
Application
Consider the router configuration below.
Packet
arrival
Port 1
Port 0
Packet
arrival
Port 2
Router
CS 756
33
34
17
Burke's Theorem
In its steady state, an M/M/m queueing system
with arrival rate and per-server service rate
produces exponentially distributed inter-departure
times with average rate
.
Application: Two cascaded, independently
operating M/M/m systems can be analyzed
separately.
Server 1
Server 2
M/M/1 system 1
Departs
M/M/1 system 2
CS 756
35
Pitfall
Consider the system below where the
servers are transmission lines.
500
Packets
Per sec.
1Mbps
2Mbps
36
18
Discussion
In general: any feedforward network of
independently-operating M/M/m systems
can be analyzed in this system-by-system
decomposition.
2
p
1
1- p
3
CS 756
37
CS 756
38
19
Jackson's Theorem
For an arbitrary network of k M/M/1 queueing
systems,
P(n1 , n2 ,..., nk ) = P1 (n1) P 2 (n2)... P k (nk ),
where
P j (n j ) = nj j (1 j ) .
39
Application
Consider the network below. The arrival rate
and probabilities p and p are known.
1
CPU
I/O
p1 1
p2 1
1 = / p1 ,
CS 756
2 = p 2 / p1
40
20
And
N1 =
1
,
1 1
N2 =
2
1 2
N = N1 + N 2 .
Average time in system is
T=
(1 1)
(1 2)
CS 756
41
Discussion
Consider the packet switching network below.
Router 2
Router 1
Packets
Router 4
Router 3
42
21