You are on page 1of 11

EEC 189Q: Computer Networks

Littles Theorem/Formula Basic Queuing Model


Reading: Appendix A

Basic Model for Network Delay/Loss System


Message, Packet, Cell Arrivals Lost or Blocked

Delay Box:
(e.g., Multiplexer, Switch,Network) T seconds

Message, Packet, Cell Departures

Assume a system at which customers/data arrive at rate a(t) Interested in


Time spent in the system: T Average number of customers/packets in the system: N(t) Fraction of arriving customers/packets that are lost or blocked: Pb System throughput (# of customers/packets/cell that pass through the system)
2

Chuah, Fall 2004

Page 1

Definitions
Consider a system with no customer at time t=0. We define the following processes: A(t): # of arrivals between time 0 to t

B(t) : # of blocked customers between time 0 to t D(t): # of customer departures between time 0 to t N(t) = A(t)-B(t)-D(t): # of customers in the system at time t Long term arrival rate (t) and throughput ,

(t ) =

Lim A(t ) t t

throughput=

Lim D(t ) t t

Chuah, Fall 2004

Arrival Rate = 1 / mean interarrival time


n+1 A(t) n-1

2 1

0 1

t n+1

Time of nth arrival = 1 + 2 + . . . + n n arrivals 1 E[]


4

Arrival = Rate

=
1 + 2 + . . . + n seconds

1 (1+2 +...+n)/n

Chuah, Fall 2004

Figure A.2

Page 2

Littles Theorem

Very important result that relate three basic quantities for most queueing systems
= long term average arrival rate of customers for service E[N] = time averaged number of customers in the system E[T] = average duration each customer spends in the system

Littles Theorem: E[N] = E[T]


- true for general arrival processes and service processes. - arrivals need not be Poisson; service times need not be exponentially distributed; customers may not be served first come first served.

Chuah, Fall 2004

Littles Theorem: Intuitive Explanation


Assume first-come-first -served system On average, duration of which a particular customer stays in the system = E[T] During this time, on average E[T] customers arrive. These customers are left behind as the customer considered leaves, hence, represents E[N] Example:
- Assume arrival rate is a = 1 packet per second and the delay of each packet is s = 5 seconds - What is the average number of packets in the system?

Chuah, Fall 2004

Page 3

Littles Theorem
1 Latest bit seen by time t
d(i) = delay of packet i x(t) = number of packets in transit (in the system) at time t Sender Receiver

x(t)

time T What is the system occupancy, i.e., average number of packets in transit between 1 and 2 ?
Chuah, Fall 2004

Littles Theorem
1 Latest bit seen by time t
d(i) = delay of packet i x(t) = number of packets in transit (in the system) at time t Sender Receiver

x(t) S= area time T Average occupancy = S/T


Chuah, Fall 2004

Page 4

Littles Theorem
1 Latest bit seen by time t
d(i) = delay of packet i x(t) = number of packets in transit (in the system) at time t Sender
S(N)

Receiver
S(N-1)

d(N-1)

x(t) S= area time T S = S(1) + S(2) + + S(N) = P*(d(1) + d(2) + + d(N))


Chuah, Fall 2004

Littles Theorem
1 Latest bit seen by time t
d(i) = delay of packet i x(t) = number of packets in transit (in the system) at time t Sender
S(N)

Receiver
S(N-1)

d(N-1)

x(t) S= area time T Average S/T = (P*(d(1) + d(2) + + d(N)))/T occupancy = ((P*N)/T) * ((d(1) + d(2) + + d(N))/N)
Chuah, Fall 2004

Average arrival time

Average delay

10

Page 5

Littles Theorem
1 Latest bit seen by time t
d(i) = delay of packet i x(t) = number of packets in transit (in the system) at time t

Sender
S(N)

Receiver
S(N-1)

a(i)

d(N-1)

x(t) S= area time T Average occupancy = (average arrival rate) x (average delay)
Chuah, Fall 2004

11

Basic Queuing Model


Arrival process Queue Servers
1 2

A(t) i i +1 t B(t)

D(t)

Customers arrive with interarrivaltimes 1 , 2 , . n Arrival rate

Service time

1 E [ ]

Chuah, Fall 2004

12

Page 6

Poisson Arrival Process


If inter-arrival times are exponential random variables with mean E[]=1/ - Then A(t) in an interval length t is a Poisson variable with mean E[ A(t)]= t

(t ) k t P[ A(t ) = k ] = e k!

for k = 0, 1, ...

Chuah, Fall 2004

13

Service Times

Service time = time required t service a customer, and is denoted by X Maximum rate at which a server can process customers is when server is continuously vuy
- Average time between customer departures = average service time - Processing capacity of a server, = 1/E[X]

Chuah, Fall 2004

14

Page 7

Queuing System Classification


Distribution of inter-arrival time Distribution of service time Number of servers Number of buffers/ System capacity

Servers

Some standard code letters for A & S M: exponential


Source

Queue

D: deterministic Ek: Erlang with parameter k Hk: Hyperexponential with parameter k G: General

C C C C C

Chuah, Fall 2004

15

Examples

M/M/1/K
- Exponential (memoryless) interarrival and departure times, 1 server, buffer size = K - M/M/1: when K is infinity

M/G/1
- Exponential interarrival times, departure time follows general distribution, 1 server, infinite buffer space

Chuah, Fall 2004

16

Page 8

M/M/1: A Basic Multiplexer Model

How do you get exponentially distributed service time?


- Let transmission line has a speed of R bits/second - Transmission time = packet size/R - Let packet size, L follows exponential distribution E[X] = E[L]/R => = R/E[L]

Chuah, Fall 2004

17

M/M/1 Queue

Special case of birth-death process


- only one server: mean service rate is always the same, - inter-arrival times and service times are exponentially distributed - M/M/1 implies infinite buffer & population size - arrival rate is always the same,
0 1

j-1

j+1

Chuah, Fall 2004

18

Page 9

M/M/1 Queue (contd)

Probability of being in state n

pn =

p0

n = 1,2 ,...,

/ is called traffic intensity and is usually denoted by symbol

pn = n p0

n = 1,2,...,

- since all probability sums up to 1

p0 =

1 = 1 1 + + + 3 + ... +
2

pn = n (1 ) n = 1,2,...,

Chuah, Fall 2004

19

Properties of M/M/1 Queue


pn = n (1 ) n = 1,2,...,

Probability of being in state n is geometric


- Utilization of the server: P(having one or more jobs) = 1- p0 = - The mean number of jobs in the system:

(1 ) n=1 n =1 - Variance of the number of jobs E[ n ] = npn = n(1 ) n =


(1 ) 2 - P(n or more jobs in the system): Var( n ) = E[ n 2 ] ( E[ n]) 2 =


P ( n ) = p j = (1 ) j = n
j= n j=n

Chuah, Fall 2004

20

Page 10

Apply Littles Theorem to M/M/1 Queue

Mean # in the system = arrival rate x mean response time

E[ n ] = E[r ] E[ r ] = E[ n ] 1 1 / = 1 =1

Chuah, Fall 2004

21

Example

On a network gateway, measurements show that the packets arrive at a mean rate of 125 packets per second, and the gateway takes about 2 ms to forward them. Using M/M/1 model, analyze the gateway
- What is the mean number of packets in gateway? - What is the mean time spent in gateway? - What is the probability of buffer overflow if the gateway had only 13 buffers - How many buffers o we need to keep packet loss below one packet per million?

Chuah, Fall 2004

22

Page 11

You might also like