api.lossn

Link-level performance measures of a product-form loss network

For a loss network with offered loads nu, requirement matrix A and capacities C (A n <= C), returns for every link j and route r the probability E(j,r) that link j alone lacks the A(j,r) free units a route-r call needs, the mean occupancy of each link, and the route losses. With the exact methods the link blocking is

E(j,r) = 1 - G(C - A(j,r) e_j) / G(C),

where G is the product-form normalization constant and e_j the j-th unit vector, computed from one extra constant per distinct (j, A(j,r)) pair. A route-r call is lost when ANY of its links blocks, so Loss_r is at least max_j E(j,r). The mean occupancy of link j is sum_r A(j,r) QLen_r.

Supported methods: ‘exact’ (or ‘manjunath’, ‘ms’) Manjunath-style exact recursion ‘rec’ recursive decision diagram (Kirby-Wang style) normalization ‘erlangfp’ Erlang fixed point; E is the per-link Kaufman-Roberts blocking on the reduced loads ‘asy’ Kelly limit; E(j,r) = 1 - (1-a_j)^A(j,r) ‘mci’ Monte Carlo summation; E from the same samples as Loss

Parameters:
  • nu – Offered load of route r (1xR)

  • A – Capacity requirement of link j for route r (JxR)

  • C – Capacity of link j (Jx1)

  • method – ‘exact’ (default), ‘rec’, ‘erlangfp’, ‘asy’ or ‘mci’

  • options – lossn_mci options (samples, seed, alpha, gamma), used by ‘mci’

Returns:

E – Blocking probability of route r on link j (JxR; 0 where A(j,r)=0) Occ: Mean number of busy units on link j (Jx1) Loss: Loss probability of route r (1xR) QLen: Mean number of route-r calls in progress (1xR)

Examples

[E, Occ, Loss, QLen] = lossn_links(nu, A, C)
[E, Occ, Loss, QLen] = lossn_links(nu, A, C, method)
[E, Occ, Loss, QLen] = lossn_links(nu, A, C, method, options)
lossn_asy(nu, A, C)

Computes the fluid limit of a loss network by convex duality

Scales offered loads nu and capacities C together, nu -> N nu and C -> N C, and returns the limit of the class loss probabilities as N grows (Kelly 1986; Ross 1995, Theorem 5.13). In this limit link j blocks independently with probability a_j, and the a_j solve the complementary slackness conditions

sum_k A(j,k) nu_k prod_i (1-a_i)^A(i,k) = C_j if a_j > 0, <= C_j if a_j = 0,

the route loss being 1 - prod_j (1-a_j)^A(j,k). With y_j = -log(1-a_j) these are the optimality conditions of the strictly convex problem

minimize sum_k nu_k exp(-sum_j A(j,k) y_j) + sum_j C_j y_j, y >= 0,

solved here by cyclic coordinate descent, each coordinate by Newton’s method on a concave increasing function. The result needs no summation over states and costs O(J R) per sweep, so it scales to any capacity; it reports zero loss on links that are underloaded at the fluid scale, so it is accurate in heavy (overloaded) traffic and for large C. A and C need not be integral.

Parameters:
  • nu – Offered load of route (class) r (1xR)

  • A – Capacity requirement of link j for route r (JxR, nonnegative)

  • C – Capacity of link j (Jx1, nonnegative)

Returns:

QLen – Mean number of route-r calls in progress, nu_r (1-Loss_r) (1xR) Loss: Limiting loss probability of route r (1xR) a: Limiting blocking probability of link j (Jx1) niter: Number of coordinate-descent sweeps

Examples

[QLen, Loss, a, niter] = lossn_asy(nu, A, C)

References

F. P. Kelly, “Blocking probabilities in large circuit-switched networks”, Adv. Appl. Probab. 18, 1986. F. P. Kelly, “Loss Networks”, Ann. Appl. Probab. 1(3), 1991. K. W. Ross, “Multiservice Loss Models for Broadband Telecommunication Networks”, Springer, 1995, Sec. 5.8.

test_lossn_ross95()

TEST_LOSSN_ROSS95 Validate the multirate link, asymptotic, per-link and revenue-sensitivity functions of the lossn API against the worked examples of K. W. Ross, “Multiservice Loss Models for Broadband Telecommunication Networks”, Springer, 1995, and against exact references.

lossn_revsens(nu, A, C, w, method, options)

Derivative of the long-run revenue rate with respect to offered loads

