4.3.26 · D4Computer Networks

Exercises — HTTP - 3 — QUIC, UDP-based, why

3,907 words18 min readBack to topic

This page builds on the parent topic. Prerequisites you may want open: TCP — three-way handshake and reliability, UDP — connectionless transport, TLS 1.3 — handshake and 0-RTT, Head-of-line blocking.


Symbols we will use (defined before use)

Everything below only uses these terms plus plain arithmetic.


Level 1 — Recognition

L1.1

State which transport protocol sits directly below HTTP/3, and which protocol sits directly below that.

Recall Solution

Directly below HTTP/3 is QUIC. Directly below QUIC is UDP. The full stack is: HTTP/3 → QUIC → UDP → IP. Here IP (Internet Protocol, defined above) is the bottom network layer that actually routes packets between machines. TCP appears nowhere in this stack — that is the whole point.

L1.2

The mnemonic SHIM-E packs QUIC's advantages into five letters. List all five items, then identify which letter is not one of the four distinct wins over TCP and explain the overlap.

Recall Solution

The five letters expand to:

  • S — Setup faster (0/1-RTT),
  • H — HOL blocking gone (independent streams),
  • I — IP migration (Connection ID),
  • M — Multiplexing without TCP,
  • E — Encryption built-in (TLS 1.3 mandatory).

The four distinct wins over TCP are S, H, I, and E. M (Multiplexing) is the overlapping letter: multiplexing many streams is not a new capability QUIC invented — HTTP/2 already multiplexed streams over TCP. What QUIC adds is doing that multiplexing without TCP's single ordered stream, which is exactly what the H win (HOL blocking gone via independent streams) already describes. So M is really a restatement of H from a different angle, not a fifth independent benefit. SHIM-E keeps M only because it makes the word pronounceable.

L1.3

True or false: "HTTP/3 changes the meaning of a GET request."

Recall Solution

False. HTTP semantics (methods, headers, status codes) are identical to HTTP/2. Only the transport changed. Header compression differs — HTTP/2 uses HPACK and HTTP/3 uses QPACK (both defined above: same goal of shrinking repeated headers, but QPACK tolerates out-of-order arrival across QUIC streams) — yet a GET /index.html means exactly the same thing in both.


Level 2 — Application

L2.1

A mobile link has ms. Compute for (a) TCP + TLS 1.3, (b) fresh QUIC, (c) resumed QUIC (0-RTT). First derive where each RTT count comes from by counting round trips.

Recall Solution

Why 2 RTT for TCP + TLS 1.3? Count the round trips before you can send an HTTP byte:

  1. TCP three-way handshake (see TCP — three-way handshake and reliability): client sends SYN, server replies SYN-ACK, client sends ACK. The client can only send data after the SYN-ACK comes back — that is the client's packet out and the server's reply back = 1 full RTT of pure waiting.
  2. TLS 1.3 handshake (see TLS 1.3 — handshake and 0-RTT): on top of the now-open TCP connection, the client sends ClientHello, the server replies ServerHello + keys, and only after that reply arrives can the client send encrypted data = 1 more RTT.

So .

Why only 1 RTT for fresh QUIC? QUIC folds the transport handshake and the crypto handshake into the same first flight of packets. The client's first flight carries both "let's connect" and "here is my crypto"; the server's single reply answers both. So .

Why 0 RTT for resumed QUIC? On a repeat visit the client already remembers the server's crypto keys, so it can encrypt and attach the actual HTTP request to the very first packet. No round trip of pure waiting is needed: .

Now plug in ms:

  • (a) ms.
  • (b) ms.
  • (c) ms.

L2.2

On the same ms link, how much time does a returning QUIC visitor save versus TCP+TLS 1.3?

Recall Solution

Returning QUIC uses 0-RTT: ms. TCP+TLS1.3: ms. Saving ms.

L2.3

Given objects each carried in one packet, and per-packet loss . What is the probability that at least one packet is lost somewhere in the batch?

Recall Solution

Assumption (stated up front): packet losses are independent — one packet vanishing tells us nothing about whether any other vanishes. This is what lets us multiply per-packet survival probabilities; without independence the product would not be valid. The probability a single packet survives is . Because losses are independent, all surviving together has probability . So Why this formula? "At least one" is the complement of "none lost." Computing "none lost" is easy because independent survivals multiply; subtracting from is far simpler than summing all the "exactly--lost" cases.

L2.4 (multiple-loss edge case)

Same , . (a) What is the expected number of packets lost? (b) What is the probability that exactly two packets are lost?

Recall Solution

