HTTP/3, QUIC Streams, and Packet Loss Recovery

LESSON

HTTP Protocol and Content Delivery

015 25 min advanced

HTTP/3, QUIC Streams, and Packet Loss Recovery

The core idea: HTTP/3 keeps HTTP semantics but runs them over QUIC, moving stream multiplexing and loss recovery into a UDP-based transport so one lost packet does less HTTP-level damage while the connection becomes harder to observe and operate.

Core Insight

Return to the HTTP/2 product page. The browser uses one connection and opens streams for HTML, JavaScript, a large image, cart summary, and recommendations. At the HTTP layer, this is already better than HTTP/1.1: small responses do not have to wait for the large image response to finish.

Now put the user on a weak mobile network. A packet is lost. With HTTP/2 over TCP, the TCP receiver cannot deliver later bytes to the HTTP/2 layer until the missing byte range is recovered. Even if later bytes contain frames for the tiny cart stream, the HTTP/2 implementation cannot process them yet because TCP presents one ordered byte stream. HTTP/2 removed HTTP message head-of-line blocking, but TCP can still create transport-level head-of-line blocking.

HTTP/3 exists to change that lower layer. It maps HTTP semantics onto QUIC, a transport protocol built over UDP. QUIC has streams, packet numbers, acknowledgments, loss recovery, congestion control, connection IDs, and TLS built into the transport. Because QUIC understands streams itself, data received for one stream can be delivered even while lost data from another stream is being recovered.

The trade-off is loss resilience and faster connection setup versus operational visibility and deployment complexity. HTTP/3 can make lossy mobile and long-distance paths behave better. It can also make debugging harder because most transport details are encrypted, UDP paths are sometimes blocked or rate-limited, and edge infrastructure must understand QUIC rather than just TCP.

Same HTTP, New Transport

HTTP/3 does not mean new HTTP semantics. A GET is still a GET. Cache-Control, ETag, Range, Authorization, cookies, status codes, media types, and CORS rules still belong to HTTP. What changes is the transport mapping.

The stack shift looks like this:

HTTP/1.1: HTTP messages over TCP
HTTP/2:   HTTP frames and streams over TCP
HTTP/3:   HTTP frames and streams over QUIC over UDP

HTTP/2 gave HTTP its own streams, but those streams were carried inside one TCP byte stream. TCP is reliable and ordered. That is normally useful: the application sees bytes in the exact order they were sent. But when multiplexed HTTP streams share that one ordered byte stream, a missing TCP segment can hold back later bytes for unrelated HTTP streams.

QUIC keeps reliability, but it does not expose one ordered byte stream to HTTP. It exposes independent streams. Stream 5 can be missing bytes while stream 7 continues to deliver bytes that arrived. The transport still has shared congestion control and connection-level limits, but delivery to the HTTP layer is no longer forced through one ordered TCP queue.

This gives you three levels again, but the middle layer is different:

connection -> QUIC connection with TLS, packet numbers, congestion state
stream     -> ordered byte stream inside QUIC
HTTP/3     -> request and response frames mapped onto QUIC streams

The simple sentence is: HTTP/3 keeps the HTTP model, but makes the transport aware of streams.

Packets, Streams, and Loss

A QUIC packet carries one or more frames. Some frames carry stream data. Each packet has a packet number, and receivers acknowledge packet number ranges they have received. If the sender decides a packet was lost, it does not resend that same packet number. It retransmits the important information, such as stream data, in a new packet.

Suppose a product page has these streams:

stream 1: /product/42.html
stream 5: /images/hero.jpg
stream 7: /api/cart-summary

The sender puts data into packets:

packet 100: STREAM frame for stream 1, offset 0
packet 101: STREAM frame for stream 5, offset 0
packet 102: STREAM frame for stream 7, offset 0
packet 103: STREAM frame for stream 5, offset 12000

Now packet 101 is lost, but packets 102 and 103 arrive. With QUIC, the receiver can process stream 7 data from packet 102 and deliver the cart summary to HTTP/3. Stream 5 has a gap at offset 0, so the image stream waits for its missing bytes. The loss is still real, but it does not have to stop unrelated stream 7.

The rough recovery loop is:

receiver observes packets 100, 102, 103
-> receiver sends ACK ranges showing 101 is missing
-> sender marks packet 101 lost after loss-detection rules
-> sender sends the lost stream 5 data again in a later packet
-> stream 5 fills its gap and continues

There are still shared limits. A lossy path can reduce the connection's congestion window, slowing all streams. A lost packet carrying connection-level control information can affect the connection. Flow-control windows still exist. But HTTP/3 avoids the specific TCP problem where one missing byte sequence prevents delivery of later bytes for every stream.

That is the mental model to keep: QUIC does not make loss free. It changes the blast radius and the queue where loss is felt.

Connection Setup and Migration

QUIC also changes connection setup. TCP and TLS are separate layers in the classic HTTPS stack. A new connection often needs TCP handshake work and then TLS handshake work before HTTP can really begin. QUIC integrates TLS 1.3 into the transport handshake, reducing round trips for new secure connections.

In a simplified successful path:

client sends QUIC Initial with TLS ClientHello
server replies with QUIC Initial/Handshake packets and TLS data
keys become available
HTTP/3 streams can start after handshake progress

For returning clients, QUIC can support faster resumption. In some cases, clients can send early data, though that comes with replay-safety constraints. The detail to remember is not "always faster." The useful point is that transport and encryption are designed together rather than bolted together after TCP.

