Queueing - Rudra Dutta

advertisement
Queueing Fundamentals for
Network Design Application
ECE/CSC 777: Telecommunications Network Design
Fall, 2013, Rudra Dutta
The Need for Models

Designing or resource provisioning a system
–
–

Prerequisite question to answer:
–
–

“What will be y for a given x ?”
“For any given x ?”
Simulation by itself may not be helpful here
–

“How much x of Resource X to put where?”
“So as to get y units of output behavior Y ”
Okay if search space is small (few design choices)
Analytical model is necessary
–
–
May not be very precise, still useful
May guide curve fits for simulation
Copyright Rudra Dutta, NCSU, Fall, 2013
Statistical TDM Performance


Bursty traffic, statistical TDM
Usual M/M/1 assumptions
–

In reality, traffic process is heavier-tailed
Delay is lower on average: “Statistical Multiplexing
Gain”
–
But unpredictable for individual packet - prediction is statistical
2
R
3
Q
Average Delay (ms)
1
4
Link utilization l/m
Copyright Rudra Dutta, NCSU, Fall, 2013
Blocking in Telephony

Delay - very small and constant, operative
quantity is blocking ratio
 Average call rate
 Average holding time
 Produce: offered traffic load or intensity
X
Copyright Rudra Dutta, NCSU, Fall, 2013
Q
Queueing Models
Customer
Arrivals
Buffer

Kendall Notation
A/S/m/B/K/Ds
A/S/m





Copyright Rudra Dutta, NCSU, Fall, 2013
Departures
Server
Customer population Infinite
Arrival process
Service time distribution
Buffer capacity Infinite
Number of concurrent servers
Queueing discipline FIFO
Time Diagram
sn
n-1
xn
xn+1
xn+2
Service
wn
Queue
tn
tn+1
tn+1
Copyright Rudra Dutta, NCSU, Fall, 2013
tn+2
tn+2
Little’s Law

Mean number in system = arrival rate x mean response
time
–
–
–
–
–
If T is large, arrivals = departures = N
Arrival rate = Total arrivals/Total time= N/T
Hatched areas = total time spent inside the system by all jobs = J
Mean time in the system= J/N
Mean Number in the system = J/T = J/N x N/T
Copyright Rudra Dutta, NCSU, Fall, 2013
Memoryless Process

Underlying process is such that nothing is
known about time of next arrival except overall
rate over long time
–
–
Next arrival time  time until which current random
variable persists
How long we have been waiting does not tell us
anything about when the wait will likely be over

–

Does not change the distribution of the likelihood for future
How long the variable has survived does not change
the likelihood distribution in the future conditioned by
the present (past)
Is (are) there such distributions? What?
Copyright Rudra Dutta, NCSU, Fall, 2013
PDF of Termination over Time
0

8
18
Bus leaves New York  Raleigh
–

13
Time 0
What is the distribution of likelihood (probability)
of time of arrival?
–
Must sum (integrate) up to 1
Copyright Rudra Dutta, NCSU, Fall, 2013
Termination Probability Distribution
0.2
0.1
0



8
13
18
If the variable survives upto a particular time, this event
conditions the probability of surviving for a further
increment of time
Changes the termination (equivalently, surviving)
probability distribution from “here on” (in the
subuniverse)
Shape of remaining PDF remains, must scale to renormalize
Copyright Rudra Dutta, NCSU, Fall, 2013
Memoryless Distribution
1

Past does not change information about future
–



More precisely, the future, conditioned by the past, is the same
as the original
Must be infinitely long-tailed, must integrate to 1
e–t (more generally, le-lt)
Rate is l at time 0  (conditioned) rate is always l
Copyright Rudra Dutta, NCSU, Fall, 2013
Markov Chain

A discrete-state stochastic process in which probability
of transitioning to another state only depends on present
state (not how or when arrived at that state)
–
Memory of system is not zero, but limited

Transition probabilities pij , sojourn times qj
 Sojourn time must be exponentially or geometrically
distributed (Markov property)
 Discrete time or continuous time
1
–
–

Discrete: transition probability at next
tick (may be self-transitions)
0
Continuous: transition probability is
exponential rate
2
Semi-Markov: arbitrary sojourn time distribution
Copyright Rudra Dutta, NCSU, Fall, 2013
3
4
Markov Chain

We will mostly be interested in
 Homogenous: unchanging transition probabilities
 Recurrent non-null: can eventually return to any state in
finite time
 Aperiodic: return time to a state is possible at any time
 Irreducible: cannot be partitioned into
non-communicating (steady-state)
component chains
1
3
–



No unreachable or useless states
0
Ergodic: aperiodic, recurrent,
non-null
Stationary: steady state exists
Steady-state analysis: flow balance
Copyright Rudra Dutta, NCSU, Fall, 2013
2
4
Pure Birth Process


