M/M/1/K Lab

CSM §6.6.2. An M/M/1 queue with only K−1 buffers, so the system holds at most K customers (K−1 waiting, one in service). Arrivals that find the system in state K are lost. With ρ = λ/μ, Eq. 6.47 gives π*j = (1−ρ)ρj / (1−ρK+1) for 0 ≤ j ≤ K. Time is measured in mean service times (μ = 1), so λ = ρ.

How it works and what to try

How it works: Set the utilisation ρ and the system size K, or load the book’s Example 6.25. Bars show π* beside the fraction of simulated time spent in each state. An animated queue shows buffers filling and arrivals being turned away, with running counts of arrivals and losses. A third panel tracks the fraction of arrivals lost and the fraction of time spent full: because Poisson arrivals see time averages, both converge to π*K.

Try this: Fix ρ = 0.8 and raise K to see how quickly the blocking probability falls. Set ρ above 1: the queue is still stable, but see where the probability sits. Run a few seeds and check whether the lost fraction stays above π*K, below it, or neither.

Section, example and equation numbers refer to Chapter 6 of S. Keshav, Mathematical Foundations of Computer Networking, Addison-Wesley, 2012.

Parameters

Simulation

Changing ρ, K or the seed restarts the run from an empty system.

Things to try

  • Fix ρ = 0.8 and raise K. How quickly does π*K fall?
  • Set ρ above 1. The queue is still stable, but where does the probability mass sit?
  • Run a few seeds. Does the lost fraction stay above π*K, below it, or neither?

Stationary distribution π*

Bars are π*j from Eq. 6.47; the last bar, π*K, is the blocking probability. Rings show the fraction of simulated time spent in each state so far, and the triangle marks the current state.

π*j, j < Kπ*K (system full)simulated time fraction

The queue

Customers arrive at rate λ from the left. An arrival that finds all K−1 buffers full and the server busy (state K) is turned away and counted as lost. At high speeds individual customers are not drawn, but the counts are still exact.

Lost arrivals compared with π*K

The red line is the fraction of arrivals so far that were lost; the green line is the fraction of time so far spent in state K. Because arrivals are Poisson, they see the system in state K with the time-average probability (Poisson arrivals see time averages), so both lines converge to π*K. In any finite run the lost fraction can lie on either side of π*K; π*K is the long-run value, not a bound.

lost / arrivalsfraction of time in state Kπ*K (theory)