CS 4251/6250 — Quiz 2 study notes

Lectures 9–18 (PCC → QUIC → Traffic Engineering → Meta · Google · Microsoft → Verification) + cumulative refresher of Lectures 1–8
How this works Each section = short theory with pictures → dashed orange “✍ iPad” box. When you hit one, switch to exam2_ipad_problems.pdf, solve that problem by hand, then open “Show solution” here. Problems are written in the same style as Quiz 1 and HW2 (select-all MCQs + numerical problems). The last section is a full mock quiz.

0 · Exam intel (from the transcripts)

I read every transcript for hints. These are the ones that change how you should study:

What the professor saidWhat it means for you
“The quiz is going to cover wherever we stop on Thursday… done with Unit 2… [Unit 3] is not going to be part of the quiz.” (L17)Coverage = L9–L18. Network verification (L18) is in. BGP/Unit 3 is out.
Lecture 19 (last words before the quiz): “Quiz one was designed so that you all have enough time to flip through all the material… quiz two is not… it's gonna be long”; about 20% of questions “a little bit harder”; “how you index your open book material” matters.Less time per question than Quiz 1. Know the core without the sheet; use the sheet's index for numbers and methods only. The plan now has a lookup drill and a 60-min mock.
“Pretty much… 90% of it is on material since quiz one… part of [the PCC] question is going to be connecting it to the general congestion control material. And that is actually the only question on the exam that touches on the rest… out of… eight questions.” (L19)Part 1 = one sub-question, inside the PCC question. Study PCC vs Reno/CUBIC/Vegas/Copa/BBR (§1.4 table); don't spend more on Part 1 than that.
“A bunch of these questions are [multiple choice], but there is one or two that are numerical… assignment two is a good guide… variations on that.” MCQs are written to look like “seemingly confident, seemingly reasonable” LLM answers; several statements so random guessing doesn't work. Don't read the papers: “the exam is gonna be reflective of the way the material was covered in class.” (L19)8 questions, mostly select-all; 1–2 HW2-style numericals. Train on spotting the one wrong word in a plausible statement (MCQ sprint). Notes + slides are the right material; papers are not.
“Cumulative… heavily biased towards new content… some questions on congestion control because that is something we covered after quiz one [PCC]… some ideas there that depend on information we covered before quiz one.” (L18)Expect a PCC/Vivace question that leans on BBR/Copa/utility ideas. Section 9 refreshes Quiz 1 material.
“Quiz two might be a little bit harder” · “the MCQs are the harder questions.” (L10, L11)Most points are lost on select-all MCQs. Every MCQ here has a full explanation for each option.
“Homework questions and numerical problems we've covered in class are very good guidance on the numerical problems… the rest is MCQ logical questions… not memorization.” (L9)The numerical problems will look like HW2 and the in-class worked examples (min-MLU, bandwidth functions, B4 waterfill, SWAN updates, TeaVaR loss). All of them are re-drilled here with new numbers.
HW2 is “due right before quiz two” and the model answers are released early “if you need to study them for Thursday.” Meta's heuristic “is going to be part of the covered material,” like Vegas was for Quiz 1. (L13, L14, L18)HPRR (Meta's heuristic) and the HW2 problems are fair game. Every HW2 problem type has a twin here.
“The exam is going to require you to know some of these low-level details.” (L18)Know the mechanisms: label-stack depth 3 + Binding SID, the version bit, sFlow, NIB pub-sub, SWAN's max(old,new) constraint, TeaVaR's loss definition, OneWAN's router roles.
Not covered: “the hardware and topology design of private WANs… you're not going to be even exposed to that in the homework”; how Meta enumerates cuts was skipped. (L14, L16)Skip those.
Quiz 1 format (your copy) 8 pages · 7 questions · basic calculator · decimal units (1 Mb/s = 10⁶ b/s, 1 MB = 10⁶ B) · select-all MCQs: +1 per correct mark, −1 per wrong mark, floor 0. “If you are not sure about a choice, you are better off not marking it.” Printed notes are allowed (you confirmed). Bring EXAM2_CHEATSHEET.pdf (10 pages) plus your Exam 1 EXAM_CHEATSHEET.pdf for Lectures 1–8. Your Exam 1 reference warns that flipping through too much paper eats time, so practise finding things with the index (Wednesday block) and take the mock with exactly these pages.

0.1 · The 3-day plan

Method: research on learning techniques (Dunlosky et al., 2013) rates practice testing and spacing as the two most effective study methods. Interleaving (mixing problem types) is also supported. Re-reading and highlighting score low. So the plan is: read the theory once → solve problems from memory → check → come back to the hard ones on a later day → finish with a timed, mixed mock quiz. Keep an error log: one line per miss, noting whether it was a concept gap or a careless slip.

WhenBlock (tick when done, saved in this browser)Time
Mon 11/2 evening20 m
5 m
105 m
80 m
20 m
Tue 11/315 m
75 m
70 m
100 m
130 m
45 m
Wed 11/420 m
95 m
65 m
30 m
15 m
25 m
45 m
60 m
90 m
—
Thu 11/5 AM30 m
Daily totals (updated after Lecture 19)Mon evening ≈ 3 h 50 · Tue ≈ 7 h 15 · Wed ≈ 7 h 25 (re-balanced after Lecture 19) · Thu morning 30 min. The times assume careful reading (≈ 130 words/min) plus about 8 min per calculation problem and 4 per multiple-choice question, with solutions checked.
If a day runs short, cut in this order (never the MCQ sprint, the mock quiz or the error log): ① Monday's blank-page recall → do it as Tuesday's warm-up. ② The Quiz 1 bridge (P9.9 only). ③ Wednesday's warm-up → 10 min. ④ §8 Verification problems → do 8.2 and 8.6 only.
Two rules for the exam itself (1) On select-all MCQs, mark only choices you can justify in one sentence. A wrong mark cancels a right one. (2) On numerical problems, write the formula with units first (e.g., MLU = max_e load_e / c_e). Most lost points on Quiz-1-style problems are unit slips (MB vs Mb, ms vs s).

1 · Congestion control, part 3: model-based vs performance-oriented (PCC)

Lecture 9 · HW2 Q1 · the only congestion-control content after Quiz 1, so expect one question here.

1.1 The same loss event can mean four different things

Every algorithm from Quiz 1 is an event → action table: “when X happens, do Y”. Each rule quietly bakes in an interpretation of what the event means. The designer decided in advance what a loss or an RTT change “usually” means and hard-coded the right reaction for that case.

AlgorithmEventPrescribed responseHidden assumption
Renopacket losshalve the windowloss = I overflowed the bottleneck queue
Scalable TCPACK arrivesincrease the window (by a fixed fraction, so growth is faster on fast links)ACKs flowing = there is room to grow
CUBICtime passesgrow along a cubic curve of the time since the last loss (wall clock, not ACKs, which fixes RTT unfairness)the right window is near where the last loss happened
FASTRTT changesadjust from delay feedback (aim for a target amount of queueing)RTT above the minimum = my own queue
H-TCPACKs arriveincrease faster the longer it has been since the last losslong loss-free periods = spare capacity

The problem: you see “100 Mb/s, 1% loss”, but the hidden cause decides what the useful response is:

① Our flow overloads the linkbig queue fills → overflow queue full → decrease substantially ② Shallow buffer overflowssmall burst, link far from capacity tiny buffer → decrease slightly / pace better ③ Another flow dominates the queueyou haven't got your fair share yet other ▮ / you ▮ → maintain the rate ④ Random (non-congestive) lossspare capacity, e.g. wireless corruption → increase the rate
Same observation, four useful responses. Algorithms pick one scenario as the default and try not to do terribly in the others.
📈 How to read this figureEach box is a different hidden situation that produces the same measurement (“100 Mb/s, 1% loss”). ① You are sending too much and filled the queue: back off a lot. ② The buffer is tiny, so even a short burst overflows it although the link is mostly idle: back off a little or pace packets more smoothly. ③ Another flow is hogging the queue and you haven't reached your fair share: hold your rate (backing off just hands it more). ④ The loss isn't congestion at all (e.g., radio interference on Wi-Fi): there is spare capacity, so increase. A rule like Reno's “halve on loss” is right only in ①. The sender can't see which box it is in, and that is the problem both philosophies in §1.2 try to solve.

1.2 Two philosophies

MODEL-BASED (Reno … BBR, Copa) asks: “What is the path doing?” • infer hidden state (BW, minRTT, queue) • map state/event → designed action • evolves by adding filters, phases, bounds (BBRv1 → v2 → v3) failure: model misreads the cause of feedback PERFORMANCE-ORIENTED (PCC) asks: “Which action actually worked?” • network = black box; change rate on purpose • measure delivery / loss / latency • utility U compares nearby actions (no need to name the cause) failure: utility, trial length, exploration design

BBR's evolution as a case study (the slide's example of how model-based designs grow):

Each fix added rules for more corner cases, and the original elegant model became less elegant. That is the critique PCC starts from: instead of an ever-growing model of the path, just measure which rate works better.

1.3 PCC Allegro (2015): randomized controlled trials on the rate

The idea in one sentencePCC treats the network as a black box: every so often it tries a slightly different sending rate, measures what happened, turns those measurements into one score (the utility), and moves toward whichever rate scored higher. It never tries to work out why loss or delay happened.
WordMeaning
sending rate r (or x)How fast the sender transmits, in Mb/s. PCC is rate-based: it sets the rate directly instead of a congestion window.
monitor interval (MI)A stretch of time (about 1–2 RTTs) during which the sender holds one rate, so it can measure that rate's effect in isolation.
utility uThe score computed at the end of an MI from what was measured there (throughput, loss; Vivace adds RTT). Higher = better. The utility function is the sender's definition of “good”.
ε (epsilon)How far the trial rates sit from r, as a fraction. ε = 5% at r = 100 → trials at 95 and 105 Mb/s.
RCTRandomized controlled trial: test two “treatments” (a lower and a higher rate) under the same conditions, in random order, and compare outcomes.

Step 1 — how a trial is scored: Allegro's utility

u(x) = T · S(L)  −  x · L          T = x(1 − L)          S(L) = 1 / (1 + e^(α(L − 0.05))),  α = 100
TermWhat it isWhat it does to the score
xthe rate you sent at in this MI (Mb/s)—
Lloss rate in this MI (fraction of packets lost, e.g. 0.01 = 1%)—
T = x(1−L)throughput that actually got throughthe reward: more delivered data = higher score
S(L)a “soft switch” (sigmoid): ≈ 1 when L is well below 5%, exactly ½ at 5%, ≈ 0 above ≈ 7%keeps the throughput reward only while loss is low; above ≈ 5% the reward is switched off
−x·Lthe rate you are wasting on lost packetsa penalty that grows with loss

Worked example (x = 100 Mb/s, the same numbers as problem 1.3): L = 1% → S = 0.98, u = 99·0.98 − 1 = 96.2 · L = 4% → S = 0.73, u = 96·0.73 − 4 = 66.2 · L = 6% → S = 0.27, u = 94·0.27 − 6 = 19.3.

01234567810020406080100loss rate L (%)u at x = 100 Mb/s5%: S = ½throughput T = x(1−L)96.266.219.3Allegro utility ucollapses past ≈5%
📈 How to read this chartThe x-axis is the loss rate the sender measured; the y-axis is the score Allegro gives a 100 Mb/s trial with that loss. The grey line is plain throughput, which barely drops with loss (100 → 90). The blue curve is Allegro's utility: almost equal to throughput at 0–2% loss, then it falls off a cliff around 5% (where S = ½). What to take away: Allegro barely cares about loss below a few percent, so it keeps sending through loss rates that make CUBIC back off every time. That is why it starves CUBIC. Above ≈ 5% its own score collapses, so it stops there.

Why the sigmoid at all? With the plain score x(1−L), a sender that sends a bit more almost always delivers a bit more, even while everyone's loss climbs. Selfish senders all keep pushing until loss is very high (a bad Nash equilibrium: nobody gains by backing off alone). The sigmoid makes high loss wreck your own score, so everyone stops near 5%.

Step 2 — which direction to move: the trials

Monitor interval (MI) at current rate r send r(1−ε) send r(1+ε) send r(1+ε) send r(1−ε) time feedback for this trial arrives ≈1 RTT later pairs in random order · utility U₋, U₊ computed for each trial · winner decides direction
📈 How to read this figureTime runs left to right. Each box is one MI in which the sender holds one rate: blue = the lower trial r(1−ε), orange = the higher trial r(1+ε). Two pairs are shown, and the order inside each pair is random (low-high, then high-low). The arrow is the catch: the score for a trial can only be computed once the ACKs for those packets come back, about one RTT later. So the sender is always scoring trials it sent in the past.

Step 3 — why comparing two nearby rates finds the best rate

046810121604812sending rate (C = 10 = your share of the bottleneck)utility (score)CU₋U₊U₋U₊at r₁ = 6: U₊ > U₋ → raise rateat r₂ = 12: U₋ > U₊→ lower rate
📈 How to read this chartThe x-axis is a sending rate; the y-axis is the utility the sender would get if it sent at that rate. The grey curve is the “landscape”: it rises up to C (more rate = more throughput, no loss yet), peaks at C (your share of the bottleneck), then falls (beyond C packets queue and drop, so the penalties dominate).
The key point: the sender never sees this curve. Each MI gives it one dot. The two coloured pairs are Allegro's trials: at r₁ = 6 (below C) the right-hand dot U₊ is higher, so it moves up; at r₂ = 12 (above C) the left-hand dot U₋ is higher, so it moves down. Either way it walks toward the peak. The curve also moves when other flows join or leave (C is your share), which is why PCC never stops probing.

Step 4 — the control loop

Allegro's problems (exam favorites) ① No latency term, so it fills buffers (bufferbloat). ② It tolerates about 5% loss, so it grabs all the bandwidth from CUBIC (CUBIC backs off on every loss; PCC doesn't). ③ Fixed step sizes: small steps converge slowly when far from the optimum, large steps overshoot near it. ④ Short flows may end before enough trials have run. ⑤ More state and computation than Reno. The professor's whiteboard summary of ① and ③: “doesn't take delay into account” and “doesn't adapt its exploration to the target rate”. Both motivate Vivace. In the evaluation figure Allegro tracks capacity most closely, but only because it accepts 2–3× more loss than Vivace.

1.4 PCC Vivace (2018): a better utility and gradient-based steps

Vivace keeps Allegro's loop (monitor intervals, trial rates, compare scores) and changes two things, which map onto Allegro's two problems:

AllegroVivace
Score (utility)throughput and loss onlyadds a latency term: how fast RTT is growing
Step (how far to move)direction from trials, size from a fixed scheduledirection and size from the measured slope (gradient) of the score

Change 1 — the score now includes delay: what dRTT/dt means

RTT = propagation delay (fixed for a given path) + queueing delay (waiting in the bottleneck buffer). On a fixed path, when RTT goes up the queue is growing, and when it goes down the queue is draining.

dRTT/dt (the “RTT gradient”) is how fast the RTT is changing during the MI: the slope of a line through the RTT samples, roughly (RTT at the end − RTT at the start) / MI length. Both are in ms, so it has no unit. Example: RTT goes 40 → 60 ms during a 100 ms MI → dRTT/dt = 20/100 = 0.20.

dRTT/dtWhat the queue is doingWhat it says about your rate
> 0growingyou are sending faster than the bottleneck can drain
= 0steady (empty, or exactly balanced)at or below capacity
< 0drainingyou are below capacity and the backlog is shrinking

Where (x − C)/C comes from: if you send at x into a bottleneck that drains at C, the queue grows by (x − C) bits every second. Queueing delay = queued bits / C, so the delay grows by (x − C)/C seconds every second. At x = 120 Mb/s and C = 100 Mb/s: (120 − 100)/100 = 0.2, the same 0.20 slope as above. So the slope measures how far above capacity you are right now.

u(x) = x^t  −  b · x · (dRTT/dt)  −  c · x · L          0 < t < 1 ;  b, c > 0 are tuning weights
whiteboard writes the same thing as  U(x) = x^α₁ − α₂·x·dRTT/dt − α₃·x·L
TermPlain meaning
x^t (e.g. t = 0.9)Reward for sending, with diminishing returns: doubling the rate less than doubles the reward. This concave shape is what lets competing Vivace flows settle on a fair split (same idea as log utility in Part 1).
−b·x·dRTT/dtPenalty for growing the queue, scaled by your rate. If the queue is draining (slope < 0) this term becomes a bonus.
−c·x·LPenalty for loss.

Worked example (problem 1.4, simplified u = x − 2·x·dRTT/dt, no loss, C = 100): x = 120 → slope 0.2 → u = 120 − 2·120·0.2 = 72 · x = 110 → slope 0.1 → u = 110 − 22 = 88 · x = 90 → slope −0.1 → u = 90 + 18 = 108. Sending closer to capacity, or a bit under it while a queue drains, scores better.

050100150200020406080time (ms)RTT (ms)avg 50 msavg 65 msx=120, slope 0.20x=110, slope 0.10
📈 How to read this chart (why slope and not the RTT value)Time runs left to right; the y-axis is the measured RTT. For the first 100 ms the sender sends at 120 Mb/s (orange): RTT climbs steeply, 40 → 60 ms (slope 0.20). Then it backs off to 110 (blue): RTT still climbs, but only half as fast, 60 → 70 ms (slope 0.10). The dashed lines are each interval's average RTT.
What to look for: the blue interval has the higher average RTT (65 vs 50 ms) even though 110 is the better rate. It starts on top of the queue the orange interval built. A score based on the RTT value would blame 110 for 120's queue. The slope judges each rate only by what it is doing to the queue now: 0.10 < 0.20, so 110 is better.

Change 2 — how far to move: the gradient

What is the gradient for? Deciding how big a step to take. After a pair of trials Vivace has two points on the score-vs-rate curve: (r₋, U₋) and (r₊, U₊). The slope between them,

g ≈ (U₊ − U₋) / (r₊ − r₋)          "how much score do I gain per extra Mb/s, around my current rate"
Δr = θ · g          new rate = r + Δr

Worked example (problem 1.5): at r = 80, trials at 76 and 84 score U₋ = 61.0 and U₊ = 58.6. g = (58.6 − 61.0)/(84 − 76) = −2.4/8 = −0.3 (the higher rate scored worse, so go down). With θ = 10: Δr = 10 · (−0.3) = −3 → new rate 77 Mb/s.

049.512.51504812sending rate (C = 10)utilityr = 4: g = +1.2steep → big step UPr = 9.5: g ≈ +0.06 → tiny stepr = 12.5: g = −2.5steep → big step DOWN
📈 How to read this chartThe grey curve is the score landscape again (peak at C = 10). Each coloured segment joins one pair of trial points; its steepness is g. Green (r = 4, far below C): steep upward, g = +1.2 → big step up. Blue (r = 9.5, just below the peak): almost flat, g ≈ +0.06 → tiny step up. Red (r = 12.5, above C): steep downward, g = −2.5 → big step down.
The takeaway: step size shrinks automatically as you approach the peak, so Vivace moves fast when far away and doesn't overshoot when close. Allegro's fixed schedule can't do this. This is gradient ascent: like walking up a hill in fog, you test a small step each way, feel which way is up and how steep it is, and take a stride in proportion.
One Vivace cycle, end to end① At rate r, run one MI at r(1−ε) and one at r(1+ε). ② For each, measure throughput, loss, and the RTT slope. ③ Score both with u → U₋, U₊. ④ g = (U₊ − U₋)/(r₊ − r₋). ⑤ Δr = θ·g, capped. ⑥ r ← r + Δr; update θ (grow if same direction as last time, reset if not). Repeat.
Allegro (comparison + schedule)The direction comes from comparing trials. The step size follows a fixed schedule. Far above C it takes many small steps. Near C it overshoots back and forth.
Vivace (comparison + slope magnitude)A large |g| means you are far from the peak, so it takes a big step. A small |g| means you are near the peak, so it takes a small step. This is gradient ascent on the utility. It tracks capacity with a small margin and much less loss.

PCC vs the Quiz 1 algorithms (the one Part 1 link on the quiz)

Lecture 19: the PCC question includes a part “connecting it to the general congestion control material”, and that is the only Part 1 content on the quiz.

AlgorithmPhilosophySignal it acts onRandom (non-congestive) lossNext to CUBIC / Reno
Renomodel-based (event → rule)loss: +1 pkt/RTT, halve on lossbacks off (misreads it as congestion)—; RTT-unfair (rate ∝ 1/RTT)
CUBICmodel-basedloss; window grows on a cubic curve of time since last lossbacks off—; RTT-fair growth; fills buffers
Vegasmodel-based, delayqueue estimate (Expected − Actual)·BaseRTT kept between α and βstill halves on lossstarves: backs off as the loss-based flow fills the queue
Copamodel-based, derived from utility ln x − δ ln dqueueing-delay magnitude: target 1/(δ·dq), ≈ 1/δ packets queuedignores (reacts to delay)competitive mode when the queue never drains
BBR v1model-based (pipe: BtlBw, RTprop)max delivery rate, min RTT; pacesignores loss → robustunfair to CUBIC (ignores the loss CUBIC obeys)
PCC Allegroperformance-oriented (black box)utility of throughput and loss, compared across nearby ratestolerates up to ≈ 5% → robust (keeps rate on lossy links)grabs the bandwidth: CUBIC backs off, Allegro doesn't
PCC Vivaceperformance-orientedutility of rate, RTT gradient and lossloss penalized in the utility, not by a fixed rulekeeps queues low (penalizes RTT growth)
Vivace vs Copa (likely MCQ angle) Copa reacts to the magnitude of queueing delay (target about 1/δ packets queued), which assumes a network model. Vivace only says “a lower RTT slope is better” and attaches no specific reaction to it. It describes desired outcomes, not network behavior.
Whiteboard asides from the Q&A (transcript only) Why not binary-search the rate? Jumping between very low and very high rates is the naive black-box search. It hurts other flows and makes feedback noisy. PCC instead compares nearby rates r(1±ε) and moves gradually.
Rate-based vs window-based are two views of one control. A window-based sender (BBR-style) still paces, at about 2·cwnd/RTT, i.e. a bit above cwnd/RTT. A rate-based sender (PCC) can still cap packets in flight at 2·rate·RTT, so it never piles unbounded data into the network. PCC's analytical models assume pure rate-based control, so adding the cap means revisiting the math, but in an implementation it makes sense.

1.5 Learning a rate vs learning a policy; where AI fits

What is learnedExampleWhen
the current rate xAllegro / Vivaceduring live experiments (online)
a table of control rulesRemyoffline generation
neural policy parameters θAuroraoffline training

A fixed learned policy still produces a changing sending rate, because its inputs (the observations) keep changing. Systems point: TCP lives inside the operating-system kernel, and kernel code generally avoids floating-point math. Neural models need floats, so they run as an ordinary program in user space. The transport reports RTT/loss/throughput through an API and the model answers with a rate or cwnd. The cost is the round trip between kernel and program: the model can't react to every ACK, only every RTT or every few RTTs.

1.6 HW2 Q1 patterns: BBR after a route change, PCC β, exploration

0123450255075100filter windows elapsed (≈10 rounds each)throughput (Mb/s)old path 100cwnd/RTT_new = 502512.5min-RTT filter expires → recover
📈 How to read this chartAn illustration, assuming the new route's RTT is 4× the old one. The x-axis counts how many times BBR's 10-round max-bandwidth filter has refreshed; the y-axis is the throughput BBR actually gets. BBR sets cwnd ≈ 2 · (estimated BW) · RTTold, because its min-RTT filter still remembers the old, short RTT. On the new path that cwnd only supports cwnd / RTTnew = 2·BW·RTTold / (4·RTTold) = half the estimated bandwidth.
What to look for: the staircase. Each time the filter forgets the old high samples, the estimate drops to what was just measured (100 → 50 → 25 → 12.5), which shrinks cwnd again. That is the feedback spiral. The green jump at the end is the min-RTT filter finally expiring (≈ 10 s): BBR learns the real RTT, cwnd is sized correctly, and throughput recovers.

BBRv1 on a longer-RTT route: the min-RTT filter (10 s window) keeps the old, small RTT, so BBR underestimates the BDP and sets cwnd ≈ 2·BW·RTTold, which is too small. The sender becomes cwnd-limited, so delivery-rate samples drop. When the high samples expire from the 10-round max-BW filter, the BW estimate drops too, which shrinks cwnd further. This feedback spiral lasts until the min-RTT entry expires (≈10 s / ProbeRTT). Fix (HW answer): when several RTT samples are consistently above the stored min, temporarily drain inflight. If the RTT stays high at low load, it is a longer propagation delay: reset the min-RTT filter, recompute BDP/cwnd, and re-probe bandwidth. If the RTT falls back, it was queueing, so keep the old min. This is imperfect, because a persistent queue from other traffic also keeps the baseline high.

PCC with delay preference U = g − β·q (g = goodput in Mb/s, q = average queueing delay in ms). β is the exchange rate: how many Mb/s of goodput you are willing to give up to save 1 ms of queueing delay. Bigger β = more delay-sensitive.

Worked (HW Q1.2): low rate gives (g, q) = (80, 4), high rate gives (90, 24). Going high buys 10 Mb/s for 20 ms more delay, so the break-even is β* = 10/20 = 0.5 Mb/s per ms. β = 0.25 (< 0.5): Ulo = 80 − 1 = 79, Uhi = 90 − 6 = 84 → high rate. β = 1 (> 0.5): Ulo = 76, Uhi = 66 → low rate.
The trap: a larger β does not always pick the lower-delay rate. With (80, 5) vs (100, 10), the break-even is 20/5 = 4, so both β = 0.25 and β = 1 pick the high rate. β only matters if it lands on different sides of the break-even.

Exploration vs exploitation: a trial must span at least one RTT (often several) to see its own effect. Shorter trials cause misattribution. Longer trials average out noise but cost throughput or queueing, and if conditions change during the trial the result mixes regimes or is stale. Trials should be long enough to be reliable and short enough to stay relevant.

✍ iPadProblem 1.1 — What should the sender do after loss? MCQ
A sender at 100 Mb/s observes 1% loss. Which statements are correct?
☐ A. If the loss is random, non-congestive loss with spare capacity, the useful response is to increase the rate.
☐ B. If another, more aggressive flow is occupying the shared buffer, the useful response is to back off substantially.
☐ C. Reno's rule (halve on loss) embeds one interpretation of loss — that this flow overloaded the link — and applies it in every scenario.
☐ D. PCC resolves the ambiguity by first identifying which of the four hidden scenarios is happening and then applying the matching response.
☐ E. If a shallow buffer overflowed from a small burst while the link is far from capacity, a slight decrease or better pacing is the useful response.
Show solution

Correct: A, C, E

  • A ✔ — Random loss isn't a congestion signal, so there's room to grow.
  • B ✘ — You're the victim and haven't reached your fair share. The useful response is to maintain.
  • C ✔ — Event→action tables bake an interpretation of the event into the action. That's what “model-based” means.
  • D ✘ — PCC deliberately doesn't name the cause. It treats the network as a black box and compares the utility of nearby rates.
  • E ✔ — Lecture table: shallow buffer → decrease slightly.
