c Hung Q. Ngo, Computer Science and Engineering, SUNY at Buffalo This Week’s Agenda October 10, 2005 Last Time • CTMC Today • A Primer on Queueing Theory CSE 620 Lecture Notes Advanced Networking Concepts Page 1 c Hung Q. Ngo, Computer Science and Engineering, SUNY at Buffalo Basic Model and Kendall Notation October 10, 2005 B B A B Denote the system by A/B/k/c − S, where • A is the inter-arrival time distribution • B is the service time distribution at each server • k is the number of servers • c is the queue capacity (omit if ∞) • S is the service discipline (omit if FIFO) Some common distributions of inter-arrival and service times: • M : Markov, i.e. exponential; e.g. M/M/1, M/M/k • D: Deterministic; e.g. M/D/k • Em : Erlang-m (common with phone call arrivals at toll offices) • Hm : Hyper-m • G: a general distribution CSE 620 Lecture Notes Advanced Networking Concepts Page 2 c Hung Q. Ngo, Computer Science and Engineering, SUNY at Buffalo October 10, 2005 Basic Parameters and Performance Measures Input Parameters • Packet arrival processes (from the outside) • Distributions of service times at servers • Service disciplines at servers: FIFO, LIFO, Random, Priorities (rush order first, shortest processing time first, ...) • Service capacity (nodes have single or multiple servers) • Queue capacity (finite or infinite) Output Performance Measures • Distributions of waiting times at nodes • Distributions of sojourn times (wait + service times) • Distributions of number of packets at nodes • Distributions of busy times at servers • Packet loss rates • Throughput • ... CSE 620 Lecture Notes Advanced Networking Concepts Page 3 c Hung Q. Ngo, Computer Science and Engineering, SUNY at Buffalo October 10, 2005 Common Parameters and Measures for A/B/k/c Systems The averages • λ: mean arrival rate • µ: mean service time at each server • ρ = λ/µ: traffic intensity • N̄ : mean number of packets in the system • N̄q : mean number of packets in the queue • W̄ : mean waiting time overall, also called response time • W̄q : mean waiting time in the queue • r: throughput (departure rate) • u: utilization The random variables • N (t): number of packets in the system at time t • N : number of packets in the system at steady state • τ : invariant distribution (if any) of {N (t)}t≥0 CSE 620 Lecture Notes Advanced Networking Concepts Page 4 c Hung Q. Ngo, Computer Science and Engineering, SUNY at Buffalo Little’s Formulas October 10, 2005 Think: each packet pays money to wait and/or to be serviced. Mean rate system earns = λ× Mean amount a packet pays The following are called Little’s Formulas • Each packet pays 1$ per unit time in the system, then N̄ = λ · W̄ • Each packet pays 1$ per unit time in the queue, then N̄q = λ · W̄q CSE 620 Lecture Notes Advanced Networking Concepts Page 5 c Hung Q. Ngo, Computer Science and Engineering, SUNY at Buffalo October 10, 2005 The M/M/1 Queue • A BDP with constant birth rate λ, constant death rate µ • Stability condition C= ∞ X n=0 ρn < ∞ iff ρ < 1 iffλ < µ • Steady state probabilities 1 n τn = ρ = (1 − ρ)ρn n ≥ 0 C • Fraction of time system has n packets is τn (λ + µ) • It then follows that Pr[N ≥ m] N̄ W̄ W̄q r u CSE 620 Lecture Notes = 1− = X m−1 X τn = ρ m n=0 nτn = ρ 1−ρ N̄ 1 = = λ µ−λ 1 ρ = W̄ − = µ µ−λ = (1 − τ0 )µ = λ = 1 − τ0 = ρ Advanced Networking Concepts Page 6 c Hung Q. Ngo, Computer Science and Engineering, SUNY at Buffalo October 10, 2005 M/M/1: Some Performance Graphing 20 x/(1-x) 18 Mean number of packets in the system 16 14 12 10 8 6 4 2 0 0 0.1 0.2 0.3 0.4 0.5 Utilization 0.6 0.7 20 0.8 0.9 1/(1-x) 18 16 Mean Response Time 14 12 10 8 6 4 2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Utilization CSE 620 Lecture Notes Advanced Networking Concepts Page 7 c Hung Q. Ngo, Computer Science and Engineering, SUNY at Buffalo October 10, 2005 The M/M/k Queue • This is a birth and death process with constant birth rate λ and death rates iµ 1 ≤ i ≤ k µi = . kµ i > k • The stability condition is ∞ ρk X ρ i ρn + < ∞, C= n! k! k n=0 i=0 k−1 X which holds iff ρ < k. • At equilibrium, τ0 τn = = "k−1 X ρn + n! n=0 τ ρn 0 n! n τ0 ρn−k k!k CSE 620 Lecture Notes k ρ 1 k! 1 − ρ/k #−1 1≤n≤k n>k Advanced Networking Concepts Page 8 c Hung Q. Ngo, Computer Science and Engineering, SUNY at Buffalo October 10, 2005 The M/M/1/c Queue • This is a birth and death process with constant birth rate λ and constant death rate µ, state space {0, 1, . . . , c} • If ρ 6= 1, τn = • If ρ = 1, ρn 0 τn = • Thus, N̄ = • Loss probability ρ 1−ρ c/2 1 c+1 0 − n≤c n>c ploss = τc = CSE 620 Lecture Notes (1−ρ) 1−ρc+1 n≤c n>c c+1 c+1 1−ρc+1 ρ ρ=1 ρc ρ 6= 1 (1−ρ) 1−ρc+1 1 c+1 Advanced Networking Concepts ρ 6= 1 ρ=1 Page 9 c Hung Q. Ngo, Computer Science and Engineering, SUNY at Buffalo October 10, 2005 M/M/1/30: Some Performance Graphing 16 (x/(1-x) - x**31 * 31/(1-x**31)) Mean number of packets in the system 14 12 10 8 6 4 2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 Traffic intensity - M/M/1/30 1 0.7 0.8 0.9 x**30*(1-x)/(1-x**31) 0.9 Mean number of packets in the system 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0 5 10 15 20 Traffic intensity - M/M/1/30 CSE 620 Lecture Notes Advanced Networking Concepts Page 10 c Hung Q. Ngo, Computer Science and Engineering, SUNY at Buffalo October 10, 2005 Simple Comparisons of Queueing Systems Question Intuitively, is it better (in terms of response time) to have an M/M/1 with service rate 10µ or an M/M/10 with service rate µ, CSE 620 Lecture Notes Advanced Networking Concepts Page 11 c Hung Q. Ngo, Computer Science and Engineering, SUNY at Buffalo October 10, 2005 Simple Comparisons of Queueing Systems 1.4 Wa(x) Wb(x) 1.2 Response Time 1 0.8 0.6 0.4 0.2 0 0 2 4 6 8 10 Lambda 12 14 16 18 Figure 1: Wa(x): waiting time of the M/M/10 queue Wb(x): waiting time of the M/M/1 queue CSE 620 Lecture Notes Advanced Networking Concepts Page 12