Introduction to Queueing Theory
In questa pagina 6
Why it is needed
In Network Performance AnalysisNetwork performance is measured by traffic metrics (bitrate R0, the link maximum; throughput S <= R0, data delivered successfully; goodput at the application layer), delay (end-to-end d = d_proc + d_queue + d_trans + d_prop with d_trans = L/R and d_prop = d/v; jitter; RTT), pipe capacity (BDP = rate times delay) and reliability (PER, PDR, PLR). The throughput of a path is that of its bottleneck link, the minimum bitrate, remembering that shared links split their capacity.Network Performance Analysis → the queueing delay was set aside: it depends on the traffic intensity, not only on link characteristics. To compute it, and to estimate the delay of the medium access protocols (Performance of Multiple Access ProtocolsWith Poisson arrivals, the success probability of a frame is the probability that no other frame arrives in the vulnerable time: pure ALOHA P_S = e^(-2G), throughput S = G e^(-2G) with maximum 1/(2e) = 0.18 at G = 1/2; slotted ALOHA S = G e^(-G) with maximum 1/e = 0.37 at G = 1; non-persistent CSMA with a = tau_p/t_F: S = G e^(-aG) / (G(1+2a) + e^(-aG)), which tends to 1 as a tends to 0 but collapses for large a, where slotted ALOHA is better. For TDMA (M/D/1) E[T] = t_F (N_u/2 + S N_u / (2(1-S)) + 1 + a) and for FDMA E[T] = t_F (N_u + S N_u / (2(1-S)) + a): FDMA is slower by t_F (N_u/2 - 1).Performance of Multiple Access Protocols →) or the jitter, the link is modelled as a queueing system (QS).
The treatment has three parts: (1) notation and definition of a queueing system, (2) performance metrics, (3) selected results (Little's law, the M/M/1 queue, the M/G/1 queue). Proofs are given only for Little's law and for the M/M/1 and M/D/1 formulas.
Part 1: the model
Definition (queueing system). A population of customers (in networks: data packets) arrives at a system made of a queue (buffer, waiting room) and a service facility with servers. Customers leave after service (departure process).
The arrival process
Customers arrive according to a random process. An infinite population is assumed: new arrivals are not affected by past ones (memorylessness). Customer is the -th:
- arrival instant of : ;
- interarrival time between and : ;
- assumption: the are independent and identically distributed (i.i.d.) with common distribution function , .
The counting process gives the number of arrivals up to time . If interarrivals are i.i.d. the process is homogeneous, and with the mean interarrival time the arrival rate is
Poisson arrivals. Only the homogeneous Poisson process of rate is considered. The number of arrivals in an interval of duration is Poisson with parameter . The interarrival time follows: "the next arrival comes after more than seconds" equals "no customer arrives in seconds", with probability (Poisson with ). So , : the interarrival time is exponential (mean ): The probability that exactly customers arrive in an interval of duration is
Example. Packets with per second: mean interarrival s. In s the mean number of arrivals is , and with : no arrival ; exactly : ; exactly : ; exactly : . The formula is exactly the one that gives the success probability of ALOHA (, ): no other frame must arrive in the vulnerable time.
Grafico interattivo: Exponential interarrival time with lambda = 2 per second: density 2e^(-2a) (decreasing, equal to 2 at a = 0) and cumulative distribution 1 - e^(-2a); the mean is 0.5 s and the probability of an interarrival <= 0.5 s is 1 - e^(-1) = 0.632
The service process
The service facility has one or more servers working in parallel and independently. The service time of is the time spent in the facility; service times are i.i.d. random variables, independent of the arrival process. The service rate of one server is and with servers in parallel it is .
Common service-time distributions:
- deterministic: constant time ; the cumulative distribution is a step. It is the case of a link sending packets all of the same length: ;
- exponential: , (exponentially distributed packet length). Mean and second moment (variance ), values needed for the Pollaczek-Khinchin formula.
The queue structure
- Queue capacity : the maximum number of customers that can wait (for packets: those that fit in the buffer).
- System storage capacity : the maximum number of customers in the system (queue or service): .
- Blocking systems: if is finite, customers finding the system full do not enter (blocking probability ). The rates of accepted and discarded customers are
- Non-blocking systems: infinite buffer. Example: one server and infinite queue.
Service discipline: the order in which customers leave the queue. The most common are FCFS (First Come First Served, also FIFO, the one used in the mathematical analysis), LCFS (Last Come First Served, LIFO) and queues with priorities.
Kendall notation. A queueing system is described by where is the statistical model of interarrivals, that of service, the number of servers, the capacity, the population size and the discipline. , , are optional: if missing, and are infinite and the discipline is FCFS. and are typically M (Markovian, exponential/Poisson), D (deterministic), G (general).
Example. M/M/1: Poisson arrivals, exponential service, one server, infinite queue, FCFS. M/D/1: Poisson arrivals, deterministic service. M/G/1: Poisson arrivals, service with any distribution.
Occupancy measures
At time : customers in the waiting queue; in service; in the whole system, with ( = departures up to ).
Definition (stability). A QS is stable if it admits a proper asymptotic distribution , , for , independent of the initial state . If it is identically zero or depends on the initial state, the QS is unstable.
Part 2: the metrics
Stability for non-blocking systems. Customers must arrive, on average, at a rate smaller than the rate at which they can be served: If the queue grows indefinitely, accumulating at the average rate . Blocking systems are always stable, since the number of customers is bounded by .
Time measures
- : waiting time of (time in the buffer before service);
- : service time;
- : system time, the total time spent in the system.
With the departure instant: , .
Traffic measures
- Arrival rate : mean number of arrivals per unit time.
- Offered traffic : mean number of arrivals during the mean service time,
- Throughput (departure rate): mean number of customers leaving the system per unit time. With the interdeparture time, .
- Useful traffic : mean number of departures during the mean service time, i.e. the throughput normalized to the service rate:
- Load factor (utilization, traffic intensity) , with servers:
The stability condition is equivalent to . For a stable, non-blocking system the output rate equals the input rate, so:
Example. A Mbit/s link sends -bit packets: packets/s ( ms). If packets/s arrive: , throughput packets/s, useful traffic . If packets/s arrived: , unstable; only packets/s leave () and the queue grows by packets per second.
Part 3: Little's law
Theorem (Little's law). The mean number of customers in a facility that conserves flow equals the arrival rate times the mean time a customer spends in it:
It is fundamental because it makes no assumption on arrival and departure processes (only that steady-state values exist), nor on the service discipline (it holds for non-FIFO scheduling too), nor on the dependence between arrivals and service, nor on the number of servers.
Proof. Count in two ways the total "customer-time" accumulated up to time , i.e. the sum of the seconds spent in the facility by all customers.
- Per instant. At instant there are customers; each consumes one customer-second per second, so the total is the area under : .
- Per customer. stays seconds, so the total is . The two totals coincide apart from customers still present at time , an error that in a stable system becomes negligible as .
Equating and dividing by , multiplying and dividing by : As the left side is the mean number of customers ; ; the last factor is the mean of the , i.e. . Hence . Neither the arrival distribution nor the service order was used, which is why the result is so general.
Applications. Choosing the facility:
| Facility | Mean number | Mean time | Little |
|---|---|---|---|
| whole QS | (system) | ||
| the queue only | (waiting) | ||
| the service only | (service) | (one server) |
The last row says that the mean number of customers in service is the utilization: for a single server is the fraction of time it is busy.
Part 3: the M/M/1 queue
Poisson arrivals (rate ), exponential service (rate ), one server, infinite buffer. Load factor , stability .
Formula (distribution and mean number in the system, M/M/1). The number of customers in the system is geometric:
Check: is the probability that the system is empty, the complement of the utilization.
Where the formulas come from. With Poisson arrivals and exponential service (both memoryless) the system changes state only by : from to on an arrival (rate ), from to on a departure (rate ). In steady state the number of passages per second from to and from to must be equal: Probabilities must sum to ; is the geometric series and converges only if , the stability condition: For the mean, using : For the variance, first with : The tail has a formula too: .
Grafico interattivo: Distribution of the number of customers in the M/M/1 system with rho = 0.8: p(n) = 0.2*0.8^n, decreasing geometric (p(0) = 0.2 = 1 - rho, p(1) = 0.16, p(2) = 0.128); the mean is rho/(1-rho) = 4
Formula (queue and times, M/M/1). Removing the number in service () from the number in the system: With Little:
The mean system time is the service time divided by : as the delay grows without bound.
Example. The Mbit/s link with -bit packets, packets/s, and packets/s (), exponential packet length (M/M/1):
- packets in the system;
- in the queue; in service, and ;
- ms; Little: ;
- ms, and ms;
- the system is empty with probability and has at least packets with probability .
If the load rises to : ms, four times more: the queue is very sensitive to load near .
Part 3: the M/G/1 queue
Poisson arrivals, general service distribution, one server. With the Pollaczek-Khinchin formula gives the mean waiting time in the queue in terms of the second moment of service: For constant service time (, i.e. M/D/1; the case of equal packets, later used in TDMA and FDMA), substitute and use : then and, with Little, :
Formula (M/G/1 with constant service).
With exponential service and Pollaczek-Khinchin returns , the M/M/1 result. In general grows with the variability of service: constant service halves the waiting time compared with exponential at the same .
Example. Same data (, , ) but all packets of bits (constant service, M/D/1): ms (against ms for M/M/1), ms, packets (Little: ).
Grafico interattivo: Normalized mean system time E[s]*mu versus load factor rho: M/M/1 (1/(1-rho)) and constant service (1 + rho/(2(1-rho))). Both diverge as rho tends to 1
Up to the delay is less than twice the service time, then it climbs steeply. A link should be dimensioned to work far from .
Versione ripasso
- Why. The queueing delay depends on traffic intensity, not only on links (Network Performance AnalysisNetwork performance is measured by traffic metrics (bitrate R0, the link maximum; throughput S <= R0, data delivered successfully; goodput at the application layer), delay (end-to-end d = d_proc + d_queue + d_trans + d_prop with d_trans = L/R and d_prop = d/v; jitter; RTT), pipe capacity (BDP = rate times delay) and reliability (PER, PDR, PLR). The throughput of a path is that of its bottleneck link, the minimum bitrate, remembering that shared links split their capacity.Network Performance Analysis →). The link is modelled as a queueing system (QS), also for access protocols (Performance of Multiple Access ProtocolsWith Poisson arrivals, the success probability of a frame is the probability that no other frame arrives in the vulnerable time: pure ALOHA P_S = e^(-2G), throughput S = G e^(-2G) with maximum 1/(2e) = 0.18 at G = 1/2; slotted ALOHA S = G e^(-G) with maximum 1/e = 0.37 at G = 1; non-persistent CSMA with a = tau_p/t_F: S = G e^(-aG) / (G(1+2a) + e^(-aG)), which tends to 1 as a tends to 0 but collapses for large a, where slotted ALOHA is better. For TDMA (M/D/1) E[T] = t_F (N_u/2 + S N_u / (2(1-S)) + 1 + a) and for FDMA E[T] = t_F (N_u + S N_u / (2(1-S)) + a): FDMA is slower by t_F (N_u/2 - 1).Performance of Multiple Access Protocols →).
- Model. Customers (packets) queue (buffer, capacity ) servers. System capacity . With blocking ( finite): customers finding the system full do not enter, , . Non-blocking: infinite buffer.
- Discipline. FCFS (FIFO, the default), LCFS (LIFO), priority queues.
- Kendall notation : arrivals, service (M Markovian/exponential, D deterministic, G general), servers. If and are missing they are infinite and the discipline is FCFS. Examples: M/M/1, M/D/1, M/G/1.
- Arrivals. Interarrival times i.i.d.; rate . For Poisson the interarrival is exponential, , , and the probability of arrivals in is .
- Arrival example. /s, s, mean : , , . The case, , is the success probability of ALOHA.
- Service. Times i.i.d., independent of arrivals; rate per server, in total. Deterministic ( for equal packets); exponential .
- Occupancy. queued, in service, .
- Stability. The QS is stable if an asymptotic distribution independent of the initial state exists.
- Times. waiting, service, system time: .
- Traffic.
- Offered ; load factor .
- Throughput , with interdeparture time; useful traffic .
- Stable (non-blocking) : , . Unstable (): , , the queue grows at rate . Blocking systems are always stable.
- Traffic example. Mbit/s link, -bit packets: /s. With : , /s. With : , /s and the queue grows by packets/s.
- Little's law. , valid with no assumption on arrivals, service, discipline or number of servers. Idea: the total time spent in the system is the same counted per customer () or per instant (). Applications: system ; queue ; service (fraction of time busy).
- M/M/1. With :
- (geometric), so ; ; ; ;
- ; ; .
- M/M/1 example. , /s: ; ; ms, Little ; ms; empty with probability ; at least 5 packets with probability . With : ms, four times more.
- M/G/1 (Pollaczek-Khinchin). . Exponential service (): M/M/1 again. Constant service (M/D/1, , equal packets, used for TDMA and FDMA): , , . Constant service halves the wait compared with exponential at the same .
- M/D/1 example. Same data (, ): ms (against 4 ms), ms, packets (Little: ).
- Why it matters. in M/M/1 diverges as . Up to the delay is below twice the service time, then climbs steeply: dimension a link far from .
- Typical mistakes: forgetting that the delay explodes as ; using instead of in the formulas; confusing (system) with (queue only); applying M/M/1 formulas to constant service, or vice versa.