✍ iPadProblem 1.2 — Allegro randomized controlled trials calcHW-style
A PCC Allegro sender is at r = 50 Mb/s with ε = 0.04. Each monitor interval runs two randomized pairs of trials.
  1. What two rates are tested?
  2. Results: pair 1 (48 then 52): U = 40.1, 41.0. Pair 2 (52 then 48): U = 40.6, 39.8. What does Allegro do?
  3. Results: pair 1 (52 then 48): U = 41.2, 40.3. Pair 2 (48 then 52): U = 40.9, 40.2. What does Allegro do now, and what changes for the next MI?
  4. Why is each trial's utility only computed about one RTT after that trial's rate begins?
  5. Why randomize the order inside each pair?
Show solution
  1. r(1−ε) = 48 and r(1+ε) = 52 Mb/s.
  2. Pair 1: 52 wins (41.0 > 40.1). Pair 2: 52 wins (40.6 > 39.8). Both agree, so move up (to 52 Mb/s, entering ADJUSTING in that direction).
  3. Pair 1: 52 wins. Pair 2: 48 wins (40.9 > 40.2). The pairs disagree, so the MI is inconclusive: stay at 50, discard these trials, and increase ε so the next trials explore farther from r (noise may have hidden a small difference).
  4. The effect of a rate choice (queue growth, loss) only reaches the sender with ACK feedback about one RTT later. Scoring earlier would attribute the outcome of the previous rate to this trial (misattribution).
  5. Network conditions drift (a queue builds, a competitor arrives). With a fixed order the later trial would always be biased the same way. Random order turns drift into disagreement between pairs (detected as inconclusive) instead of a systematic wrong answer.
✍ iPadProblem 1.3 — Allegro's utility and the 5% loss cliff calc
Allegro uses u(x) = T·S(L) − x·L with T = x(1−L) and S(L) = 1 / (1 + eα(L − 0.05)), α = 100.
  1. Compute u for x = 100 Mb/s at L = 1%, 4%, 6%.
  2. Explain what this implies when Allegro shares a bottleneck with CUBIC.
  3. Name the metric missing from this utility and the consequence.
Show solution
  1. L = 0.01: exponent = 100(−0.04) = −4 → S = 1/(1+0.0183) = 0.982; T = 99 → u = 99·0.982 − 1 = 96.2.
    L = 0.04: exponent −1 → S = 1/(1+0.368) = 0.731; T = 96 → u = 70.2 − 4 = 66.2.
    L = 0.06: exponent +1 → S = 1/(1+2.718) = 0.269; T = 94 → u = 25.3 − 6 = 19.3.
  2. Utility stays high until loss nears 5%, then collapses. So Allegro keeps pushing through loss rates that make CUBIC back off every time. In the lecture's words, Allegro grabs essentially all the bandwidth: PCC doesn't coexist with loss-based algorithms.
  3. Latency / RTT. Allegro happily fills buffers (bufferbloat). Vivace fixes this with the RTT-gradient term.
✍ iPadProblem 1.4 — Vivace: RTT gradient vs RTT magnitude calc
Capacity C = 100 Mb/s; the queue is non-empty and doesn't overflow. For 100 ms the sender sends at 120 Mb/s and RTT rises 40 → 60 ms. For the next 100 ms it sends at 110 Mb/s and RTT rises 60 → 70 ms. Use the simplified utility u(x) = x − b·x·(dRTT/dt) with b = 2 (no loss).
050100150200020406080time (ms)measured RTT (ms)sending at 120 Mb/ssending at 110 Mb/s40 ms60 ms70 ms
  1. Average RTT in each interval? Which rate would a utility penalizing average RTT prefer?
  2. RTT slope in each interval, and u(120), u(110)? Which rate wins?
  3. Show that both slopes match dRTT/dt = (x − C)/C. Using that, what is u(90)? Why is that term a reward?
Show solution
  1. Interval 1: (40+60)/2 = 50 ms. Interval 2: (60+70)/2 = 65 ms. A magnitude-based utility prefers 120, which is wrong, because the queue left behind by interval 1 inflates interval 2's RTT.
  2. Slopes: 20 ms/100 ms = 0.20 and 10/100 = 0.10. u(120) = 120 − 2·120·0.2 = 72. u(110) = 110 − 2·110·0.1 = 88. 110 wins, which is correct, since it is closer to C.
  3. (120−100)/100 = 0.2 ✓, (110−100)/100 = 0.1 ✓. At 90: slope = −0.1 (queue draining) → u = 90 − 2·90·(−0.1) = 108. A negative gradient is rewarded: draining the queue is even better than growing it slowly.
✍ iPadProblem 1.5 — Vivace step vs Allegro step calc
A Vivace sender at r = 80 Mb/s tests 76 and 84 Mb/s and measures U(76) = 61.0, U(84) = 58.6. Its confidence amplifier is θ = 10 (Mb/s per unit of gradient).
  1. Estimate the gradient g and the proposed change Δr. New rate?
  2. The next decision again points down with g = −0.25, and θ has doubled. New rate?
  3. Allegro with a fixed step of ε·r (ε = 0.05) — where does it go from 80? When is a fixed step worse?
  4. Why does Vivace bound Δr relative to r?
Show solution
  1. g = (58.6 − 61.0)/(84 − 76) = −2.4/8 = −0.3. Δr = θg = 10·(−0.3) = −3, so r = 77 Mb/s.
  2. θ = 20 → Δr = 20·(−0.25) = −5, so r = 72 Mb/s. Repeating the same direction raises confidence, so the steps get larger.
  3. It moves to 76 (step 4) whatever the slope. Far from the optimum, small fixed steps take many iterations. Near it, they overshoot and oscillate. Vivace's step shrinks as g → 0 near the peak.
  4. Utility measurements are noisy. A noisy, huge |g| would produce an extreme jump. The bound (a dynamic change boundary) limits fractional change per step.
✍ iPadProblem 1.6 — PCC with a delay penalty (HW2 Q1.2 style) calcHW-style
U = g − β·q (g goodput in Mb/s, q average queueing delay in ms). Measurements: low rate g = 60, q = 2; high rate g = 72, q = 14.
  1. Utilities and choices for β = 0.5 and β = 2. Which gives lower delay?
  2. For which β are the two rates tied?
  3. Does a larger β always select a strictly lower-delay rate than a smaller β? Give a numerical counterexample (both configurations choose from the same two measured options).
  4. Interpret β's unit.
Show solution
  1. β = 0.5: low 60 − 1 = 59, high 72 − 7 = 65 → high. β = 2: low 60 − 4 = 56, high 72 − 28 = 44 → low. β = 2 gives the lower delay (2 ms vs 14 ms).
  2. 60 − 2β = 72 − 14β → 12β = 12 → β = 1 (= Δg/Δq = 12/12).
  3. No. Example: low (g = 50, q = 8), high (g = 70, q = 10). β = 0.5: 46 vs 65. β = 2: 34 vs 50. Both pick high, so the delay is the same. A larger β only changes the choice when β crosses the break-even Δg/Δq.
  4. Mb/s of goodput the operator is willing to give up to save 1 ms of queueing delay.
✍ iPadProblem 1.7 — BBRv1 after a route change (HW2 Q1.1 with numbers) calcHW-style
BBRv1, bottleneck 100 Mb/s (unchanged), continuous demand. The route changes: RTprop 20 ms → 80 ms. Assume cwnd = 2·BtlBw_est·RTprop_est and ignore pacing-gain cycling. The max-BW filter spans 10 rounds; the min-RTT filter spans 10 s.
  1. Right after the change: cwnd (in Mb and in kB), the BDP the new path needs, and the throughput the flow can achieve.
  2. What happens to BtlBw_est when the old samples leave the BW filter? Next cwnd and throughput? Continue one more step.
  3. When does it recover, and why?
  4. Propose a modification and how it distinguishes longer propagation delay from queueing.
Show solution
  1. cwnd = 2·100 Mb/s·0.02 s = 4 Mb = 500 kB. New BDP = 100·0.08 = 8 Mb = 1 MB. Rate ≈ cwnd/RTT = 4 Mb/0.08 s = 50 Mb/s (cwnd-limited).
  2. Delivery samples are now ≈ 50, so after ~10 rounds BtlBw_est = 50 → cwnd = 2·50·0.02 = 2 Mb → 25 Mb/s. Next: 1 Mb → 12.5 Mb/s. A downward spiral, because both estimates feed each other.
  3. When the stale 20 ms sample expires from the 10 s min-RTT filter (ProbeRTT), RTprop_est = 80 ms. cwnd then matches the path and bandwidth probing (gain 1.25) climbs back to 100 Mb/s.
  4. HW answer: trigger an early RTT reassessment when the last several RTT samples are consistently above the stored min. Temporarily reduce inflight to drain queues and take fresh baseline samples. If RTT stays high under low load, it is propagation delay: reset the min-RTT filter, recompute BDP and cwnd, and re-probe bandwidth. If RTT drops back near the old value, it was queueing, so keep the old estimate. Imperfect: a persistent queue from other flows keeps the baseline elevated. Draining and resetting the filter are separate operations.
✍ iPadProblem 1.8 — Learning rates, learning policies, running AI MCQ
Which statements are correct?
☐ A. Remy updates its table of control rules during live operation on the Internet.
☐ B. A fixed learned policy can still produce a constantly changing sending rate.
☐ C. Moving a neural congestion controller to user space lets it react to every ACK at microsecond timescales.
☐ D. Linux kernel code generally avoids floating point, one reason heavy learned controllers run in user space behind an API.
☐ E. PCC Vivace learns its sending rate through live experiments.
☐ F. Because PCC is rate-based, it cannot limit the number of packets in flight.
☐ G. A good way to find the best rate is a binary search that alternates very low and very high rates.
Show solution

Correct: B, D, E

  • A ✘ — Remy generates its rule table offline.
  • B ✔ — The policy maps observation history → action. Observations change, so the rate changes.
  • C ✘ — User-space models react every RTT or every few RTTs; they can't react per ACK.
  • D ✔ — Integer-only kernel math, plus the cost of kernel development.
  • E ✔ — Allegro and Vivace learn the rate x online.
  • F ✘ — Rate and window are linked through the RTT. A rate-based sender can cap inflight at about 2·rate·RTT, just as BBR (window-based) paces at about 2·cwnd/RTT. PCC's analysis assumes pure rate control, so the math would need revisiting.
  • G ✘ — The professor's aside: big rate swings hurt other flows and make the feedback noisy. PCC compares nearby rates r(1±ε) instead.
✍ iPadProblem 1.9 — Exploration vs exploitation (HW2 Q1.3) MCQ
Which statements about experiment (trial) length in BBR/PCC-style probing are correct?
☐ A. A trial shorter than one RTT risks attributing performance to the wrong rate.
☐ B. Longer trials always produce better decisions.
☐ C. Longer trials average out measurement noise, but if conditions change during the trial the result mixes regimes and may be stale.
☐ D. Short flows may finish before PCC has run enough trials to converge.
☐ E. Exploration is free when the network is idle, so trials should be as long as possible.
Show solution

Correct: A, C, D

  • A ✔ — Feedback lags by one RTT, so you'd score the previous rate.
  • B ✘ — Not if the network changes during the trial.
  • C ✔ — The core trade-off: reliable vs relevant.
  • D ✔ — Mentioned in lecture as a PCC weakness.
  • E ✘ — Exploration costs throughput or queueing, and long trials go stale.

2 · QUIC

Lecture 10 · HW2 Q2. Organizing question: besides “how fast?”, what must transport do for an app like a phone video page?

App needWhat can go wrongQUIC mechanism
Start a secure exchange fastTCP + TLS spend RTTs before useful dataTLS 1.3 integrated into the transport handshake (1-RTT; 0-RTT on resumption)
Progress on concurrent objectshead-of-line (HOL) blockingindependently ordered streams
Recover lost bytes without stalling othersTCP's single byte orderpacket-number ACKs + loss inference + stream offsets
Respect receiver capacityoverrun the receiverstream- and connection-level flow control
Survive Wi-Fi → cellularTCP 4-tuple changes, so the connection diesconnection IDs + path validation
(Rate)congestioncongestion control still governs everything, per connection

2.1 Handshake: how many RTTs before the response?

TCP + TLS 1.3 (fresh)QUIC (fresh, 1-RTT)QUIC 0-RTT (resumption) SYN SYN-ACK ACK+ClientHello ServerHello… HTTP request response 3 RTT Initial (conn + crypto) handshake reply HTTP request response 2 RTT Initial + early data response (+hs) 1 RTT needs: remembered state+ server accepts early data (eligible / replay-safe requests);handshake still completes
The layered stack (TCP, then TLS on top, then the app) explains TCP's extra RTTs: security was added later. QUIC merges the transport and crypto handshakes.
📈 How to read this figureEach panel is a timeline: client on the left, server on the right, time going down. Every slanted arrow is one message; going across and back is one RTT. TCP + TLS 1.3: SYN / SYN-ACK sets up the connection (1 RTT); ClientHello / ServerHello sets up the encryption keys (1 RTT); only then can the HTTP request go out, and the response takes a third RTT. QUIC: its first message (“Initial”) carries the connection setup and the TLS ClientHello together, so after one RTT both are done and the request goes out. 0-RTT: a client that talked to this server before kept a key from that session (a “resumption ticket”). It sends the request in its very first flight, encrypted with that key, so the response comes back after one RTT. The normal handshake still completes alongside.
Read the question: “request sent” vs “response received”. The slide (RTT = 40 ms) labels when the HTTP request can be sent: TCP + TLS 1.3 at 2 RTT (80 ms), QUIC at 1 RTT (40 ms), 0-RTT at 0 (request in the first flight). The response arrives one RTT later: 3, 2, 1 RTT (120, 80, 40 ms), which is what the figure above counts. Two kinds of state must be set up before the first secure request: transport state (identify the connection, agree on parameters) and cryptographic state (authenticate the server, derive keys). TCP + TLS does them one after the other; QUIC does them together.

2.2 Why not just modify TCP? Ossification

