• No results found

Basic Queueing Theory M/M/* Queues. Introduction

N/A
N/A
Protected

Academic year: 2021

Share "Basic Queueing Theory M/M/* Queues. Introduction"

Copied!
21
0
0

Loading.... (view fulltext now)

Full text

(1)

CS 756 1

Basic Queueing Theory

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 machine-readable or printed form, must be obtained from

the author in writing.

Introduction

Queueing theory provides a mathematical basis for understanding and predicting the behavior of communication networks. Basic Model

Server Queue

(2)

CS 756 3

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)

M/M/1 Queueing Systems

Interarrival times are exponentially distributed, with average arrival rate λλλλ. Service times are exponentially distributed, with average service rate µµµµ.

There is only one server.

The buffer is assumed to be infinite.

The queuing discipline is first-come-first-serve (FCFS).

(3)

CS 756 5

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).

In equilibrium, Let

We have

State Transition Diagram

1 0 2 3 4 5 λ µ λ µ λ µ λ µ λ µ λ µ } {systeminstatei P Pi = P Pi = µ i+1 λ λ µ i i+1 The rate of movements in both directions should be equal

(4)

CS 756 7

Equations from the state transition diagram:

Solve What is ?

P

P

P

P

P

P

3 2 2 1 1 0 µ λ µ λ µ λ = = =

P

P

P

P

P

P

P

P

P

k k 0 0 2 0 1 2 0 0 1 ) ( ρ ρ ρ ρ µ λ ρ µ λ = = = = = =

ρ

Since we have That is, .

Note that must be less than 1, or else the system is unstable. ∞ = ∞ = = = 0 0 0 1 k k k

P

k

ρ

P

. 1 1 1 1 0 0 ρ ρ = = − −

P

P

ρ

)

1

(

ρ

ρ

=

k k

P

(5)

CS 756 9

Average Number of Customers

? ) 1 ( 0 0 ∞ = ∞ = = − = = k k k k k kP N ρ ρ

Average delay per customer (time in queue plus service time):

Average waiting time in queue:

Average number of customers in queue: λ µ λ = − = N 1 T λ µ ρ µ λ µ− − = − = 1 1 W ρ ρ λ − = = 1 2 W NQ

(6)

CS 756 11

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.

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.

(7)

CS 756 13

The system can be considered as 24 M/M/1 queues: We have 75% 64 48 = = ρ 3 75 . 0 1 75 . 0 = − = N msec 42 24 1 48 64 1 = − = T Queue Arrivals Departs to the other end of the T1 line Server, 1/24th of the T1 line Packet

Scenario 2

Users share a 1.544 Mbps line through an IP router. Packets from 24 users The entire T1 as the server

(8)

CS 756 15

The (aggregated) arrival rate is The service rate is

We have

This system is 24 times faster than TDM ! . 1152 48 24× = . 1536 64 24× = msec 4 . 2 384 1 1152 1536 1 % 75 64 / 48 ≈ = − = = = T ρ

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.

(9)

CS 756 17

M/M/m Queueing Systems

All servers are identical, with service rate

µ

Departs Queue Arrivals 1 2 Servers m

State Transition Diagram

Balance equations: 1 0 2 λ µ λ 2µ λ 3µ mµ m m+1 µ m λ λ λ µ m > ≤ = − m i P m m i P i P i i i , , for for 1 µ µ λ

(10)

CS 756 19

Solution

Where

Noticing that we have

> ≤ = m i m m P m i i mp P P i m i i for , ! for , ! ) ( 0 0 ρ . µ λ ρ m = , 1 0 = ∞ = i

P

i

]

[

1 (!(1) ) 0 ) (

!

1 0 ρ ρ ρ − − = =

+

m m m m i i m i P

The probability that an arriving customer has to wait in queue:

This is known as the Erlang C formula. ) 1 ( ! ) ( ! ) ( ! 0 0 0 ρ ρ ρ ρ ρ − = = = = ∞ = − ∞ = ∞ = m m P m m P m m P P P m m i m i m m i i m m i i Q

(11)

CS 756 21

Average number of waiting customers:

ρ ρ ρ ρ ρ ρ ρ ρ − = − = = = = − = ∞ = ∞ = + ∞ = + ∞ = 1 ) 1 ( ! ) ( ! ) ( ! ) ( 2 0 0 0 0 0 0 P m m P i m m P m m P i P i P m i N Q m i i m i m i m i m i m i i Q

Average waiting time in queue:

Average time in the system:

Average number of customers in the system: ) 1 ( ρ λ ρ λ = − = N P W Q Q λ µ µ ρ λ ρ µ µ + = + − = + − = m P P W T Q 1 Q ) 1 ( 1 1 ρ ρ ρ λ µ λ µ λ λ − + = − + = = 1 P m m P T N Q Q

(12)

CS 756 23

M/M/1/K Queueing Systems

Similar to M/M/1, except that the queue has a finite capacity of K slots.

That is, there can be at most K customers in the system.

If a customer arrives when the queue is full, he/she is discarded (leaves the system and will not return).

Analysis

Notice its similarity to M/M/1, except that there are no states greater than K . We have

Noticing that we have λ µ λ µ λ µ λ µ λ µ 0 1 2 K- 1 K > ≤ ≤ = K i for , 0 0 for , 0 i K P P i i ρ 1 0 = = K i Pi ρ ρ 1 0 1 1 + − − = K P

(13)

CS 756 25

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 be the value of N at time

t. Moreover, if , is said to be a

counting process.

The counting process 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 ) (t N 0 ) 0 ( = N N(t) ) (t N 0 ,ts ,... 1 , 0 , ! ) ( } ) ( ) ( { + − = = n= n t e n s N s t N P n t λ λ

Discussion

The interarrival times of a Poisson process with rate is exponentially distributed with average The reverse is also true: if the interarrival times of events are exponentially distributed with average 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.

λ 1/λ

λ / 1

(14)

CS 756 27

Sampling Poisson Arrivals

Consider a Poisson customer arrival process of with average rate λ.

Each customer can be classified as Type I or Type II, with probability p and 1-p

respectively.

Then, the arrival process of Type I customers is also Poisson with average rate pλ.

Likewise, the arrivals of Type II customers is Poisson with average rate (1p)λ.

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.

(15)

CS 756 29

Exercise

Consider the router configuration below.

The lengths of arriving packets are exponentially distributed with an average of 1000 bits.

2000 Packets Per sec. 1Mbps 2Mbps Port 1 Port 2 40% 60% Port 0

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

(16)

CS 756 31

Compute the average time a packet spent at the router (including transmission time).

Compute the average number of packets at the router(including the ones in

transmission).

Merging Poisson Arrivals

Given two exponential variables and with rates and , the random variable is also exponential, with rate .

Consider two Poisson arrivals, with average rates and .

The merged arrival process will also be a Poisson process, with the average rate

X1 X2

λ

1

λ

2 } , min{X1 X2 X =

λ

λ

1

+

2

λ

1

λ

2

λ

λ

1

+

2

(17)

CS 756 33

Application

Consider the router configuration below.

Router Port 1 Port 2 Port 0 Packet arrival Packet arrival

The lengths of arriving packets are

exponentially distributed with an average of 1000 bits.

– Why do we care about packet lengths ? Packet arrivals at ports 1 and 2 are

exponentially distributed with average rates of 2000 and 3000 packets per second,

respectively.

The transmission rate of port 0 is 10Mbps. The whole system can be modeled as a single M/M/1 queueing system, with an arrival rate of 5000 and service rate of 10,000.

(18)

CS 756 35

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 M/M/1 system 1 Server 2 Departs M/M/1 system 2 µ1 µ2 λ

Pitfall

Consider the system below where the servers are transmission lines.

Packets lengths are exponentially distributed with an average of 1000 bits.

Can the two queues be analyzed separately ? Why ?

1Mbps 2Mbps

500 Packets Per sec.

(19)

CS 756 37

Discussion

In general: any “feedforward” network of

independently-operating M/M/m systems can be analyzed in this system-by-system decomposition. λ p 1- p µ1 µ2 µ3 µ4

Question: How about networks that do

contain “feedbacks” ?

Answer: the interarrival times of some

systems may not be exponentially

distributed and thus cannot be analyzed as independent M/M/m queues

(20)

CS 756 39

Jackson's Theorem

For an arbitrary network of k M/M/1 queueing systems,

where

That is, in terms of the number of customers in each system, individual systems act as if they are independent M/M/1 queues (they may not). ), ( )... ( ) ( ) ,..., , (n1 n2 n P1 n1 P2 n2 P n P k = k k . ) 1 ( ) ( j ρj ρj j n nj P = −

Application

Consider the network below. The arrival rate and probabilities and are known.

We first compute the arrival rates and :

λ

p1 p2 CPU µ1 I / Oµ2 λ λ1 λ1 p1λ1 λ1 p2 λ2 λ2

λ

1

λ

2 p p p p 1 2 2 1 1 1 2 2 2 1 / , / ,

λ λ λ λ λ λ λ λ λ = = = + =

(21)

CS 756 41

Let and . By Jackson's theorem,

And

Total number of customers in system is Average time in system is

µ λ ρ1= 1/ 1 ρ2=λ2/µ2 ) 1 ( ) 1 ( ) , (i j = ρ1i −ρ1 ρ2j −ρ2 P ρ ρ ρ ρ 2 2 2 1 1 1 1 , 1− = − = N N . 2 1 N N N = + . ) 1 ( ) 1 ( 2 2 1 1 ρ λ ρ ρ λ ρ λ = − + − = N T

Discussion

Consider the packet switching network below.

Can we cite the Jackson's theorem, model the transmission lines as servers, and analyze them as separate M/M/1 queues ? Why ?

Router 1

Router 2

Router 3

Router 4

References

Related documents

This paper seeks to place photocatalytic e ffi ciencies into context, comparing performances of the conventional photocatalyst dispersion in surface mortar coatings with that

In accordance with the terms of article 18 of the Statutes of the association “Réseau ONCO- POITOU-CHARENTES”, the Internal Regulations are drawn up by the Administrative

This study focuses on the heat wave trend analysis associated with the variability in temperature and relative humidity in Delhi for the time period of 61

The aim of the presented studies is to determine changes in the volume of soil loss under typical field crop rotation conditions with bare fallow and to esti- mate the impact

Those who reflected on the experiences of the post Windrush migrants (Cumberbatch 1998, Phillips and Phillips 1998 and Andrews 2013) recall that young children who either came with,

Baseline demographic and clinical characteristics of all patients who underwent radical cystectomy with ileal orthotopic neobladder. Parameters Total Neobladder-vaginal fistula

In the FRS2 and ERK1/2 mediated negative feedback loop, the activated EGFR or FGFR induce FRS2 tyrosine phosphorylation thereby activates ERK1/2, which in turn

To specifically address the primary research question, the study focused on two related secondary questions: (1) Does the cultivation of GM crops result in a lower amount