Assumption (stated up front): as in L2.3, losses are independent across packets, each lost with the same probability . This is exactly the setup that defines a binomial count, so the binomial coefficient and the factors are justified. The number of lost packets follows a binomial count: each of packets is lost independently with probability . (a) Expected losses. Expectation of a sum of independent indicators is the sum of their probabilities: So on average one packet is lost — which is exactly why the single-loss model in L3/L4 is the natural baseline, but note it is only the average, not a guarantee. (b) Exactly two lost. Choose which of the are lost ( ways), those lost (), the other survive (): So even though the average is one loss, there is roughly an chance of two losses — multiple losses are common, not exotic.


Level 3 — Analysis

L3.1

For the same batch of objects, exactly one packet is lost, and it happens to be the object at position (counting from ) in TCP's single ordered stream. In the worst case, how many later objects does that one loss block from being delivered under TCP/HTTP2, and how many under QUIC/HTTP3?

Figure (below): a side-by-side comparison. On the left, TCP is drawn as a single lane holding six numbered packets in strict order; packet 2 is coloured red and marked "LOST", and packets 3–6 behind it are coloured yellow and marked "wait" because they are blocked. On the right, QUIC is drawn as six separate horizontal lanes, one packet per lane; lane 2 is red ("lost -> only this delayed") while lanes 1, 3, 4, 5, 6 are green with arrows flowing all the way to the right ("flows"). The picture shows one broken lane freezing everyone under TCP versus only itself under QUIC.

Figure — HTTP - 3 — QUIC, UDP-based, why
Recall Solution

TCP: delivery is strictly in order, so every object arriving after the lost one is held back until the retransmission arrives. If the loss is at position , then objects are blocked — that is later objects blocked, plus object itself is late. Worst case is : up to later objects blocked. QUIC: each object rides its own stream, so a loss on stream blocks only stream . Exactly object is delayed. The other keep flowing. This is the visual meaning of "independent streams": one broken go-kart, not one frozen truck.

L3.2

Explain why HTTP/2 running over TCP still suffers head-of-line blocking even though HTTP/2 multiplexes streams at the application layer.

Recall Solution

HTTP/2 slices many logical streams into frames and interleaves them — that removes application-layer HOL blocking. But all those frames are poured into one TCP byte-stream. TCP promises byte-#500 is not delivered until bytes #1–#499 arrive. When a TCP segment is lost, TCP holds back all already-arrived later bytes — including frames belonging to other HTTP/2 streams — until the retransmission fills the gap. So the blocking moved down one layer, from HTTP into TCP, but did not disappear. QUIC solves it by giving each stream its own ordering inside the transport, so a gap in one stream never stalls another. See Head-of-line blocking.

L3.3 (multiple-loss impact)

Now suppose two packets are lost among the objects. Compare how the total number of delayed objects behaves under TCP versus QUIC, and explain why the gap between them widens with more losses.

Recall Solution

QUIC: each lost packet delays only its own stream. Two independent losses on two different streams delay exactly 2 objects; the other flow. The count of delayed objects equals the count of losses — it grows linearly and gently. TCP: everything is one ordered stream, so what matters is the earliest of the two losses. If the earlier loss sits at position , all objects are blocked = objects — the second loss adds essentially nothing, because the earliest gap already froze the tail. Worst case () still blocks . Why the gap widens: under QUIC, blocked-objects ≈ number-of-losses (linear, small). Under TCP, blocked-objects is governed by the position of the earliest loss, and with more losses the earliest one tends to sit further forward, freezing an even larger tail. More losses barely hurt QUIC but push TCP toward its worst case — so on lossy links (high , many losses) the advantage of independent streams grows.


Level 4 — Synthesis

L4.1

A user loads a page of objects over a ms, mobile link. Build a rough end-to-end story: (a) setup time saved by fresh QUIC over TCP+TLS1.3, and (b) the expected number of blocked objects under each protocol using the parent's toy model (assume exactly one loss occurs, uniformly placed).

Recall Solution

(a) Setup. ms; ms. Saving ms. (b) Blocked objects. With one loss placed uniformly at position :

  • TCP: blocked-later count is . Averaging over :
  • QUIC: exactly the lost stream is delayed, so . The story: the fresh-connection setup win is a fixed ms, but the HOL win scales with the page — on average TCP stalls ~ objects behind one loss while QUIC stalls one. On rich, lossy pages the HOL win dominates.

L4.2

Same link ( ms). A returning visitor uses QUIC 0-RTT. Define a single "combined saving" number and compute it: take the setup latency saved plus the extra latency avoided from HOL blocking, where a blocked object costs one extra retransmission round trip () to unblock. Assume one uniformly-placed loss and use the L4.1 average blocked counts.

Recall Solution

Define combined saving , converting blocked objects into time via "each average blocked object waits one extra for the retransmission."

Setup saving. ms; ms. Setup saved ms.

