FullStack AI Hub
Studio
lesson depth
Mastery
not started · 0%

HTTP/3 & QUIC Protocol

UDP-based QUIC transport, zero-RTT handshakes, and head-of-line blocking elimination.

Freshness: current•15 min read•Software and Web Engineering

Key Learning Outcomes

  • ✓Understand QUIC connection migration and 0-RTT handshakes
  • ✓Eliminate TCP head-of-line blocking in high-latency networks
Isometric Diagram LabNetworking & Security · 6 steps · 11 min

TCP Congestion Control vs. QUIC 0-RTT

Simulate packet loss to compare TCP head-of-line blocking against independent QUIC stream multiplexing.

Open Isometric Walkthrough
Full Technical Reference Document

Mental model

Even though HTTP/2 multiplexes dozens of parallel JS, image, and SSE streams over a single TCP connection, TCP itself forces strict byte-order delivery across the entire socket—so losing one single TCP packet stalls every multiplexed HTTP/2 stream concurrently (TCP Head-of-Line Blocking). HTTP/3 (RFC 9114) solves this at the transport layer by replacing TCP + separate TLS completely with QUIC over UDP, embedding mandatory TLS 1.3 directly inside independent encrypted UDP streams, supporting seamless IP Connection Migration as phones switch Wi-Fi to 5G, and offering 1-RTT / 0-RTT fast connection resumption while negotiating graceful fallback cleanly through Alt-Svc headers.

Client Discovers Alt-Svc h3=443
QUIC 1-RTT/0-RTT TLS 1.3 Handshake
Independent UDP Streams Multiplexed
Packet Loss Isolates Single Stream Only
Connection ID Migrates Across Wi-Fi/5G
Conceptual teaching model synthesized from:rfc9114-http3,mdn-http-headers

Theory

HTTP/3 moves reliability, congestion control, and encryption out of OS kernel TCP directly into userspace QUIC libraries (quiche, ngtcp2, lsquic) running above UDP port 443:

Transport FeatureHTTP/1.1 Over TCPHTTP/2 Over TCP + TLS 1.3HTTP/3 Over QUIC (UDP + Integrated TLS 1.3)
Transport Head-of-Line (HoL) BlockingBlocked per connection (requires 6 TCP sockets)Still present! 1 lost TCP packet pauses all parallel HTTP/2 streamsEliminated across streams (packet loss affects only the owning QUIC stream!)
Connection + TLS Setup RTTs1 RTT TCP + 1 RTT TLS 1.3 (2 RTTs)1 RTT TCP + 1 RTT TLS 1.3 (2 RTTs)1 RTT cold; 0 RTT warm resumption (data sent in packet 1!)
Network Switching (Wi-Fi -> Cellular)Drops connection immediately (bound to SrcIP:Port 4-tuple)Drops connection immediately (2 RTT reconnect stall)Seamless Connection Migration via 64-bit cryptographic Connection ID (CID)
Header CompressionPlaintext uncompressed headersHPACK (relies on ordered TCP framing)QPACK (tolerates out-of-order UDP frames without header deadlock)

0-RTT Replay Constraints, UDP Kernel Offloads (GSO/GRO), and Alt-Svc Discovery

Wait—0-RTT early data carries a subtle security catch: because an attacker on the network path can capture and replay a client's very first 0-RTT UDP datagram prior to server nonce freshness checks completing, never allow non-idempotent state mutations (POST /payments, POST /transfer, DELETE) inside 0-RTT early data! Edge gateways (Nginx/Cloudflare/Envoy) either mark Early-Data: 1 (425 Too Early if unsafe) or restrict 0-RTT strictly to idempotent GET/HEAD requests. On the server-side hardware boundary, naive recvmsg()/sendmsg() UDP loops burn noticeably more CPU per gigabit than kernel-offloaded TCP unless Linux UDP GSO (Generic Segmentation Offload), UDP GRO (Generic Receive Offload), and SO_REUSEPORT + CID-aware eBPF L4 load balancing are active so QUIC packets survive multi-worker routing cleanly during mobile IP changes!

bash
# Edge Reverse Proxy advertisement notifying clients of HTTP/3 UDP endpoint cleanly:
# Header emitted on initial HTTP/2 TLS handshake:
# Alt-Svc: h3=":443"; ma=86400
​
# Verify HTTP/3 + QUIC negotiation directly via modern cURL (HTTP/3 builds)
curl --http3-only -I https://fullstackaihub.com
​
# Inspect QUIC ALPN negotiation + Alt-Svc fallback header on HTTP/2:
curl -sI --http2 https://fullstackaihub.com | grep -i "alt-svc"

Note too that ~3%–5% of strict corporate VPNs or hotel networks silently block outbound UDP port 443, which makes Happy Eyeballs (RFC 8305 / HTTP/3 race with TCP HTTP/2) mandatory: browsers race QUIC against HTTP/2 over TCP within tens of milliseconds so users behind blocked UDP firewalls fall back smoothly without hang delays.

