Documente Academic
Documente Profesional
Documente Cultură
Eytan Modiano
Massachusetts Institute of Technology
Eytan Modiano
Slide 1
Packet Switched Networks
PS PS
PS
Packet Network
PS
PS
PS
Buffer
Packet
PS Switch
Eytan Modiano
Slide 2
Queueing Systems
Eytan Modiano
Slide 3
Random events
• Arrival process
– Packets arrive according to a random process
– Typically the arrival process is modeled as Poisson
( !T )n e "!T
P(n arrivals in interval T)=
n!
Eytan Modiano
Slide 4
The Poisson Process
( !T )n e "!T
P(n arrivals in interval T)=
n!
n = number of arrivals in T
E[n] = !T
E[n2 ] = !T + (! T )2
Eytan Modiano
Slide 5
Inter-arrival times
= 1 - e-λt
• The exponential distribution is often used to model the service times (I.e., the
packet length distribution)
Eytan Modiano
Slide 6
Markov property (Memoryless)
Pr oof :
P(t0 < T ! t0 + t)
P(T ! t0 + t | T > t 0 ) =
P(T > t0 )
t 0 +t
=
$t0
"e #"t dt
=
#e | t00
# "t t + t
=
#e #" (t +t 0 ) + e #" (t0 )
%
#e #"t %
e #" (t0 )
$ "e dt
# "t |t0
t0
# "t
=1#e = P(T ! t)
• Distribution of the time until the next arrival is independent of when the last
arrival occurred!
Eytan Modiano
Slide 7
Example
• When a customer arrives at the station the average amount of time until the
next arrival is 20 minutes
– Regardless of when the previous train arrived
Eytan Modiano
Slide 8
Properties of the Poisson process
• Merging Property
λ1
λ2 "! i
λk
Let A1, A2, … Ak be independent Poisson Processes
of rate λ1, λ2, …λk
A = ! Ai is also Poisson of rate = !" i
• Splitting property
– Suppose that every arrival is randomly routed with probability P to stream 1
and (1-P) to stream 2
– Streams 1 and 2 are Poisson of rates Pλ and (1-P)λ respectively
P λP
λ
1-P λ(1−P)
Eytan Modiano
Slide 9
Queueing Models
Customers server
Queue/buffer
• Model for
– Customers waiting in line
– Assembly line
– Packets in a network (transmission line)
• Want to know
– Average number of customers in the system
– Average delay experienced by a customer
Eytan Modiano
Slide 10
Little’s theorem
Network (system)
λ packet per second (N,T)
• Little’s theorem: N = λT
– Can be applied to entire system or any part of it
– Crowded system -> long delays
On a rainy day people drive slowly and roads are more congested!
Eytan Modiano
Slide 11
Proof of Little’s Theorem
α(t) T4
α(t), β(t) T3
T2 β(t)
T1
t1 t2 t3 t4
Eytan Modiano
Slide 12
Proof of Little’s Theorem
1t
Nt = " N(! )d! = timeave.number of customers in queue
t0
'T i
Tt = i= 0
= timeave.systemdelay, T = Limitt # $ Tt
& (t)
• Assume above limits exists, assume Ergodic system
! (t)
t ! (t)
% !(t) % i=1 Ti
! (t) ! (t)
Ti
N= i=1
=( ) = (T
Eytan Modiano
Slide 13 t t ! (t)
Application of little’s Theorem
• Example:
Customers server
Queue/buffer
1) The transmitter: DTP = packet transmission time
– Average number of packets at transmitter = λDTP = ρ = link utilization
4) Transmitter + buffer
– Average number of packets = ρ + Nq
Eytan Modiano
Slide 14
Application to complex system
!3
!1 !1
!2 !3
!2
• We have complex network with several traffic streams moving through it and
interacting arbitrarily
• N = ∑i Ni & λ = ∑i λi
"
i= k
i=1 i i
!T
• From Little's Theorem: T=
"
i= k
i=1
!i
Eytan Modiano
Slide 15
Single server queues
buffer
λ packet per second Server
• M/M/1
– Poisson arrivals, exponential service times
• M/G/1
– Poisson arrivals, general service times
• M/D/1
– Poisson arrivals, deterministic service times (fixed)
Eytan Modiano
Slide 16
Markov Chain for M/M/1 system
1−λδ λδ λδ λδ λδ
0 1 2 k
µδ µδ µδ µδ
• State k ⇒ k customers in the system
Eytan Modiano
Slide 17
Equilibrium analysis
• "
!
Now by axiom of probability: P(n) = 1
i=0
P(0)
# "i =0 $ n P(0) =
!
=1
1% $
# P(0) = 1 % $
P(n) = $ n (1% $)
Eytan Modiano
Slide 18
Average queue size
! !
#
N = " nP(n) = " n#n (1 $ #) =
n=0 n=0 1$ #
# %/µ %
N= = =
1$ # 1$ % /µ µ $ %
• T includes the queueing delay plus the service time (Service time = DTP = 1/µ )
– W = amount of time spent in queue = T - 1/µ ⇒
1 1
W= !
µ!" µ
• Finally, the average number of customers in the buffer can be obtained from
little’s formula
! !
NQ = !W = " =N"#
Eytan Modiano
Slide 19
µ"! µ
Example (fast food restaurant)
• Customers arrive at a fast food restaurant at a rate of 100 per hour and
take 30 seconds to be served.
• How much time do they spend in the restaurant?
Eytan Modiano
Slide 20
Packet switching vs. Circuit switching
λ/M
1 1 2 3 M 1 2 3 M
λ/M
N M(! / µ)
D = M /µ + M/M/1
(µ " ! ) formula
Packets generated at random times
(! / µ) M/M/1
D = 1/ µ +
λ/M ( µ " !) formula
Eytan Modiano
Slide 21
Circuit (tdm/fdm) vs. Packet switching
100
TDM with 20
sources
Average Service Time
Ideal Statistical
10
Multiplexing
(M/D/1)
1
0 0.2 0.4 0.6 0.8 1
Eytan Modiano
Slide 22
M server systems: M/M/m
Server
buffer
λ packet per second M servers
µ packet per
Server second, per
server
• Departure rate is proportional to the number of servers in use
1−λδ λδ λδ λδ λδ λδ
0 1 2 m m+1
P(0) = & # + )
&% n =0 n! m!(1" !) )(
n= *
P(0)(m!)m
PQ = # P(n) =
n= m m!(1" !)
n= * n=*
mm !m + n !
NQ = # nP(n + m) = # nP(0)( ) = PQ ( )
n=0 n =0 m! 1 " !
NQ
W= , T = W + 1/ µ, N = + T = + / µ + NQ
Eytan Modiano
Slide 24
+
Applications of M/M/m
• When the system is lightly loaded, PQ~0, and Single server is m times faster
• When system is heavily loaded, queueing delay dominates and systems are roughly the
same
Eytan Modiano
Slide 25
M/M/Infinity
1−λδ λδ λδ λδ λδ λδ
0 1 2 n n+1
P(0)(! / µ )n
! P(n " 1) = nµ P(n), #n > 1, $ P(n) =
n!
"1
P(0) = '1 + & n =1 (! / µ )n / n!) = e" ! / µ
%
( *
P(n) = (! / µ )n e" ! / µ / n! $ Poisson distribution!
N = Averagenumber in system = ! / µ, T = N / ! =1 / µ = servicetime
Eytan Modiano
Slide 26
Blocking Probability
• M/M/m/m system
– m servers ⇒ m circuits
– Last m indicated that the system can hold no more than m users
• Erlang B formula
– Gives the probability that a caller finds all circuits busy
– Holds for general call arrival distribution (although we prove Markov case
only)
(! / µ) m / m!
PB =
"n= 0
m
( ! / µ ) n
/ n!
Eytan Modiano
Slide 27
M/M/m/m system: Erlang B formula
1−λδ λδ λδ λδ λδ
0 1 2 m
P(0)( ! / µ )n
!P(n " 1) = nµP(n), 1 # n # m, $ P(n) =
n!
[% ]
m "1
P(0) = n= 0
( ! / µ ) / n!
n
(! / µ ) / m!
m
PB = P(Blocking ) = P(m) = m
%n= 0 (! / µ) n / n!
Eytan Modiano
Slide 28
Erlang B formula
• Example
– Arrival rate = 4 calls per minute, average 3 minutes per call => A = 12
Circuits PB
20 1%
15 8%
7 30%
Eytan Modiano
Slide 29
Multi-dimensional Markov Chains
• K classes of customers
– Class j: arrival rate λj; service rate µj
• State of system: n = (n1, n2, …, nk); nj = number of class j customers in the system
• If detailed balance equations hold for adjacent states, then a product form solution
exists, where:
Eytan Modiano
Slide 30
Truncation
• Eliminate some of the states
– E.g., for the K M/M/1 queues, eliminate all states where n1+n2+…+nk > K1 (some constant)
G n"S
Eytan Modiano
Slide 31
Example
– When µ1=! µ2 need to know the number of calls in progress of each session type
– Two dimensional markov chain state = (n1, n2)
– Want P(n1, n2): n1+n2 <=m
i = m j = m "i
( !1n1 / n1 !)( !2n2 / n2 !)
P(n1, n2 ) = G= # #( ! / i!)(!
i j
, 1 2 / j!), n1+ n2$ m
G i =0 j =0
– Notice that the double sum counts only states for which j+i <= m
Eytan Modiano
Slide 32
PASTA: Poisson Arrivals See Time Averages
• More general queueing systems have a more general state that may
include how much service each customer has already received
Eytan Modiano
Slide 33
Occupancy distribution upon arrival
• Example:
– Deterministic arrivals 1 per second
– Deterministic service time of 3/4 seconds
Eytan Modiano
Slide 34
Occupancy upon arrival for a M/M/1 queue
an = Lim t-> inf (P (N(t) = n | an arrival occurred just after time t))
Pn = Lim t-> inf (P(N(t) = n))
Proof: Let A(t, t+δ) be the event that and arrival occurred between t and t+δ