HOL time. Under the toy model a stalled batch waits one retransmission to unblock, and the number stalled differs: TCP averages objects behind the gap, QUIC just . Because in TCP those objects all wait behind the same single retransmission, the extra wall-clock delay is ms for TCP versus ms for QUIC — the same one retransmission RTT. So in this simplest model the HOL wall-clock time saving is ms even though fewer objects are stalled: QUIC's win here is how many objects are held, not the length of the single retransmission wait.

Combined saving (wall-clock ms) ms, plus a throughput/experience win of fewer objects stalled that this ms-only number deliberately does not capture.

The honest answer: the clean combined time saving is ms (all from setup); the HOL benefit shows up as fewer blocked objects, which improves perceived load even when the single retransmission RTT is shared. Report both — a single ms figure alone understates QUIC.


Level 5 — Mastery

L5.1

A skeptic says: "If QUIC wanted its own transport, they should have registered a new IP protocol number like TCP (6) and UDP (17), not tunneled inside UDP — tunneling is a hack." Defend QUIC's choice of UDP with two concrete reasons and one consequence.

Recall Solution

Reason 1 — deployability. Middleboxes (NATs, firewalls) routinely drop packets with unknown IP protocol numbers. A brand-new protocol number would be silently blackholed across much of the internet, so it could never be deployed. UDP is already universally permitted (it carries DNS), so QUIC packets pass everywhere. Reason 2 — evolvability. TCP lives in the OS kernel and is fossilized by middleboxes that inspect and rewrite its headers. QUIC lives in user space and encrypts almost its entire packet, so browsers/servers can ship transport upgrades like ordinary software and middleboxes cannot peek or meddle. Consequence: UDP only provides ports + a checksum, so QUIC must rebuild reliability, ordering, flow control, and congestion control itself (see Congestion control — slow start, AIMD). That is a cost, but it is a cost paid in user-space code that can evolve — exactly the point.

L5.2

Your video call keeps running when you walk out of Wi-Fi range and switch to 4G — your IP address changes mid-call. Explain precisely why a plain TCP connection would have died, and what QUIC feature saves it.

Recall Solution

A TCP connection is identified by the 4-tuple (source IP, source port, destination IP, destination port). When Wi-Fi → 4G changes your source IP, the tuple no longer matches, so the OS treats packets as belonging to no known connection — the TCP connection dies and must be rebuilt (new handshake, new TLS). QUIC instead tags the connection with a Connection ID that is independent of IP and port. When your IP changes, the server still recognizes the same Connection ID and the connection migrates without interruption — no new handshake, no dropped call.

L5.3

Critique this claim rigorously: "Because QUIC runs on UDP and UDP is unreliable, HTTP/3 can lose data silently."

Recall Solution

The claim confuses layers. UDP indeed offers no retransmission — it is the dumb "delivery truck." But QUIC adds, on top of UDP, its own packet numbers, acknowledgements, and retransmission logic. If a QUIC packet is lost, QUIC detects the missing ACK and resends the data on the affected stream. From the application's view, HTTP/3 delivers every byte reliably and in per-stream order — as reliably as TCP, and without TCP's cross-stream HOL blocking. So HTTP/3 is fully reliable; the unreliability lives only in the UDP carrier beneath QUIC's reliability machinery.


Recall Quick self-quiz reveal lines

Transport directly under HTTP/3 ::: QUIC (which runs over UDP). for fresh QUIC in RTTs ::: 1 RTT. for TCP+TLS1.3 in RTTs ::: 2 RTT (1 for TCP handshake + 1 for TLS 1.3). Probability of at least one loss among N packets, per-packet loss p (losses independent) ::: . Expected number of packets lost among N at loss p ::: . Probability of exactly k losses among N at loss p (independent) ::: . Average objects blocked by one uniformly-placed loss under TCP, N objects ::: . Objects blocked by one loss under QUIC ::: exactly 1. Header compression format in HTTP/2 vs HTTP/3 ::: HPACK vs QPACK (QPACK tolerates out-of-order streams). QUIC feature that survives Wi-Fi→4G ::: the Connection ID (connection migration).


Connections

  • HTTP-2 — multiplexing and HPACK
  • TCP — three-way handshake and reliability
  • UDP — connectionless transport
  • TLS 1.3 — handshake and 0-RTT
  • Head-of-line blocking
  • Congestion control — slow start, AIMD
  • Middlebox ossification and protocol evolution

Flashcards

What transport protocol does HTTP/3 run on?
QUIC, which itself runs over UDP.
Why 2 RTT for TCP + TLS 1.3 setup?
1 RTT for the TCP three-way handshake plus 1 RTT for the TLS 1.3 handshake.
Why only 1 RTT for fresh QUIC?
QUIC folds the transport and crypto handshakes into one flight.
Expected packets lost among N at loss probability p?
.
What is HPACK and what is QPACK?
HPACK is HTTP/2's header-compression format (assumes ordered delivery); QPACK is HTTP/3's, redesigned to tolerate out-of-order arrival across QUIC streams.