A loss network with offered loads nu (unit mean holding times), requirement matrix A and capacities C earns w_k per unit time for each route-k call in progress, so its revenue rate is W = sum_k w_k QLen_k. This function returns the sensitivity dW/dnu_k and the implied costs: the expected revenue lost over the lifetime of an admitted route-k call through the extra blocking it causes to later calls. They satisfy (Ross 1995, Theorem 5.11)

dW/dnu_k = (1 - B_k) (w_k - c_k), c_k = W(C) - W(C - A e_k),

so admitting a route-k call raises revenue only if w_k exceeds c_k. The link implied cost (shadow price) of route k on link j is W(C) - W(C - A(j,k) e_j), the revenue lost when link j alone loses the units of one route-k call.

Supported methods: ‘exact’ (or ‘manjunath’, ‘ms’), ‘rec’ Theorem 5.11 with exact normalization constants ‘erlangfp’ reduced-load approximation of the implied costs: the link costs c(j,k) solve Ross (1995) eq. 5.21, c(j,k) = sum_l D(j,l,k) eta(j,l) [w_l - sum_{i~=j} c(i,l)], with eta the Erlang fixed point reduced loads and D the change of the Kaufman-Roberts blocking of route l on link j when its capacity drops by A(j,k); then dW/dnu_k = prod_j (1 - E(j,k)) (w_k - sum_j c(j,k)) ‘mci’ Monte Carlo summation: dW/dnu_l = Cov(X_l, r(X))/nu_l from the importance samples, with delta-method confidence intervals

Parameters:
  • nu – Offered load of route k (1xR)

  • A – Capacity requirement of link j for route k (JxR)

  • C – Capacity of link j (Jx1)

  • w – Revenue per unit time of a route-k call in progress (1xR)

  • method – ‘exact’ (default), ‘rec’, ‘erlangfp’ or ‘mci’

  • options – lossn_mci options (samples, seed, alpha, gamma), used by ‘mci’

Returns:

dW – Revenue sensitivity dW/dnu_k (1xR) c: Route implied cost c_k (1xR; NaN if a route-k call never fits) W: Revenue rate sum_k w_k QLen_k clink: Link implied cost of route k on link j (JxR; 0 where A(j,k)=0) ci: ‘mci’ only: struct with .revsens (1xR), .revsensCI (Rx2) and

Examples

[dW, c, W, clink, ci] = lossn_revsens(nu, A, C, w)
[dW, c, W, clink, ci] = lossn_revsens(nu, A, C, w, method)
[dW, c, W, clink, ci] = lossn_revsens(nu, A, C, w, method, options)

References

K. W. Ross, “Multiservice Loss Models for Broadband Telecommunication Networks”, Springer, 1995, Sec. 5.7 and 6.3. F. P. Kelly, “Routing in circuit-switched networks: optimization, shadow prices and decentralization”, Adv. Appl. Probab. 20, 1988.

lossn_kr_asy(rho, b, C)

Normal approximation of multirate single-link blocking for large C

In the critically loaded regime, where C and the offered loads grow together with sum_k b_k rho_k / C -> 1, the normalized occupancy of a stochastic knapsack converges to a truncated multivariate normal law (Kelly 1991; Ross 1995, Theorem 2.8) and blocking is asymptotically proportional to the call size (Ross 1995, Corollary 2.7). For a knapsack of fixed capacity C the resulting approximation is

alpha = (C - sum_k b_k rho_k) / sqrt(C), sigma^2 = sum_k b_k^2 rho_k / C, delta = phi(alpha/sigma) / (sigma Phi(alpha/sigma)), B_k = b_k delta / sqrt(C),

with phi and Phi the standard normal density and distribution function. B_k is capped at 1. The approximation is accurate when |alpha| is small (roughly below 1); far from critical loading use lossn_kr for the exact values, or lossn_asy for the fluid (Kelly) limit.

Parameters:
  • rho – Offered load of class k (1xK, nonnegative)

  • b – Bandwidth units held by a class-k call (1xK, nonnegative)

  • C – Link capacity (positive)

Returns:

B – Approximate blocking probability of class k (1xK) alpha: Normalized spare capacity (C - sum b rho)/sqrt(C) sigma: Normalized occupancy standard deviation delta: Blocking per unit of call size, times sqrt(C)

Examples

[B, alpha, sigma, delta] = lossn_kr_asy(rho, b, C)

References

K. W. Ross, “Multiservice Loss Models for Broadband Telecommunication Networks”, Springer, 1995, Sec. 2.7. M. I. Reiman, “A critically loaded multirate link with trunk reservation”, Queueing Systems 9, 1991.

