2 % @brief Majumdar-Woodside robust box bounds on throughput
for closed
3 % multiclass queueing networks with mixed scheduling disciplines.
6 % Computes distribution-insensitive (NBUE) upper and lower bounds on
the
7 % per-
class system throughput of a closed multiclass queueing network, as
8 % defined by Majumdar and Woodside,
"Robust bounds and throughput guarantees
9 % for closed multiclass queueing networks", Performance Evaluation 32 (1998)
10 % 101-136. The upper bound intersects
the no-contention bound (eq. 2) with
11 %
the utilization-based bound (eq. 3) and
is independent of
the scheduling
12 % discipline. The lower bound
is the multiclass throughput guarantee of
13 % Theorem 2 (eq. 15): X_c >= N_c / (Z_c + sum_k V_kc (S_kc + d_kc^+)), where
14 %
the per-visit queueing delay bound d_kc^+ depends on
the discipline at
15 % station k -- FIFO (Theorem 1 / eq. 6, via Lemma 1), processor sharing
16 % (Lemma 2), preemptive priority (Lemma 3) and non-preemptive priority
17 % (Lemmas 4-5). The coupled inequalities are resolved by
the interval-
18 % narrowing fixed point that reproduces
the BNR-Prolog robust box bounds;
19 % for a single FIFO class it reduces to
the Muntz-Wong asymptotic bounds.
21 % Bounds are insensitive to
the service-time distributions (only NBUE
is
22 % assumed) and to routing dependencies; only
the mean
visits V, mean service
23 % demands S, populations N, think times Z, per-station disciplines and per-
24 % class priorities are required. The think time Z aggregates
the pure-delay
25 % (infinite-server) stations; only queueing stations are passed in V,S.
29 % [Xlo,Xup,Wlo] = pfqn_mwrbb(V,S,N,Z,sched,prio)
34 % <tr><th>Name<th>Description
35 % <tr><td>V<td>(K x C) mean
visits of class c at queueing station k
36 % <tr><td>S<td>(K x C) mean service demand per visit of class c at station k
37 % <tr><td>N<td>(1 x C) population of class c
38 % <tr><td>Z<td>(1 x C) think time (pure delay) of class c
39 % <tr><td>sched<td>(K x 1) discipline code per station: 0=FIFO (default),
40 % 1=PS, 2=non-preemptive priority, 3=preemptive priority,
41 % 4=ABA full-contention (discipline-independent, P_cm=1)
42 % <tr><td>prio<td>(1 x C) class priority, lower value = higher priority
43 % (default: all equal). Used only at priority stations.
48 % <tr><th>Name<th>Description
49 % <tr><td>Xlo<td>(1 x C) lower bound on class throughput (Theorem 2)
50 % <tr><td>Xup<td>(1 x C) upper bound on class throughput (eqs. 2-3)
51 % <tr><td>Wlo<td>(K x C) per-visit residence time at station k for class c
52 % consistent with
the lower throughput bound
55function [Xlo,Xup,Wlo] = pfqn_mwrbb(V,S,N,Z,sched,prio)
58if nargin < 4 || isempty(Z)
62if nargin < 5 || isempty(sched)
66if nargin < 6 || isempty(prio)
71% no-contention upper bound on
the cycle rate f_c = X_c/N_c (eqs. 1-2)
74 fup(c) = 1 / (Z(c) + sum(V(:,c).*S(:,c)));
81 fup_old = fup; flo_old = flo;
83 % utilization-based narrowing of
the upper bounds (eq. 3)
90 other = other + N(m)*V(k,m)*S(k,m)*flo(m);
93 denomk = N(c)*V(k,c)*S(k,c);
95 cap = min(cap, (1 - other)/denomk);
98 fup(c) = min(fup(c), max(cap,0));
101 % lower-bound narrowing (Theorem 2, eq. 15). The higher-priority delay at
102 % a priority station carries a 1/f_c
factor and
is isolated algebraically
103 % as Bh so that f_c = (1 - Bh) / DEN.
105 [DEN,Bh] = mwrbb_denom(c,V,S,N,Z,fup,flo,sched,prio);
107 if val < 0, val = 0; end
108 flo(c) = max(flo(c), val);
111 if max(abs(fup-fup_old)) < tol && max(abs(flo-flo_old)) < tol
119% per-visit residence at converged rates, consistent with
the lower bound
126 Wlo(k,c) = mwrbb_residence(k,c,V,S,N,fup,flo,sched,prio);
131% ------------------------------------------------------------------------
132% Lower-bound denominator DEN and isolated higher-priority work Bh for class c.
133function [DEN,Bh] = mwrbb_denom(c,V,S,N,Z,fup,flo,sched,prio)
144 if d == 3 || d == 2 % priority stations contribute to Bh
147 Bh = Bh + N(m)*fup(m)*V(k,m)*S(k,m);
151 W = mwrbb_station_wrest(k,c,V,S,N,fup,fc,sched,prio);
156% ------------------------------------------------------------------------
157% Per-visit residence at station k for class c EXCLUDING
the isolated higher-
158% priority (1/f_c) term. Includes own service and all bounded delay terms.
159function W = mwrbb_station_wrest(k,c,V,S,N,fup,fc,sched,prio)
164if d == 0 % FIFO (Theorem 1 / Lemma 1)
167 if fc*Vkc == 0, pcm = 1; else pcm = min(1,(fup(m)*V(k,m))/(fc*Vkc)); end
168 s = s + N(m)*S(k,m)*pcm;
170 W = s; % own service
is the m=c term (= N_c S_kc)
171elseif d == 1 % processor sharing (Lemma 2)
174 Ncont = N(m); if m == c, Ncont = N(c)-1; end
175 if fc*Vkc == 0, term = Skc; else term = min(Skc,(fup(m)*V(k,m)*S(k,m))/(fc*Vkc)); end
176 dp = dp + Ncont*term;
179elseif d == 4 % ABA full-contention (discipline-independent, P_cm = 1)
182 s = s + N(m)*S(k,m); % wait behind full service of all customers
185else % preemptive (3) or non-preemptive (2) priority
188 if prio(m) == prio(c) % equal priority (includes c)
189 Ncont = N(m); if m == c, Ncont = N(c)-1; end
190 if fc*Vkc == 0, pcm = 1; else pcm = min(1,(fup(m)*V(k,m))/(fc*Vkc)); end
191 dp = dp + Ncont*S(k,m)*pcm;
193 % higher-priority (prio<prio(c)) handled via Bh in mwrbb_denom
195 if d == 2 % non-preemptive: lower-priority water-filling
196 L = find(prio > prio(c));
198 [~,ord] = sort(S(k,L),'descend'); Ls = L(ord);
202 if fc*Vkc == 0, capr = Inf; else capr = (fup(l)*V(k,l))/(fc*Vkc); end
203 if N(l) <= 0, al = 0; else al = min(budget/N(l), capr); end
204 if al < 0, al = 0; end
205 dp = dp + N(l)*al*S(k,l);
206 budget = budget - N(l)*al;
207 if budget < 0, budget = 0; end
215% ------------------------------------------------------------------------
216% Full per-visit residence (including higher-priority delay) for reporting Q.
217function W = mwrbb_residence(k,c,V,S,N,fup,flo,sched,prio)
221W = mwrbb_station_wrest(k,c,V,S,N,fup,fc,sched,prio);
223if (d == 2 || d == 3) && fc*Vkc > 0
226 W = W + N(m)*fup(m)*V(k,m)*S(k,m)/(fc*Vkc);