Queuing
Queuing
PERFORMANCE
ANALYSIS
Queueing Models
Little’s theorem
QUEUING IN THE NETWORK LAYER AT A
ROUTER
average queueing
• R: link bandwidth (bps)
delay
• L: packet length (bits)
• a: average packet arrival
rate
traffic intensity
= La/R
§ La/R ~ 0: avg. queueing delay small La/R ~ 0
La/R -> 1 3
BASIC SINGLE QUEUE MODEL
4
BASIC SINGLE QUEUE MODEL
• For example, a 56 kbps transmission line can “serve” 1000-bit packets at a rate
of
56,000 bits/sec
= 56 packets/sec
1000 bits/packet
5
APPLIC ATIONS OF QUEUING ANALYSIS
OUTSIDE OF NETWORKING
6
THE POISSON ARRIVAL MODEL
• Examples
• Customers arriving to a bank
• Packets arriving to a buffer
• The rate λ of a Poisson process is the average number of events per unit time
(over a long time).
8
PROPERTIES OF A POISSON PROCESS
(l t ) - lt n
Pn (t ) = e
n!
9
PROPERTIES OF A POISSON PROCESS
• For 2 disjoint (non-overlapping) intervals, (s1, s2) and (s3, s4), (i.e. s1 < s2 £
s3 < s4), the number of arrivals in (s1, s2) is independent of the number of
arrivals in (s3, s4)
10
INTERARRIVAL TIMES OF A POISSON
PROCESS
- lt
P (t 1 > t ) = P0 (t ) = e
11
INTERARRIVAL TIMES OF A POISSON
PROCESS
• So
- lt - lt
Ft1 (t ) = P (t 1 £ t ) = 1 - e and ft1 (t ) = le
12
INTERARRIVAL TIMES OF A POISSON
PROCESS
• Let t 2 = the length of time between the first and second arrival.
• We can show that
13
INTERARRIVAL TIMES OF A POISSON
PROCESS
• Similarly define t 3 as the time between the second and third arrival; t4 as
the time between the third and fourth arrival;…
• The random variables t 1 ,t 2 , t 3 ,… are called the interarrival times of the
Poisson process
14
INTERARRIVAL TIMES OF A POISSON
PROCESS
• The interarrival time random variables, t 1, t 2t, 3 …
• Are (pair-wise) independent.
• Each has an exponential distribution with mean 1/λ.
15
THE M/M/1 QUEUE
16
QUEUING NOTATION
17
QUEUING NOTATION
18
ASIDE: THE D/D/1 QUEUE
19
ASIDE: THE D/D/1 QUEUE
20
STATE ANALYSIS OF AN M/M/1 QUEUE
• Let n be the state of the system = the number of packets in the system
(including the server).
• Let pn be the steady state probability of finding n customers waiting in the
system (including the server).
21
STATE ANALYSIS OF AN M/M/1 QUEUE
22
STATE ANALYSIS OF AN M/M/1 QUEUE
¹
• If the system is stable (i.e. pn 0 for each n), then in a steady state it will drift
back and forth across the dotted line. So,
• the number of transitions from left to right = the number of transitions from
right to left.
23
STATE ANALYSIS OF AN M/M/1 QUEUE
24
STATE ANALYSIS OF AN M/M/1 QUEUE
25
STATE ANALYSIS OF AN M/M/1 QUEUE
• Similarly
p2 = r p1 = r 2 p0
• And in general
pn=rnp0
26
STATE ANALYSIS OF AN M/M/1 QUEUE
¥
• We need to solve for p0 , so we need one more equation. Use S pn = 1
n =0
• We obtain
æ 1 ö
¥
1 = S r n p0 = p0 S r n =
n =0
¥
n =0
{ p0 ç ÷ for r < 1
è 1- r ø
¥ for r ³ 1
27
STATE ANALYSIS OF AN M/M/1 QUEUE
• So we must have
p0 = 1 - r
and
pn = (1 - r ) r n
for n = 1, 2,3,...
28
STATE ANALYSIS OF AN M/M/1 QUEUE
• Note that requiring ρ < 1 for stability (i.e. λ <µ ) makes intuitive sense.
• Also ρ=1-ρ0
= probability that the queuing system is NOT empty
= probability the server is working
29
STATE ANALYSIS OF AN M/M/1 QUEUE
30
HOW LONG IS THAT LINE?
¥ ¥
r r
E (n) = å npn = (1 - r )å np = (1 - r )
n
=
n =0 n =0 (1 - r ) 1 - r
2
31
LITTLE’S FORMULA AND QUEUING
DELAY
32
LITTLE’S FORMULA AND QUEUING
DELAY
34
LITTLE’S FORMULA AND QUEUING
DELAY
35
LITTLE’S FORMULA AND QUEUING DELAY
µ E ( n) r 1
µ E (T ) = = =
l r (1 - r ) 1 - r
which is unitless
36
LITTLE’S FORMULA AND QUEUING
DELAY
1
E (W ) = E (T ) -
µ
37
SINGLE LINK EXAMPLE
38
SINGLE LINK EXAMPLE
So l
r = = 0.67
and
µ
r
E ( n) = = 2.0 packets
1- r
E ( n)
E (T ) = = 1.0 ms
l
40
Number of customers in the system at time T
Equally, the shaded area is composed of horizontal strips of height 1 and width T (i) (for the ith
customer).
Hence,