lossn_kr(rho, b, C)

Exact occupancy distribution and per-class blocking of a stochastic knapsack

A single link of C bandwidth units is offered K classes of calls. Class k arrives as a Poisson process with offered load rho_k (arrival rate times mean holding time) and holds b_k units for the whole call; a call that finds fewer than b_k free units is lost. The occupancy distribution q(n) = P(n units busy), n = 0..C, satisfies the Kaufman-Roberts recursion

n q(n) = sum_k b_k rho_k q(n - b_k), q(n) = 0 for n < 0,

and a class-k call is blocked when more than C - b_k units are busy,

B_k = sum_{n = C-b_k+1}^{C} q(n).

The result is insensitive to the holding-time distributions beyond their means. A class with b_k = 0 is never blocked; a class with b_k > C always is.

Parameters:
  • rho – Offered load of class k (1xK, nonnegative)

  • b – Bandwidth units held by a class-k call (1xK, nonnegative integers)

  • C – Link capacity in bandwidth units (nonnegative integer)

Returns:

q – Occupancy distribution, q(n+1) = P(n units busy), n = 0..C (1x(C+1)) B: Blocking probability of class k (1xK) QLen: Mean number of class-k calls in progress, rho_k (1 - B_k) (1xK)

Examples

[q, B, QLen] = lossn_kr(rho, b, C)

References

J. S. Kaufman, “Blocking in a Shared Resource Environment”, IEEE Trans. Commun. 29(10), 1981. J. W. Roberts, “A Service System with Heterogeneous User Requirements”, 1981. K. W. Ross, “Multiservice Loss Models for Broadband Telecommunication Networks”, Springer, 1995, Sec. 2.2.

test_lossn_mci()

TEST_LOSSN_MCI Validate Monte Carlo summation for loss networks against exact enumeration, Erlang-B, and the Erlang fixed point.

test_lossn_manjunath()

TEST_LOSSN_MS Validate the Manjunath-Sikdar transform for loss networks against Erlang-B, exact box enumeration, and the Monte Carlo estimator.

mexify_lossn

@brief MATLAB Coder script to generate MEX functions for lossn_ module.

This script generates MEX (MATLAB Executable) versions of loss-network functions for improved performance.

See also CODER, CODER.CONFIG, CODER.TYPEOF, CODEGEN.

lossn_rec(nu, A, C)

[QLEN, LOSS, LG, NITER] = LOSSN_REC(NU, A, C) Exact analysis of a loss network by MDD-rec: the normalising constant is the sum of a product form over the admissible set {n >= 0 : A n <= C}, which is what a decision diagram holding that set computes in one memoised walk.

A Kelly loss network carries offered load nu_r on route r and admits a call only while the resource constraint A n <= C still holds after it. The stationary law is the truncation of independent Poisson counts to that set,

P(n) = (1/G) prod_r nu_r^{n_r} / n_r!, G = sum_{A n <= C} prod_r …,

so g_r(k) = nu_r^k/k! and MDD_REC returns G. By PASTA the acceptance probability of a class-r call is the ratio of two such constants,

1 - B_r = G(C - A e_r) / G(C),

which is one further diagram per class.

WHY THIS EXISTS ALONGSIDE LOSSN_MANJUNATH. The Manjunath-Sikdar transform evaluates G exactly as a multidimensional residue, and the residue argument counts WHOLE UNITS: it needs an integral A and C. On a region declaring a fractional class size or capacity the analyzer had no exact route at all and fell back to the Erlang fixed point, an approximation. MDD-rec needs only that the admissible set be finite and bounded coordinate by coordinate, which a fractional constraint still is, so it is exact there too. It is also an exact alternative to the Monte Carlo summation LOSSN_MCI estimates.

– Input NU : 1 x K offered load per class A : J x K non-negative resource requirement matrix C : J x 1 capacity vector – Output QLEN : 1 x K mean number of class-r calls in progress (the carried load) LOSS : 1 x K blocking probability LG : log of the normalising constant G(C) NITER: number of diagram walks performed, K + 1

– Reference F. P. Kelly, “Loss networks”, Annals of Applied Probability 1(3), 1991. S. Balsamo, A. Marin, I. Stojic, “Computation of the normalising constant for product-form models of distributed systems with synchronisation”, Future Generation Computer Systems 111 (2020) 475-490.

See also LOSSN_MANJUNATH, LOSSN_ERLANGFP, LOSSN_MCI, MDD_REC.