0

2

3

4


5
6
Birth-death model
–
–
–
–

1

Population variation under births and deaths
Constant, independent rates
Time is continuous – chances of simultaneous events
ignored
Only possible transitions: one more, or one less
Pure birth – no death, continuously increasing
population
Copyright Rudra Dutta, NCSU, Fall, 2013
Pure Birth Process

Pk(t) : probability of population size k at time t
 Sk Pk(t) = 1, for any t

0

1

2

3

4


5
6
Pk(t+Dt) = Pk(t) [1 - l Dt ] + Pk-1(t) [ l Dt ]
d_____
Pk(t)
= - l Pk(t) + l Pk-1(t)
dt

Rate of moving from any state to the next is l
–
–
Over infinitesimal time Dt, chance of transition is l Dt
Provided system in that state: un-condition with state
probability at beginning of infinitesimal time
Copyright Rudra Dutta, NCSU, Fall, 2013
Pure Birth Process

Pk(t) : probability of population size k at time t
 Sk Pk(t) = 1, for any t

0

1

2

3

4


5
6
Pk(t+Dt) = Pk(t) [1 - l Dt ] + Pk-1(t) [ l Dt ]
d_____
P0(t)
d_____
Pk(t)
= - l P0(t)
= - l Pk(t) + l Pk-1(t)
dt
dt
-lt
P1(0) = 1
 P0(t) = e
Pk(0) = 0, k ≠ 1
-lt
 P1(t) = lt e
Pk(t) = (lt)k e-lt / k!
Copyright Rudra Dutta, NCSU, Fall, 2013
Poisson distribution
Birth Death Process
pk is the equilibrium state of Pk(t)


0
1
2
μ
μ

p1 = p0 --μ
pk = p0

--μ
S pk = 1
k=0
Copyright Rudra Dutta, NCSU, Fall, 2013

3
μ

4
μ

5
μ

6
μ
μ
p2 + p4μ = p3 ( +μ)
k
( )
∞

1
 p0 = ----------------∞  k
1 + S --k=1
(μ)
=1–l/m
The M/M/1 Queue

Assumes Poisson arrival process, exponential
service times, single server, FCFS service
discipline, infinite capacity for storage
 Arrival rate: l (e.g., packets / sec)
–

Service rate: m
–

Inter-arrival times are exponentially distributed
(and independent) with mean 1 / l
Service times are exponentially distributed
(and independent) with mean 1 / m
System load / utilization: r = l / m

r must be strictly less than 1 for stability
Copyright Rudra Dutta, NCSU, Fall, 2013
Performance Metrics
N : Average number of customers in
system, including any in service
 T : Average time spent in system

p0 = 1 – l / m = 1 – r
pk = (1 – r) rk
∞
N = S k pk
k=0
N = r / (1 – r)
sN2 = r / (1 – r)2
Little’s Law: N = l T
T = 1 / (m (1 – r))
0
Copyright Rudra Dutta, NCSU, Fall, 2013
r
1
M/M/∞ System: Responsive server


0

1
μ
k-1
(
2
2μ

pk = p0 P -----i=0 (i+1)μ

)
3
3μ
4
4μ
 k 1
--- --μ k!
( )
= p0

p0 = e –l/m
 k e –l/m
pk= --- ------μ
k!
( )
Copyright Rudra Dutta, NCSU, Fall, 2013



5
5μ
6
6μ
7μ
N= l/m
Little’s Law: N = l T
T=1/m
Naturally (consider second picture)
M/M/m/m
Like M/M/∞/∞, but finite number of servers
 No buffering of waiting calls – blocked calls cleared



0
1

2
μ
2μ
3μ
 k 1
--- --μ k!
k≤m
/
S
k=0
Copyright Rudra Dutta, NCSU, Fall, 2013

--μ
k 1
( )
--k!

4
4μ

p0 = 1
m

3
( )
pk = p0

5
6
5μ
6μ

--μ
m 1
( )
--m!
pm = ---------------m
 k 1
S --- --k=0
(μ)
k!
Erlang’s loss formula
B (m, l/m)
Erlang’s B function
E (A, N)
Summation


Analytical models are necessary for network traffic
arrival and service
Model must represent
–
–


Uncertainty in exact time of traffic demand arrival, since this is
not determined by network
Variation in effort required to serve traffic – too many factors,
may represent by uncertainty
Simple queuing considerations allow development of
stochastic models
Final result: models (formulae) that predict performance
metrics (e.g. delay)
–
–
For any given amount of provisioned service resource
Under given traffic load (demand for service)
Copyright Rudra Dutta, NCSU, Fall, 2013
Download