QUIC connection IDs also help with network changes. A phone can move from Wi-Fi to cellular and get a new IP address. A TCP connection is tied to the old address and port tuple, so it usually breaks. QUIC uses connection IDs so endpoints can recognize that packets still belong to the same QUIC connection even when the network path changes, subject to validation and implementation support.

For mobile users, this is not academic. The same page load or API session may survive path changes that would otherwise force a reconnect. That can reduce visible failures during network transitions. It also gives operators a new thing to inspect: connection migration, path validation, and whether middleboxes treat UDP traffic well.

Worked Path: Loss on a Mobile Product Page

Trace the product page under HTTP/3.

The browser reaches https://www.shop.test. During protocol negotiation and connection setup, it establishes a QUIC connection for HTTP/3. It opens streams:

stream 0/control: HTTP/3 control stream
stream 4: /product/42.html
stream 8: /assets/app.js
stream 12: /images/hero.jpg
stream 16: /api/cart-summary

The server sends data across packets:

packet 210: stream 4 HTML bytes
packet 211: stream 12 image bytes
packet 212: stream 16 cart JSON bytes
packet 213: stream 8 JavaScript bytes
packet 214: stream 12 more image bytes

The mobile path drops packet 211. The receiver still gets packet 212 and can deliver stream 16 data to HTTP/3. The cart summary can complete while the image stream waits for the missing image bytes to be retransmitted. The user sees the cart update quickly even though the image has a gap.

The receiver acknowledges what arrived:

ACK ranges: 210, 212-214

The sender's loss recovery sees packet 211 as missing and retransmits the image stream data in a new packet:

packet 220: retransmitted stream 12 image bytes for the missing offset

When packet 220 arrives, stream 12 fills its gap and the image continues. The important observation is that packet 220 does not have to unblock stream 16; stream 16 already completed.

Now compare that to HTTP/2 over TCP. If the missing TCP segment contained bytes before the cart stream's frames in the TCP byte stream, the receiver could not deliver the cart frames to HTTP/2 until TCP recovered the missing segment. QUIC changed where ordering is enforced: inside each stream, not across the whole connection's delivered byte stream.

What HTTP/3 Does Not Magically Fix

HTTP/3 is not "HTTP/2 but always faster." It changes constraints.

QUIC still uses congestion control. If the network is losing many packets, the connection may reduce its sending rate, and all streams can slow down. Independent streams reduce head-of-line delivery blocking, but they do not create infinite bandwidth.

QUIC still has flow control. A stream can be blocked by its stream window. The whole connection can be blocked by its connection window. A receiver that stops reading data can still create backpressure.

QUIC usually runs over UDP, and UDP paths can be uneven. Some corporate networks, mobile carriers, firewalls, or load balancers block or degrade UDP. Real deployments commonly keep HTTP/2 available as a fallback. Operationally, this means you need to know which clients are using HTTP/3, which are falling back, and why.

QUIC encrypts more transport metadata than TCP. That is good for privacy and protocol evolution, but it changes observability. Middleboxes and packet captures cannot inspect the same fields they might inspect for TCP. Debugging often moves to endpoint logs, QUIC-aware metrics, qlog traces, edge telemetry, and client-side measurements.

The deployment trade-off is:

better stream independence and setup behavior
-> more UDP and QUIC-aware edge requirements
-> less passive visibility from the network
-> need for explicit endpoint instrumentation

Operational Failure Modes

Failure: assuming HTTP/3 removes all head-of-line blocking. It removes TCP byte-stream head-of-line blocking between QUIC streams. It does not remove congestion control, flow-control stalls, server queues, application bottlenecks, or connection-level failures.

Failure: no fallback story. Some paths do not handle UDP well. Clients should be able to use HTTP/2 when HTTP/3 cannot be established, and operators should measure fallback rates rather than treating them as invisible.

Failure: debugging only from packet captures. QUIC encrypts most transport details. Teams need endpoint metrics: packet loss, smoothed RTT, PTO events, congestion window behavior, stream resets, connection close errors, migration attempts, and HTTP/3 status by client population.

Failure: ignoring connection IDs and migration. Mobile clients can change network paths. If edge routing, load balancing, or connection ID handling is wrong, migration can look like random request failure.

Failure: treating UDP as stateless and cheap. QUIC connections still have state: TLS keys, stream state, flow-control windows, congestion state, connection IDs, and anti-amplification limits. Edge capacity planning must account for that state.

Useful signals include negotiated protocol (h3 versus h2), HTTP/3 success and fallback rates, handshake time, RTT, packet loss, PTO count, stream reset reasons, connection close codes, migration success, UDP blocked rates, and user-visible latency by protocol. If HTTP/3 improves median latency but worsens a subset of networks, those signals should show it.

Connections

The HTTP/2 lesson showed how streams and frames remove HTTP/1.1 response-order blocking on a single connection. This lesson moves one layer down: QUIC makes the transport itself stream-aware so packet loss on one stream does not necessarily block delivery of another.

The next lesson covers HTTPS edge boundaries. That matters because HTTP/3 changes edge operations: ALPN advertises protocol support, TLS is integrated into QUIC, UDP must reach the edge, and fallback behavior becomes part of the secure delivery contract.

Close the lesson and reconstruct a lossy page load from memory: streams, packets, lost packet number, ACK ranges, retransmitted stream data, which stream waits, which stream continues, and which metric would prove the difference between HTTP/2-over-TCP blocking and QUIC stream independence.

Resources

Key Takeaways

PREVIOUS HTTP/2 Multiplexing, Flow Control, and HPACK NEXT HTTPS Edge Boundaries: TLS, SNI, ALPN, and HSTS