Communication Networks Network Calculus: Deterministic Traffic Analysis Last updated: Thursday, May 07, 2015 Prof. Amir Herzberg Dept of Computer Science, Bar Ilan University
Network Calculus: Topics 1.Introduction Voice call processing example Network calculus Fixed-rate service and Reich’s equation Min-Plus Convolution 2.Arrival curves 3.Service curves Backlog, delay bounds, IntServ routers (Latency- Rate servers), Shapers
Voice Call Processing & Delays Sound sampled and encoded Constant Bit Rate (CBR), e.g. 64Kbps (8000*8b) Voice activity detection (and compression?) Discard (long, e.g. >0.2s) inactive periods On-off Variable Bit Rate (VBR) Question: what link rate C is needed?
Voice Call Processing & Delays (cont’) Sound sampled and CBR-encoded Voice activity detection, compression VBR Shaping Specifications of sent traffic Allows efficient rates, buffers Packetization (and padding if necessary)
Voice Call Processing & Delays (cont’) Sender: Sampling and CBR-encoding Voice Activity Detection, compression VBR Shaping Packetization (and padding if necessary) Network (queues, transmission, propagation) Receiver Immediate or delayed playout?
Voice Transport over Packet Network Deterministic vs. stochastic analysis
Playout Delay to `Hide` Jitter Lines: actual packet delays Is output Ok? What size of buffer (backlog)?
Playout Buffer Model Network system S: CBR input: R(t)=rt Delay variation (jitter) bounded by Δ Namely for some D>0 holds: R(t) ≦ R*(t+D+Δ) and R*(t+D-Δ) ≦ R(t) Playout buffer S’: Receive first bit at d(0), delay it by Δ Then, serve at constant rate r, when not empty if never empty after d(0), then S(t)=r(t-Δ-d(0)) +
Playout Buffer Analysis Claim: for every t>d(0) holds 0<R*(t)-S(t)<2Δr Playout buffer always non- empty, produces at rate r Buffer size of 2Δr is sufficient (to avoid overflow) Proof: (omitted)
Network Calculus Deterministic analysis of scheduling/ queuing / flow Uses min, max as binary operators and integrals (min-plus. max-plus algebra) Worst-case wasteful [cf. probabilistic queuing analysis – later] Applicable to many problems Voice, audio, data, … Only `traffic flow`, no processing/control Discrete or continuous time (bit or fluid model, resp.)
Network Calculus: References and Sources Network Calculus by J. Le Boudec, P. Thiran, Springer, Aug 2001, LNCS 2050 In library Online: Communication Networking – an analytical approach, Kumar, Manjunath and Kuri, Elsevier, 2004 (mainly ch. 4) In (folder) in library
Network Calculus Network Calculus: Worst-case analysis of Arrivals, Service, Buffering and Departures Used in design of QoS protocols Internet: mainly IntServ, DiffServ ATM Arrivals A(t) Departures D(t)Service Buffer X(t)
Buffer Analysis: Fixed Rate Queue Bits sent (removed) at C bits/second (unless empty) a k : arrival of (complete) packet k L k [0,∞) : bit-length of packet k A(t), D(t): total arrivals (deliveries) till time t; A(0 - )=0 t - : just before time t X(t): queued bits at time t X(t)
Reich’s Equation: Work- conserving schedule with output rate C t A(t) X(t) A(s) time v(t) this line has slopeC, and valueA(s) +C. (t s) att s Proof:
Reich’s Equation: Let v be earliest time after which buffer was not empty: Hence:
Reich’s Equation: Illustration t A(t) X(t) A(s) time b this line has slopeC, and valueA(s) +C. (t s) att s D(time)
Reich’s Equation: Departures
Departures and Convolutions A(s)=0 for s<0, and (t-s) + =0 for s≥t, hence… Definition: The convolution A*B of two non-decreasing functions A(t), B(t): + is: Note: compare to linear systems theory convolution: Two equivalent notations: A*B, A ⊗ B
Convolution Operation - Visualization slopeρB(t) s t C t ρ τ t C A(t) (A * B)(t) A(τ ) + B(t τ)τ) B(t-τ) A(t)=Ct +
Convolution Operator: Properties Convolution operator * is… Commutative: A*B=B*A Associative: (A*B)*C=A*(B*C) Distributive over min function: A*min{B,C} = = min {(A*B), (A*C)} The convolution A*B is: slopeρ τ t C A(t) (A * B)(t) A(τ ) + B(t τ)τ)
Convolutions and the δ (delay) function The convolution A*B is: Define the delay function as: Since A(t) is non-decreasing: B(t)≥0 is causal if B(t)=0 for t<0; If A, B are causal then…
Network Calculus: Topics 1.Introduction 2.Arrival curves Arrival curve and min-plus convolution Leaky bucket Good arrival curves are sub-additive Minimal arrival curve and min-plus deconvolution 3.Service curves Backlog, delay bounds, IntServ routers (Latency- Rate servers), Shapers
Cumulative flows Cumulative flow R(t) F, t real (or integer) F = { x(t) | x(t) is non decreasing and x(t) = 0 for t < 0 } Models: time t bits time t bits R 1 (t)R 2 (t) Fluid model (continuous)Packet model (left continuous)
Arrival Curves Flow R has arrival curve (envelope) iff ∀ 0 s t: R(t) -R(s) (t-s) and (x<0)(α(x)=0) Example 1: affine arrival curve r,b (t) = r,b (t) = rt+b for t>0, r,b≥0 (Example 2, stair arrival curve kv T, : hidden next foil) time bits b slope r R(t)
(t) = kv T, (t) = k (t+ )/T with T = period, = tolerance, k = constant packet size Characterizes flows that are periodic stream of packets of same size k (cells), that suffers a variable delay <= time bits k kv T, (t) = k (t+ )/T T- 2T- 3T- 2k 3k 4k Example 2: stair arrival curve kv T, o All packets of size k. Then R conforms to =kv T, R conforms to = r,b with r = k/T and b = k( +T)/T
Leaky Bucket Conforming Arrivals Leaky Bucket (LB) conformance test: Parameters: rate r, bucket size b Initially: bucket 0 (empty) Upon packet arrival: If bucket+|packet| ≦ b then {bucket+=|packet|; mark packet `conforming`} else mark packet `non-conforming’; Every 1/r seconds: if bucket>0 then bucket--; R(t) r x(t) b R(t)
Affine Arrivals are LB-Conforming Let R* be leaky-bucket conforming arrivals R* has affine arrival curve (t) = r,b (t) = rt+b for t>0, r,b≥0 If R conforms to (has envelope) (t), then R*=R All packets of R are conformant R(t) r,b r x(t) b R(t) slope r b
GCRA (T, ) All packets (cells) of flow R are of the same size k Arrival time of nth = A n Theoretical arrival just after nth arrival is n = max(A n, n-1 ) + T If A n+1 >= n – then cell is conformant, otherwise not Example: GCRA (10,2) n n A n ccncccnc Equivalences: R conforms to GCRA (T, ) R conforms to staircase arrival curve = kv T, R conforms to leaky bucket (r = k/T, b = k( +T)/T) R conforms to affine arrival curve = r,b
Min-Plus Convolution Flow R has envelope (arrival curve) iff ∀ 0 s t: R(t) -R(s) (t-s) and (x<0)(α(x)=0) The min-plus convolution of R andαis: Flow R has arrival curve α,iff R ≦ R ⊗ α R has arrival curve all 0 s t, R(t) -R(s) (t-s) R(t) R(s) + (t-s) for all 0 s t R(t) inf u { R(u) + (t-u) } R R
Min-plus convolution (cont’) Definition (f g) (t) = inf u { f(t-u) + g(u) } t f(t) g(t) (f g)(t)
Enveloped Arrivals Process A(t) has envelope E if for every t, s (s t) holds A(t)-A(s) E(t-s) A has envelope E if and only if A A*E Envelopes are non-decreasing, non-negative If A, E are causal (A(t)=0 for t<0, E δ 0 ) then: A*E A* δ 0 = A A*E A=A*E If arrivals with envelope E pass via element with lower service curve S, define `max delay` as:
Some properties of min-plus convolution (f g) F is associative is commutative Neutral element: 0 : f 0 = f ( 0 (t) = 0 for t = 0 and 0 (t) = for t > 0) is distributive with respect to min ( is isotone: f f’ and g g’ f g f’ g’ Functions passing through origin (f(0) = g(0) = 0): f g f g Concave functions passing through the origin: f g = f g
Example: rate latency function T (delay function) R,T (rate-latency function) latency T R,T (t) Slope (rate) R delay T T (t) R (t)=Rt Rate R R (delay function)
Sub-Additive Functions Recall cumulative flow functions A function f F is sub-additive iff: If flow has arrival curve f F, then it also has sub-additive arrival curve In particular, the `sub-additive closure` Focus on sub-additive arrival curves Mostly, `good` functions: sub-additive and f(0)=0
Affine Arrivals are Sub-Additive affine arrival curve: r,b (t) = rt+b for t>0, r,b≥0 Is sub-additive (and `good`): r,b (s+t) = r(s+t)+b ≦ ≦ rs+b+rt+b = r,b (s)+ r,b (t) time bits b slope r
Sub-additivity and arrival curves T k 2T 3T 2k 3k 4k 4T T k 2T 3T 2k 3k 4k 4T Flow R has arrival curve , the sub-additive closure, is arrival curve What is the sub-additive closure ? Use min-plus convolution
Sub-additive Closure The sub-additive closure of an arrival curve, is a (sub-additive) arrival curve f F, f(0)=0 f ≥ f ⊗ f ≥ 0 Repeat… sequence of smaller and smaller functions: is sub-additive with (`good`) is sub-additive with f (0) = 0 = f f = f f
Examples time bits T R,T (t)+K’ R K’ time bits T R,T (t)+K’’ R K’’ 2T 2K’ R,T (t)+K’) (2) 2T R,T (t)+K’ ’ R,T (t)+K’
Combining Two Leaky Buckets time bits b M slope r slope p time bits b slope r IntServ Standard Traffic Specifications: T-Spec 4-tuple: (p,M, r, b) Peak rate p (link speed), packet size M `Store and forward`: entire packet `received at once’ Burst size b, long-term average rate r (u) = min (pu+M, ru+b) = (pu+M) (ru+b) Exercise: show (u) is sub-additive (and `good`)
Combining Two Arrival Curves (1) Generalize: Flow R has arrival curves ’ ∀ 0 s t: R(t) -R(s) (t-s), R(t) -R(s) ’(t-s) Clearly: R has arrival curve ’ E.g., two affine arrival curves (leaky bucket) But sometimes there is a tighter curve!
Combining Arrival Constraints (2) Flow R has arrival curves ’ Clearly: R has arrival curve ’ Example: t)= r,b (t), ’(t)= v T, (t) Pick r=1, b=0, T=2, =0… Is ’ sub-additive? time bits slope 1 1,0 (t) time bits 1 V 2,0 (t) [stair function] 46 ’ ’(2.5)=2 ’( 2)=1 ’( 0.5)=0.5
Combining with Sub-Additive Closure Flow R has arrival curves ’ also ’ Also arrival curves: ⊗ ’ and The sub-additive closure of ’ If ’ are `good`, then ⊗ ’= time bits slope 1 1,0 (t) time bits 1 V 2,0 (t) [stair function] 46 ’
Minimal arrival curve Assume we only know arrival rate R (empirically) How can we compute the (minimal) arrival curve ? The answer uses min-plus deconvolution R
Min-plus deconvolution Ø Definition (f Ø g) (t) = sup u { f(t+u) - g(u) } t f(t) g(t) (f g)(t)
Properties of min-plus deconvolution (f g) F in general (f f) F (f f) is sub-additive with (f f) (0) = 0 (f g) h = f (g h) Duality with : f g h f g h
Minimal arrival curve The minimal arrival curve of flow R is R Ø R . Proof: It is an arrival curve because R(t) – R(s) = R((t-s)+s) - R(s) sup u { R((t-s)+u) - R(u) } = (R Ø R) (t-s) l If ’ is another arrival curve for flow R, then R R ’ [use duality rule: f g h f g h ] R Ø R ’. ∎
Contents 1.Introduction 2.Arrival curves 3.Service curves, backlog, delay bounds Service curve: definition Backlog and delay bounds Shapers
Goal of Service Curve and GR node define an abstract node model independent of a specific type of scheduler applies to real routers, which are not a single scheduler, but a complex interconnection of delay and scheduling elements applies to nodes that are not work-conserving
Service Curve System S has (minimal/lower) service curve , if F, and for any arrival process A(t), the delivery process D(t) satisfies: D≥ A ⊗ Assuming system is full (some backlog) S A(t)D(t) t s A(s) A( ) D( ) (t)
Service Curve System S has (minimal/lower) service curve , if F, and for any arrival process A(t), the delivery process D(t) satisfies: D≥ A ⊗ Assuming system is full (some backlog) If is continuous, for all t exists some s ≦ t such that D(t) - A(s) (t-s) [see hidden foil] (t) S A(t)D(t) t s A(s) A( ) D( )
Equivalence of Service Curve Defs Equivalence of min-plus convolution and rates definitions Exists some 0 s t : y(t) - x(s) (t-s) y(t) x(s) + (t-s) for some 0 s t y(t) inf u { x(u) + (t-u) } y x
Constant rate server (t)=ct Proof: take s = beginning of busy period: y(t) – y(s) = c (t-s) and y(s) = x(s) -> y(t) – x(s) = c (t-s) buffer s t0 ct t
Rate-latency service curve Standard model for Internet (IntServ) router: (lower) service curve S(t)= Rt + ⊗ δ T E.g.: fixed rate, but (max) packet size L T=L/R in this case T bits R seconds
WFQ Scheduler is a Latency Rate Server Notations: Bound on length of packets GPS departure time of k th packet (any queue) WFQ departure time of same packet WFQ Delay Theorem [4.3 in KMK]: GPS deliveries for non-empty queue j : Hence GPS, WFQ have lower service curves: Latency Rate Server
Example 1: Constant-Rate Server Infinite buffer, output rate r `Fluid model` service curve S(t)=rt + (Lower) service curve S(t)=(rt + -L)=rt + * δ L / r A(t)D(t) S(t) S(t) r sloper sloper L r
Example 2: Coder and Constant-Rate Server Coder output bursts (can be < L bits), rate r Packetizer outputs packets: rate r, max delay L /r D p (t)≥A(t-L /r), i.e. lower service curve is D(t)=(D p *(r t + )) ≥ (A*δ L/r )*(r t + ) Latency rate servers: rate r, delay (latency) d Lower service curve S(t)=δ d *(rt + )=r(t-d) + Typical `Per-Hop Behavior` service specifications A(t)D(t) D p (t) r Coder Packetizer L
The service curve of a Greedy shaper is its shaping curve x(t) Shaper y(t) If is sub-additive and y(t) = (x (t). The service curve of a shaper is thus
Fixed-delay node: service curve T seconds T x y 0 T T (t) Function T t
Min-plus deconvolution Ø Definition (f Ø g) (t) = sup u { f(t+u) - g(u) } t f(t) g(t) (f g)(t)
Tight Bound on Backlog If flow has arrival curve and node offers service curve then the backlog is at most: sup ( (s) - (s)) = ( Ø )(0) = v( , ) Proof: simple application of definitions of curves δ(s) v(,)v(,) s Recall (f Ø g) (t) = sup u { f(t+u) - g(u) }
Tight Bound on Delay If flow has arrival curve and node has service curve then delay h( , )=sup s { δ (s)}, δ (s)= inf{ τ≥0: (s) ≦ (s+τ)} Proof: omitted. δ(s) v(,)v(,) s
Theorem: Delay of Enveloped Arrivals Given causal arrivals A with envelope E into element with lower service curve S(t), the departures D satisfy: Namely, delay is at most Where: Proof: Since S is lower service curve: D≥A*S By definition of : Hence: A=A*E, since E is envelope of (causal) A Claim follows (from associativity of convolution *)
Leaky Bucket via IntServ Router Flow with LB-arrivals, A(t)=b+rT Latency-rate server (e.g. router): B(t)=R(t-T) + If r ≤ R: buffer ≦ b+rT, delay ≦ T+b/R Burstiness of flow increased by rT. If r > R, the bounds are infinite. data Arrivals A(t)=b+rt b T b+rT T+b/R Latency-rate Service curve: B(t)=R(t-T) +
Leaky Bucket via WFQ Flow with LB-arrivals, A(t)=b+rt Latency-rate server (e.g. router): S(t)=R(t-T) + If r ≤ R: buffer ≦ b+rT, delay ≦ T+b/R Burstiness of flow increased by rT. If r > R, the bounds are infinite. For WFQ: data Arrivals A(t)=b+rt b T B+rT T+b/R Latency-rate Service curve: S(t)=R(t-T) + Details: Network Calculus lecture (or [KMK/BT]
Service Curves: not just lower… Delay often bounded by service curves: S(t) is a (lower/minimal) service curve if D≥A*S S(t) is an upper service curve if D A*S S(t) is a service curve if D=A*S S(t),S(t): non-negative, non-decreasing, causal
The composition theorem Theorem: the concatenation of two network elements each offering (lower) service curve i offers the (lower) service curve 1 2 Holds for lower, upper service curvers
Cascade of Service Elements Traffic passes thru several `elements` Each has upper and lower service curves Composing: Composite lower service curve: Similarly, composite upper service curve: A(t) D 1 (t)D 2 (t) S 1 ( t ) D n (t) S 1 (t) S 2 (t) S 2 (t) S n (t) S n (t)
Cascade of Latency Rate Servers Latency rate servers: rate r, delay (latency) d Lower service curve of k th server: S k (t)= r k (t-d k ) + A(t) D 1 (t)D 2 (t) S 1 ( t ) D n (t) S 1 (t) S 2 (t) S 2 (t) S n (t) S n (t)
R1R2 T2 = T1 Example: Cascade of Two Latency-Rate Servers (IntServ Routers) R1 T2T1+T2
Pay Bursts Only Once D1D1 D2D2 D D b /R + T 1 + T 2 end to end delay bound is less!! D b /R + T 1 + T 2 end to end delay bound is less!! D 1 +D 2 (2b + rT 1 )/ R + T 1 + T 2 Recall, LB via router: delay ≦ T+b/R b out =b in +RT
Regulators (aka Shapers) How to ensure envelope E? Regulator: departures envelope is E (any arrivals) A regulator with envelope E satisfies: Arrivals A(t), Departures D(t), and D(t) A(t) Departures envelope is E (any arrivals) For all s t holds D(t)-D(s) E(t-s) D D*E
Regulators (Shapers) Lemma Def: A regulator with envelope E satisfies: Arrivals A(t), Departures D(t), and D(t) A(t) Departures envelope is E (any arrivals) For all s t holds D(t)-D(s) E(t-s) D D*E Lemma: Proof:
Leaky Bucket Regulator / Shaper D(t)-D(s) σ+ρ(t-s) Such process is (σ,ρ)-regulated, or (σ,ρ)-process D has envelope E(t)= σ+ρt for t≥0, E(t)=0 for t<0 Or use notation: E(t)= (σ+ρt)I [t≥0] D(0)=0 for t<0 D, E are causal D=D*E Called leaky-bucket (LB) regulator / shaper σ ρ A(t) D(t) X 1 (t) X 2 (t) Source buffer Token bucket
Leaky Bucket Shaper Operation [fluid model - ignore packetization] LB becomes empty buffer becomes empty buffer nonempty amount of data in the buffer departure process time σ LB full LB nonempty amount of tokens in LB Bucket is full
LB Shaper: Properties, Operation Denote peak (input=output) rate by R D(t)-D(s) σ+ρ(t-s) Bucket size σ, average rate ρ Max burst (at rate R ): σR/(R-ρ) LB becomes empty buffer becomes empty buffer nonempty amount of data in the buffer time σ LB nonempty σ
LB Shaper Theorem: D=A*E Lemma: Claim: Consider any time t. If source buffer at t is empty then: Source buffer non-empty at t bucket empty at t Let v(t) be last time before t bucket was full At t all tokens were used for departures, so: A(t): arrivals to LB shaper with envelope E(t)= σ+ρt for t>0, E(t)=0 for t 0
Cascade of Leaky Buckets Shapers Theorem: D 2 =D 1 =A*E Associativity: D 2 =A*(E*E) E*E E, since E is causal (E(t)=0 for t<0) E E*E Holds for any subadditive E [for all s t holds E(t) E(s)+E(t-s)] E.g. for Leaky Bucket… E=E*E D 2 =A*E=D 1 A(t) D 1 (t)D 2 (t) E(t)= =(σ+ρt)I [t≥0] E(t)