lossn_mci(nu, A, C, options)

Estimates the product-form normalization constant and class blocking probabilities of a loss network by Monte Carlo summation.

Implements the importance-sampling Monte Carlo summation method of Ross and Wang, “Monte Carlo Summation Applied to Product-Form Loss Networks”, Probability in the Engineering and Informational Sciences, 6 (1992), 323-348.

A loss network has links j=1..J with capacity C(j) and classes (routes) r=1..R with offered load nu(r) and per-link circuit requirement A(j,r). The state n=(n_1,..,n_R) is feasible iff A*n <= C (set Omega). The equilibrium distribution is product form with normalization constant g(C) = sum_{n in Omega} prod_r nu(r)^n_r / n_r! . The class-r acceptance probability is 1-beta_r = g(C-A(:,r))/g(C).

States are sampled from the importance distribution (Eq. 6) p(n) = (1/c) prod_r gamma_r^n_r / n_r!, n in {0..N_1}x..x{0..N_R}, with N_r = min_j floor(C_j/A_jr) over A_jr>0. Ratio estimators (Eq. 8) give unbiased/consistent g and consistent blocking with delta-method confidence intervals.

Parameters:
  • nu – Offered load of route (class) r (1xR vector)

  • A – Circuit requirement of link j for route r (JxR matrix)

  • C – Available capacity of link j (Jx1 vector)

  • options – struct with optional fields: samples (default 1e5),

Returns:

QLen – Mean carried load (E[n_r]) for route r (1xR) Loss: Blocking probability beta_r for route r (1xR) lG: Log of the estimated normalization constant g(C) ci: struct with confidence intervals and point estimates: nsamples: Number of Monte Carlo samples used

Examples

[QLen, Loss, lG, ci, nsamples] = lossn_mci(nu, A, C)
[QLen, Loss, lG, ci, nsamples] = lossn_mci(nu, A, C, options)
lossn_kr_dim(rho, b, Btarget)

Dimensions a multirate link by the Kaufman-Roberts recursion

Returns the smallest integer capacity C such that every class of the stochastic knapsack (see lossn_kr) has blocking B_k(C) no larger than its target. The unnormalized Kaufman-Roberts terms

n q(n) = sum_k b_k rho_k q(n - b_k), q(0) = 1,

do not depend on C, so the search extends a single recursion one unit at a time and evaluates B_k(C) = sum_{n>C-b_k} q(n) / sum_{n<=C} q(n) at each step, at a total cost of O(C K). The search scans every C upwards rather than bisecting because the blocking of a wide class need not decrease monotonically in C (Ross 1995, Sec. 2.6).

Parameters:
  • rho – Offered load of class k (1xK, nonnegative)

  • b – Bandwidth units held by a class-k call (1xK, nonnegative integers)

  • Btarget – Blocking target, scalar or 1xK, each in (0,1]

Returns:

C – Smallest capacity with B_k(C) <= Btarget_k for all k B: Blocking probabilities at that capacity (1xK)

Examples

[C, B] = lossn_kr_dim(rho, b, Btarget)
lossn_erlangfp(nu, A, C)

Computes performance metrics for loss networks using Erlang FP

Uses the Erlang fixed point (reduced-load) approximation to compute performance metrics for loss networks. Calls on route r arrive according to Poisson rate nu_r with unit mean service times. Link capacity requirements are: sum_r A(j,r) n(j,r) <= C(j) for all links j. Each link is solved in isolation by the Kaufman-Roberts recursion on the loads thinned by the other links, so a route asking for A(j,r) > 1 units is blocked when fewer than A(j,r) units are free; with unit requirements this is Kelly’s Erlang fixed point.

Parameters:
  • nu – Arrival rate of route (class) r (1xR vector)

  • A – Capacity requirement of link j for route r (JxR matrix)

  • C – Available capacity of link j (Jx1 vector)

Returns:

QLen – Mean queue-length for route r Loss: Loss probability for route r E: Blocking probability of route r on link j (JxR matrix) niter: Number of iterations required for convergence

Examples

[QLen, Loss, E, niter] = lossn_erlangfp(nu, A, C)

[QLen,Loss,E,niter] = LOSSN_ERLANGFP(nu,A,C) Erlang fixed point (reduced-load) approximation for loss networks

Calls (i.e., jobs) on route (i.e., class) r arrive according to Poisson rate nu_r, r=1..R. Call service times on route r have unit mean.

Link capacity requirements are:

sum_r A(j,r) n(j,r) <= C(j)

for all links j=1..J, where n(j,r) counts the calls on route r on link j.

Link j sees route r offered at nu_r thinned by the blocking of r on every OTHER link, and its occupancy distribution is the Kaufman-Roberts one (Kaufman 1981, Roberts 1981), so B(j,r) = P(more than C(j)-A(j,r) units busy). Unit requirements reduce this to Kelly’s Erlang fixed point; the earlier form fed the multi-unit load to Erlang B, which counted a call of size a as a single unit and ran to the iteration cap 40% low.

INPUT: nu (1xR): arv. rate of route (class) r = 1..R A (J,R): capacity requirement of link j for route r = 1..R C (J,1): available capacity of link j

OUTPUT: Q (1xR): mean queue-length for route r = 1..R calls L (1xR): loss probability for route r = 1..R calls E (JxR): blocking probability of route r on link j

NOTE: nu_r may be replaced by a utilization rho_r=nu_r/mu_r, where mu_r is the service rate for route r.

lossn_manjunath(nu, A, C)

Exact normalization constant and blocking probabilities of a loss network

Calls on route r arrive according to a Poisson process of rate nu_r with unit mean holding time, so nu_r is the offered load. A call is admitted only if it leaves every link within capacity,

sum_r A(j,r) n_r <= C(j), j = 1 … J,

and is lost otherwise. The admissible set is coordinate convex, so by Kelly’s truncation theorem the stationary distribution is the truncated product form

p(n) = (1/g(C)) prod_r nu_r^{n_r} / n_r!, A n <= C,

and every metric follows from ratios of the normalization constant

g(C) = sum_{A n <= C} prod_r nu_r^{n_r} / n_r! E[n_r] = nu_r g(C - A e_r) / g(C) Loss_r = 1 - g(C - A e_r) / g(C)

because a class r call is blocked exactly when the state cannot absorb one more unit of its own requirement vector.

g(C) is evaluated exactly by the transform technique of Manjunath and Sikdar. Writing the indicator of each constraint as a contour integral turns the sum into a J-fold integral over the unit circle whose integrand factorizes into the z-transforms of the per-route terms,

g(C) = oint … oint prod_j [ (z_j^{C_j+1}-1) / (z_j^{C_j+1}(z_j-1)) ] prod_r Fcal_r(z_1^{A_1r} … z_J^{A_Jr}) dz_1 … dz_J.

Inside the unit circle the only pole in z_j is at the origin, of order C_j+1, so each integration is a residue and hence a Taylor coefficient. The routine therefore builds the generating function as a multivariate power series truncated at degree C_j in z_j, one shift-and-accumulate convolution per route, and each ‘<=’ constraint is discharged by summing the coefficients of degrees 0 … C_j along that dimension. Truncation is exact because A is nonnegative: a monomial above degree C_j can never contribute to an extracted coefficient.

Contour integrations are interleaved with the product rather than deferred to the end: variable z_j is created when the first route with A(j,r) ~= 0 is multiplied in and integrated out immediately after the last one, so the peak memory is the product of (C_j+1) over the simultaneously live links, an induced width, rather than over all J links.

Unlike lossn_erlangfp this is exact rather than a reduced-load approximation, and unlike lossn_mci it carries no sampling error, which matters for rare blocking: a loss probability of 1e-4 recovered from a simulated or sampled throughput is dominated by the estimator variance. The cost is prod_j (C_j+1) memory over the live links, so it is exact but not unconditionally cheap; use lossn_mci when that product is prohibitive.

A and C must be integer valued, since the residue argument counts whole units of capacity. Each row is divided by the greatest common divisor of its entries and of C(j), which is exact and shrinks the corresponding dimension. Routes appearing in no constraint never block and contribute a factor exp(nu_r) to g(C).

Parameters:
  • nu – Offered load of route (class) r (1xR vector)

  • A – Capacity requirement of link j for route r (JxR nonnegative integers)

  • C – Available capacity of link j (Jx1 nonnegative integers)

Returns:

QLen – Mean carried load E[n_r] for route r (1xR) Loss: Blocking probability for route r (1xR) lG: Log of the exact normalization constant g(C) niter: Number of iterations, always 1 (direct method)

Examples

[QLen, Loss, lG, niter] = lossn_manjunath(nu, A, C)

References

D. Manjunath and B. Sikdar, Integral Expressions for the Numerical Evaluation of Product Form Expressions Over Irregular Multidimensional Integer Spaces.