Alternatives and trade-offs

  • HTTP/3 Over QUIC at Public CDN / Edge Gateway + HTTP/2 or HTTP/1.1 Internally: Captures dramatic mobile tail-latency improvements (15%–40% faster page loads on lossy 4G/5G cellular networks and zero dropped streams on commuter Wi-Fi->LTE handoffs) at the edge while keeping internal datacenter VPC microservice hops simple over HTTP/2/gRPC over TCP.
  • HTTP/2 Over TCP Only: Simpler kernel TCP stack, hardware NIC TSO/LRO offload already enabled everywhere, predictable firewalls, lower server CPU per Mbps—ideal when clients are strictly low-loss datacenter servers or desktop fiber connections.
  • WebTransport Over HTTP/3: Extends QUIC directly into browser JavaScript APIs with both reliable streams and unreliable QUIC datagrams (ideal for live browser game physics or ultra-low-latency audio/telemetry where old dropped packets shouldn't pause new frames!).

Failure modes and misconceptions

  1. Expecting HTTP/3 Speedups Inside Origin-to-DB or Clean Fiber LAN Links: Inside a lossless 0.2 ms datacenter network where packet loss approaches zero, TCP Head-of-Line blocking rarely occurs—while QUIC's userspace UDP encryption can actually consume more CPU than kernel-offloaded HTTP/2! Deploy HTTP/3 primarily on public edge PoPs facing consumer WAN/mobile users.
  2. Allowing POST / State-Mutating APIs Over 0-RTT Without 425 Too Early Guards: Unprotected 0-RTT routes are trivially vulnerable to packet-level network replay attacks before handshake nonce verification completes. Restrict 0-RTT strictly to idempotent GET/HEAD requests or reject mutated Early-Data: 1 headers with HTTP 425 Too Early.
  3. Naively Load-Balancing QUIC Across Multiple Edge Servers by SrcIP:Port Hash: Because QUIC clients migrate IPs cleanly (Wi-Fi -> 5G) mid-session, standard L4 source-IP hashing routes migrated packets to the wrong backend proxy node, breaking active downloads! Multi-node QUIC edges must embed server routing IDs inside QUIC Connection IDs (or use QUIC-aware L4 eBPF routers).
  4. Shipping Alt-Svc Over Unreachable Firewall UDP Port 443 Without Opening Host Firewalls: Advertising Alt-Svc: h3=":443" when VPS ufw/iptables or cloud Security Groups only allow TCP/443 causes clients to burn milliseconds attempting doomed QUIC handshakes on every fresh session! Open UDP/443 explicitly and verify curl --http3-only.
Reflect before revealing the guide

Decision scenario

Your AI learning platform serves global mobile learners commuting across flaky Wi-Fi and LTE cellular links while streaming interactive MDX/JS assets and long-lived chat/telemetry feeds from a Traefik/Cloudflare edge. Enable HTTP/3 (QUIC) strictly on the public edge gateway (UDP/443 + Alt-Svc: h3=":443"; ma=86400), enforce 425 Too Early protection rejecting non-idempotent POST/PATCH/DELETE calls in 0-RTT early data, keep Happy Eyeballs automatic HTTP/2 TCP fallback enabled for restrictive enterprise firewalls blocking UDP, enable Linux UDP GSO/GRO on self-managed QUIC hosts, and continue terminating edge-to-origin container hops internally over pooled HTTP/1.1 / HTTP/2 TCP.

Learning outcomes

  • Explain why HTTP/2 over TCP still suffers transport Head-of-Line blocking across parallel streams and how QUIC solves it over UDP.
  • Contrast QUIC 1-RTT cold handshakes, replay-constrained 0-RTT resumption (425 Too Early), and Connection ID IP migration.
  • Configure Alt-Svc negotiation, UDP/443 firewall rules, and automatic Happy Eyeballs fallback to HTTP/2.
  • Identify why HTTP/3 belongs at lossy public user edges rather than inside lossless datacenter backend meshes.

Trade-offs

HTTP/3 + QUIC delivers resilient mobile connection migration, 0-RTT/1-RTT startup, and isolated stream recovery on lossy wireless networks, at the cost of higher UDP userspace CPU unless offloaded via GSO/GRO, CID-aware edge routing, and strict 0-RTT anti-replay guards.

Prerequisites & Related Concepts (2)

Private notes

0 words
Recommended Free Track
Free · Verifiable Credential

FS-201Production LLM Engineer

Design an observable full-stack LLM product from capability validation through interfaces retrieval evaluation security and operations.

37 concepts~35h self-paced
Start Free Course
Weekly Engineering Dispatch

Get the weekly systems teardown

One technical note per week covering inference bottlenecks, retrieval harnesses, and commit-pinned teardowns.

Next