A TCP change has to reach three places: the endpoint stacks (OS kernels, APIs), the peer (negotiation), and the path. The path is the real problem. Middleboxes are devices in the middle of the path that look inside packets: firewalls, NATs (which rewrite addresses and ports), load balancers, even home Wi-Fi routers. Many were built to expect TCP exactly as it looked years ago, so when they see something unfamiliar they “normalize” it (rewrite it to a standard form), strip it, or drop the packet as suspicious. Example: both endpoints support a new TCP option, but a firewall deletes it from the SYN, so the endpoints never learn the other side supports it and silently fall back to old behaviour (the slide's “the middlebox removes its signal”). The cycle: devices see a narrow set of behaviors → implementations depend on them → new values fail → fallback preserves the old assumptions. A brand-new transport protocol number would be dropped even more often.

QUIC's move Ride on UDP (broadly accepted by paths, supported by every OS), implement everything else in user space, so updating the app updates the transport, and encrypt almost all transport header fields so middleboxes can't depend on or rewrite them, which prevents the next round of ossification. QUIC is not “reliable UDP”: it is a full connection-oriented, secure transport over UDP.

Side effect: many implementations (Google, Cloudflare, Akamai, Meta…). Even with RFC 9000–9002, each makes its own assumptions, so interop problems appear (“Google server needs Google client” early on). IETF interop matrices helped.

2.3 Head-of-line blocking and streams

Head-of-line (HOL) blocking = data that already arrived can't be used because something in front of it in the delivery order is missing. Like a supermarket queue where everyone waits behind one person whose card was declined. TCP delivers one ordered byte stream, so if bytes 1000–1999 are lost, bytes 2000+ sit in the receiver's buffer, unusable, until the retransmission arrives, even when they belong to a completely different object.

QUIC wordWhat it is
streaman independent ordered byte sequence inside one connection (one per HTTP request/response)
STREAM framea chunk of one stream: (stream ID, byte offset, the bytes)
packetone numbered transmission; holds one or more frames, possibly from different streams
UDP datagramwhat actually crosses the network; carries one or more QUIC packets
HTTP/2 over ONE TCP byte stream A ✗ lost B C A B and C arrived but sit in the TCP buffer until A's gap is filled QUIC: one connection, many streams A ✗ lost B ✔ C ✔ A wait only stream A waits for its own missing prefix Nesting of QUIC objects UDP datagram QUIC packet (packet number 101, protected) STREAM frame: id 4, offset 1000, len 500 STREAM frame: id 8, offset 0, len 700
A packet can carry frames from several streams; a stream can span many packets.
📈 How to read this figureLeft: HTTP/2 puts objects A, B, C into one TCP byte order. A's segment is lost, so B and C (which arrived fine) wait in the buffer. Right: QUIC gives each object its own stream, so B and C are delivered immediately and only A waits for its retransmission. Bottom: how the pieces nest: a UDP datagram holds a QUIC packet (with a packet number), which holds STREAM frames (each naming its stream and byte offset).
Independent ordering ≠ independent performance (slide). ① Within a stream, missing bytes still block later bytes of that stream. ② All streams share congestion control and connection-level flow-control credit, so a bottleneck slows everyone. ③ App-level dependencies (object X needs object Y) still stall.

2.4 Reliability: packet numbers vs stream offsets

Why two numbering systems? They answer two different questions. Stream ID + offset answers “which bytes are these and where do they go?”, so the receiver can put data in place no matter which packet carried it. The packet number answers “which transmission is this?” and is never reused. In TCP, a retransmitted segment has the same sequence number as the original, so when an ACK comes back the sender can't tell whether it acknowledges the original or the copy. Its RTT sample is ambiguous. In QUIC every ACK names exactly one transmission, so RTT samples and loss detection are clean.

IdentifierNamesWhen bytes are resent
TCP sequence numberbyte position in the one connection streamsame numbers (so a retransmission's ACK is ambiguous)
QUIC stream ID + offsetbyte position in one streamsame stream and offsets (reassembly, dedup)
QUIC packet numberone transmissionnew packet number, never reused; packetization may change
QUIC loss recovery: packet numbers vs stream offsets (L10) serverphone ✗ 100: A off 0 101: B off 0 102: A off 1000 103: C off 0 ACK 101–103 (100 missing?) 110: A off 0 (resend) phone's stream buffers after 101–103 arrive A 0–999 missing 1000–1999 waits B 0–999 delivered C 0–999 delivered after 110 arrives A 0–999 1000–1999 A delivers 0–1999 in order
Only stream A waits (no connection-wide barrier). The resend gets a new packet number (110) but the same stream offsets (A, 0–999). The ACK names packets, not offsets.

Example from the slides: packet 100 (A: offset 0, len 1000) is lost and its bytes are resent in packet 110 with the same A offset 0, len 1000. Then stream A can deliver bytes 0–1999 in order. An ACK reports packets received (“ACK 101–103”), not the next deliverable stream offset, so packet 100's fate is uncertain (delayed or lost).

How the sender decides “packet 100 is lost” (example)Packets 100–103 were sent; the ACK says “101–103 received”. ① Packet threshold: 103 is at least 3 numbers above 100 and was acknowledged, so 100 is declared lost (it was probably not just reordered). ② Time threshold: even without 3 later packets, if 100 is still unacknowledged about 9/8 of an RTT after a later packet was acknowledged, it is declared lost. ③ PTO: if no ACKs come back at all (e.g., the last packet of a transfer is lost, so there are no later packets to trigger ①/②), the sender sends a small probe to provoke an ACK. The probe alone does not declare anything lost. Once a loss is declared, the missing bytes are resent in a new packet (110) with the same stream offsets.

2.5 Connection migration

📱 phone server{cid-X, cid-Y} Wi-Fi 192.0.2.10:51000 → dest CID cid-X Cellular 198.51.100.20:62000 → dest CID cid-Y (another issued ID) PATH_CHALLENGE (random 8 bytes) ⇄ PATH_RESPONSE,then re-learn congestion state for the new path

TCP's connection is its 4-tuple (src IP, dst IP, src port, dst port); a new IP kills it (timeout → app exception → new handshake → recover app state). QUIC uses connection IDs to locate state; packet protection authenticates the traffic. The client switches to a different issued CID (so the paths aren't trivially linkable), validates the new path, and re-learns what the new path supports (Wi-Fi 20 ms/100 Mb/s vs cellular 80 ms/10 Mb/s): “a surviving connection does not imply a surviving path model.”

📈 How to read the migration figureThe phone first reaches the server over Wi-Fi (its packets carry connection ID cid-X). It walks out of range and continues over cellular: new IP address, new port, and it switches to a different connection ID the server issued earlier, cid-Y. The server knows both IDs belong to the same connection, so the streams continue. The PATH_CHALLENGE / PATH_RESPONSE exchange checks the new path before trusting it.

2.6 HW2 Q2 pattern: scheduling buffered streams

Flow control vs congestion control: flow control protects the receiver (it advertises how many more bytes it can buffer: a credit per stream and one for the whole connection); congestion control protects the network (cwnd). The sender may send only what both allow.

All data is already at the sender, but the congestion window limits what is in flight, and the scheduler decides which stream gets those slots. Prioritizing B helps B even with everything buffered. The cost is that lower-priority streams wait, and they can starve if high-priority data keeps arriving. Method: build a table time | ACKs received | cwnd | packets sent, then add one-way delay to get arrival and display times.

Worked (HW Q2.2): image A = 3 packets, text B = 2 packets, all already buffered at the sender. RTT = 50 ms (one-way 25 ms). cwnd starts at 1 packet and grows by 1 for each ACK round (the homework's simplified model). Each row is a moment when the sender can transmit.
t (ms)ACKs just receivedcwndB-first sendsround-robin sends
0—1B1A1
50the 1 packet sent at 02B2, A1B1, A2
100the 2 sent at 503A2, A3B2, A3
A packet sent at t arrives at t + 25. B-first: B's last packet (B2) is sent at 50 and arrives at 75 ms, so B displays then. Round-robin: B2 goes out at 100 and arrives at 125 ms. A's last packet goes out at 100 either way, so A displays at 125 in both. Prioritizing B helped B without hurting A here; with more B data, A would have waited longer (starvation risk).
✍ iPadProblem 2.1 — Time to first response calc
RTT = 30 ms; ignore serialization and processing. A client requests a small object (fits in one packet). When does the response arrive (time from the client's first packet) for:
  1. TCP + TLS 1.3, fresh connection?
  2. QUIC, fresh connection?
  3. QUIC 0-RTT resumption, accepted by the server?
  4. What two conditions does 0-RTT require?
  5. Why can't the industry just merge TCP's SYN with the TLS ClientHello?
  6. For (a)–(c), when can the client send its HTTP request?
Show solution
  1. SYN/SYN-ACK (1 RTT) + ClientHello/ServerHello (1 RTT) + request/response (1 RTT) = 3 RTT = 90 ms.
  2. Combined transport + crypto handshake (1 RTT) + request/response = 2 RTT = 60 ms.
  3. Request in the first flight, encrypted with remembered keys = 1 RTT = 30 ms. The handshake still completes in parallel.
  4. ① Prior resumption state remembered from an earlier connection. ② The server accepts early data (only eligible, replay-safe requests).
  5. The change must reach both endpoints' OS stacks and survive the path. Middleboxes strip or reject unfamiliar TCP options or drop the packets (transport ossification). Correct endpoints don't guarantee deployability.
  6. One RTT before each response: TCP + TLS at 2 RTT = 60 ms, QUIC at 1 RTT = 30 ms, 0-RTT at 0 ms (in the first flight). The slide's “2 RTT” and “1 RTT” labels mark these request times.
✍ iPadProblem 2.2 — Head-of-line blocking (HW2 Q2.1 style) calcHW-style
Objects: A = image (3 packets), B = text (1 packet), C = caption (2 packets). Each displays as soon as all its bytes are delivered to the application; they're independent. Transmission order and arrival times are identical for every transport:
packetA1B1C1A2C2A3
arrives (ms)lost → retransmission at 701014182226
  1. Display times of A, B, C with one TCP connection (HTTP/2-style multiplexing).
  2. With QUIC, one stream per object.
  3. With three separate TCP connections (HTTP/1.1-style). Why not just do that?
Show solution
  1. TCP delivers bytes in order. Everything after A1's gap sits in the kernel buffer until 70 ms: A = B = C = 70 ms.
  2. Each stream is ordered independently: B = 10 ms, C = 22 ms (C1 at 14 and C2 at 22), A = 70 ms (needs A1).
  3. Same as QUIC (B 10, C 22, A 70). But you pay a handshake per connection, more state, CPU/threads in the app, and separate congestion controllers (more aggressive in aggregate). QUIC gets the independence inside one connection with one CC.
✍ iPadProblem 2.3 — Packet numbers vs stream offsets short
Packet 40 = [A: off 0, len 1000]; packet 41 = [A: off 1000, len 1000] + [B: off 0, len 500]; packet 42 = [A: off 2000, len 1000]. Packet 41 is lost. The ACK frame reports 40 and 42.
  1. What can the receiver hand to the application for stream A? For stream B?
  2. The sender retransmits the lost data. What packet number does it use, and which identifiers stay the same? Must it reuse the same packetization?
  3. What would TCP do differently with the bytes after the gap?
  4. Why is it useful that the retransmission has a new packet number?
Show solution
  1. Stream A: bytes 0–999 only (2000–2999 are buffered behind the gap). Stream B: nothing; its only bytes were in 41.
  2. A new, never-reused packet number (e.g., 47). Stream IDs and offsets stay the same (A off 1000 len 1000, B off 0 len 500). Packetization can change: they could be split into two packets or merged with new data.
  3. TCP would hold all later bytes, including other objects multiplexed in the same byte stream, until the gap is filled.
  4. Packet numbers identify transmissions, so an ACK for 47 is unambiguous. That gives clean RTT samples and loss detection; TCP reuses sequence numbers, so ACKs of retransmissions are ambiguous. Offsets identify bytes for reassembly and deduplication.
✍ iPadProblem 2.4 — Stream scheduling under a congestion window (HW2 Q2.2 style) calcHW-style
All data is buffered at t = 0: A (image, 4 chunks) and B (text, 2 chunks), one chunk per packet. RTT = 40 ms (20 ms each way), ACKs immediate, no loss. cwnd starts at 2 packets and grows by 1 after each RTT. Send whenever the window permits. Fill a table (time | ACKs received | cwnd | packets sent) and give A's and B's display times for:
  1. B-first
  2. round robin, starting with A
  3. A-first
  1. Why does prioritization matter even though all the data is already buffered? What is the cost?
Show solution
policyt=0 (cwnd 2)t=40 (cwnd 3)t=80 (cwnd 4)B shownA shown
B-firstB1 B2A1 A2 A3A420 ms100 ms
RR (A first)A1 B1A2 B2 A3A460 ms100 ms
A-firstA1 A2A3 A4 B1B2100 ms60 ms
(Display = send time + 20 ms one-way.)
  1. The congestion window, not the buffer, limits what is in flight. The scheduler decides which stream gets those scarce slots. Cost: the low-priority stream waits (A goes from 60 to 100 ms in B-first vs A-first). If high-priority data keeps arriving, low priority can starve. (In this case A ends at 100 under both B-first and RR.)
✍ iPadProblem 2.5 — Connection migration MCQ
A phone moves from Wi-Fi to cellular mid-download. Which statements are correct?
☐ A. A TCP connection is identified by its 4-tuple, so the client IP change breaks it.
☐ B. QUIC packets carry a connection ID, letting the server associate packets from the new address with the existing connection state.
☐ C. Because the QUIC connection survives, it should keep its Wi-Fi congestion window on the cellular path.
☐ D. Path validation (PATH_CHALLENGE / PATH_RESPONSE with random data) checks that the new path works.
☐ E. The client must keep using exactly the same connection ID on the new path so the server can recognize it.
Show solution

Correct: A, B, D

  • A ✔ — src IP, dst IP, src port, dst port.
  • B ✔ — Connection IDs locate state; packet protection authenticates the traffic.
  • C ✘ — “A surviving connection doesn't imply a surviving path model.” Re-establish what the new path supports (e.g., 20 ms/100 Mb/s → 80 ms/10 Mb/s).
  • D ✔ — Explicit challenge/response before relying on the path.
  • E ✘ — It switches to another issued ID (cid-X → cid-Y). The server maps both to the same connection.
✍ iPadProblem 2.6 — QUIC loss detection short
Packets 20–26 are sent. ACK frames acknowledge 21, 22, 23, and later 25. Use a packet threshold of 3 (RFC 9002 default).
  1. Which packets are declared lost by the packet threshold? Which are still undecided?
  2. A short flow's last packet's ACK is lost and nothing else is outstanding. Which mechanism helps, and what does its expiry do?
  3. Why does QUIC's ACK format cost some goodput compared with TCP's?
Show solution
  1. 20 (23 acked, 3 higher). 24 is not yet lost by packet threshold (largest acked 25 is only 1 higher); the time threshold (≈ 9/8 × RTT) may declare it. 26 is outstanding.
  2. The probe timeout (PTO): send a probe to elicit an ACK covering everything received. It is shorter than TCP's RTO wait. PTO expiry alone does not declare loss; the response to the probe does.
  3. ACKs list ranges of individual packet numbers (SACK-like), and frames carry per-stream metadata, so more header bytes per useful byte. TCP's cumulative ACK is one number.
✍ iPadProblem 2.7 — Why QUIC looks the way it does MCQ
Which statements are correct?
☐ A. A QUIC stream can still be blocked by its own missing bytes.
☐ B. Because streams are independent, a congested bottleneck slows down only the stream whose packet was dropped.
☐ C. QUIC runs over UDP partly because UDP is broadly allowed by Internet paths and supported by endpoint operating systems.
☐ D. Encrypting most transport header fields makes it harder for middleboxes to depend on or rewrite them, reducing future ossification.
☐ E. Deploying new QUIC behavior typically requires a kernel upgrade on both endpoints.
☐ F. Different QUIC implementations can have interoperability problems even though they follow the same RFCs.
Show solution

Correct: A, C, D, F

  • A ✔ — Ordering is per stream: missing prefix → later bytes of that stream wait.
  • B ✘ — Congestion control and connection flow-control credit are shared by all streams.
  • C ✔ — And a brand-new transport protocol number would be dropped even more.
  • D ✔ — Middleboxes see the IP and UDP headers and very little of QUIC's.
  • E ✘ — QUIC lives in user space, so an application update changes the transport.
  • F ✔ — Each makes its own assumptions (e.g., about path challenges and stream handling). IETF interop matrices exist because of this.

3 · Traffic engineering (TE) foundations

Lecture 11 · HW2 Q3. Unit 2 zooms into one operator's private WAN. Its inputs are aggregates (a traffic matrix), not individual flows.

The picture from the whiteboard: a content provider (Meta, Google, Microsoft) owns a private WAN that connects its data centers to each other and to PoPs, where it hands traffic to several ISPs and on to users. Because one operator owns the whole network (and often the sending hosts), it can decide where traffic goes and how much each service may send, which the public Internet cannot.

Three words used everywhere in Unit 2 Demand d: how much traffic a source wants to send to a destination (Gb/s). The table of all demands is the traffic matrix.
Utilization of a link = load on it / its capacity. 8 Gb/s on a 10 Gb/s link = 0.8 = 80%. Above 100% means the link can't carry it: queues grow and packets drop.
MLU (maximum link utilization) = the highest utilization over all links. It measures how close the busiest link is to overflowing. “Min-MLU TE” = choose routes so that the busiest link is as empty as possible.

3.1 Slow down, or move the traffic?

Shortest path s t 12 on 10 → 120% ✗ 0 on 5 ECMP (equal split) s t 6 on 10 → 60% 6 on 5 → 120% ✗ Min-MLU TE s t 8 on 10 → 80% 4 on 5 → 80%
12 Gb/s demand; paths 10 and 5 Gb/s. At 16 Gb/s nothing fits: the 15 Gb/s cut is the limit. TE recovers stranded capacity; it cannot create capacity.
📈 How to read this figureSame network three times: source s, destination t, an upper path of 10 Gb/s and a lower path of 5 Gb/s; demand is 12 Gb/s. Each label is “traffic on that path → its utilization”. Shortest path puts all 12 on the upper path: 120%, overloaded, while the lower path idles. ECMP splits evenly, 6 + 6: the small path is now at 120%. Min-MLU splits in proportion to capacity, 8 + 4: both at 80%, the best possible. Why 8/4: the busiest link is lowest when both utilizations are equal, a/10 = (12−a)/5 → a = 8.

3.2 From NUM to TE, and why minimize peak utilization

Congestion-control NUM (Unit 1)Routing-only TE (Unit 2)
Givenrouting + capacitiesdemands + capacities
Choosesending rateswhere traffic goes (paths, splits)
Who / howindependent endpoints, distributed, must convergeone operator owns routers (and often contracts with sources), so centralized coordination is possible
Timescaleevery RTT (ms), per flowseconds to minutes, on aggregates

They form a feedback loop: TE moves traffic, which changes the RTTs and bottlenecks each flow sees, which changes the rates CC picks, which changes the demand TE measures. The separation of timescales breaks the loop: CC reacts every few milliseconds and handles fast fluctuations, while TE recomputes every few minutes on averages. From TE's view CC is “already settled”; from CC's view the routes are fixed.

Why TE needs its own objective: take the 12 Gb/s example and compare the splits 8/4 and 9/3. Both fit (utilizations 0.8 & 0.8 vs 0.9 & 0.6), so every sender gets its full 12 Gb/s with no loss and no queueing. The senders' utilities are identical either way, so they can't say which split is better. The operator needs a network-level goal, such as the lowest MLU, which prefers 8/4 (busiest link 0.8, not 0.9).

Why min-MLU (the professor's answer) Not just “leave room if a link fails”. The main reason is timescales: demand changes much faster than TE can react (seconds to minutes). Minimizing the peak utilization maximizes headroom everywhere, so a spike can be absorbed (with CC keeping it sane) until the next TE cycle.
min  ρ
s.t. Σ_p x_kp = d_k                 (carry each demand)
     Σ_{k,p : e∈p} x_kp ≤ ρ·c_e     (every link)
     x_kp ≥ 0                       12-Gb/s example: a/10 = (12−a)/5 → a* = 8, ρ* = 0.8
Reading the LP line by line Variables: xkp = how much of demand k you put on path p (Gb/s); ρ = the MLU you are trying to make small.
“min ρ”: make the busiest link's utilization as small as possible.
“Σp xkp = dk”: each demand must be fully carried, split over its paths however you like.
“Σ xkp ≤ ρ·ce” for every link e: add up all traffic (from every demand) whose path uses link e; it must fit within ρ × capacity. This line is what ties the demands together: they compete for the same links.
“x ≥ 0”: no negative traffic.
The solver returns the split (x) and the resulting MLU (ρ). In the 12 Gb/s example there is one demand and two paths, and the answer is the 8/4 split with ρ = 0.8.

RFC 9522 definition: TE = performance evaluation and optimization of operational IP networks, using measurement, characterization, modeling, and control of traffic. Objectives come in two classes. Traffic performance: loss, delay, delivered throughput, service commitments. Resource use: avoid persistent hotspots, use alternate capacity, preserve headroom, minimize cost (leased or transit links). A “best” routing is best only for a stated objective. Policy can remove otherwise useful paths.

Control surfaces: traffic management (limit a sending rate / reject requests, i.e. admission), routing (move demand), resource constraints (reserve headroom, exclude paths). Which ones you have depends on the operator's authority.

3.3 The practical TE loop: five problems

1 Measure& characterize 2 Allocaterates + paths 3 Realizerouter config 4 Changelive net safely 5 Verify& adapt every action creates a new state to measure
ProblemKey example from lecture
1. Demand isn't handed to youThe R→T counter reads 10 Gb/s = A + B in an unknown mix (5+5? 8+2?). Per-link load can't reveal the matrix or how much traffic is movable (B could use idle U). And delivered rate ≠ load ≠ demand (loss later on the path).
2. One split doesn't settle allocationWhen demand exceeds capacity, routing alone can't fix it; someone must decide who gets less. A asks 10, B asks 8, but only 15 can cross: favor A (10, 5) or split equally (7.5, 7.5)? A policy decides. Time can help too: urgent traffic needs 12 now (8 next hour); a batch job needs 5 for one hour and may finish any time before the end of next hour. Running it now = 17 on 15 ✗; deferring it = 12 now and 8 + 5 = 13 next hour ✓.
3. An allocation isn't a router configThe optimizer says “put 3 Gb/s of A's traffic on path 2”, but ordinary routers can't express that. ECMP only splits equally. Normal IP forwarding picks one next hop per destination prefix (longest-prefix match), so you can only move a whole prefix: if one prefix carries 9 Gb/s you can't move just 3 of it. You need a finer unit of traffic (e.g. MPLS trunks, §4) and router APIs that can express weighted splits.
4. Feasible ≠ safe transitionSwap A (8) and B (8) on two 10 Gb/s paths: either whole move gives 16/10. With 2 Gb/s headroom: move 2 of A, then 2 of B, repeated 4×. Confirm each move before the next. The first move consumes headroom; the second restores it.
5. Verify & adaptRerouting B via U black-holes B→T because U has a stale “discard T's prefix” route (an old rule could also create a loop). Check the candidate config before rollout, then measure loads, rate, loss, and delay after.
Problem 1: what does the counter tell you? A B R U T 10 Gb/s, counter = 10 B's alternative: 5 Gb/s, idle counter: A + B = 10. Is it 5 + 5? 8 + 2? → can't tell how much B could move Problem 5: verify before you reroute A B R U T ✗ U: “discard T's prefix” (stale) this candidate black-holes B → T check it first, then measure after
Same network (L11). Link counters show load, not who sends it or what could move. A plausible reroute can still break reachability, so the candidate config must be verified first.
Staged swap with 2 Gb/s headroom (each path 10 Gb/s) start P1: A8P2: B8 move 2 A P2 = 10 (full, OK) move 2 B 8 / 8 again → repeat ×4
📈 How to read this figureTwo paths of 10 Gb/s each. At the start, A (blue) has 8 Gb/s on path 1 and B (orange) has 8 on path 2; we want them swapped. Moving all of A at once would put 8 + 8 = 16 on path 2. Each row is one step: move only 2 Gb/s of A (path 2 is now exactly full, 10/10, still OK), then 2 of B back the other way, restoring the 2 Gb/s of headroom. Repeat four times and they've swapped without ever exceeding a link.

3.4 Scale forces trade-offs

Design choiceBenefitCost
Aggregate trafficfewer rulescoarser control
Plan less oftenless computationstaler decisions
Sample telemetryless dataless visibility
Batch updatesfewer operationslarger transition steps
Design questionChoicesTrade-off
Where does the input come from?historical pattern (e.g. yesterday's daily cycle) / live measurementpredictable peaks are planned well / sudden changes are caught
When is the plan computed?offline (ahead of time) / online (continuously)more time to search for a good answer / fresher decisions
Who decides?centralized / distributed / hybridglobally coordinated (but slower, a logical single point of failure) / fast local reaction (but suboptimal) / both
What does the decider see?local / global informationcheap telemetry / network-wide visibility
Does it watch the result?open loop / closed loopsimple / adapts to what actually happened, but risks flapping (oscillating back and forth between two routings)
✍ iPadProblem 3.1 — Shortest path vs ECMP vs min-MLU calc
s→t has two disjoint paths: P1 (the shortest) with 10 Gb/s and P2 with 40 Gb/s. Demand 30 Gb/s.
P1 (shortest): 10 Gb/sP2: 40 Gb/sst··demand s → t: 30 Gb/s (later 55 Gb/s)
  1. Utilization of each path and MLU under shortest-path routing; under ECMP.
  2. The min-MLU split and MLU*.
  3. Demand becomes 55 Gb/s. What can TE do?
  4. Give the professor's main reason why minimizing peak utilization is a good TE objective.
Show solution
  1. Shortest path: P1 30/10 = 300% (P2 0%). ECMP: 15/10 = 150% on P1, 15/40 = 37.5% on P2.
  2. Equalize: x/10 = (30 − x)/40 → 40x = 300 − 10x → x = 6 on P1, 24 on P2; MLU* = 0.6 (= 30/50, split ∝ capacity).
  3. 55 > 50 (the cut), so no routing fits. TE can't create capacity. It can carry 50 (with MLU 100%, no headroom), and admission control / rate limits / congestion control must cut demand.
  4. Demand changes at RTT timescales, but TE reacts in seconds to minutes. Minimizing the max utilization maximizes headroom on every link to absorb spikes until the next TE cycle (with CC handling the very short term).
✍ iPadProblem 3.2 — Min-MLU on three parallel paths calc
Three disjoint paths with capacities 10, 20, 30 Gb/s carry a 42 Gb/s demand. Find the min-MLU allocation and MLU*. State the general rule.
Show solution
Why equal utilizations: if one path were busier than another, moving a little traffic from the busier to the less busy one would lower the maximum. So at the optimum all paths have the same utilization u. Then path i carries u·ci, and these must add up to the demand: u·(10 + 20 + 30) = 42 → u = MLU* = 42/60 = 0.7. Allocations 0.7·(10, 20, 30) = (7, 14, 21) (check: 7 + 14 + 21 = 42). Rule: on parallel disjoint paths, split proportional to capacity, and MLU* = D/Σc.
✍ iPadProblem 3.3 — Measurement: can link counters reveal demand? short
A and B both reach T through router R over a 10 Gb/s link whose counter reads 9 Gb/s. B also has an idle 5 Gb/s alternative via U.
10 Gb/s linkcounter reads 9 Gb/s5 Gb/s · idleABRUT
  1. What are the possible (A, B) demand pairs?
  2. Why does this matter for TE?
  3. Why is “link load” also not the same as “delivered rate”?
Show solution
  1. Any a + b = 9 (e.g., 4.5/4.5, 8/1, 2/7). The counter can't separate them.
  2. TE needs the traffic matrix to know how much is movable: only B's traffic could use the path via U. Hence per-source measurement (sFlow, host reports) and rules or contracts at ingress.
  3. Load on one link may later be lost on a congested downstream link, so load ≠ delivery. And demand may exceed load if CC already throttled the senders.
✍ iPadProblem 3.4 — Staged swap with headroom calc
Two 10 Gb/s paths. A = 7 Gb/s on P1, B = 7 Gb/s on P2. Goal: swap them. Each move shifts part of one aggregate and must keep every path ≤ 10 Gb/s, even after only that move completes.
  1. What happens if A moves entirely first?
  2. Give a safe sequence of moves. What is the minimum number of moves?
  3. What does the plan require from the network and the controller?
Show solution
  1. P2 = 7 + 7 = 14 Gb/s > 10 (transient overload; same if B moves first).
  2. Headroom = 3 per path, so move ≤ 3 at a time and alternate:
    moveP1P2
    startA7 = 7B7 = 7
    1. A −3 → P2A4 = 4A3+B7 = 10
    2. B −3 → P1A4+B3 = 7A3+B4 = 7
    3. A −3 → P2A1+B3 = 4A6+B4 = 10
    4. B −3 → P1A1+B6 = 7A6+B1 = 7
    5. A −1 → P2B6 = 6A7+B1 = 8
    6. B −1 → P1B7 = 7A7 = 7
    6 moves. That is the minimum, since each aggregate needs ⌈7/3⌉ = 3 moves.
  3. Traffic must be divisible into smaller units (split aggregates), there must be spare headroom, and the controller must confirm each move before the next (switches update asynchronously).
✍ iPadProblem 3.5 — Deferring batch traffic calc
Path capacity 20 Gb/s. Urgent traffic: 16 Gb/s in hour 1, 12 Gb/s in hour 2. A batch transfer needs 6 Gb/s for one hour (6 Gb/s·h of volume) and must finish by the end of hour 2.
  1. Run the batch in hour 1: utilization? Defer it to hour 2?
  2. If the batch may be spread over both hours at any rates, what schedule minimizes the peak utilization?
Show solution
  1. Hour 1: 22/20 = 110% ✗. Deferred: hour 1 16/20 = 80%, hour 2 18/20 = 90% ✓.
  2. Equalize: 16 + b₁ = 12 + b₂ with b₁ + b₂ = 6 → b₁ = 1, b₂ = 5; both hours 17/20 = 85%. TE becomes a scheduling problem (when, not just where).
✍ iPadProblem 3.6 — RPC vs replication (HW2 Q3 twin) calcHW-style
Two paths between DCs: fast (10 Gb/s, RTT 4 ms) and slow (10 Gb/s, RTT 30 ms). Policy: RPC traffic needs RTT < 10 ms; replication is latency-tolerant. Demands: RPC 5 Gb/s, replication 9 Gb/s.
fast path: 10 Gb/s, RTT 4 msslow path: 10 Gb/s, RTT 30 msDC1DC2demands DC1 → DC2: RPC 5 Gb/s (needs RTT < 10 ms) · replication 9 Gb/s
  1. The controller aggregates both classes into one demand and routers use ECMP. Link loads, MLU, and RPC on the slow path?
  2. Find a configuration that meets the policy. What is the best MLU it can reach? Can you get it by just changing how the aggregate is split? What information and forwarding state does it need?
  3. RPC grows to 12 Gb/s. Redo (a) and (b).
Show solution
  1. Total 14 → 7/7, MLU = 0.7. ECMP splits each class in half, so 2.5 Gb/s of RPC rides the slow path (violates policy).
  2. RPC 5 on fast. Replication x on fast, 9 − x on slow. min max((5+x)/10, (9−x)/10) → x = 2: fast 7, slow 7, MLU = 0.7 with the policy met. No, re-splitting the aggregate can't do it: routers must classify traffic (e.g., DSCP or class labels), the controller needs per-class demand, and routers need per-class forwarding rules / split weights (more state).
  3. Total 21 > 20 = cut: infeasible for any routing. Aggregate ECMP: 10.5/10.5 → MLU 1.05 (overload), with 6 RPC on slow. Policy-respecting: RPC can only use fast (10 < 12), so admit/rate-limit RPC to 10 (or send 2 on slow and violate the policy). Replication 9 on slow → MLU 1.0 / 0.9. TE can't create capacity; admission or CC handles the excess.
✍ iPadProblem 3.7 — TE vs congestion control MCQ
Which statements are correct?
☐ A. TE typically acts on aggregates every few seconds to minutes; congestion control acts per flow every RTT.
☐ B. Minimizing MLU is attractive mainly because it minimizes the average path latency.
☐ C. If total demand exceeds the capacity of the minimum cut, a better TE split can still carry all of it.
☐ D. ECMP balances flows, which isn't the same as balancing bytes.
☐ E. If both the current and the target configurations are feasible, any order of router updates is safe.
☐ F. Besides routing, TE's control surfaces include traffic management such as rate limiting or admission.
Show solution

Correct: A, D, F

  • A ✔ — This timescale separation is what breaks the NUM↔TE feedback loop.
  • B ✘ — It's about headroom. Min-MLU often raises mean latency (Meta example: 10 ms vs 7.5 ms).
  • C ✘ — TE fixes inefficient mapping, not insufficient resources.
  • D ✔ — Hash-based per-flow splitting ignores flow sizes and path capacities.
  • E ✘ — Transient states can overload (swap example) or black-hole and loop.
  • F ✔ — Traffic management, routing, and resource constraints.

4 · Mechanisms that make TE possible: MPLS and SDN

Lecture 12. The professor's warning: MPLS and SDN are not separate worlds. Real networks are hybrids: a centralized controller programs an MPLS data plane.

4.1 MPLS: forward on a label, not on the IP prefix

Ethernet header MPLS shim (32 bits) IP header payload label · 20 Exp 3 S TTL 8 Exp/TC = QoS classS = 1 on bottom label · TTL = hop limit
The slide prints “5” under TTL. The professor said “if Wikipedia says 8 then it's 8”. It is 8 (20+3+1+8 = 32).
A B D F [17][42][IP] ingress: classify+pushswap 17→42 pop (penultimate)egress: leave LSP
📈 How to read this figure (one packet's trip)① A (ingress) looks at the IP packet once, decides which class it belongs to (its FEC, e.g. “to F, gold class”), and pushes label 17 in front of the IP header. ② B never reads the IP header: it looks up 17 in its MPLS table (“17 → swap to 42, send out port 1”) and forwards. Labels only mean something to the next router, which is why they change at every hop. ③ D, the router just before the exit, pops the label (“penultimate-hop pop”) so that ④ F receives a plain IP packet and does a single normal IP lookup. The numbers in brackets are what the packet carries on each link.

Units of traffic: packets/flows → forwarding equivalence class (FEC, forwarded the same way) → traffic trunk (FEC + TE attributes: bandwidth, burst, priority, preemption, resilience, path preference, policing) → LSP over the physical links.

Constraint-based route selection (CSPF): ① trunk request (e.g., A→F, 6 Gb/s, exclude RED) → ② prune links with insufficient allocatable bandwidth or excluded colors → ③ run shortest path on what remains and instantiate the LSP. Trunks placed one at a time are order-dependent: e.g. two 6 Gb/s trunks and two 10 Gb/s paths, where trunk X can use either path but trunk Y can only use path 1. Place X first on its shortest path, path 1, and Y no longer fits; place Y first and both fit. So several trunks may need joint optimization. Resilience: a 100 Gb/s trunk over three 400 Gb/s links that must survive one link failure → reserve 50 on each (any two survivors carry 100). General rule: with k equal links and up to f failures, the worst case leaves k − f links, so each must hold D/(k − f); here 100/(3 − 1) = 50, i.e. 150 reserved in total for a 100 Gb/s trunk. That is wasteful, so operators oversubscribe (committed sum > capacity, e.g., 450 on 400) because a worst case on every trunk at once is unlikely. Another way to avoid waste (Q&A): program the backups into the TE solution as an ordered preference, e.g., “S→D traffic uses link 1 first; above 50 Gb/s spill to link 2; beyond that to link 3”, so the last link is rarely used. If backups aren't part of the TE solution, a failure has to wait for the next TE computation. TE is a feedback process: observe → decide → act → check. Reroute only when the expected benefit justifies the path change.

4.2 SDN refresher (the parts the case studies build on)

Traditional per-router control plane: every router runs OSPF/IS-IS/BGP and computes its own FIB. For TE that leaves only link weights as a knob: you can't steer u→z onto a non-shortest path without changing weights (which moves everyone else's traffic too), you can't split one destination's traffic across two paths, and you can't route two classes to the same destination differently.

network apps: routing · TE · access control · load balancing northbound API SDN controller = “network OS” interface/abstractions · network-wide state (distributed DB)communication (OpenFlow, SNMP…) southbound API (OpenFlow) switchswitchLSR (MPLS)switch
Data-plane switches can be cheap and simple. Logically centralized ≠ physically one machine: controllers are replicated and run leader election.
✍ iPadProblem 4.1 — The MPLS shim header calc
  1. List the MPLS header fields with sizes. What's the total?
  2. How many label values can one router distinguish?
  3. A packet carries a 3-label stack. Overhead in bytes, and as a % of a 1500-byte packet? How does a router know which label is the last?
  4. Give two reasons label switching helps TE beyond raw lookup speed.
Show solution
  1. Label 20 · Exp/TC 3 · S (bottom of stack) 1 · TTL 8 = 32 bits (4 bytes).
  2. 220 = 1,048,576 (a few low values are reserved). Labels are local to each router.
  3. 3 × 4 = 12 B → 12/1500 = 0.8%. The bottom label has S = 1.
  4. ① Traffic to the same destination can take different paths (by source, class, port, or ingress), which is impossible with destination-based IP. ② Precomputed backup LSPs give fast reroute. Also: separate tables let MPLS decisions differ from IP's.
✍ iPadProblem 4.2 — Walking MPLS forwarding tables calc
Ingress R1 classifies two FECs to destination network D:
R1: video→D: push 17, out to R2 · backup→D: push 23, out to R3
R2: in 17 → swap 31, out to R4 · R3: in 23 → swap 44, out to R4
R4: in 31 → pop, out to D · in 44 → pop, out to D
R2–R3 (backup)R1R2R3R4Dvideo FEC: R1→R2→R4→D · backup FEC: R1→R3→R4→D
  1. List the label each FEC carries on every link.
  2. Both FECs reach R4 and leave to D. Why do they carry different labels at R4, and is it a problem that R3 could also have used label 31 internally?
  3. The R2–R4 link fails. R2 has a precomputed backup “in 17 → swap 23, out to R3” (R2–R3 link exists). Trace a video packet.
Show solution
  1. Video: R1→R2 17, R2→R4 31, R4→D unlabeled (IP). Backup: R1→R3 23, R3→R4 44, R4→D IP.
  2. R4's incoming labels identify the LSP (and could carry different treatment). Each router owns its label space, so values are local: R3 using 31 for something on its own table is irrelevant to R4's 31.
  3. R1 pushes 17 → R2 swaps to 23 → R3 (which treats it like backup traffic) swaps to 44 → R4 pops → D. Fast reroute without waiting for a controller.
✍ iPadProblem 4.3 — Constraint-based path selection (CSPF) calc
Undirected links (cost, available Gb/s, color): A–B (1, 10), B–F (1, 4), A–C (1, 8, RED), C–F (1, 8), A–D (3, 9), D–F (2, 9), B–D (1, 9).
(1, 10)(1, 4)(3, 9)(2, 9)(1, 8) RED(1, 8)(1, 9)ABDCFlabels: (cost, available Gb/s); red link has color RED
top: cost 2, 10 Gb/sbottom: cost 3, 6 Gb/sAFtrunks X = 6 Gb/s and Y = 8 Gb/s, single LSPs
  1. Trunk T1: A→F, 6 Gb/s, exclude RED. Prune, then find the path. What would plain shortest path have picked?
  2. Then trunk T2: A→F, 5 Gb/s, no color constraint, placed after T1 is reserved. Path?
  3. Separate network: A→F via top path (cost 2, 10 Gb/s) or bottom path (cost 3, 6 Gb/s). Trunks X = 6 and Y = 8 Gb/s, each a single LSP. Place them X then Y, then Y then X. Lesson?
Show solution
  1. Prune B–F (4 < 6) and A–C (RED). Remaining A→F routes: A–B–D–F cost 1+1+2 = 4, A–D–F cost 3+2 = 5. Choose A–B–D–F and reserve 6 on each link (A–B 4 left, B–D 3, D–F 3). Plain shortest path: A–B–F or A–C–F (cost 2), which violate bandwidth or color.
  2. Prune links with < 5 left: B–F (4), A–B (4), B–D (3), D–F (3). Remaining: A–C (8), C–F (8), A–D (9). Path A–C–F (cost 2).
  3. X then Y: X takes top (10 → 4 left). Y = 8 fits neither top (4) nor bottom (6), so it fails. Y then X: Y top (→ 2 left), X bottom (6) ✓. Greedy per-trunk CSPF is order-dependent; several trunks need joint optimization.
✍ iPadProblem 4.4 — Resilient trunk reservations calc
A 120 Gb/s trunk can use four parallel 400 Gb/s links.
  1. Reserve on one link only: what happens on a failure?
  2. Must survive any single link failure without recomputation: per-link reservation and total reserved?
  3. Any two failures?
  4. How do operators keep this from wasting capacity?
Show solution
  1. If that link fails, the trunk has no path until the controller recomputes.
  2. Survivors (3) must carry 120 → 40 per link, total 160 (+33%). In general D/(k−f) per link.
  3. 120/2 = 60 per link, total 240 (2×).
  4. Oversubscription: the sum of commitments exceeds capacity (e.g., 450 committed on 400), betting that not every trunk's worst case happens at once. Or prioritized/weighted backup groups (use link 2 only when link 1 is full).
✍ iPadProblem 4.5 — TE with only link weights calc
Undirected weights: u–v 2, u–x 1, u–w 5, v–x 2, v–w 3, x–w 3, x–y 1, w–y 1, w–z 5, y–z 2.
2152331152uvwxyz
  1. Least-cost u→z path and cost?
  2. The operator wants u→z on u–v–w–z. Propose weight changes that make it the unique least-cost path; check the closest competitors.
  3. What are the side effects, and what two TE wishes can't destination-based link-state routing express at all?
Show solution
  1. u–x–y–z = 1+1+2 = 4.
  2. u–v–w–z costs 10. One choice: u–x = 20, y–z = 20, u–w = 20. Competitors: u–v–x–y–w–z = 2+2+1+1+5 = 11, u–v–x–w–z = 12, u–v–w–y–z = 26 → u–v–w–z = 10 unique ✓ (any change of this kind works if you check all paths).
  3. Weights are global: they move all traffic using those links (e.g., x→z now changes too). With destination-based routing you can't split u→z over two paths (unless costs tie exactly, for ECMP's equal split), and you can't route two classes to the same destination differently at w. MPLS or SDN fixes this.
✍ iPadProblem 4.6 — SDN flow table with priorities calc
priomatchaction
30src = 10.1.2.3send to controller
20src = 1.2.*.*drop
10dst = 3.4.*.*forward(2)
0*forward(1)
What happens to: (a) 1.2.9.9 → 3.4.5.6 (b) 10.1.2.3 → 3.4.0.1 (c) 7.7.7.7 → 3.4.1.1 (d) 7.7.7.7 → 8.8.8.8? (e) What changes for (a) if the priorities of the drop and forward(2) rules are swapped? (f) Which table feature supports TE measurement?
Show solution
(a) matches prio 20 and 10, highest wins → drop. (b) prio 30 → controller. (c) prio 10 → port 2. (d) default → port 1. (e) It's forwarded on port 2: priority disambiguates overlapping matches, so an ordering bug changes behavior (the verification lecture's point). (f) Per-rule counters (bytes, packets).
✍ iPadProblem 4.7 — MPLS and SDN in practice MCQ
Which statements are correct?
☐ A. MPLS and SDN are alternatives: a network uses one or the other.
☐ B. A centralized controller (PCE) can compute paths and program an MPLS data plane.
☐ C. Under purely centralized control, link-failure recovery takes at least a report to the controller, recomputation, and reprogramming, often hundreds of ms or more.
☐ D. The southbound API (e.g., OpenFlow) defines what in a switch is controllable.
☐ E. A logically centralized SDN controller must physically run on a single machine.
☐ F. MPLS labels have network-wide meaning, so every router must use the same label for an LSP.
☐ G. In distributed MPLS TE, the ingress router uses RSVP-TE to set up and reserve the LSP at downstream routers, using bandwidth information flooded by modified OSPF/IS-IS.
☐ H. When an SDN switch sees a link fail, it recomputes its own routes locally and then informs the controller.
Show solution

Correct: B, C, D, G

  • A ✘ — The professor stressed they are not separate. Hybrids are the norm.
  • B ✔ — The SDN + MPLS TE architecture slide.
  • C ✔ — Hence hybrid designs with local fast reaction.
  • D ✔ — Slide: “defines what is controllable, what is not.”
  • E ✘ — It is replicated, with leader election. The single point of failure is logical (bugs, bad config).
  • F ✘ — Labels are local; LSRs swap them hop by hop.
  • G ✔ — The MPLS signaling slide: OSPF-TE/IS-IS-TE flood link and reserved bandwidth, and RSVP-TE installs the LSP.
  • H ✘ — Reversed. The switch sends an OpenFlow port-status message; the controller updates link state, calls the routing app, recomputes, and installs new flow tables via OpenFlow.

5 · Meta's Express Backbone (EBB)

Lectures 12–14 · HW2 Q5. The professor's framing: Meta = the nitty-gritty details of a hybrid design (Google = nuanced allocation/fairness, Microsoft = failure handling).

5.1 Two networks, four planes

JourneyNetworkWhat matters
DC → Internet user (via PoP / ISP)Classic Backbone (CBB)global reach, user experience, externally compatible, so costly ISP-grade gear
DC → DC (replication, internal transfers)Express Backbone (EBB)huge, fast-growing internal traffic; Meta controls both ends, so it can customize and cut cost

Separating them keeps large internal bursts from hurting user traffic and allows different routing and ops choices. (Google: B2/B4. Microsoft: CORE/SWAN.) All three started with cheap, less reliable internal networks that became critical, then reliable, and are now being merged. Meta was IPv6-native from day one (Google's later v4→v6 migration was a multi-year effort).

Four parallel physical planes (eight in newer papers). Each is a separate topology with its own routers and its own controller. Why: roll a new controller release out to ¼ of capacity, run A/B tests, and keep failure domains separate. Don't confuse physical plane ≠ control plane ≠ data plane ≠ traffic class. Each plane is its own routing domain and exchanges routes with the data-center networks using BGP (the inter-domain routing protocol); Meta in turn exchanges routes with the rest of the Internet using BGP. So BGP runs at two levels. A recent paper argues the planes should share more when solving TE.
EBB: four parallel physical planes, each with its own controller (L12–13) DC Afabric DC Bfabric controller 1 controller 2 controller 3 controller 4 plane 1traffic spread over all 4
Each colored lane is a separate physical network (own routers) with its own controller. A new controller release can go to one plane (¼ of capacity) first, and failures stay inside one plane. Physical plane ≠ control plane ≠ data plane ≠ traffic class.

5.2 Architecture: who does what

Central TE controller snapshot → path allocation → driver(every ~1–3 min) sFlow collector→ traffic matrix (DC×DC×class) BGP route injectorsreachability into/out of EBB Routers (each runs Open/R + LSP agent) Spark: neighbors · LinkMonitor: RTT/health · KvStore: link state (eventual) Decision: routes · FIB: programs ASIC · LSP agent: MPLS segment routes failure: local backup in ~100s of ms; controller re-optimizes later MPLS segment routes live topology (Open/R)
📈 How to read this figure (one control cycle)Follow the information. ① Inputs: the sFlow collector turns sampled packets into a traffic matrix (how much each DC sends to each other DC, per class); Open/R on every router reports the live topology (which links are up, their RTT); BGP route injectors say which destination prefixes can be reached through EBB. ② Decision: every 1–3 minutes the central controller takes a snapshot of these, solves the TE problem (which paths, how much on each), and a driver turns the result into MPLS label stacks. ③ Action: the LSP agent on each router installs them. ④ Between cycles: if a link fails, routers switch to pre-installed backups on their own (fast), and the next controller cycle re-optimizes (slow but global). That split of fast-local and slow-global is the hybrid design.

5.3 TE policy: multicommodity flow and service classes

commodity k = (source DC, destination DC, class), demand d_k, candidate paths P_k
decision    x_kp = Gb/s of k on path p
carry       Σ_p x_kp = d_k
share links Σ_{k,p∋e} x_kp (+ burst margins) ≤ U · c_e      ← couples the demands
objective   min U  (MLU)   — or min Σ cost·x (latency) for gold

In words: a commodity is one “kind” of traffic that must get from A to B (here: one DC pair in one service class). “Multicommodity flow” means many such demands share the same links. The decision is how many Gb/s of each commodity go on each of its allowed paths. The “carry” line says each demand is fully routed; the “share links” line adds up every commodity on each link and keeps it under the target, which is what makes the demands compete. A burst margin is extra capacity set aside on top of the average rate so short bursts of high-priority traffic don't overflow the link.

Short/long split of 12 Gb/s (short 10 Gb/s, 5 ms; long 5 Gb/s, 20 ms)short utillong utilfeasible?
12 / 0120%0%no
6 / 660%120%no
10 / 2 (min latency)100%40%yes: MLU 100%, mean latency (10·5+2·20)/12 = 7.5 ms
8 / 4 (min MLU)80%80%yes: MLU 80%, mean latency (8·5+4·20)/12 = 10 ms

Constraints say what is possible; the objective chooses what is preferred.

Meta's classes: ICP (network control) → Gold → Silver → Bronze, allocated in priority order. Keep the number of classes small (about 4–8), because with many levels the distinctions stop meaning anything. Gold: shortest path (cost = measured RTT from LinkMonitor) plus a protected burst margin. Capacity limits may push some gold to longer paths. Silver/Bronze: restrict to the K-shortest paths (the K lowest-cost paths for that DC pair, e.g. K = 4, so a 100-hop path is never used just to balance load), then choose rates on them to minimize utilization. K-shortest restricts the choices; it doesn't set the split.
Allocations aren't enforcement. Whiteboard example on a 100 Gb/s A→B link: gold 20 + 20 burst margin = 40, silver 10 + 5 = 15, bronze 5. Planned total 60, fine. If bronze then bursts from 5 to 90, it overwhelms the shared buffer, and gold and silver see delay and loss. Router fix: strict-priority queues (gold dequeued first) plus buffer carving (reserve buffer per class, e.g., gold 2 MB, silver 1 MB, bronze 0.5 MB, rest shared), because priority alone doesn't stop bronze from filling the memory. Then bronze users complain about loss. Meta's answer is entitlements: guaranteed bandwidth per service, with rate limiting at hosts when the network has no spare capacity. Google instead builds bandwidth allocation into TE (§6).

HPRR: Meta's heuristic (HW2 Q5, explicitly examinable)

Solving the exact LP with millions of variables every minute is too slow. Heuristic Path ReRouting reroutes one LSP at a time. It accepts a reroute only if the max utilization along the new route (after the move) is lower than the max along the current route (before). Candidate routes come from Dijkstra with exponential link cost w_e = exp[α(u′_e/u* − 1)] (u′ = the link's utilization if the LSP uses it). The current route is also a candidate.

SymbolMeaning
LSPa fixed-size chunk of one demand, pinned to one path (e.g. an 8 Gb/s demand carried as four 2 Gb/s LSPs)
u′eutilization link e would have if this LSP were moved onto it: (current load of e without this LSP + LSP rate) / capacity
u*target utilization, a threshold the operator picks (HW: 0.855)
αhow sharply cost rises past u* (HW: 66.4)
wethe link's cost for Dijkstra; route cost = sum of its links' w
0.60.70.80.90.9501020304050link utilization u′ if the LSP is placed on itlink cost wu* = 0.855w = 122.332.9cheap below u*: route freelyexplodes above u*: avoid
📈 How to read this chartx = the utilization a link would reach with this LSP on it; y = its cost. Below u* (0.855) the cost is about 0, so Dijkstra treats lightly loaded links as free. Right at u* the cost is 1. Past it, the cost explodes (22.3 at 0.895, 32.9 at 0.9), so Dijkstra steers away from links that would get hot. Why exponential: it behaves like “use any path, but stay off nearly full links”, which is what minimizing utilization wants, without solving a full LP.
One HPRR pass, step by stepFor each LSP in turn: ① temporarily take it off its current route; ② for every link compute u′ (utilization if the LSP were added there) and w = exp[α(u′/u* − 1)]; ③ run Dijkstra on w to find the cheapest route (the current route competes too); ④ accept the move only if the highest u′ on the new route is strictly lower than the highest utilization on the current route. Otherwise leave it where it is. Repeat for the next LSP, and do more passes until nothing moves.
HW Q5.3 in these terms: one unsplittable 6 Gb/s LSP from S to D; background traffic is 3 Gb/s on the direct link and 2.95 on each of the two links via M (all 10 Gb/s). Direct: u′ = (3 + 6)/10 = 0.9 → w = 32.9. Via M: each link u′ = (2.95 + 6)/10 = 0.895 → w = 22.3, two links → route cost 44.7. Dijkstra picks direct (32.9 < 44.7) even though via M has the lower MLU (0.895 < 0.9). The sum over links charges the 2-hop route twice: the hop bias below.

5.4 Route programming: segment routing, Binding SIDs, versioned updates

Static labels + source stack, limited to depth 3 → Binding SID at an intermediate node SRC A B C D DST stack at SRC: [→A, →B→C, 19999] C sees Binding SID 19999 → pushes [→D, →DST] Only SRC and C hold path-specific state; A, B, D keep fixed label→interface rules installed at startup.
📈 How to read this figureThe packet travels left to right. SRC can only push 3 labels, but the path has 5 hops. So SRC pushes “→A”, “→B→C”, and a special label 19999 (the Binding SID). A and B just follow their fixed rules and pop their labels. When the packet reaches C, the top label is 19999, which C was programmed to replace with a fresh stack “→D, →DST”. Only SRC and C needed per-path programming; every other router kept its startup rules.
Consistent update with a version bit: prepare v1 everywhere, THEN flip the source A M N I J Z v0 (old)v1 (new) 1. install v1 at I, J2. wait for ALL acks 3. A tags new pkts v14. in-flight v0 pkts finish on v0 rules flip before J ready→ black hole at J
📈 How to read this figureTraffic from A to Z is moving from the old path A–M–N–Z (v0, top) to the new path A–I–J–Z (v1, bottom). Packets carry a version bit. ① The controller installs the v1 rules at I and J while A keeps tagging packets v0, so nothing changes yet. ② It waits until every router has acknowledged. ③ Only then does A start tagging new packets v1, which follow the v1 rules. ④ v0 packets already in flight finish on the old path, whose rules are still there. The note at the right is the failure this prevents: if A flipped before J had its rule, v1 packets would reach J and be dropped (a black hole).

Without this, “eventual consistency” updates (send all messages, let them land whenever) create transient black holes (A switches before J has its rule) or loops (an old J→A rule). Meta: one version bit in the packet (it alternates 0/1, since only two versions coexist), and the source flips only after the transaction is acknowledged by all routers. This is cheap, though not the most efficient option. Google instead stages updates (e.g., downstream first) so every intermediate state is safe. Side effect: mid-update, packets of one flow may take different paths, so the sender sees an RTT change that isn't congestion.

5.5 Capacity planning uses the same TE model

Basic TE: given capacities, choose rates. Planning: choose capacities so that TE stays feasible for every demand matrix in a set H and every failure in a set S (cˢ = surviving capacity). Building fiber takes months or years, so the forecast comes from compute commitments (GPUs, CPUs, storage being bought per site), not from product teams' guesses.

Pipe model: forecast every pair A B C D D_ij per ordered pair: n(n−1) = 12 numbers Hose model: budget per site backbone A B C D E_A out, I_A in 2n = 8 numbers; any matrix within them
Capacity takes months to years to build, and which DC pairs will grow is uncertain. A hose keeps each site's totals (Σ_j D_ij ≤ E_i, Σ_i D_ij ≤ I_j) and lets the pairwise traffic move: A may send 10 Gb/s to B today and to C tomorrow.
Pipe model One forecast per DC pair, Dij: n(n−1) numbers, and brittle if traffic shifts between pairs (does B's growth go to A? to E?).
Hose model Per site: total it may send, Ei, and total it may receive, Ij (2n numbers). Any matrix with ΣjDij ≤ Ei and ΣiDij ≤ Ij is allowed (like a cloud VM's NIC limit). Meta uses a segmented hose (a few large allocations per DC for heavy pairs).

Traffic between groups must cross the cut links. It is enough to check simple cuts (single or few links) rather than all exponentially many. Scale: several thousand machines; 1 M routing scenarios in < 3 min; full plan for 300+ nodes and 1000+ links in < 6 h (via decomposition and parallelism).

Left open at the end of the Meta case (answered by Google): enforcing tenant shares under unpredictability, sharing capacity across planes, solving huge LPs efficiently.

✍ iPadProblem 5.1 — Min latency vs min MLU calc
DC A sends 15 Gb/s to DC B over two disjoint paths: short (10 Gb/s, 4 ms) and long (10 Gb/s, 16 ms).
short path: 10 Gb/s, 4 mslong path: 10 Gb/s, 16 msABDC A → DC B: 15 Gb/s
  1. The minimum-latency allocation: split, MLU, mean fixed latency.
  2. The min-MLU allocation: split, MLU, mean latency.
  3. Which objective does Meta use for gold, and which for silver/bronze? Why restrict silver/bronze to K-shortest paths?
Show solution
  1. Fill the short path first: 10 / 5. Utilizations 100% / 50% → MLU 1.0. Mean latency (10·4 + 5·16)/15 = 120/15 = 8 ms.
  2. Equalize: 7.5 / 7.5 → MLU 0.75. Mean latency (7.5·4 + 7.5·16)/15 = 10 ms. Same topology, demand, and constraints; a different “best”.
  3. Gold: shortest path (cost = measured RTT), with a protected burst margin. Silver/bronze: min utilization, restricted to K-shortest paths so load balancing never picks absurdly long paths. K-shortest limits the choices; the objective sets the split.
✍ iPadProblem 5.2 — Gold first, then silver, then bronze calc
Paths: short (10 Gb/s, 5 ms) and long (10 Gb/s, 20 ms). Gold demand 6 Gb/s with a 2 Gb/s burst margin; silver 8 Gb/s; bronze 2 Gb/s. Allocate in priority order. Gold uses shortest path. Silver and bronze minimize the maximum link utilization given what is already placed (count gold's margin as used).
  1. Gold placement and what's left.
  2. Silver placement and MLU.
  3. Bronze placement and the final MLU.
  4. Later, bronze actually sends 9 Gb/s on its configured paths. What happens, and what mechanisms protect gold and silver? What does Meta add so bronze owners don't just see mysterious loss?
Show solution
  1. Gold 6 + margin 2 = 8 reserved on short; short has 2 left, long 10.
  2. Silver s on short, 8 − s on long: max((8+s)/10, (8−s)/10) is minimized at s = 0 → silver 8 on long; both links at 80% → MLU 0.8.
  3. Bronze b on short: max((8+b)/10, (8+2−b)/10) → 8 + b = 10 − b → b = 1: 1 short, 1 long, both 90%.
  4. Bronze far exceeds its budget and shares queues with gold and silver. Routers use strict-priority queues (gold dequeued first) plus buffer carving (reserved buffer per class) so bronze can't fill the memory. Bronze sees the loss. Meta adds entitlements (guaranteed bandwidth per service) with host-side rate limiting when the network has no spare capacity, so a bronze service knows exactly what it was promised.
✍ iPadProblem 5.3 — HPRR: granularity and getting stuck (HW2 Q5.1–Q5.2 twin) calcHW-style
HPRR reroutes one LSP at a time and accepts a move only if the max utilization along the new route after the move is lower than the max utilization along the LSP's current route before the move. Links are directed and parallel S→D.
L: 10 Gb/sR: 5 Gb/sSD(a) demand S → D: 9 Gb/s, no background
L: 10 Gb/s · background 1 · LSP B = 5R: 10 Gb/s · background 3 · LSP A = 7SD(b) unsplittable LSPs; initial placement shown
  1. 9 Gb/s S→D over links L (10 Gb/s) and R (5 Gb/s), no background. Best MLU with arbitrary splitting? With the demand carried by 2, 3, or 4 equal LSPs?
  2. Links L and R, both 10 Gb/s, with fixed background L = 1, R = 3. Unsplittable LSPs A = 7 (currently on R) and B = 5 (currently on L). Evaluate every single-LSP move. Where does HPRR end? Is it optimal?
  3. Propose a fix for (b) and its cost.
Show solution
  1. Arbitrary: x/10 = (9−x)/5 → x = 6 → MLU 0.6. 2 LSPs of 4.5: x ∈ {0, 4.5, 9} → best max(0.45, 0.9) = 0.9. 3 LSPs of 3: x = 6 → max(0.6, 0.6) = 0.6 (optimal). 4 LSPs of 2.25: x = 6.75 → max(0.675, 0.45) = 0.675. Finer granularity approaches the optimum but isn't monotone; what matters is whether the LSP grid hits the optimal split. More LSPs = more forwarding state and computation.
  2. Start: L = 1 + 5 = 6 (0.6), R = 3 + 7 = 10 (1.0). MLU 1.0.
    Move A → L: after, L = 1 + 5 + 7 = 13 → 1.3, not < 1.0 (A's current max) → reject.
    Move B → R: after, R = 3 + 7 + 5 = 15 → 1.5, not < 0.6 → reject.
    HPRR is stuck at 1.0. Optimal: swap, A on L (1 + 7 = 8) and B on R (3 + 5 = 8) → MLU 0.8.
  3. Consider moving two LSPs at a time (swaps). That reaches 0.8 here, but evaluation cost grows combinatorially and it still doesn't guarantee a global optimum. (The joint LP would be optimal but slow.)
✍ iPadProblem 5.4 — HPRR's exponential link cost (HW2 Q5.3 twin) calcHW-style
One unsplittable LSP of 5 Gb/s S→D, currently on the direct link. All links are 10 Gb/s. Fixed background: direct link 4 Gb/s; each of the two links via M (S→M, M→D) 3.9 Gb/s. HPRR runs Dijkstra with link cost we = exp[α(u′e/u* − 1)], where u′e is the link's utilization if the LSP uses it; route cost = sum of link costs; α = 50, u* = 0.8. The current route is a candidate.
direct: 10 Gb/s · background 4 · LSP (5 Gb/s) now here10 Gb/s · bg 3.910 Gb/s · bg 3.9SMD
  1. Cost of the direct route and of the route via M. Which does HPRR pick?
  2. MLU of each choice. Which is better?
  3. Explain the discrepancy and propose a fix. Does your fix solve the problem in 5.3(b)?
Show solution
  1. Direct: u′ = (5+4)/10 = 0.9 → w = exp[50(0.9/0.8 − 1)] = exp(6.25) ≈ 518. Via M: u′ = (5+3.9)/10 = 0.89 per link → w = exp[50(0.89/0.8 − 1)] = exp(5.625) ≈ 277.3 each → route cost ≈ 554.5. HPRR keeps the direct route.
  2. Direct: MLU = 0.9. Via M: max(0.89, 0.89, 4/10) = 0.89, slightly better.
  3. Summing link costs penalizes the 2-hop route (two exponentials), even though its bottleneck is lower. That is deliberate in Meta's setting (a longer route with slightly lower MLU isn't always better), but suboptimal for pure MLU. Fix: use the route's bottleneck (max post-move utilization) as the path metric (a minimax/widest-path Dijkstra). This does not fix 5.3(b): that one comes from moving one LSP at a time, not from the per-LSP route search.
✍ iPadProblem 5.5 — Versioned path updates MCQ
Traffic A→Z moves from v0 (A–M–N–Z) to v1 (A–I–J–Z) using Meta's version bit. Steps: (1) install v1 rules at I; (2) install v1 rules at J; (3) A starts tagging packets v1; (4) remove v0 rules at M and N. Which statements are correct?
v0 (old path)v1 (new path)AMNIJZ
☐ A. Order 1, 3, 2, 4 can black-hole packets at J.
☐ B. Order 2, 1, 3, 4 is safe, provided step 3 waits for acknowledgments from I and J.
☐ C. Step 4 may run immediately after step 3 is issued, because new packets are tagged v1.
☐ D. A single bit suffices because only the old and the new version ever coexist; the bit alternates 0/1 across updates.
☐ E. With this scheme, packets of the same flow can briefly take two different paths, which the sender may see as an RTT change unrelated to congestion.
Show solution

Correct: A, B, D, E

  • A ✔ — v1 packets reach J before J has a v1 rule, so they are dropped.
  • B ✔ — All v1 rules are ready before any v1 packet exists. The order among the preparation steps doesn't matter.
  • C ✘ — v0 packets already in flight still need M and N's v0 rules. Remove them only after the old packets drain.
  • D ✔ — Version alternation.
  • E ✔ — The lecture made this connection to congestion control.
✍ iPadProblem 5.6 — Building the traffic matrix with sFlow calc
An EBB edge router samples 1 in 1000 packets. In one second the collector receives 5,000 samples whose headers map to (DC1 → DC2, silver), with an average packet size of 1,500 bytes.
  1. Estimate that cell of the traffic matrix in Gb/s.
  2. Why doesn't sampling lose the information TE needs?
  3. Why not keep a per-flow byte counter in the switch ASIC? Where must sampling happen to build the full DC×DC matrix?
Show solution
  1. 5,000 × 1,000 = 5×10⁶ packets/s × 1,500 B × 8 = 60 Gb/s.
  2. Traffic is heavy-tailed (Pareto): a few heavy hitters carry most bytes, and TE decisions are about those big aggregates. At billions of packets/s, 1-in-N still yields many samples.
  3. Switches keep no per-flow state at Tb/s (sub-ns per packet); per-packet counters plus reporting are too expensive. Sampling at the ingress edge routers is enough, since every DC-pair flow enters through one.
✍ iPadProblem 5.7 — Pipe vs hose calc
Three sites. Hose limits: egress EA = 10, EB = 6, EC = 4; ingress IA = IB = IC = 8 (Gb/s).
ABCWANA: egress E = 10, ingress I = 8B: E = 6, I = 8C: E = 4, I = 8
  1. How many numbers does a pipe model need for n = 3 sites? For n = 50? A hose model?
  2. Largest possible A→B demand allowed by the hose?
  3. For the cut separating {A} from {B, C}: the most traffic that can leave A across it, and the most that can enter A.
  4. Why is the hose model better for capacity planning months ahead? What does Meta's “segmented hose” add?
Show solution
  1. Pipe: n(n−1) = 6 (n = 50: 2,450). Hose: 2n = 6 (n = 50: 100).
  2. min(EA, IB) = min(10, 8) = 8.
  3. Out of A: min(EA, IB + IC) = min(10, 16) = 10. Into A: min(IA, EB + EC) = min(8, 10) = 8.
  4. Pairwise forecasts are brittle (does B's growth go to A or to E?). A hose keeps per-site totals but lets the pair mix change ("A sends 10 to B today and to C tomorrow"), and the plan must be TE-feasible for all of them under the failure set. Segmented hose: a few large allocations per DC for known heavy pairs, which shrinks the space of matrices to check.
✍ iPadProblem 5.8 — Label-stack depth and Binding SIDs short
Assume each hop needs one adjacency label, EBB hardware handles at most 3 labels, and a Binding SID takes one slot: the router it names pushes a new stack (up to 3 labels). A path has 7 hops: SRC→R1→R2→R3→R4→R5→R6→DST.
SRCR1R2R3R4R5R6DST7 hops · each hop needs one label · hardware: at most 3 labels per stack
  1. Can SRC encode it alone? How many Binding-SID routers are needed, and which (one valid choice)?
  2. When only the R5→DST portion changes, which routers need new state?
  3. Why is static-label source routing better than installing per-path rules at every router?
Show solution
  1. No (7 > 3). Each non-final stack covers 2 hops + 1 BSID; the final stack covers 3 hops. 2 + 2 + 3 = 7 → 2 Binding SIDs: SRC [→R1, →R2, BSID@R2]; R2 [→R3, →R4, BSID@R4]; R4 [→R5, →R6, →DST].
  2. Only the router owning the relevant BSID (here R4; R2 if the change reached earlier). Transit routers keep their fixed label→interface rules.
  3. Every path change would otherwise require updates at every router on the path (many forwarding-state updates and consistency issues). With static labels, only the headend and a few BSID routers change. A dynamic SID per (site pair, class) can also name a next-hop group (a weighted bundle of continuations).
✍ iPadProblem 5.9 — Meta EBB architecture MCQ
Which statements are correct?
☐ A. EBB's planes are parallel physical networks with their own controllers, so new controller software can be rolled out to a fraction of capacity and A/B tested.
☐ B. An EBB “plane” is the same thing as a traffic class such as gold or bronze.
☐ C. When a primary path fails, an LSP agent activates a preinstalled backup within hundreds of milliseconds; the central controller re-optimizes in a later cycle.
☐ D. Restoring reachability after a failure guarantees that the rerouted demands have enough capacity.
☐ E. Open/R's KvStore replicates link state with strong consistency, so all routers see an update at the same instant.
☐ F. Gold traffic is allocated before silver and bronze, on shortest paths measured by RTT.
Show solution

Correct: A, C, F

  • A ✔ — Phased releases and separate failure domains.
  • B ✘ — Physical plane ≠ control plane ≠ data plane ≠ traffic class. The slide calls this out.
  • C ✔ — Two-stage failure response.
  • D ✘ — Several rerouted demands can compete for the backup's links.
  • E ✘ — It is eventually consistent.
  • F ✔ — Priority order; gold uses shortest paths with RTT from LinkMonitor.

6 · Google: intent, Orion, bandwidth functions, B4, BwE, dSDN

Lectures 14–16 · HW2 Q4. Google's “DNA” is expressing desired behavior: intent, and fairness via bandwidth functions. B4 = the internal inter-DC WAN (sites become vertices, inter-site capacity becomes edges); B2 = the user-facing one.

6.1 Intent-based networking (RFC 9315)

Intent = a declarative statement of goals and outcomes: what to achieve, not how (like SQL, not Python). It separates the TE/ops people from device configuration (what the RFC calls “nerd knobs”).

LevelExampleStill undecided
Intent“Keep ≥ 8 Gb/s for service S while link e is drained for maintenance”which paths, splits, device rules, update order
Policy“Prefer path P1 when it has capacity”the allocation under current conditions
Configuration“Install these next hops and weights”nothing; the device must realize exactly this state

Examples of intent: steer traffic from geography X away from geography Y unless the destination is in Y · avoid vendor V's equipment for customer C even at reduced service · smart-city signal traffic on dedicated, redundant, non-fate-sharing slices. Non-examples: configure an interface's IP (configuration) · “alert when utilization > threshold” (a rule) · “deny P1 unless from P2” (an access policy tied to prefixes; if the prefixes change, the “intent” breaks).

Unwrapping an intent means making explicit its traffic scope (S, A→C), required service (8 Gb/s when S offers that much), maintenance scope (no forwarding on e), failure assumptions, and preferences (shorter paths). Lifecycle: Interpret → Check & plan (feasible?) → Fulfill (paths, splits, host limits, update order) → Assure (observe) → Respond (repair, re-plan, or report that the contract can't be met). Intents can be infeasible (8 Gb/s across a 6 Gb/s cut) or conflicting (two mandatory 8 Gb/s services on one 10 Gb/s bottleneck). Then identify the conflict and ask for a changed contract, a different maintenance plan, or more capacity.

Fulfillment vs assurance (checks at three levels): configuration (are the next hops installed? a rule may be missing after a restart) · network behavior (paths, counters, loss, queues) · service outcome (offered vs delivered). If S only offers 2 Gb/s, seeing 2 Gb/s delivered says nothing about whether 8 Gb/s is available.

6.2 Orion: Google's SDN controller (per domain)

apps: Routing Engine · TE app · Path Exporter · Raven (BGP/IS-IS)desired state ↓ · observed state ↑ NIB (pub-sub)shared desired + observed state Config Manager Topology Manager Flow Manager OpenFlow Front End switch agents: apply ops, report device state
A classic SDN controller built as microservices (team boundaries, independent evolution). Domains are independent and talk via BGP; there is no hierarchy of Orions. This differs from Meta's single central controller per plane.
📈 How to read this figureTop: applications (Routing Engine, TE app, Path Exporter, Raven) say what they want. Middle: the NIB (Network Information Base), a shared database holding both the desired state and the observed state of the domain. Below it, managers that each own one job: Config Manager (validates and applies configuration), Topology Manager (tracks which ports and links are actually up), Flow Manager (makes switch rules match what is desired). Bottom: the OpenFlow Front End talks to the switch agents. Desired state flows down, observed state flows up, and nobody calls anybody directly: they all read and write the NIB.

6.3 Sharing policies, then bandwidth functions

With source control (Google also controls the sending hosts, so it can cap how fast each app sends), TE also chooses the admitted rate r_i ≤ d_i: how much of app i's demand di is let into the network, not just where it goes. That needs a language for how to share, even within one class. The slide's bar chart splits one 8 Gb/s link three ways: equal 4 / 4, weighted + capped 6 / 2, priority to app 2 0 / 8. Same physical limit, different policy. The whiteboard example (two apps on a 10 Gb/s link):

PolicyDemands 8 and 2 on a 10 linkWork-conserving?
Equal split with hard rate limits (“work-conserving” = never leaves capacity idle while someone still wants it)5 each, but app 2 only uses 2 → 5 / 2, so 3 is wastedNo (what ISPs do; bad in a private network you own)
Max-min fair (water-filling)8 / 2: the small demand (2) is satisfied first, the rest (8) goes to the otheryes
Weighted (e.g., WRR queues 2:1)by weights, leftovers redistributedyes (the work-conserving WRR variant)
Strict priorityhigh firstyes

Real policies are hierarchies (Q&A). At the root: a few classes with strict priority between them, often softened by minimum guarantees (strict only beyond some allocation). Inside each class the split continues, e.g., Instagram and Facebook Marketplace are both business-critical, but Instagram gets a guarantee because it is far more bandwidth-hungry. The hierarchy is global; its configuration is nuanced. Bandwidth functions are Google's language for expressing exactly this. (A vertical bandwidth-function segment would mean infinite priority; you can write it mathematically but it makes no practical sense.)

The fair share s, in plain wordsSeveral apps share one link, each with its own importance (weight) and its own maximum need (demand cap). Google describes each app with one curve, its bandwidth function B(s): “if the network is being this generous (s), I get this much bandwidth (B)”. The network then turns one common knob, s, upward for everyone at once, and stops when the link is full. Fairness means every app is evaluated at the same s; what each one gets at that s depends on its own curve.
Analogy: pouring water into differently shaped glasses connected at the bottom, so the water level (s) is the same in all of them. A wide glass (steep curve) holds more at the same level; a glass that is full (flat part, the cap) takes no more; you stop pouring when you run out of water (capacity C).
Bandwidth function B(s): x-axis = dimensionless fair share s (shared by all groups); y-axis = bandwidth that group gets at that s. Piecewise linear. Slope = weight/priority (steeper = more important right now). Flat part = demand cap (or a temporary plateau if it rises again later). Allocation rule: raise the common s until the sum of all Bi(s) on the bottleneck equals capacity (max-min fairness in s). If C ≥ total demand, everyone is capped and the remainder is unused.
012468100246810fair share sbandwidth (Gb/s)C=4C=8C=12App1 = min(3s, 6)App2 = min(s, 10)
📈 How to read this chart (and solve with it)x-axis: the common fair share s. y-axis: bandwidth each app receives at that s. Blue App1 = min(3s, 6): rises 3 Gb/s per unit of s (weight 3), then goes flat at its cap of 6. Orange App2 = s: rises 1 per unit (weight 1). The dashed verticals mark the s chosen for each capacity. To solve: slide a vertical line to the right until the two heights add up to C. C = 4: at s = 1 the heights are 3 + 1 = 4 ✓. C = 8: at s = 2, 6 + 2 = 8 ✓ (App1 just hit its cap). C = 12: App1 is stuck at 6, so App2 must supply the other 6, which happens at s = 6 ✓. What to notice: while both curves rise, the split follows the slopes (3:1). Once one is capped, all extra capacity goes to whoever is still rising.

Lecture numbers (App1 = min(3s, 6), App2 = min(s, ·)): C = 4 → s = 1 → (3, 1): both unsatisfied, so the 3:1 weight shows in the rates. C = 8 → s = 2 → (6, 2): App1 hits its cap. C = 12 → s = 6 → (6, 6): the extra goes to App2. A function whose slope changes (e.g., App1 gets its first 4 Gb/s with strict priority, then App2 grows faster) expresses policies that no single fixed weight ratio can, even work-conserving. That is the punchline of HW2 Q4.

Freezing at other bottlenecks, and routing freedom

A B C D A–B 8 Gb/s (shared) B–C 2 Gb/s B–D–C 4 Gb/s App1: A→B→C, min(3s,6)App2: A→B, s fixed route: App1 frozen at 2→ App2 = 6 · (2, 6) with D route: s = 2 → (6, 2)
📈 How to read this figureTwo apps share link A–B (8 Gb/s). App1 continues past B to C; App2 stops at B. Case 1, App1 may only use B–C (2 Gb/s): when s reaches 2/3, App1 = 3s = 2 fills B–C, so App1 is frozen at 2 even though it wants up to 6. App2 keeps growing alone until A–B is full: App2 = 8 − 2 = 6. Result (2, 6). Case 2, App1 may also use B–D–C (4 Gb/s more): App1 is no longer blocked at 2, so both keep rising until A–B fills at s = 2: (6, 2). Same link, same functions; the routes changed where growth stopped.

A group is frozen once any link on its path is full (or it hits its cap). The others keep growing. The routes decide where growth stops, and TE can change the operating point (both cases carry 8 Gb/s on A–B).

Aggregation: add heights at the same s

02468100481216fair share sbandwidth (Gb/s)parent gets 11 → s=5child 1child 2aggregate
📈 How to read this chartBlue and orange are two children; green is their parent (their sum). At every s the green height = blue height + orange height. The parent's bends come from the children: slope 3 + 1 = 4 while both rise; slope 1 once child 1 caps at 6 (s = 2); flat once child 2 also caps at 8 (s = 8). The dashed line shows decomposition: if the parent is granted 11 Gb/s, find where green reaches 11 (s = 5) and read each child at that s: (6, 5).

Parent P = child1 + child2 (add vertically, never add the s coordinates). Every bend has a child-level explanation: slope 4 while both grow, slope 1 after child 1 caps, slope 0 when everyone is satisfied. Decompose: read the parent backward (allocation → local s), then read each child forward at that s. Example: parent gets 11 → s = 5 → children (6, 5). Aggregates keep the policy information that a single total-demand number would lose. Solve a small problem on aggregates, then split it locally (and distributed) to children.

6.4 The B4 allocation algorithm (waterfill over paths)

Goal: max-min fairness in fair-share coordinates. Raise the smallest shares first, and keep raising the groups that can still grow. Each flow group (FG) uses its cheapest path first. When a link on that path fills, the group's rate at that point stays on the filled path and further growth spills to its next path in cost order. A group freezes when it hits its demand cap or has no path with spare capacity. Lecture example (directed links; cost 1 per link, except A–D costs 10):

The two groups' bandwidth functions (read from the slide's plot): FG1 (A→B) = 11s up to s = 1.5 (16.5 Gb/s), then slope 1 up to its cap of 20 at s = 5. FG2 (A→C) = s/2 (cap 10). FG1 is far more important at first (weight 11 vs ½).

A B C D A→B 10 A→C 10 C→B 10 A→D 5 D→C 5 FG1: A→B, cap 20paths AB(1) · ACB(2) · ADCB(12) FG2: A→C, slope ½, cap 10paths AC(1) · ADC(11)
00.9123.3351005101520fair share sgroup rate (Gb/s)A–B fullA–C fullFG1 capFG1 (A→B)FG2 (A→C)
📈 How to read the network and this chartNetwork: arrows are one-way links labelled with capacity; path cost = number of links, except A–D, which costs 10 (so routes through D are tried last). FG1's paths in cost order: A→B (1), A→C→B (2), A→D→C→B (12). FG2's: A→C (1), A→D→C (11). Chart: each group's total rate as s rises; dashed verticals mark the moments a link fills or a cap is reached, i.e. the rows of the table below.
Deriving each row ① A–B fills: FG1 uses only A→B, so A–B fills when 11s = 10 → s = 10/11. FG2 = (10/11)/2 = 0.45 on A–C. FG1 keeps its 10 on A→B, and anything more must go A→C→B.
② A–C fills: A–C now carries FG1's extra (B₁(s) − 10) plus all of FG2 (B₂(s)). Set (B₁(s) − 10) + B₂(s) = 10. Past s = 1.5, B₁ = 16.5 + (s − 1.5), so (6.5 + s − 1.5) + s/2 = 10 → s = 10/3. Then FG1 = 18.33 (10 + 8.33) and FG2 = 1.67. Both groups' next paths go through D.
③ FG1 hits its cap: at s = 5 FG1 = 20; the extra 1.67 rides A→D→C→B. FG2 = 2.5: 1.67 stays on A–C, 0.83 goes A→D→C. A–D and D–C carry 1.67 + 0.83 = 2.5 of 5. FG1 freezes (satisfied).
④ D links fill: only FG2 is still growing. A–D carries FG1's 1.67 + FG2's share; it fills when FG2's D share = 3.33, so FG2 = 1.67 + 3.33 = 5 (s = 10). FG2 freezes by the network, below its cap of 10.
EventsFG1FG2What happens
A–B fills10/1110 (all on AB)0.45 (AC)FG1 spills to ACB
A–C fills10/318.33 (10 AB + 8.33 ACB)1.67 (AC)solve (FG1(s) − 10) + FG2(s) = 10; both move to D routes
FG1 hits cap520 (+1.67 ADCB)2.5 (+0.83 ADC)FG1 frozen (demand-satisfied)
A–D / D–C fill10205 (1.67 AC + 3.33 ADC)FG2 frozen by the network (its cap is 10)

Quantization: hardware can't split 0.762

Why it's needed: the algorithm above produces exact fractions (FG1 sends 8.33/20 = 5/12 of its traffic on A→C→B). A switch splits traffic by hashing flows into a small number of equal buckets, so it can only do fractions like 0, ½, 1 (with K = 2 buckets). The allocation has to be rounded to what the hardware can express.

Switches implement splits with a finite number of equal forwarding-weight units (e.g., K = 2 → 0%, 50%, 100%). Rounding each group independently can overload a shared link: FG1 (½, 5⁄12, 1⁄12) → (½, ½, 0) and FG2 (⅓, ⅔) → (½, ½) put 20·½ + 5·½ = 12.5 Gb/s on A–C (capacity 10). B4 then greedily adjusts to fit. Final result: FG1 = 10 AB + 10 ACB, FG2 = 5 on ADC (FG1 leaves the D route, FG2 takes all of it).

6.5 BwE: the Bandwidth Enforcer (making the shares real at the sources)

Global Enforcer (MPFA) Cluster Enforcer Cluster Enforcer Job Enforcer Job Enforcer Host Host Host budgets ↓ (bandwidth functions resolved) usage / demand ↑ Network Model Server: topology, pathsAdmins: sharing policy
📈 How to read this figureA tree, top to bottom: Global Enforcer → one Cluster Enforcer per data center → one Job Enforcer per job → Host Enforcers on the actual machines. Information flows up (each level reports usage and demand), decisions flow down (each level splits the budget it received among its children, using their bandwidth functions). At the bottom, the host's Linux traffic shaper (HTB) enforces the rate limit on each task. The Network Model Server supplies the topology and paths; administrators supply the sharing policy.
ComponentUpDown
Host Enforcertask usagetask rate limits (Linux HTB, “hierarchical token bucket”, the kernel's built-in rate limiter)
Job Enforcerusage per jobjob budget → tasks
Cluster Enforceruser demand + aggregate bandwidth functionscluster budget → users → jobs
Global Enforcerprioritized demand informs TEcluster budgets via hierarchical network allocation (MPFA, multi-path fair allocation: the bandwidth-function waterfill of §6.4 run over the network's paths)

TE ↔ BwE loop: TE (B4) gives paths + split weights; BwE gives prioritized demand. TE can change routing; BwE holds routing fixed and carries budgets down to sender limits. Both speak bandwidth functions. On each host, the BwE limit caps TCP. If cwnd/RTT is below the limit, congestion control is what binds; otherwise the limit binds. Benefits: predictability, protecting the network from bursts, and a clear answer to “why am I limited?” (“that's the fair share in your contract”). Costs: an enforcer on every host (a bug can cripple the fleet), complex control loops at sub-minute to minute scale, and debugging whether BwE or CC is limiting you. Delayed updates waste capacity (HW2 Q4.3): if a team's demand drops below its budget, the spare isn't redistributed until the next parent cycle. Fix: event-driven updates or demand reports, at the cost of more messages and computation.

Orion in B4: the global TE chooses paths network-wide. In each domain, a TE app turns those choices into RouteAdverts for the Routing Engine and coordinates backup and fallback. The Path Exporter summarizes physical paths and capacity for TE and BwE (failures change what it exports). Raven integrates BGP and IS-IS so central TE and conventional routing coexist. Summary slide: new abstraction (bandwidth functions) → more precise TE input · source control → division within a class + network protection · all allocation can be expressed as intent and enforced globally.

6.6 Did SDN simplify or complicate WAN operations? → dSDN (2024)

SDN pros programmability and automation, abstraction of low-level configuration, and globally optimal decisions (hard to do distributed, especially TE). It can lower box cost (simple switches).
SDN cons a logical single point of failure: replicas protect against hardware failure, but a bug or bad config has a huge blast radius. External dependencies (servers, services, a separate control-plane network with its own failure modes). Scaling the optimization. Complexity. You still run distributed routing (IS-IS/BGP/Open-R) for fast recovery, so you run two control planes. Large engineering teams.

Data: of the 41 largest B4 outages over four years, 42% were control-only and 10% control-and-data, so 52% had a control-related root cause (the rest of the pie: 32% data-plane only, 16% other). What changed since SDN's birth: router vendors opened up. Operators now run their own software on router CPUs (Meta runs Open/R on every vendor's box).

dSDN: Keep operator-defined control and TE over a global network view (programmability). Change: run the TE control logic inside each router and exchange state (“in-band” = over the same links that carry data, not a separate management network) in-band over the data network (no separate control-plane network). That gives fate-sharing: control depends only on the routers and links it manages. Each router floods its local link status and capacity, ingress demand, attached prefixes, and IDs/sequence numbers (freshness), so every router learns the full TE inputs and computes the global TE solution itself. The ingress then encodes its chosen path as an MPLS label stack (source routing, like Meta): map prefix and class → egress, hash among weighted source routes, push labels. Components: LocalState + NodeStateExchange (observe and exchange) → StateDB → Pathing + TE solver → Programmer (install). The TE solver is replaceable. SDN ≠ centralized control; SDN = programmability. On failure, each headend (the ingress router where a path starts) learns of it, recomputes, and updates its own ingress state, with no round trip to a controller and no transit reprogramming.
What must happen before traffic moves off a failed link? (L16) Central SDN notify controller recompute TE program transit activate ingress depends on servers + a separate control-plane network (its own failures) dSDN flood to every headend each computes TE update own ingress in-band, on the routers themselves: fate-sharing; no transit reprogramming
Both end with routes that avoid the failed link. dSDN shortens the chain of dependencies, while still computing a global TE solution (at every router) and encoding the path as an MPLS label stack at the ingress.
DesignDecision basisHow the path takes effect
Link-state shortest path (IS-IS)topology + link costs (no TE)each router picks its next hop
Central TEglobal topology + demandcontroller installs paths
dSDNglobal TE computed at every routeringress encodes the source route

(MPLS + RSVP-TE is a distributed mechanism for reservation, but it doesn't solve the global TE problem either.) Not covered: WAN hardware and topology design, DC/WAN commonalities.

✍ iPadProblem 6.1 — Intent, policy, or configuration? short
Classify each as intent, policy, configuration, or a non-example (rule / access policy): (i) “Keep at least 8 Gb/s available to service S while link e is drained.” (ii) “Prefer path P1 for S when it has capacity.” (iii) “Install next-hop group {P1: 0.7, P2: 0.3} on R7.” (iv) “When interface utilization exceeds 90%, emit an alert.” (v) “Avoid routing customer X's traffic through vendor V's equipment, even at reduced service levels.” (vi) “Deny traffic to prefix P1 unless it comes from prefix P2.”
(b) For (i), only 6 Gb/s can cross the cut while e is drained. Which lifecycle stage finds this and what should happen? (c) S offers only 2 Gb/s and receives 2 Gb/s. Does this show the intent is met?
Show solution
(i) intent · (ii) policy · (iii) configuration · (iv) non-example: a rule · (v) intent (an outcome, with guidance on trade-offs) · (vi) non-example: an access policy tied to prefixes.
(b) Check & plan finds it infeasible. Respond: identify and report the conflict, and ask for a changed contract, a different maintenance plan, or more capacity.
(c) No. Observing 2 Gb/s when only 2 is offered says nothing about the availability of 8. Assurance must compare offered vs delivered (service outcome), plus configuration and network-behavior checks.
✍ iPadProblem 6.2 — Sharing policies on one link calc
Three applications share a 12 Gb/s link with demands A = 3, B = 4, C = 9. Give each one's rate and the unused capacity under: (a) equal shares with hard rate limits (non-work-conserving), (b) max-min fairness, (c) weighted max-min with weights 1 : 1 : 2, (d) strict priority C > B > A.
Show solution
(a) 4 each, capped by demand → 3, 4, 4; unused 1.
(b) Water-fill: equal share 4 → A capped at 3; remaining 9 split by B and C (4.5 each) → B capped at 4 → C gets 5 → 3, 4, 5; unused 0.
(c) Rates t, t, 2t with 4t = 12 → t = 3 → 3, 3, 6 (A exactly satisfied); unused 0.
(d) C 9, then B 3, A 0 → 0, 3, 9.
✍ iPadProblem 6.3 — Bandwidth functions with a priority switch calcHW-style
App1: B₁(s) = 2s for s ≤ 2 (reaches 4), flat at 4 for 2 ≤ s ≤ 4, then rises with slope 1 to its cap of 6 at s = 6. App2: B₂(s) = 0 for s ≤ 2, then slope 3 to its cap of 9 at s = 5. They share one bottleneck.
0123456780246810fair share sbandwidth (Gb/s)App1App2
  1. Allocations for C = 3, 10, 13, 16 Gb/s (and any unused capacity).
  2. Describe the policy these curves express.
Show solution
  1. C = 3: s ≤ 2, 2s = 3 → s = 1.5 → (3, 0).
    C = 10: s ∈ [2, 4]: 4 + 3(s−2) = 10 → s = 4 → (4, 6).
    C = 13: s ∈ [4, 5]: (s) + 3(s−2) = 4s − 6 = 13 → s = 4.75 → (4.75, 8.25).
    C = 16: at s = 5: 5 + 9 = 14; App2 capped; App1 = s → s + 9 = 16 → s = 7 > 6, so App1 caps at 6 → (6, 9), 1 Gb/s unused (all demand satisfied).
  2. App1 gets strict priority for its first 4 Gb/s. Then App2 takes every increment until it has 6 (C = 10). Then they share 1 : 3 until App2's demand is met. App1's plateau at 4 is temporary; its cap is 6. No single fixed weight ratio can express this.
✍ iPadProblem 6.4 — Bandwidth functions vs fixed weights (HW2 Q4.1–4.2 twin) calcHW-style
Two flow groups share a bottleneck: X(s) = min(2s, 8), Y(s) = min(s, 6) (demands 8 and 6).
02468100246810fair share sbandwidth (Gb/s)X(s) = min(2s, 8)Y(s) = min(s, 6)
  1. Allocations at C = 6, 12, 16.
  2. Same capacities with non-work-conserving 2:1 sharing (reserve 2C/3 and C/3, then cap by demand). Unused capacity?
  3. With work-conserving 2:1 sharing.
  4. Construct a bandwidth-function policy that no single fixed weight ratio can implement, and show why.
Show solution
  1. C = 6: 3s = 6 → s = 2 → (4, 2). C = 12: s = 4 → (8, 4). C = 16: X capped at 8 for s ≥ 4; 8 + s = 16 → s = 8 > 6 → Y caps at 6 → (8, 6), 2 unused.
  2. C = 6: (4, 2). C = 12: (8, 4). C = 16: reserve 10.67 / 5.33 → (8, 5.33), 2.67 unused while Y still wants 0.67.
  3. C = 16: X 8, leftover goes to Y up to its demand → (8, 6), 2 unused (demand-limited). Same as the functions here.
  4. E.g., X(s) = min(2s, s + 2, 8), Y(s) = min(s, 8). C = 6 → s = 2 → (4, 2), a 2:1 ratio. C = 10 → s = 4 → (6, 4), a 3:2 ratio. The ratio depends on the operating point, so no fixed weight reproduces both (the HW answer's construction).
✍ iPadProblem 6.5 — Aggregating and decomposing calc
Children: c₁(s) = min(3s, 6), c₂(s) = min(s, 8).
02468100246810fair share sbandwidth (Gb/s)c₁(s) = min(3s, 6)c₂(s) = min(s, 8)
  1. Write the aggregate P(s): breakpoints and slopes.
  2. The parent is allocated 11 Gb/s. Each child's rate? Allocated 6?
  3. Why aggregate with functions instead of passing up one total-demand number (14)?
Show solution
  1. Add heights: slope 4 on [0, 2] (P(2) = 8) → slope 1 on [2, 8] (P(8) = 14) → flat at 14.
  2. 11: on the slope-1 segment, 6 + s = 11 → s = 5 → (6, 5). 6: on the slope-4 segment, 4s = 6 → s = 1.5 → (4.5, 1.5).
  3. A single number loses how the children should share at each level. The function preserves it, so the parent can be allocated among other aggregates and decomposed locally (and in a distributed way) without solving the full problem.
✍ iPadProblem 6.6 — Freezing and routing freedom calc
App1 (A→B→C): min(3s, 6). App2 (A→B): min(s, 10). A–B = 8 Gb/s shared; B–C = 2 Gb/s used only by App1.
8 Gb/s (shared)2 Gb/s4 Gb/s4 Gb/sABCDApp1: A→B→C, min(3s, 6) · App2: A→B, min(s, 10)dashed: route B–D–C, available only in the second part
  1. With fixed routes, find the allocation. When does App1 freeze?
  2. An unused route B–D–C with 4 Gb/s becomes available to App1. New allocation?
  3. What does this show about TE vs bandwidth allocation?
Show solution
  1. App1 freezes when B–C fills: 3s = 2 → s = 2/3 → App1 = 2. App2 keeps growing until A–B fills: 2 + s = 8 → s = 6 → (2, 6).
  2. App1 can reach 2 + 4 = 6 beyond B, but A–B is still shared: 3s + s = 8 → s = 2 → App1 = 6 (its cap), App2 = 2 → (6, 2).
  3. Same curves, same total on A–B (8), but routes change where growth stops. TE picks routes to improve the max-min allocation; the bandwidth functions define the policy.
✍ iPadProblem 6.7 — Run the B4 waterfill yourself calc
Directed links, cost 1 each: A→B 6, A→C 6, C→B 6 (Gb/s). FG1 (A→B): min(2s, 12), paths AB then ACB. FG2 (A→C): min(s, 8), path AC.
A→B 6A→C 6C→B 6A→D 2 (cost 10)D→C 10 (cost 1)ABCDFG1: A→B, min(2s, 12) · FG2: A→C, min(s, 8)dashed links are added only in the last part
  1. At what s does the first link fill? Group rates then?
  2. Continue until no group can grow. Final rates and per-path split. Unused capacity?
  3. Now add A→D (2 Gb/s, cost 10) and D→C (10 Gb/s, cost 1), giving FG1 the path ADCB and FG2 the path ADC. Continue from (b). Final rates?
Show solution
  1. A→B fills when 2s = 6 → s = 3: FG1 = 6 (AB), FG2 = 3 (AC).
  2. FG1 spills to ACB: A→C load = (2s − 6) + s = 6 → s = 4. FG1 = 8 (6 AB + 2 ACB), FG2 = 4 (AC). A→C is full and both groups have no unsaturated path, so both freeze. C→B carries 2 of 6, so 4 Gb/s unused.
  3. Both grow over A→D: (2s − 8) + (s − 4) = 2 → 3s = 14 → s = 4.67. FG1 = 9.33 (6 AB + 2 ACB + 1.33 ADCB), FG2 = 4.67 (4 AC + 0.67 ADC). Check C→B: 2 + 1.33 = 3.33 ≤ 6 ✓.
✍ iPadProblem 6.8 — Quantization overload calc
Use the lecture's continuous B4 result: FG1 = 20 Gb/s split ½ AB, 5⁄12 ACB, 1⁄12 ADCB; FG2 = 5 Gb/s split ⅓ AC, ⅔ ADC. Capacities: AB, AC, CB 10; AD, DC 5.
  1. Load on every link (continuous).
  2. Round every fraction independently to the nearest multiple of 50%. Loads now?
  3. Fix it with 50% units without reducing either group.
Show solution
  1. AB 10; ACB 8.33 → AC gets 8.33 + FG2 1.67 = 10; CB 10 (8.33 + 1.67 from ADCB); AD = 1.67 + 3.33 = 5; DC 5. Every link is full.
  2. FG1 → (½, ½, 0): AB 10, ACB 10. FG2 → (½, ½): AC 2.5, ADC 2.5. AC = 10 + 2.5 = 12.5 > 10 ✗.
  3. Greedy adjustment (the slide's result): FG1 = 10 AB + 10 ACB; FG2 = 100% ADC (5). AC 10, CB 10, AD 5, DC 5 ✓.
✍ iPadProblem 6.9 — BwE update period waste (HW2 Q4.3 twin) calcHW-style
A parent splits a 20 Gb/s link between teams A and B (equal shares when both need them; unused capacity is redistributed). Current budgets: 10 / 10. New demands for the next 500 ms: A = 4 Gb/s, B = 18 Gb/s. The next parent update is 500 ms away.
  1. How much data (MB) does each team send in the interval?
  2. What could the network deliver under the stated policy? How much is wasted?
  3. Propose a mechanism change with its benefit and cost.
Show solution
  1. A: min(4, 10) × 0.5 s = 2 Gb = 250 MB. B: capped by its budget, 10 × 0.5 = 5 Gb = 625 MB.
  2. Policy: A 4, B 16 (gets A's unused 6) → (4 + 16) × 0.5 = 10 Gb = 1,250 MB. Sent 875 MB, so 375 MB wasted (3 Gb).
  3. Event-driven updates: a team reports as soon as its demand drops below its budget (or the parent lends unused budget immediately). Benefit: capacity redistributes within ms. Cost: more frequent reports and allocation computation, which can make the hierarchy's control plane a bottleneck.
✍ iPadProblem 6.10 — Orion, BwE, dSDN MCQ
Which statements are correct?
☐ A. In BwE, usage reports flow up the hierarchy and bandwidth budgets flow down to host enforcers.
☐ B. Host enforcers cap tasks' rates (e.g., with Linux HTB); TCP congestion control still operates underneath that cap.
☐ C. A single Orion controller instance manages all of B4; domains don't need BGP between them.
☐ D. Orion's NIB is a pub-sub system: components subscribe to state changes rather than the NIB invoking every component's callback.
☐ E. dSDN gives up programmability to gain reliability.
☐ F. In dSDN, every router learns the TE inputs by flooding and computes the global TE solution; the ingress encodes its chosen path as an MPLS label stack.
☐ G. 52% of the 41 largest B4 outages studied had a control-related root cause.
Show solution

Correct: A, B, D, F, G

  • A ✔ — Usage ↑, budgets ↓.
  • B ✔ — If cwnd/RTT < limit, CC binds; otherwise BwE's limit binds.
  • C ✘ — Orion is per domain; domains act like ASes and exchange BGP (Raven).
  • D ✔ — This avoids making the NIB a bottleneck that knows every reaction.
  • E ✘ — It keeps operator-defined control and global TE. SDN = programmability, not centralization.
  • F ✔ — Source routing, like Meta's.
  • G ✔ — 42% control-only + 10% control-and-data.
✍ iPadProblem 6.11 — Short essay: did SDN simplify WAN operations? essay
Answer in 5–6 sentences: what SDN simplified, what it complicated, what changed in the last ~20 years, and what dSDN keeps and changes.
Show solution
Simplified: programmability and automation through one interface, abstraction of device configuration, and globally optimal TE decisions (hard to do distributed); intent-based operation. Complicated: external dependencies (controllers, services, a separate control-plane network), a logical single point of failure where one bug has a huge blast radius (replication doesn't help against bugs), solver scaling, and two control planes at once (distributed IS-IS/BGP/Open-R is still needed for fast recovery), plus big engineering teams. Data: 52% of B4's largest outages were control-related. Changed: router vendors opened up, so operators run their own code on router CPUs (Open/R on everything). dSDN keeps operator-defined control and TE over a global view, and changes where it runs: on every router, exchanging state in-band (fate-sharing) and source-routing at ingress. SDN ≠ centralized.

7 · Microsoft: SWAN, TeaVaR, OneWAN

Lectures 16–17 (taught by the TA). Microsoft's DNA: failure handling, and historically solving the optimization problem exactly with an LP solver (Meta and Google use heuristics).

MetaGoogleMicrosoft
inter-DC WANEBBB4SWAN
Internet-facing WANCBBB2CORE

7.1 SWAN: centralized TE for high utilization

  1. Collect: hosts tell their service's broker (a per-service server that gathers demand and later hands out rate limits) how much they want to send; brokers pass totals to the controller. Network agents on the switches report topology and link state.
  2. Compute: an optimal, fair allocation, class by class. Interactive traffic (user-facing, latency-sensitive) is allocated first; background traffic (bulk copies, backups) gets what remains. Within a class SWAN wants max-min fairness and high throughput. It gets there approximately by solving a series of LPs: each one maximizes total throughput while not letting any flow fall below the level it reached in the previous round, so the smallest flows are raised first, like water-filling. Output: a rate for each tunnel between each pair of DCs.
  3. Realize: brokers rate-limit hosts; network agents configure only the edge (ingress) switches. Core routers have statically configured label-switched paths, so SWAN just picks tunnels and weights at the edge (e.g., tunnel 1: 50%, tunnel 2: 30%, tunnel 3: 20%). Each tunnel entry is a rule, and the rule table is small. Recomputed about every 5 min.

Congestion-free updates with scratch capacity

Switches don't update simultaneously, so mid-update a link can carry some flows' old rates and others' new rates. Lecture example (links 100 Gb/s): initial U(F1 80, F2 20) / L(20, 80) → target swap. If F2 moves first, U = 80 + 80 = 160. If F1 moves first, L overloads. Splitting into chunks without spare room still overloads.

Why max(old, new)? An update step tells every ingress switch to change its tunnel weights, but each switch applies the change at a slightly different moment. During the step, any flow may be at its old rate or its new rate on a given link, and you can't control which. The worst case for a link is every flow sitting at whichever of its two values is larger on that link. So the safe test adds up, flow by flow, the larger of the two values and requires that to fit. If it fits for every link and every step, no mixture of old and new can overload anything.
Why scratch capacity makes this possible: if every stage leaves a fraction s of each link free, a step may move traffic as long as the temporary overlap fits in that free slice. Moving a little of the traffic per step keeps the overlap small, so a plan always exists. Smaller s means a smaller overlap allowed per step, so more steps; the bound is ⌈1/s⌉ − 1.
For every link e and every step i → i+1:
     Σ_f  max( x_f,e(i) , x_f,e(i+1) )  ≤  c_e          ← worst case: any mix of old/new
Flow conservation each stage:  Σ_e x_f,e(i) = d_f
Objective: maximize headroom (slack); if infeasible with k stages, try k+1

Whiteboard version of the lecture LP (a = F1, b = F2; u = upper, l = lower link):
  variables per stage i:   a_u^i, a_l^i, b_u^i, b_l^i
  each flow fully carried: a_u^i + a_l^i = 80,   b_u^i + b_l^i = 80
  upper link, step i→i+1:  max(a_u^i, a_u^{i+1}) + max(b_u^i, b_u^{i+1}) + h ≤ 100
  (same for the lower link) · stage 0 and stage 3 are fixed · maximize h, h ≥ 0
With scratch capacity s (fraction kept free on every link): at most ⌈1/s⌉ − 1 steps
     (s = 10% → ≤ 9 · s = 20% → ≤ 4 · bigger s = fewer steps but less usable capacity)
Lecture plan, 20% scratch (link 100): F1 = blue, F2 = orange, free = grey stageUL 0 1 2 3 (target)
U: 64/16 → 44/36 → 24/56 → 16/64. Check 0→1 on U: max(64,44)+max(16,36) = 64+36 = 100 ✓ · 1→2: 44+56 = 100 ✓ · 2→3: 24+64 = 88 ✓. L mirrors U. Each completed stage keeps the 20% scratch (the invariant); only transient mixes may hit 100%. (The slide says “up to 2 Gbps per flow per stage”; the numbers actually move 20 per stage.)
📈 How to read this figureTwo links, U (upper) and L (lower), 100 Gb/s each. Each bar is one link at one stage: blue = F1's traffic, orange = F2's, grey = free. Read left to right: F1 shifts from mostly-U to mostly-L while F2 does the opposite, 20 Gb/s at a time. Every completed stage keeps 20 Gb/s (20%) free. To check a transition, take the two bars of the same link in neighbouring stages and add the larger F1 part and the larger F2 part: it must be ≤ 100. (0→1 on U: 64 + 36 = 100 ✓.)

Changing the tunnel set with limited rule space

If the new allocation uses different tunnels, you must install new rules before removing old ones. With infinite rule space: add all new rules, shift traffic congestion-free, delete old ones. In reality the table is small, so keep spare rule entries (scratch rule capacity). Lecture: from {1,2} to {3,4} with one spare slot: add 3 → compute an optimal allocation restricted to {2,3} → congestion-free shift → remove 1 → add 4 → shift to {3,4} (that allocation was already computed at the start) → remove 2. Getting to the target takes a series of LPs (allocation LPs for intermediate tunnel sets plus congestion-free plan LPs).

Changing tunnels {1,2} → {3,4} with one spare rule slot (L17) startadd 3 remove 1add 4remove 2 tunnel 1 tunnel 2 empty tunnel 1 tunnel 2 tunnel 3 empty tunnel 2 tunnel 3 tunnel 4 tunnel 2 tunnel 3 tunnel 4 empty tunnel 3 shift {1,2} → {2,3}(LP for {2,3}, congestion-free) shift {2,3} → {3,4}(target LP already solved) carries traffic installed, idle
Install a new tunnel before removing an old one, and move traffic only between tunnel sets that are installed. Every shift is itself a congestion-free (scratch-capacity) update, so reaching the target takes a series of LPs.

7.2 TeaVaR: utilization with an availability guarantee

EBB, B4, and SWAN recover reactively: fast local reroute, then the controller re-optimizes seconds to minutes later. Until then, allocations made for “all links up” can't be met, so there is no availability guarantee.

Deterministic k-failure guarantee “What can I promise even if any k links fail at once?” 3 links × 10 Gb/s, s→d: 0 failures → 30; any 1 failure → 20 (after the failure, traffic moves onto the two survivors, which carry 20); any 2 → 10. In general n links of capacity c → (n − k)·c. Simple, but it sizes for rare events and wastes capacity almost all of the time.
Probabilistic guarantee “What bandwidth can we guarantee β = 99.98% of the time?” Use the failure probabilities instead of the worst case.
TeaVaR's example network and scenario q4 (L17) s d ✗ L1 top · 10 Gb/s · p(fail) = 10⁻³ L2 middle · 10 Gb/s · 10⁻¹ L3 bottom · 10 Gb/s · 10⁻³ q4 = (L1, L2, L3) = (down, up, up) P(q4) = 10⁻³ · 0.9 · 0.999 ≈ 0.0009 F1 sends (2, 3, 5) on (L1, L2, L3), demand 10 loses the 2 on L1 → loss 0.2 F2 sends (4, 3, 3), demand 10 loses the 4 on L1 → loss 0.4 L(x, q4) = max(0.2, 0.4) = 0.4
Tunnels = links; no rerouting inside a scenario. Repeat for all 2³ scenarios to get the loss distribution of allocation x, then take its β-percentile: V(x) = VaR_β.

The slide's numbers, worked out. P(fail): top L1 = 10⁻³, middle L2 = 10⁻¹ (flaky), bottom L3 = 10⁻³, independent.

EventProbabilityConsequence
no link fails(0.999)²(0.9) ≈ 89.8%30 Gb/s available
exactly one fails≈ 10.2% (almost all of it is the middle link)20 Gb/s left
two or more fail≈ 2·10⁻³·10⁻¹ = 0.02%≤ 10 Gb/s left
top or bottom fails1 − 0.999² ≈ 0.2%(matters if you use only those two)
Heads-up: the TA's spoken numbers were off. In lecture the TA said “two links fail ≈ 0.2%” and that top + bottom gives 20 Gb/s “99.98% of the time”. The math from the slide's probabilities gives 0.02% and 99.8% (table above). The idea is the same: using probabilities lets you promise more than the worst case. If a quiz question gives numbers, compute it yourself with independence.
Independence:     P(scenario q) = Π_links  P(link state in q)       (2^n scenarios for n links)
Loss of a flow in q:  1 − (demand still deliverable on surviving tunnels)/(demand)
                      (no rerouting inside the scenario)
L(x, q) = MAX over flows of that loss                                  ← worst-off flow
Loss distribution for allocation x: values L(x,q) with probabilities P(q)
V(x) = VaR_β = β-percentile of that distribution  (smallest v with P(L ≤ v) ≥ β)
TeaVaR:  x*, V* = argmin_x V(x)  s.t. link capacities
Guarantee: scale every allocation by (1 − V*) → satisfiable β of the time
TeaVaR in plain words ① Scenarios. Each link is either up or down, so n links give 2ⁿ possible states of the network (“scenarios”). With independent failures, a scenario's probability is the product of each link's probability of being in that state.
② Loss in a scenario. Fix an allocation x (how much each flow sends on each tunnel). In a scenario, traffic on failed tunnels is simply lost (no rerouting yet). A flow's loss = the fraction of its demand that didn't get through. The scenario's loss L(x, q) is the worst flow's loss, because the promise must hold for every flow.
③ Loss distribution. Listing every scenario's loss with its probability gives the distribution of “how bad things are” under allocation x.
④ VaRβ (value at risk). Sort scenarios from least to most loss and add up their probabilities until you reach β (e.g. 99.98%). The loss where you stop is V(x): “with probability at least β, loss is no worse than V”.
⑤ Optimize and promise. TeaVaR searches for the allocation with the smallest V. If the best is V* = 0.1, every flow is promised 90% (1 − V*) of its allocation, and that promise holds in all scenarios except the rarest (1 − β) of the time.
Tiny example (problem 7.5, even split over 3 links, β = 0.95): P(loss = 0) = 0.92169, P(loss ≤ ⅓) = 0.99832. The first value to reach 0.95 is ⅓, so V = ⅓ and the guarantee is 30 × (1 − ⅓) = 20 Gb/s, 95% of the time.

Lecture loss example (scenario q4: L1 down, L2 and L3 up): F1 sends (2, 3, 5) and F2 sends (4, 3, 3) on (L1, L2, L3), demand 10 each. F1 loses 2/10 = 0.2, F2 loses 4/10 = 0.4, so L(x, q4) = 0.4 (the max over flows). Probability primer: dependent events use P(A∩B) = P(A)·P(B|A); independent ones use P(A∩C) = P(A)·P(C). The p-th percentile is the value below which p% of samples fall.

7.3 OneWAN: merge the split WANs

Why two WANs traffic isolation (big inter-DC transfers don't hurt users) · different technologies (centralized control and simpler devices for inter-DC) · independent growth.
Why it got costly fragmented capacity (one WAN overloaded while the other has spare; inter-DC came to dominate) · duplicate connectivity (DC edges wired to both: equipment and power) · operational complexity (two stacks, two expertises) · CORE's RSVP-TE hit scale limits, and config changes had a global blast radius.

Challenges: ① routing-table scale (~10⁵ DC routes vs ~10⁶ Internet routes) ② fast failure repair ③ scaling the TE optimization ④ estimating Internet demand (not under your control) ⑤ migrating live traffic seamlessly.

Aggregationrouter (full BGP:Internet + DC) Backbone Bonward 10 Backbone Conward 20 ⅓ of flows ⅔ of flows backbone core:MPLS only, SWAN-stylecentral TE (paths, rates) egressaggregation
Steering: ① drop entry routers with excessive onward delay ② max-flow from A to the destination site ③ distribute flows by those weights. Packet: outer label = site / TE tunnel, inner SID = BGP next hop.
📈 How to read this figureTraffic arrives at aggregation router A (left), which has two backbone entry routers to choose from: B (onward capacity 10) and C (onward capacity 20). A drops any entry router whose onward delay is too high, computes the maximum flow it can push through each remaining one, and splits flows in that proportion: 10 : 20, so ⅓ of flows via B and ⅔ via C. From there the backbone's central TE (SWAN-style) carries them across the WAN.
OneWAN: what the packet carries on each segment (L17) IP egress-site label BGP-NH SID IP TE path label BGP-NH SID IP BGP-NH SID IP IP ingressedge ingressaggregation ingressbackbone backbonecore egressbackbone egressaggregation egressedge BGPtraffic steering traffic engineeringsegment routing BGP only the purple aggregation routers hold full IP tables
Outer label = which site / TE tunnel; inner SID = which BGP next hop. Backbone routers forward on labels only, so they never need the ~10⁶ Internet routes.
✍ iPadProblem 7.1 — Plan a congestion-free update calc
Two links U and L, 100 Gb/s each. F1 = 80 Gb/s, F2 = 80 Gb/s. Current: F1 (U 70, L 10), F2 (U 10, L 70). Target: F1 (U 10, L 70), F2 (U 70, L 10). Every link keeps 20 free.
currentU701020L107020targetU107020L701020blue = F1, orange = F2, grey = free · links U and L: 100 Gb/s each
  1. Write the condition a transition from stage i to i+1 must satisfy on each link.
  2. Can it be done in one step? Show the worst case.
  3. Construct a 3-stage plan (two intermediate states) and verify every transition.
  4. What does SWAN's bound say about the number of steps with 20% scratch? What's the trade-off in choosing the scratch?
Show solution
  1. For each link e: Σf max(xf,e(i), xf,e(i+1)) ≤ ce (any mix of old and new rates may coexist). Each flow's total is conserved at every stage.
  2. U: max(70, 10) + max(10, 70) = 140 > 100 ✗ (same on L).
  3. Stage 1: F1 (50, 30), F2 (30, 50). Stage 2: F1 (30, 50), F2 (50, 30). Stage 3 = target.
    0→1: U max(70,50) + max(10,30) = 100 ✓; L max(10,30) + max(70,50) = 100 ✓.
    1→2: U 50 + 50 = 100 ✓; L 50 + 50 ✓. 2→3: U max(30,10) + max(50,70) = 100 ✓; L max(50,70) + max(30,10) = 100 ✓.
  4. ≤ ⌈1/s⌉ − 1 = ⌈5⌉ − 1 = 4 steps (an upper bound; here 3). More scratch means fewer steps and faster convergence, but less capacity for real traffic (SWAN used about 10%).
✍ iPadProblem 7.2 — Check the lecture's plan, and catch a bad one calc
Links 100 Gb/s. Stage 0: U (F1 64, F2 16), L (F1 16, F2 64). Stage 1: U (44, 36), L (36, 44). Stage 2: U (24, 56), L (56, 24). Stage 3: U (16, 64), L (64, 16).
  1. Worst-case load on U for each transition.
  2. A colleague proposes going straight from stage 0 to U (40, 40), L (40, 40). Valid?
  3. Why is the scratch capacity still 20 after each completed stage?
Show solution
  1. 0→1: max(64,44) + max(16,36) = 64 + 36 = 100 ✓. 1→2: 44 + 56 = 100 ✓. 2→3: 24 + 64 = 88 ✓. (L is symmetric.)
  2. U: max(64,40) + max(16,40) = 64 + 40 = 104 > 100 ✗. F1 hasn't left U before F2 might arrive.
  3. Each flow's total (80) is conserved and both completed states use 80 per link. The invariant is kept at stage boundaries; only transient mixes may reach 100%.
✍ iPadProblem 7.3 — Changing tunnels with a small rule table calc
An ingress switch's tunnel-rule table holds 4 entries. Current tunnels {T1, T2, T3}; the new optimal allocation uses {T4, T5, T6}.
  1. With 1 spare entry, list the steps. How many intermediate allocation LPs and how many congestion-free shift plans are needed?
  2. The table holds 5 entries (2 spare). Steps and counts?
  3. Why not overwrite T1 with T4 directly?
Show solution
  1. Add T4 → allocate over {T2, T3, T4} (LP) → congestion-free shift → remove T1. Add T5 → allocate over {T3, T4, T5} (LP) → shift → remove T2. Add T6 → shift to {T4, T5, T6} (allocation already known from the start) → remove T3. 2 extra allocation LPs, 3 shift plans (each shift plan is itself an LP).
  2. Add T4, T5 → allocate over {T3, T4, T5} → shift → remove T1, T2 → add T6 → shift to the final set → remove T3: 1 extra allocation LP, 2 shift plans.
  3. Traffic currently using T1 would be disrupted (dropped or rerouted unpredictably), possibly causing congestion. Keep spare rule entries the same way you keep spare link capacity.
✍ iPadProblem 7.4 — Deterministic failure guarantees calc
Four disjoint links of 10 Gb/s connect s to d. What bandwidth can be guaranteed with 0, 1, or 2 simultaneous link failures (spreading traffic optimally and rerouting after a failure)? Why is the 2-failure guarantee wasteful if two simultaneous failures happen 0.1% of the time?
(b) The lecture's slide. Three 10 Gb/s links, independent failure probabilities: top 10⁻³, middle 10⁻¹, bottom 10⁻³.
  1. P(no failure), P(exactly one failure), P(two or more failures)?
  2. Allocation X: 20 Gb/s spread so that any two surviving links carry it. What fraction of the time is 20 Gb/s delivered?
  3. Allocation Y: 10 + 10 on top and bottom only. What fraction of the time is 20 Gb/s delivered?
  4. Which one meets “20 Gb/s, β = 99.98%”?
Show solution
0 failures: 40; any 1: 30 (spread 7.5 each; survivors carry 30); any 2: 20. It sizes the guarantee for a 0.1% event, so 99.9% of the time 20 Gb/s of capacity sits idle. That motivates TeaVaR's probabilistic β-guarantee.

(b) i. None: 0.999²·0.9 ≈ 0.8982. Exactly one ≈ 0.1·0.999² + 2·0.001·0.999·0.9 ≈ 0.1016 (almost all from the flaky middle). Two or more ≈ 2·0.001·0.1 ≈ 0.0002 = 0.02%.
ii. X fails only if two or more links are down: delivered ≈ 99.98% of the time.
iii. Y needs both top and bottom up: 0.999² ≈ 99.8% (fails 0.2% of the time).
iv. X. Note: in lecture the TA said Y gives 99.98%; the probabilities on the slide give 99.8%. Trust your own computation.

✍ iPadProblem 7.5 — TeaVaR: scenarios, loss distribution, VaR calc
Three links L1, L2, L3 (10 Gb/s each) carry one s→d flow; links fail independently with probabilities 0.01, 0.02, 0.05. Use the lecture's loss model: tunnels = links; in a scenario, traffic assigned to a failed link is lost (no rerouting).
L1: 10 Gb/s · p(fail) = 0.01L2: 10 Gb/s · p(fail) = 0.02L3: 10 Gb/s · p(fail) = 0.05sd
  1. Probability of each of the 8 scenarios.
  2. Allocation E: split demand equally over the 3 links. Allocation T: split equally over L1 and L2 only. Loss distribution of each.
  3. VaR (the β-percentile loss) of each for β = 0.90, 0.95, 0.99.
  4. Max demand each allocation can carry (capacity), and the bandwidth it can guarantee β of the time (demand × (1 − VaR)) for each β. Which is better?
Show solution
  1. Up probabilities 0.99, 0.98, 0.95.
    downnoneL1L2L3L1L2L1L3L2L3all
    P.92169.00931.01881.04851.00019.00049.00099.00001
    (Sum = 1. E.g., L3 only: 0.99·0.98·0.05.)
  2. E: loss 0 w.p. .92169; ⅓ w.p. .07663 (one down); ⅔ w.p. .00167; 1 w.p. .00001.
    T: loss 0 when L1 and L2 are up: .99·.98 = .9702; ½ w.p. .01·.98 + .99·.02 = .0296; 1 w.p. .0002 (L3 is irrelevant).
  3. CDFs: E reaches .92169 at 0 and .99832 at ⅓. T reaches .9702 at 0 and .9998 at ½.
    β = .90: E 0, T 0. β = .95: E ⅓, T 0. β = .99: E ⅓, T ½.
  4. Capacity: E carries up to 30 (10 per link); T up to 20.
    β = .90: E 30·1 = 30; T 20 → E. β = .95: E 30·⅔ = 20; T 20·1 = 20 → tie. β = .99: E 20; T 20·½ = 10 → E. The best allocation depends on β, which is why TeaVaR optimizes the tail loss rather than using a fixed rule.
00.330.50.67100.250.50.750.91loss L(x,q) (fraction of demand unmet)P(loss ≤ value)β = 0.99β = 0.95blue = even split (E)orange = L1+L2 only (T)
📈 How to read this chartEach staircase is a cumulative distribution: for a loss value on the x-axis, the height is the probability that the loss is at most that value. To read VaRβ, go to height β on the y-axis (the dashed lines), move right until you hit the staircase, and read the loss below. At β = 0.99 the blue (even split) line is already above 0.99 at loss ⅓, so VaR = ⅓. The orange (L1 + L2 only) line only gets past 0.99 at loss ½, so VaR = ½. Lower VaR is better.
✍ iPadProblem 7.6 — TeaVaR's loss function (lecture example extended) calc
Flows F1 and F2 (demand 10 each) send F1: (2, 3, 5) and F2: (4, 3, 3) Gb/s on links (L1, L2, L3).
L1: F1 2 · F2 4L2: F1 3 · F2 3L3: F1 5 · F2 3sddemand 10 Gb/s per flow; rates in Gb/s
  1. L(x, q) for: no failure; L1 down; L3 down; L2 and L3 down.
  2. Suppose these four are the only scenarios, with probabilities 0.90, 0.05, 0.04, 0.01. VaR at β = 0.95 and β = 0.99?
  3. What rates can be guaranteed 95% of the time?
Show solution
  1. None: 0. L1 down: F1 2/10 = 0.2, F2 4/10 = 0.4 → 0.4. L3 down: F1 0.5, F2 0.3 → 0.5. L2+L3 down: F1 0.8, F2 0.6 → 0.8. (Max over flows: the worst-off flow.)
  2. CDF: 0 → .90, 0.4 → .95, 0.5 → .99, 0.8 → 1. β = .95 → V = 0.4. β = .99 → V = 0.5.
  3. Scale by (1 − 0.4): 6 Gb/s for each flow, available 95% of the time.
✍ iPadProblem 7.7 — OneWAN traffic steering calc
An aggregation router A connects to backbone entry routers B, C, D with links A–B 40, A–C 25, A–D 50 Gb/s. Their onward capacity toward the destination site is B 30, C 40, D 60. D's onward delay is excessive.
402550onward 30onward 40onward 60 · excessive delayABCDsiteA = aggregation router; B, C, D = backbone entry routers (Gb/s)
  1. Apply OneWAN's three steering steps. What weights result? How would 1,100 flows be distributed?
  2. Why do aggregation routers hold the full IP tables while backbone routers don't? What do the outer label and the inner SID identify?
Show solution
  1. ① Filter by latency → drop D. ② Max flow: via B min(40, 30) = 30; via C min(25, 40) = 25; total 55. ③ Weights 6/11 ≈ 0.545 to B, 5/11 ≈ 0.455 to C → 600 / 500 flows. Backbone TE then allocates across the WAN tunnels.
  2. Internet routes number ~10⁶ (vs ~10⁵ DC routes). Only aggregation routers run BGP and pick the egress next hop; backbone routers just forward on MPLS labels that the controller programs (SWAN-style), which saves memory. Outer label = destination site / TE tunnel; inner SID = the BGP next hop (egress aggregation router).
✍ iPadProblem 7.8 — SWAN, TeaVaR, OneWAN MCQ
Which statements are correct?
☐ A. SWAN's controller configures only the ingress (edge) switches; core routers forward on statically configured label paths.
☐ B. SWAN allocates the background class first and the interactive class with the remaining capacity.
☐ C. Congestion-free updates are needed because switches apply updates at different times, so links can see a mix of old and new rates.
☐ D. TeaVaR assumes independent link failures, so a scenario's probability is a product of per-link probabilities.
☐ E. Guaranteeing service under any 2 simultaneous failures always uses capacity more efficiently than a probabilistic β-guarantee.
☐ F. A split WAN can strand capacity: one WAN overloaded while the other has spare.
☐ G. OneWAN removes trunks below 500 Mb/s from the optimization, cutting variables about 7× while affecting about 2.5% of traffic.
Show solution

Correct: A, C, D, F, G

  • A ✔ — Only tunnel selection and weights at the edge.
  • B ✘ — Interactive (high priority) first.
  • C ✔ — The 160 Gb/s transient example.
  • D ✔ — Multiply per-link up/down probabilities.
  • E ✘ — It's the opposite: it sizes for rare events and wastes capacity.
  • F ✔ — Fragmented capacity: inter-DC traffic grew to dominate.
  • G ✔ — And 5× fewer constraint rows.

8 · Network verification

Lecture 18 (the last Unit 2 lecture; it's on the quiz). The question: can we guarantee that configurations are error-free? Not intent (that is human-readable), but the thousands of configurations generated from reconciling hundreds of intents. Updates, versioning, and TeaVaR plan for failures, but nothing so far catches a human or config error (a 4 typed instead of a 5 in a prefix).

8.1 The running example

S F B D primary (firewall F)backup B Requirements Web/443: deliver despite one failed link SSH/22: use F in normal op Telnet/23: block delivery B's buggy ACL (first match): TCP/443 → DenyTCP/22 → Permitdefault → Deny
All links up: web goes S–F–D, fine. If S–F fails, routing settles on S–B–D, and B drops web. The bug is invisible until a failure happens.
📈 How to read this figureFour routers: traffic goes from S to D. Normally it takes the top path through F (a firewall); B is the backup path. The three requirements on the right are what the operator wants: web (port 443) must get through even with one failed link; SSH (22) must pass through F; Telnet (23) must never arrive. B's ACL (access-control list) is checked top to bottom and the first matching rule wins. Its first rule denies TCP/443, which is the bug: harmless while the top path works, fatal for web traffic once S–F fails and routing moves to B.

8.2 The verification map

The big idea: search for a counterexampleTo show a property always holds (“web always arrives, whatever single link fails”), you would have to check every packet × every failure, which is impossible by simulation. Instead, write down the network's behaviour and the negation of the property (“there exists a failure and a web packet that does not arrive”) as one logic formula, and ask a solver: can this be true? SAT (satisfiable): the solver found values that make it true. That is a concrete bug report: which link failed, which packet, which forwarding choices. UNSAT: no such case exists, so the property holds for everything the model describes.
Network inputsconfig · packets · failures Operator intentdelivery · policy · resilience Behavior model M Requirement P Solver searchesAllowed ∧ M ∧ ¬PSAT = counterexample
📈 How to read this figureLeft: what we know about the network (its configuration, which packets we care about, which failures are allowed) is turned into a behaviour model M. Right: what the operator wants (delivery, policy, resilience) becomes a requirement P. The solver gets both and searches for a case that fits M but breaks P. Finding one (SAT) = counterexample.

Model components: configuration (route rules, filters) · packet class (the headers in scope, as symbolic packets: one variable stands for every packet in the class, e.g. “any TCP packet to D on port 443, from any source address and port”, and the solver reasons about all of them at once instead of testing them one by one) · environment (which links are up or failed) → possible forwarding steps → compose → feasible paths and prefixes. A digital twin (a simulated copy of the network that you feed test packets) only checks the cases you thought to try; with billions of possible packets × failure combinations it can't cover them all. Symbolic search covers the whole modeled space in one query.

In the table: ∃ = “there exists”, ∀ = “for every”, ¬ = “not” (full symbol table in §8.3). A prefix of a path is its beginning part, e.g. S, B, S is a prefix that already repeats S.

RequirementMeaningConstrains
Reachabilitysome path arrives (∃)delivered paths
Isolationno path arrives for forbidden traffic (∀ ¬)delivered paths
Waypointingevery delivered path visits F (∀ paths). It does not require delivery; add reachability if packets must also arrive.delivered paths
Loop freedomno feasible prefix repeats a router (a loop witness can end before delivery)all forwarding prefixes
Failure tolerancethe property holds across all allowed failure conditions (e.g., ≤ 1 link down)scope

8.3 Encoding in first-order logic

SymbolRead it asSymbolRead it as
∧and∀xfor every x
∨or∃xthere exists an x
¬notA ⟹ Bif A then B (true whenever A is false)
⟺exactly when (same truth value)∧i, ∨i“and” / “or” over all i

Letters used below: h = a packet header (symbolic: stands for every packet in a class at once); e = the environment, i.e. which links are up; x = the routing and forwarding choices; u, v = routers; S, D = source and destination.

Packet class    H_p = { h : h.dstIP ∈ D_IP ∧ h.proto = TCP ∧ h.dport = p }   (any src IP / src port)
ACL (ordered)   hit_i(h)   = match_i(h) ∧ ¬( match_1(h) ∨ … ∨ match_{i−1}(h) )   ← first match wins
                permit(h)  = ∨_i ( hit_i(h) ∧ action_i = allow )
One hop         N(u,v,h,e) = sel(u,v,h,e) ∧ up(u,v,e) ∧ permit_{u→v}(h)
                             (route selected ∧ link up ∧ ACL permits — ALL three)
Path            Path(v0…vm,h,e) = ∧_{i
The same lines in plain words Packet class: “all TCP packets to D's addresses on port p, from any source” — one symbol h covers all of them.
hiti: rule i matches the packet and no earlier rule did, so rule i is the one that decides. permit: the deciding rule says allow.
N(u, v): the packet can really move from u to v: routing picks v as next hop, the link is up, and the filter lets it through. All three are needed.
Path: every consecutive hop along a router sequence works. R(S, D): some such path goes from S to D.
Backward layers: R₀ = routers already at D; R₁ adds routers that can reach a router in R₀ in one working hop; and so on. S can reach D if S ever joins a layer. In a small network, as many layers as the longest path suffice.
≤ 1 failure as “every pair has one up”: if two links were both down, the clause (upa ∨ upb) for that pair would be false. Requiring every pair's clause to be true is the same as “at most one link is down”, using only and/or/not (pure SAT).
Query: “is there a failure case we allow, consistent with how the network behaves, in which the requirement fails?”
Reachability layers for web, S–F down, buggy ACL at B 0 steps: {D}≤1 step: {D, F}≤2 steps: {D, F} F→D: selected ∧ up ∧ permit ✓B→D: selected ∧ up but ACL denies 443 ✗ S: S–F down; S→B is fine but B ∉ R₁ ⇒ S never enters ⇒ web unreachable
📈 How to read this figureThe reachability layers for a web packet with S–F failed. 0 steps: only D. ≤ 1 step: F joins, because F→D is selected, up, and permitted. B does not join: B→D is selected and up, but B's ACL denies port 443. ≤ 2 steps: S's only working next hop would be B, which is not in the previous layer, so S never joins. Web from S is unreachable: a counterexample.

Scenarios in scope with ≤ 1 failure on 4 links: none, S–F, F–D, S–B, B–D (5 cases, one symbolic query). Before the repair, web is dropped for S–F down and for F–D down, so the query is SAT with counterexample “S–F down, web packet”. After the repair (B permits web), it is delivered in all 5, so UNSAT.

8.4 SAT vs SMT; Minesweeper

SAT (Boolean satisfiability): given true/false variables and a formula over them, find values that make the formula true, or prove none exist. Here every variable is Boolean (link states, next hops, forwarding, reachability). It is NP-complete (no known algorithm is fast on every input), but modern solvers are fast on most practical instances. SMT (satisfiability modulo theories) adds richer domains: bit-vectors (addresses), integers (route metrics), linear arithmetic (capacity: x₁ + x₂ ≤ 5, latency bounds). Use SMT to capture capacity, availability, or latency requirements.

Minesweeper (SIGCOMM 2017) is a compiler for router configurations: parse configs and topology → encode routing and forwarding as SMT constraints → search for violations. It encodes the three kinds of routing policy: export (which routes a router advertises to each neighbour), import (which advertised routes it accepts) and selection (which accepted route it prefers). For example c ↔ a ∧ up ∧ accept: S has a usable route from B exactly when B advertised it, the S–B link is up, and S's import policy accepts it. It also encodes route preferences and interactions between protocols. It checks stable routing states: states where routing has settled, so no router would change its choice given what its neighbours advertise and its policies. E.g. after S–F fails, the only stable state has S selecting the route via B, and the solver then checks the requirement in that state. An ACL can also be implemented as “don't advertise”, so the routing configuration is analyzed too, not just the filters.
The caveats A SAT result is solid evidence (a concrete counterexample). UNSAT is only as good as the model: missing ACLs, an external controller that reacts to failures, or humans “fixing” things live are all outside it. Richer models cost more computation (NP-hard). The research is about expressive-but-efficient encodings and network-specific algorithms.

Unit 2 summary (last slide): private WANs control their traffic (choose routes, divide capacity among tenants, rate-limit at sources for predictability) but still need CC for RTT-scale reactions. Centralized control gives an easier interface and globally optimal decisions, but it must coexist with distributed control and is a logical single point of failure. Modeling failure to hedge against it is a critical operation.

✍ iPadProblem 8.1 — Scenario table for the running example calc
S F B D primarybackup
Routing: S uses S–F–D when S–F and F–D are both up; otherwise it settles on S–B–D. F's ACL: deny TCP/23, permit everything else. B's ACL (first match): TCP/443 → deny; TCP/22 → permit; default → deny. Requirements: web (443) delivered under any ≤ 1 link failure; SSH (22) goes through F in normal operation; telnet (23) never delivered.
  1. For each scenario (none, S–F, F–D, S–B, B–D down), is web / SSH / telnet delivered, and via which node?
  2. Which requirements are violated, and in which scenarios?
  3. Repair B's ACL minimally and state the verification result after the repair.
Show solution
downpathwebSSHtelnet
noneS–F–D✓✓ via Fblocked at F
S–FS–B–D✗ dropped at B✓ via Bblocked (default deny)
F–DS–B–D✗ dropped at B✓ via Bblocked
S–BS–F–D✓✓ via Fblocked at F
B–DS–F–D✓✓ via Fblocked at F
(b) Only web reachability under failure fails (S–F down, F–D down). The waypoint holds in normal operation; isolation holds everywhere.
(c) Change B's first rule to TCP/443 → permit (or delete it). Web is then delivered in all 5 scenarios, so the query “≤ 1 failure ∧ model ∧ web not delivered” is UNSAT; telnet is still default-denied.
✍ iPadProblem 8.2 — Reachability layers calc
Same network and buggy ACL as 8.1, for a web packet. Using N(u,v) = selected ∧ up ∧ permit and backward layers R₀ = {D}, Rk = Rk−1 ∪ {v : N(v,u) for some u ∈ Rk−1}:
  1. Compute R₀, R₁, R₂ with F–D down.
  2. With S–B down.
  3. With F–D down after the repair.
  4. Why do two layers suffice here?
Show solution
  1. R₀ = {D}. F→D: link down ✗. B→D: selected and up, but the ACL denies 443 ✗ → R₁ = {D}. S→B is selected but B ∉ R₁ → R₂ = {D}. S unreachable.
  2. R₁ = {D, F} (B→D still denies web). S→F is selected, up, and permitted → R₂ = {D, F, S}. Reachable.
  3. R₁ = {D, B}, R₂ = {D, B, S}. Reachable.
  4. The longest loop-free path (the diameter) is 2 hops, so k = 2 covers every possible path.
✍ iPadProblem 8.3 — Encoding an ordered ACL short
B's ACL in order: r1: src ∈ 66.6.0.0/16 → deny; r2: TCP/443 → permit; r3: TCP/22 → permit; r4: default → deny.
  1. Decide: web from 66.6.1.1; web from 10.0.0.1; telnet from 10.0.0.1; SSH from 66.6.7.7.
  2. Write hit₂(h) and permit(h) in first-order logic.
  3. An engineer swaps r1 and r2. Which decision changes, and what kind of requirement does that violate?
Show solution
  1. deny (r1) · permit (r2) · deny (r4) · deny (r1).
  2. hit₂(h) = match₂(h) ∧ ¬match₁(h) = (h.proto = TCP ∧ h.dport = 443) ∧ ¬(h.src ∈ 66.6.0.0/16). permit(h) = (hit₂(h)) ∨ (hit₃(h)), since only r2 and r3 allow (equivalently ∨i hiti ∧ actioni = allow).
  3. Web from 66.6.1.1 becomes permitted: an isolation violation (the blocked source now reaches D). Order matters, which is why the encoding includes ¬(earlier matches).
✍ iPadProblem 8.4 — Writing requirements and the query short
For the network in 8.1 (links SF, FD, SB, BD), write:
  1. Isolation for telnet.
  2. Waypointing for SSH. Does it imply SSH is delivered?
  3. Loop freedom.
  4. “At most one link down” as pure Boolean clauses. How many clauses?
  5. The solver query that checks “web survives every single-link failure”, and how to read SAT vs UNSAT.
Show solution
  1. ∀h ∈ H23, ∀e allowed: ¬R(S, D, h, e).
  2. ∀h ∈ H22, ∀ delivered paths π = (S … D): F ∈ π. No: it constrains delivered paths only, so dropping all SSH satisfies it vacuously. Add reachability if SSH must arrive.
  3. ¬∃ path prefix v₀…vm, ∃ i ≠ j : vi = vj (checked on prefixes, since a loop never delivers).
  4. Every pair has an up link: (upSF ∨ upFD), (upSF ∨ upSB), (upSF ∨ upBD), (upFD ∨ upSB), (upFD ∨ upBD), (upSB ∨ upBD): C(4,2) = 6 clauses.
  5. Allowed(e) ∧ M(C, h, e, x) ∧ h ∈ H443 ∧ ¬R(S, D, h, e). SAT → the assignment is a counterexample (which link failed, the packet, the forwarding state). UNSAT → no violation exists within the model's scope.
✍ iPadProblem 8.5 — Why symbolic search? calc
(a) How many failure scenarios are in scope for ≤ 1 failure on 4 links? ≤ 2 failures? (b) For 50 links with ≤ 2 failures? All subsets? (c) Why model packets symbolically (H443) instead of enumerating headers?
Show solution
(a) 1 + 4 = 5; 1 + 4 + 6 = 11. (b) 1 + 50 + 1225 = 1,276; all subsets 2⁵⁰ ≈ 10¹⁵. (c) A class like “any src IP, any src port, TCP, dport 443” covers ~2⁴⁸+ concrete headers. Simulation (a digital twin) can't enumerate them; one symbolic query covers them all.
✍ iPadProblem 8.6 — SAT, SMT, Minesweeper MCQ
Which statements are correct?
☐ A. If the solver returns UNSAT for (allowed failures ∧ model ∧ ¬property), the property is guaranteed in the real network under all conditions.
☐ B. A SAT result yields a concrete counterexample: a failure condition, a packet, and forwarding state that violate the property.
☐ C. Pure Boolean SAT can't directly express “the sum of competing traffic on a link ≤ its capacity” over integer rates; SMT can.
☐ D. Minesweeper derives routing and forwarding constraints from router configurations, including import policies and route preferences, and checks stable routing states.
☐ E. Waypointing alone guarantees that packets are delivered.
☐ F. Loop freedom is checked on forwarding prefixes, because a looping packet may never be delivered.
Show solution

Correct: B, C, D, F

  • A ✘ — Only within the modeled scope. Missing behaviors (external controllers, humans, unmodeled ACLs) aren't covered.
  • B ✔ — The witness explains the problem.
  • C ✔ — SMT adds integers, bit-vectors, linear arithmetic.
  • D ✔ — A compiler for configs; stable states after failures.
  • E ✘ — It constrains only delivered paths; add reachability.
  • F ✔ — A loop witness can end before delivery.

9 · Cumulative refresher: Quiz 1 material (Lectures 1–8)

Compressed from your Quiz 1 and exam-1 reference. Expect at most one or two questions here, probably wrapped around PCC/BBR ideas.

TopicThe one thing to remember
End-to-end argumentCorrectness (e.g., a file arriving intact) can only be completely verified at the endpoints. Link-level checks only improve performance. Fate-sharing: keep connection state at the endpoints so the network survives router failures.
NUMmax Σ U(x_s) s.t. Ax ≤ c. Source rule U′(x) = path price. log utility → proportional fairness; α→∞ → max-min; α = 2 → Reno-like (min potential delay); linear → max throughput (starves long flows).
Reno / AIMD+1 per RTT, halve on loss. x ∝ 1/(RTT·√p) → RTT unfairness. Needs ≈ 1 BDP of buffer to stay at full utilization. CUBIC grows on wall-clock time (RTT-fair).
Fluid modelsdW/dt = [inc·(1−p) − dec(W)·p] / R: read the increase term (AI if constant, MI if ∝W) and the decrease term (MD if ∝W, AD if constant).
Copad_q = RTT_standing − RTT_min; λ_target = 1/(δ·d_q); λ_current = cwnd/RTT_standing. Current > target → decrease. ±v/δ per RTT; about 1/δ packets queued; competitive mode.
VegasQ = (W/RTT_min − W/RTT)·RTT_min (packets queued). Q < α → +1; Q > β → −1; otherwise hold (α=1, β=3 typical). Starves beside Reno.
Bufferbloatqueue delay = bytes queued × 8 / link rate. A huge FIFO plus loss-based CC gives seconds of delay. Fix with AQM (CoDel) or delay-aware CC.
BBRBtlBw = windowed max delivery rate (10 rounds); RTprop = windowed min RTT (10 s). BDP = BtlBw·RTprop; cwnd ≈ 2·BDP; must pace. PROBE_BW gains 1.25/0.75/1×6. PROBE_RTT drains inflight to refresh the min RTT. v1 ignores loss (unfair); v2 adds loss/ECN; v3 refines.
ECN / DCTCPMarks give a signal before buffer-overflow loss, with no retransmission. Standard ECN response = react as if one loss (once per RTT), not proportionally. DCTCP: cwnd ← (1 − α/2)cwnd.
CoDelSojourn time per packet. Bad queue = min sojourn > target (5 ms) for a whole interval (100 ms). Drop gaps then shrink as 100/√count. Persistent delay matters, not the average or the max.
INTSwitches stamp per-hop info (queue length, tx bytes, timestamp, capacity). This reveals which hop is congested, which an ECN bit can't. Header overhead grows with hops, so it is used in datacenters.
0590410data in flightBDP (optimal)lossdelivery rateRTT
📈 How to read this chart (BBR's model of the path)x-axis: how much data the sender has in flight. Blue: the delivery rate the receiver sees. Orange: the RTT. Left of the BDP line, more in-flight data means more delivered (the pipe isn't full) and the RTT stays at its minimum (no queue). At the BDP (bandwidth × min RTT) the pipe is exactly full: maximum delivery rate and minimum RTT, the optimal point BBR aims for. Right of it, extra data only builds a queue: delivery stays flat and the RTT climbs, until the buffer overflows at “loss”. Loss-based algorithms (Reno, CUBIC) operate out near the loss line; BBR tries to stay at the knee.

9.1 Bridges: Part 1 ideas that Part 2 reuses

The professor said Quiz 2 may use “ideas that depend on information we covered before quiz one”. These are the links most likely to be tested. The § numbers point into your Exam 1 reference (networks-exam1/notes/EXAM_REFERENCE.md), the full source for Lectures 1–8.

Part 2 topicPart 1 idea it builds onExam 1 ref.
TE vs congestion control (§3)The two knobs: change rates (CC, endpoints) or routes (TE, control plane). Controlling both is rare, except in hyperscaler WANs.§3.1, §4.6
Min-MLU, MCF (§3, §5)Routing matrix A and link loads Ax; NUM's Ax ≤ c becomes TE's Σ x_kp ≤ U·c_e.§3.2, §3.5
B4 waterfill, bandwidth functions (§6)Max-min fairness by water-filling; weighted utilities (w·log x); fairness is a property of the utility. Parking lot: max-min (½, ½, ½) vs proportional (⅓, ⅔, ⅔).§3.3, §3.4
PCC utilities (§1)Utility functions, concavity (one hill, so climbing works), Copa's utility ln x − δ ln d.§3.4–3.5, §6.1
PCC vs Copa / BBR (§1)Model-based vs model-less; Copa targets 1/δ queued packets (delay magnitude); BBR estimates BtlBw and RTprop.§10.1, §6, §10.3–10.8
PCC rate-based vs windows (§1.4 aside)Windows vs rates; pacing hybrid: cap inflight at cwnd, pace at 2·cwnd/RTT.§5.3
QUIC ossification (§2)Internet ossification then vs now: one company now owns server, network and client, so it can deploy (BBR, QUIC).§7.2
QUIC reliability (§2)End-to-end argument: reliability belongs at the endpoints; definition of reliability (all delivered, in order).§2.5, §2.1
SDN pros/cons, dSDN (§4, §6.6)SDN's real benefits (cheap hardware, global optimization) vs cost (network-wide blast radius); “single point of failure” = a logically centralized wrong decision, not a dead machine.§2.1
dSDN fate-sharing (§6.6)Clark's fate-sharing: state is lost only if the entity that needs it is lost. dSDN applies it to control: control depends only on the routers and links it manages.§2.3
Data plane vs control plane timescales (§4, §5)Data plane: per packet, nanoseconds. Control plane: seconds to minutes. Hence local fast reroute + slow central TE.§2.1
BwE, entitlements, source control (§5, §6.5)Deployment authority: the feasible mechanism depends on who controls the bottleneck and the sender. Private WANs control both, which is why host rate limits work there and not on the open Internet (cf. why ECN and source quench failed).§10.2, §9.3, §2.6
TeaVaR, SWAN headroom (§7)The “finite / delayed / distributed” framing: operators keep failure headroom and can't plan to use 100%.§3.7
How to use this (about 15 min, Day 3): Lecture 19 said Part 1 appears only inside the PCC question, so focus on the PCC, rate-vs-window and NUM rows. read your Exam 1 reference §1 (formula sheet) and §11–13 (comparison tables), then this table, then do problems 9.9–9.10. If any row feels unfamiliar, open the § it points to.
✍ iPadProblem 9.1 — NUM: fairness on two links calc
Two links, 10 Mb/s each. Flow 0 crosses both; flow 1 uses only link 1; flow 2 only link 2. Find the allocation under (a) max throughput (linear utility), (b) proportional fairness (log utility), (c) max-min fairness.
123link 1: 10link 2: 10long flow (flow 0 / L): crosses both linksflow 1 / S1: link 1 onlyflow 2 / S2: link 2 only
Show solution
(a) x₀ = 0, x₁ = x₂ = 10 (total 20; the long flow starves). (b) Maximize log x₀ + 2·log(10 − x₀): 1/x₀ = 2/(10 − x₀) → x₀ = 10/3 ≈ 3.33, x₁ = x₂ = 6.67. (c) Equal share on each bottleneck → 5, 5, 5.
✍ iPadProblem 9.2 — Copa decision calc
Copa, δ = 0.5, cwnd = 20 packets, RTT_min = 40 ms, RTT_standing = 50 ms. Compute d_q, the target and current rates (packets/s), and the next adjustment and its size per RTT (v = 1).
Show solution
① Queueing delay = standing RTT − minimum RTT: dq = 50 − 40 = 10 ms. ② Copa's target rate is the rate at which this flow would keep 1/δ packets queued: λtarget = 1/(δ·dq) = 1/(0.5·0.010 s) = 200 pkt/s. ③ Current rate = cwnd / standing RTT = 20/0.050 s = 400 pkt/s. ④ Current > target means it is queueing more than it wants → decrease. Each ACK changes cwnd by v/(δ·cwnd), and there are ≈ cwnd ACKs per RTT, so ≈ v/δ = 1/0.5 = 2 packets per RTT.
✍ iPadProblem 9.3 — Vegas decision calc
Vegas, W = 24 packets, BaseRTT = 40 ms, current RTT = 50 ms, α = 1, β = 3. Compute Q = (W/BaseRTT − W/RTT)·BaseRTT and the action.
Show solution
Expected rate (if nothing were queued) = W/BaseRTT = 24/0.040 s = 600 pkt/s. Actual rate = W/RTT = 24/0.050 s = 480 pkt/s. The difference (120 pkt/s) is data sitting in queues instead of moving; multiplying by BaseRTT turns it into a packet count: Q = 120 × 0.04 = 4.8 packets of this flow queued. Vegas wants between α = 1 and β = 3; 4.8 > β → too much queued → decrease cwnd by 1 (it would increase if Q < α and hold if in between).
✍ iPadProblem 9.4 — Bufferbloat calc
A 50 Mb/s bottleneck with a FIFO holding 2 MB of waiting data; base RTT 30 ms. (a) Queueing delay for a packet behind 2 MB? (b) Resulting RTT? (c) Max waiting data (kB) to keep queueing ≤ 10 ms?
Show solution
(a) A packet must wait until everything ahead of it is transmitted. Convert bytes to bits first: 2 MB × 8 = 16 Mb. At 50 Mb/s that takes 16/50 = 0.32 s = 320 ms. (b) RTT = base RTT + queueing delay = 30 + 320 = 350 ms, more than 10× the base: that is bufferbloat. (c) Reverse it: the link drains 50 Mb/s × 0.010 s = 0.5 Mb in 10 ms, and 0.5 Mb ÷ 8 = 62.5 kB. Any queue larger than that adds more than 10 ms.
✍ iPadProblem 9.5 — BBR estimates calc
Delivery-rate samples 80, 95, 90 Mb/s; RTT samples 30, 25, 40 ms. (a) BtlBw, RTprop, BDP (kB)? (b) Why does BBR periodically cut inflight in ProbeRTT? (c) Why must BBR pace?
Show solution
(a) Max → 95 Mb/s; min → 25 ms; BDP = 95×10⁶ × 0.025 = 2.375 Mb = ≈ 297 kB. (b) To drain the queue so it can measure (refresh) the true min RTT, since max BW and min RTT can't be observed at the same time. (c) Without pacing, bursts build queues and delivery samples underestimate or distort the bottleneck rate.
✍ iPadProblem 9.6 — CoDel MCQ
CoDel with target 5 ms and interval 100 ms. Experiment 1: sojourn time stays at 6 ms for 300 ms. Experiment 2: sojourn alternates 3 ms (20 ms) and 30 ms (5 ms). Which are correct?
☐ A. Experiment 1 meets the persistent-delay condition after about 100 ms, even though its maximum is lower than experiment 2's.
☐ B. Experiment 2 enters dropping as soon as a 30 ms sojourn is observed.
☐ C. If experiment 1 persists, successive drop gaps shrink as 100/√count ms (100, 70.7, 57.7, 50 …).
☐ D. CoDel's target must be re-tuned whenever the link rate changes because it is measured in bytes.
Show solution

Correct: A, C

  • A ✔ — The minimum sojourn stays above target for a whole interval.
  • B ✘ — Within every interval the min is 3 ms < 5, so it's good queueing (a burst).
  • C ✔ — Control law.
  • D ✘ — Sojourn time is in time units, independent of link rate.
✍ iPadProblem 9.7 — Reading fluid models calc
A sender updates once per RTT R; it sees a loss indication with probability p. What algorithm does each describe? (i) dW/dt = [3(1−p) − p·W/2]/R. (ii) dW/dt = [(1−p)·W/4 − p·W/2]/R. (iii) For (i), the equilibrium window.
Show solution
(i) AIMD: +3 packets per RTT without loss, halve (−W/2) on loss. (ii) MIMD: ×1.25 per RTT without loss, ×0.5 on loss. (iii) Set dW/dt = 0: 3(1−p) = pW/2 → W* = 6(1−p)/p.
✍ iPadProblem 9.8 — ECN, INT, end-to-end MCQ
Which are correct?
☐ A. ECN marks let the sender respond to congestion before buffer overflow causes loss, without retransmitting the marked packets.
☐ B. With Reno's standard ECN response, if 20% of a window's packets are marked the window shrinks by exactly 20%.
☐ C. INT records can show which hop had the largest queue; a single ECN mark can't.
☐ D. By the end-to-end argument, reliable link-level retransmission makes an endpoint file checksum unnecessary.
☐ E. BBRv1 reduces its rate in response to ECN marks.
Show solution

Correct: A, C

  • A ✔ — Signal before loss.
  • B ✘ — It reacts like one loss: halve, once per RTT.
  • C ✔ — Per-hop telemetry.
  • D ✘ — Only the endpoints can verify the complete transfer; link checks just help performance.
  • E ✘ — v1 ignores loss and ECN; v2 adds them.
✍ iPadProblem 9.9 — Bridges between Part 1 and Part 2 MCQ
Which statements are correct?
☐ A. dSDN's fate-sharing applies Clark's principle to control: control should depend only on the routers and links it manages, so it fails only when they do.
☐ B. Host rate limits (BwE) work in Google's WAN for the same reason ECN never deployed on the open Internet.
☐ C. Min-MLU traffic engineering and NUM congestion control turn the same knob: both adjust source sending rates.
☐ D. QUIC's fast rollout fits the Part 1 “de-ossification” story: one company controlling servers, clients and much of the traffic can change transport behavior quickly.
☐ E. In B4's waterfill, if every flow group has the same bandwidth function B(s) = s and no cap, the result is max-min fair.
☐ F. SDN's single-point-of-failure risk is mainly the controller machine crashing, which replication solves.
Show solution

Correct: A, D, E

  • A ✔ — Clark: state is lost only when the entity that needs it is lost. dSDN: control runs on the routers, in-band, so no separate control network or server can fail independently.
  • B ✘ — Opposite reasons. BwE works because one authority controls both the senders and the network. ECN (and ICMP source quench) failed because authority on the open Internet is fragmented and networks don't trust each other.
  • C ✘ — Different knobs: CC changes rates with routes fixed; TE changes routes with demand fixed (Exam 1 ref §3.1).
  • D ✔ — Exam 1 ref §7.2: deployability went up because one company can own the server, much of the network and the client. QUIC also runs in user space, so updating the app updates the transport.
  • E ✔ — Equal slopes mean equal priority, so raising the common fair share s is exactly water-filling: max-min fairness.
  • F ✘ — Controllers are replicated. The risk is a logically centralized wrong decision (a bug or bad config) applied network-wide: the blast radius.
✍ iPadProblem 9.10 — Parking lot: max-min, proportional, and bandwidth functions calc
Two 10 Gb/s links in series. A long flow L crosses both links; S1 uses only link 1; S2 uses only link 2. Everyone has unlimited demand.
123link 1: 10link 2: 10long flow (flow 0 / L): crosses both linksflow 1 / S1: link 1 onlyflow 2 / S2: link 2 only
  1. Max-min fair rates (water-filling)?
  2. Proportionally fair rates (maximize log L + log S1 + log S2)?
  3. Run B4-style waterfill with bandwidth functions B(s) = s for all three groups.
  4. Repeat (c) with S1's function changed to B(s) = 2s. What do you notice?
Show solution
  1. Raise all equally; both links fill together at 5: L = S1 = S2 = 5.
  2. By symmetry S1 = S2 = 10 − L. Maximize log L + 2·log(10 − L): 1/L = 2/(10 − L), so L = 10/3. L = 3.33, S1 = S2 = 6.67. The long flow pays two link prices, so it gets less.
  3. Equal functions = max-min. Link 1: s + s = 10 → s = 5, and link 2 likewise. (5, 5, 5), same as (a).
  4. Link 1: L + S1 = s + 2s = 10 → s = 10/3. L = 10/3 and S1 = 20/3 freeze (link 1 is full). S2 keeps growing on link 2 until L + S2 = 10 → S2 = 20/3. Result (3.33, 6.67, 6.67). The bandwidth function reproduced the proportionally fair outcome: by choosing slopes, the operator picks the fairness notion. Fairness is a property of the utility (Exam 1 ref §3.4).

10 · Mock Quiz 2 (do it on Day 3, timed)

Rules 60 minutes (the real quiz is long, so rehearse under pressure), only your two printed cheatsheets (as on the real quiz), calculator OK. It's the last section of the iPad PDF. Score MCQs exactly like the real quiz: +1 per correct mark, −1 per wrong mark, floor 0 per question. Then open the solutions below and write an error log: for each miss, was it a concept gap (re-read that section, redo its problems) or a careless slip (units, misread)? The questions are deliberately a little harder than Quiz 1, since the professor said Quiz 2 would be.
✍ iPadProblem M.1 — Performance-oriented congestion control (12 pts) MCQcalc
(a) Which statements are correct?
☐ A. Allegro's default utility counts throughput only while the loss rate stays below about 5%.
☐ B. Vivace penalizes the magnitude of the RTT, as Copa does with queueing delay.
☐ C. In Vivace, a larger magnitude of the estimated utility gradient produces a larger rate change, subject to a bound.
☐ D. When Allegro's two trial pairs disagree, it moves in the direction of the pair with the larger utility difference.
☐ E. Under random non-congestive loss, PCC can keep increasing its rate because higher rates still yield higher utility, without identifying the cause of the loss.
(b) A Vivace sender at 200 Mb/s tests 190 and 210 Mb/s and measures U(190) = 150, U(210) = 146. With θ = 25, compute g, Δr, and the new rate.
Show solution

Correct: A, C, E

  • A ✔ — Sigmoid(L − 0.05).
  • B ✘ — It penalizes the gradient dRTT/dt.
  • C ✔ — Δr = θg, bounded.
  • D ✘ — It stays at r and widens ε.
  • E ✔ — No cause identification; just utility comparison.

(b) g = (146 − 150)/(210 − 190) = −0.2; Δr = 25·(−0.2) = −5 → 195 Mb/s.

✍ iPadProblem M.2 — QUIC scheduling and semantics (12 pts) calcMCQ
(a) All buffered at t = 0: A (2 chunks), B (1 chunk), C (2 chunks); one chunk per packet; RTT 60 ms (30 each way); ACKs immediate; no loss; cwnd starts at 1 and grows by 1 per RTT. Give each object's display time under C-first, and under round robin in the order A, B, C.
(b) Which statements are correct?
☐ A. With HTTP/2 over one TCP connection, a lost packet of one object can delay delivery of other objects whose bytes already arrived.
☐ B. QUIC 0-RTT can be used on the first-ever connection to a server.
☐ C. A QUIC retransmission reuses the original packet number so the receiver can match it to the lost packet.
☐ D. All QUIC streams in a connection share one congestion controller.
Show solution

(a) C-first: t0 C1; t60 C2, A1; t120 A2, B1 → C 90, A 150, B 150 ms. RR (A, B, C): t0 A1; t60 B1, C1; t120 A2, C2 → B 90, A 150, C 150 ms.

Correct: A, D

  • A ✔ — TCP-level head-of-line blocking.
  • B ✘ — It needs remembered resumption state.
  • C ✘ — A new packet number; stream offsets identify the bytes.
  • D ✔ — CC is per connection.
✍ iPadProblem M.3 — Traffic engineering with classes (12 pts) calc
Three disjoint paths: P1 (10 Gb/s, 5 ms), P2 (10 Gb/s, 8 ms), P3 (20 Gb/s, 30 ms). Demands: interactive 6 Gb/s (requires path latency ≤ 10 ms) and bulk 18 Gb/s.
P1: 10 Gb/s, 5 msP2: 10 Gb/s, 8 msP3: 20 Gb/s, 30 msstinteractive 6 Gb/s (needs ≤ 10 ms) · bulk 18 Gb/s
  1. The controller aggregates both classes and minimizes MLU, and each path carries the classes in proportion. Loads, MLU, and interactive traffic on P3?
  2. Find a policy-compliant allocation with the same MLU. What does the network need for it?
  3. Interactive grows to 22 Gb/s, bulk drops to 10. Is the aggregate feasible? Is the policy feasible? What should the operator do?
Show solution
  1. 24/40 = MLU 0.6: P1 6, P2 6, P3 12. Interactive is 25% of each path → 3 Gb/s on P3 (violates the policy).
  2. P1 + P2 carry 12: all 6 interactive + 6 bulk; P3 12 bulk → MLU 0.6. It needs traffic classification, per-class demand estimates, and per-class forwarding rules/weights.
  3. Aggregate 32 ≤ 40: feasible (MLU 0.8). Policy: interactive may only use P1 + P2 = 20 < 22, so it is infeasible. Admit/rate-limit interactive to 20 (P1, P2 full) and put bulk on P3 (0.5), or renegotiate the policy. TE can't create low-latency capacity.
✍ iPadProblem M.4 — Mechanisms (10 pts) MCQ
Which statements are correct?
☐ A. An MPLS label is 20 bits, and the S bit marks the bottom of the label stack.
☐ B. CSPF prunes links that can't meet a trunk's bandwidth or color constraints before running shortest path.
☐ C. With Meta's version bit, the source may start tagging packets v1 as soon as it has sent the update messages to the new path's routers.
☐ D. sFlow lets switches keep exact per-flow byte counts at line rate.
☐ E. Under the hose model, a site's total egress is bounded, but how it splits across destinations may change.
☐ F. A Binding SID lets an intermediate router supply the rest of a label stack, working around a stack-depth limit.
Show solution

Correct: A, B, E, F

  • A ✔ — label 20 | Exp 3 | S 1 | TTL 8.
  • B ✔ — Prune → shortest path → install.
  • C ✘ — It must wait for acknowledgments that every v1 rule is installed.
  • D ✘ — It samples 1-in-N packets; switches keep no per-flow state.
  • E ✔ — That is the point of the hose.
  • F ✔ — Continuation at the BSID node.
✍ iPadProblem M.5 — HPRR (12 pts) calc
Parallel directed links L and R, 10 Gb/s each, with fixed background 2 Gb/s on each. Unsplittable LSPs: A = 6 and C = 3 on L, B = 4 on R. HPRR considers A, then B, then C, repeating passes until nothing changes. A move is accepted only if the max utilization on the new route after the move is lower than the max utilization on the LSP's current route before it.
L: 10 Gb/s · background 2 · LSPs A = 6, C = 3R: 10 Gb/s · background 2 · LSP B = 4SD
  1. Run HPRR. Final placement and MLU.
  2. Is it optimal among unsplittable placements? Justify.
  3. What MLU would arbitrary splitting achieve?
Show solution
  1. Start: L = 2 + 6 + 3 = 11 (1.1), R = 6 (0.6).
    Pass 1: A → R: after R = 12 → 1.2, not < 1.1 ✗. B → L: after L = 15 → 1.5, not < 0.6 ✗. C → R: after R = 9 → 0.9 < 1.1 ✓ → L = 8 (0.8), R = 9 (0.9).
    Pass 2: A → R: after 15 ✗. B → L: after 12 → 1.2, not < 0.9 ✗. C → L: after 11 → 1.1, not < 0.9 ✗. Stop: L {A}, R {B, C}, MLU 0.9.
  2. Enumerate the subsets on L: {A} → 0.9; {B, C} → L 9, R 8 → 0.9; every other subset ≥ 1.1. So 0.9 is optimal; HPRR got lucky here (contrast 5.3).
  3. Total 13 + 4 = 17 over 20 → 0.85.
✍ iPadProblem M.6 — Bandwidth functions and intent (14 pts) calcMCQ
(a) Two groups share one bottleneck: A(s) = min(4s, 8), B(s) = min(s, 10). Allocations at C = 6, 14, 20 Gb/s. (b) A and B are the children of an aggregate that is allocated 9 Gb/s. Children's rates? (c) Which statements are correct?
024681012024681012fair share sbandwidth (Gb/s)A(s) = min(4s, 8)B(s) = min(s, 10)
☐ A. If service S offers 2 Gb/s and receives 2 Gb/s, an intent of “≥ 8 Gb/s for S” is confirmed.
☐ B. Orion's reconciliation repairs drift such as rules missing after a component restart.
☐ C. TE gives BwE paths and split weights; BwE enforces budgets at hosts and reports prioritized demand to TE.
☐ D. A non-work-conserving 2:1 policy can leave capacity unused while one group still has unmet demand.
Show solution

(a) C = 6: 5s = 6 → s = 1.2 → (4.8, 1.2). C = 14: A caps at s = 2 (total 10); 8 + s = 14 → s = 6 → (8, 6). C = 20: B caps at 10 → (8, 10), 2 unused.
(b) Aggregate slope 5 until s = 2 (10 Gb/s): 5s = 9 → s = 1.8 → (7.2, 1.8).

Correct: B, C, D

  • A ✘ — Offered = delivered = 2 says nothing about 8 Gb/s availability.
  • B ✔ — Desired vs observed state, at every layer.
  • C ✔ — The TE ↔ BwE loop.
  • D ✔ — E.g., (8, 5.33) with 2.67 unused while Y wanted 6.
✍ iPadProblem M.7 — SWAN and TeaVaR (14 pts) calc
(a) Links U and L, 50 Gb/s each. F1: (U 30, L 10) → (U 10, L 30). F2: (U 10, L 30) → (U 30, L 10). Can the update happen in one step? Check a plan through the intermediate state F1 (20, 20), F2 (20, 20). What's SWAN's step bound with this 20% scratch? (b) F1 sends (4, 4, 2) and F2 sends (1, 3, 6) on links (L1, L2, L3); demands 10 each. Compute L(x, q) for “L1 down” and “L3 down”. (c) The only scenarios are none (0.90), L1 down (0.06), L3 down (0.04). VaR at β = 0.95 and at 0.99, and the rate per flow guaranteed in each case.
Show solution
(a) One step: U = max(30,10) + max(10,30) = 60 > 50 ✗. 0→1: U max(30,20) + max(10,20) = 50 ✓, L max(10,20) + max(30,20) = 50 ✓. 1→2: U max(20,10) + max(20,30) = 50 ✓, L 50 ✓. Valid 2-stage plan. Bound ⌈1/0.2⌉ − 1 = 4.
(b) L1 down: F1 4/10 = 0.4, F2 1/10 = 0.1 → 0.4. L3 down: F1 0.2, F2 0.6 → 0.6.
(c) CDF: 0 → 0.90, 0.4 → 0.96, 0.6 → 1.00. β = 0.95 → V = 0.4 → guarantee 10·0.6 = 6 Gb/s per flow. β = 0.99 → V = 0.6 → 4 Gb/s per flow.
✍ iPadProblem M.8 — Verification (14 pts) calcMCQ
S A B D primarybackup
S routes via A when S–A and A–D are up, otherwise via B. Requirement: DNS (UDP/53) from S reaches D under any single link failure. A's ACL: permit all. B's ACL (first match): r1 UDP → deny; r2 UDP/53 → permit; r3 default → permit.
  1. Write the verification query. Is it SAT or UNSAT? Give a witness if SAT.
  2. Fix the configuration and re-evaluate.
  3. How many failure scenarios are in scope, and how many pairwise clauses encode “≤ 1 failure”?
(d) To also require “DNS + other traffic on B–D ≤ 10 Gb/s”, which solver class do you need?
Show solution
(a) Allowed(e) [≤ 1 failure] ∧ M(config, h, e) ∧ h ∈ HUDP/53 ∧ ¬R(S, D, h, e). SAT: witness “S–A down (or A–D down), DNS packet, S→B selected, B's r1 denies”. r1 shadows r2.
(b) Swap r1 and r2 (or delete r1 if UDP needn't be blocked). Re-check: DNS is delivered in all 5 scenarios → UNSAT (holds within the model).
(c) 5 scenarios (none + 4 single failures); C(4,2) = 6 clauses.
(d) SMT (integer or linear arithmetic over rates); pure SAT is Boolean only.

11 · One-page formula and fact sheet (for printing, use the fuller EXAM2_CHEATSHEET.pdf instead)

── PCC (L9) ─────────────────────────────────────────────────────────────────────────────
Allegro   u = T·Sigmoid(L−0.05) − x·L,  T = x(1−L)       trials r(1±ε), ≥1 RTT each, wait 1 RTT
          pairs agree → move; disagree → stay, ε↑       STARTING(×2) → DECISION → ADJUSTING
Vivace    u = x^t − b·x·dRTT/dt − c·x·L      g ≈ (U₊−U₋)/(r₊−r₋)     Δr = θ·g (θ grows, Δr bounded)
fluid     dRTT/dt ≈ (x − C)/C     (slope, not magnitude)
PCC-β     U = g − β·q   (β = Mb/s traded per ms)   tie when β = Δg/Δq
BBR route change: min-RTT filter 10 s keeps old RTT → cwnd = 2·BW·RTT_old too small → rate = cwnd/RTT_new
                  → BW filter (10 rounds) drops → spiral until min-RTT expires
── QUIC (L10) ─────────────────────────────────────────────────────────────────────────────
response time (fresh): TCP+TLS1.3 = 3 RTT · QUIC = 2 RTT · QUIC 0-RTT = 1 RTT (needs state + server OK)
stream ID+offset = byte identity (same on resend) · packet number = transmission (new on resend)
loss: packet threshold (3 higher acked) · time threshold (9/8 RTT) · PTO = probe, doesn't declare loss
per-connection: CC, flow-control credit, crypto · per-stream: order/delivery · migration: CID + PATH_CHALLENGE
scheduler tables: t | ACKs | cwnd | sent → arrive = t + one-way delay
── TE (L11, L13) ──────────────────────────────────────────────────────────────────────────
MLU = max_e load_e/c_e      parallel disjoint paths: x_p = D·c_p/Σc,  MLU* = D/Σc
min ρ s.t. Σ_p x_kp = d_k ; Σ_{k,p∋e} x_kp ≤ ρ c_e ; x ≥ 0
mean latency = Σ x_p·lat_p / D          TE can't beat the cut: D > cut ⇒ admission / CC
staged move with headroom h: move ≤ h per step, alternate, confirm each
── MPLS / SDN (L12) ───────────────────────────────────────────────────────────────────────
MPLS shim 32 b = label 20 | Exp/TC 3 | S 1 | TTL 8  · push / swap / pop · labels local per router
CSPF: prune (bw, colors) → shortest path → install; sequential trunks are order-dependent
survive f of k parallel links: reserve D/(k−f) per link (total D·k/(k−f))
flow table: match · action (fwd/drop/modify/to-controller) · priority · counters
── Meta (L12–14, HW Q5) ───────────────────────────────────────────────────────────────────
CBB (external) / EBB (internal) · 4 planes, own controllers · sFlow 1-in-N sampling → DC×DC×class matrix
estimate = samples × N × avg size × 8 / interval  · Open/R: Spark, LinkMonitor, KvStore (eventual), Decision, FIB
classes ICP > Gold (shortest RTT + burst margin) > Silver > Bronze (K-shortest + min MLU)
strict priority + buffer carving · entitlements + host rate limits
HPRR: one LSP at a time; accept iff maxutil(new route, after) < maxutil(current route, before)
      w_e = exp[α(u′_e/u* − 1)], route cost = Σ w_e (penalizes hops); stuck states need swaps
label stack depth 3 → Binding SID continuation · version bit: install v1 everywhere, all ACK, then flip src
hose: E_i, I_j (2n numbers) vs pipe n(n−1)  ·  max i→j ≤ min(E_i, I_j)
── Google (L14–16, HW Q4) ─────────────────────────────────────────────────────────────────
intent (what) > policy (preference) > configuration (exact state) · lifecycle: interpret, check+plan, fulfill, assure, respond
Orion per domain (BGP between) · NIB pub-sub · reconcile desired↓ observed↑ · request→resolve→realize→report
B(s): slope = weight, flat = cap · pick s with Σ B_i(s) = C · freeze at bottleneck/cap · aggregate: add heights
B4: cheapest path first, spill on fill, freeze; quantize splits (K units); fix overload greedily
BwE: host (HTB) → job → cluster → global; usage ↑ budgets ↓ · waste from stale budgets = Δrate × interval
dSDN: 52% of 41 largest outages control-related; TE on every router, in-band, ingress source-routes
── Microsoft (L16–17) ─────────────────────────────────────────────────────────────────────
SWAN: interactive then background (iterative LP ≈ water-fill); edge-only config; static core labels
congestion-free: Σ_f max(x_f(i), x_f(i+1)) ≤ c_e  · scratch s ⇒ ≤ ⌈1/s⌉−1 steps · spare rule entries for tunnel changes
TeaVaR: P(q) = Π P(link state); flow loss = unmet/demand; L(x,q) = max over flows; V = β-percentile;
        min V(x); guarantee = allocation × (1−V*) β of the time · k-failure: n links of c → (n−k)·c
OneWAN: agg routers (full BGP, choose egress) / backbone (MPLS) · steer: latency filter → max-flow weights
        prune trunks < 500 Mb/s (2.5% traffic → 5× rows, 7× vars) · CLP/GLOP 5×
── Verification (L18) ─────────────────────────────────────────────────────────────────────
N(u,v,h,e) = sel ∧ up ∧ permit · hit_i = match_i ∧ ¬(earlier) · R_k backward from D, k ≤ diameter
query Allowed ∧ M ∧ ¬P → SAT = counterexample; UNSAT = holds in model only
≤1 of n links down: C(n,2) pairwise clauses (up_a ∨ up_b) · scenarios Σ_{i≤k} C(n,i)
SAT (Boolean) vs SMT (+integers, bit-vectors) · Minesweeper: config compiler, stable routing states
── Units ───────────────────────────────────────────────────────────────────────────────────
1 B = 8 b · 1 MB = 10⁶ B · Gb/s × s = Gb → ÷8 = GB · delay = bits/rate · BDP = rate × RTT

Built from the course slides, transcripts, HW2 and its model answers, and your Quiz 1. Good luck. You've got this.