HTTPhttp/1.1http/2http/3comparisonquic

HTTP/1.1 vs HTTP/2 vs HTTP/3

Three versions with identical semantics and three different transports: sequential text over TCP, multiplexed frames over one TCP connection, and multiplexed streams over QUIC — each is the right choice for a different link and a different deployment.

ConceptualBrowserSimulated
▶ InteractiveInterview question
Progress

You have not marked these as done yet. Read on anyway if they feel familiar; come back to them if something here does not land.

The problem

A team is asked "should we enable HTTP/3?" for an internal API, a public website and a mobile app backend. The honest answer is different for each, because the versions differ in exactly the properties that depend on the link: setup cost, behaviour under loss, and what the infrastructure in between can carry.

What changed, and what did not

Methods, status codes, headers, caching, cookies — the semantics in HTTP: Requests, Responses, Headers and Status Codes — are the same across all three versions; an application handler cannot tell which one the client used unless it asks. What changed is the transport binding: how requests are framed, whether they share a connection, what a lost packet costs, and how many round trips it takes to start. Every row in the matrix below is a consequence of the transport choice, not of HTTP.

The three versions on the properties that differ
PropertyHTTP/1.1HTTP/2HTTP/3
TransportTCP (+ TLS on 443)TCP + TLS (browsers require TLS; ALPN h2)QUIC over UDP, TLS 1.3 built in
FramingText lines; Content-Length or chunkedBinary frames with stream idsBinary frames; one request per QUIC stream
MultiplexingNone: one request in flight per connection; ~6 connections per origin in browsersMany streams on one connectionMany streams on one connection
Cold setup to first requestTCP 1 RTT + TLS 1–2 RTTTCP 1 RTT + TLS 1–2 RTT1 RTT combined; 0-RTT resumption
Behaviour under packet lossA loss stalls one of ~6 connectionsA loss stalls every stream (TCP HoL)A loss stalls only the affected stream(s); shared congestion window
Header compressionNone (headers repeated in full)HPACKQPACK
Connection identityIP 4-tuple; breaks on network changeIP 4-tuple; breaks on network changeConnection ID; survives IP change (migration)
Prioritisation / pushClient ordering onlyRFC 9218 priorities; push deprecatedRFC 9218 priorities; no push
Kernel / infrastructureEverywhere; every proxy, LB and toolBroad; L4 balancers pin a client to one backendUserspace; needs UDP/443 open; fewer proxies and tools; higher CPU
Web usageLegacy and non-browser clientsMajority of browser page loadsLarge and growing minority, mostly via CDNs (numbers shift yearly)
Debuggabilitycurl, telnet, plain tcpdumpNeeds h2-aware tools; TLS keys to decryptNeeds QUIC-aware tools (qlog, Wireshark with keys)

The same page under one lost packet

Simulated

The rows that matter most in production are setup cost and loss behaviour, and both are easiest to see on one concrete case: a page needing six 30 kB assets from one origin, RTT 80 ms, and exactly one packet lost early in the transfer. The proportions below are an educational model — real outcomes depend on the congestion controller, the loss position, retransmission timers and whether the loss is detected by duplicate ACKs or a timeout — but the shape is what each transport guarantees.

HTTP/1.1 opens six connections, pays six handshakes (in parallel, so two RTTs of wall-clock, but six times the handshake CPU) and the loss stalls one asset while five proceed. HTTP/2 pays one handshake, then the loss stalls *all six* streams for at least one RTT while TCP retransmits, because every stream’s bytes sit behind the hole in one byte stream. HTTP/3 pays one combined round trip and the loss stalls only the stream whose data was in the lost packet — but every stream shares the congestion window, which shrinks on the loss, so the others slow rather than stop.

Six assets, RTT 80 ms, one packet lost (simulated proportions, not a measurement)
                    HTTP/1.1 (6 conns)     HTTP/2 (1 conn)        HTTP/3 (1 QUIC conn)
setup to 1st byte   160 ms (TCP+TLS1.3)    160 ms (TCP+TLS1.3)     80 ms (combined)
loss at ~200 ms     1 of 6 assets waits    all 6 streams wait      1 stream waits, 5 continue
                    ~80 ms for retransmit  ~80 ms for retransmit   (cwnd shrinks for all)
approx. finish      ~ 420 ms               ~ 400 ms                ~ 300 ms
handshake CPU       6×                     1×                      1× (+ userspace QUIC cost)
same case, no loss  ~ 340 ms               ~ 320 ms                ~ 240 ms

Choosing

The choice follows the link. Inside a data centre — sub-millisecond RTT, negligible loss, warm pooled connections — HTTP/1.1 with keep-alive is perfectly adequate and the easiest to debug, proxy and load-balance; HTTP/2 is worth it when the protocol on top wants streams (gRPC requires it) or when a client makes many concurrent small requests to one backend and pooling dozens of h1 connections is awkward. HTTP/3 buys nothing here that justifies its CPU and tooling cost.

Public websites get HTTP/2 from any modern server or CDN for free, and it is the default answer: one connection, compressed headers, no sharding hacks. HTTP/3 shines on lossy, high-latency, mobile last miles — 1 RTT setup, connection migration when the phone changes network, and loss that stalls one image instead of the whole page. The pragmatic deployment is a CDN or edge load balancer that terminates HTTP/3 and HTTP/2 from clients and speaks HTTP/1.1 or /2 to origins over warm connections, so the origin never runs a QUIC stack.

Two constraints override preference. Browsers only speak h2 and h3 over TLS, so a plaintext endpoint is HTTP/1.1 (or h2c for non-browser clients). And anything in the path must support the version: a load balancer that balances TCP connections undermines h2, a firewall that drops UDP/443 removes h3, and an old proxy that buffers whole responses turns any streaming design into a batch one. Measure with real clients on real networks; the win from h3 is a distribution, not a constant.

  • Internal, low-latency, reliable links: HTTP/1.1 keep-alive, or HTTP/2 when the protocol needs streams (gRPC).
  • Public web: HTTP/2 by default; enable HTTP/3 at the CDN/edge for mobile and long-haul users.
  • Mobile apps on cellular: HTTP/3 where the client library supports it and UDP is reachable; fallback to h2 must be automatic.
  • Never assume: check what the load balancer, the proxy and the client library actually negotiate (curl -v, --http3, DevTools Protocol column).

Key points

  • All three versions share HTTP semantics; they differ only in the transport binding — framing, multiplexing, setup cost, loss behaviour.
  • HTTP/1.1: one request per connection at a time, ~6 browser connections per origin, headers uncompressed, universal support.
  • HTTP/2: many streams on one TCP connection with HPACK; a lost segment stalls all streams; requires TLS in browsers; L4 balancers pin clients to one backend.
  • HTTP/3: streams over QUIC/UDP with TLS 1.3 built in; 1-RTT setup, per-stream loss recovery, connection migration; needs UDP/443, costs more CPU.
  • Internal reliable links: HTTP/1.1 or /2. Public web: HTTP/2 by default. Lossy mobile and long-haul: HTTP/3 at the edge.
  • The infrastructure in the path decides what actually gets negotiated; verify rather than assume.

Why does this exist?

Mechanisms are answers to constraints. Open each question before reading the answer.

▸Why keep three versions in service instead of retiring the old ones?

Because the older ones are simpler and universally supported: every proxy, tool and embedded device speaks HTTP/1.1, and h1 keep-alive over a clean link has no performance problem worth solving. Each version is an answer to a link condition the previous one handled badly.

▸Why does packet loss decide between HTTP/2 and HTTP/3?

It is the only property where the transports differ qualitatively: TCP’s in-order stream makes one loss cost every h2 stream a retransmission timeout, while QUIC confines it to the affected stream. On a clean link the difference is unobservable.

▸Why terminate HTTP/3 at the edge instead of at the origin?

The lossy, high-RTT segment is the last mile; the edge-to-origin path is a warm, low-loss backbone where h1/h2 pooling is cheaper and easier to operate. You buy the benefit where it exists and skip the cost where it does not.

HTTP/1.1 vs 2 vs 3

HTTP/1.1 vs HTTP/2 vs HTTP/3
What changed between the versions, and a toy page-load model to see when each one wins.
HTTP/1.1HTTP/2HTTP/3
TransportTCPTCPQUIC over UDP
MultiplexingNone — one request in flight per connection; browsers open ~6Many streams on one connection (binary frames)Many streams, each with its own loss recovery
Connection setup1 RTT TCP + 1 RTT TLS 1.3 (per connection)1 RTT TCP + 1 RTT TLS 1.31 RTT (TLS 1.3 built into QUIC); 0-RTT on resumption
Header compressionNone (text, repeated every request)HPACKQPACK
Under packet lossOne connection stalls, the others continueWhole connection stalls (transport HoL)Only the affected stream stalls
Encryption in browsersOptional (http:// allowed)Required in practice (browsers only do h2 over TLS)Required (QUIC is always encrypted)
Typical useSimple APIs, internal tools, curlMost sites today; gRPCCDNs, large sites, mobile and lossy networks
Network
Page
Simulated
HTTP/1.1141 ms · headers 5.9 KB
HTTP/2166 ms · headers 1.1 KB
HTTP/3fastest141 ms · headers 1.1 KB
setuprequest roundstransferloss stalls
HTTP/3 wins here. Few resources, little loss: HTTP/2 and HTTP/3 are close; HTTP/1.1 pays for two extra request rounds. HTTP/3 edges ahead with its 1-RTT setup.
Model: setup = handshake RTTs; request rounds = ⌈resources / connections⌉ × RTT; transfer = max(bytes / bandwidth, slow-start rounds × RTT); loss stalls = expected lost segments × RTT × the share of traffic a stall blocks (1/6 per HTTP/1.1 connection, all of HTTP/2, one stream in HTTP/3). Real pages also depend on priorities, caching and server push — treat the numbers as directions, not measurements.

How it fails

What the failure looks like from inside real software.
Reference · show
  • HTTP/3 enabled at the origin behind a load balancer that only forwards TCP: clients advertise h3 via Alt-Svc, try UDP, time out, fall back — slower than never offering it.
  • gRPC service behind an L4 balancer: every stream from one client lands on one pod; autoscaling adds pods that get no traffic.
  • Internal service migrated from h1 to h2 "for performance" with no measurable gain and a new dependency on h2-aware proxies and debugging tools.
  • Old proxy in the path downgrades everything to HTTP/1.1 with Connection: close; each request now pays a full handshake and nobody notices because the version column in DevTools shows the edge, not the origin.
  • Header bloat that HPACK hid reappears when a path uses HTTP/1.1: a 6 kB cookie exceeds a proxy’s header limit and returns 431.

Check yourself

Answer out loud or on paper first, then compare. These come from the interview questions linked to this lesson.

  1. What did HTTP/2 fix over HTTP/1.1, what problem did it leave behind, and how does HTTP/3 address it? When would you choose not to deploy HTTP/3?

    Show a strong answer

    HTTP/1.1: Persistent Connections and Their Limits serialises: one request in flight per connection (pipelining never worked in practice), so browsers open ~6 connections per host and sites resorted to domain sharding, sprites and inlining. Headers are repeated as text on every request — hundreds of bytes of cookies per image. HTTP/2 (HTTP/2: Streams on One Connection) keeps HTTP’s semantics and changes the wire: a binary framing layer, many streams multiplexed over one TCP connection, HPACK header compression with a shared dynamic table, stream priorities, and (rarely useful, since removed from Chrome) server push. One connection means one handshake, one slow start and one congestion window instead of six.

    What it leaves behind is everything below it. All streams share a single ordered TCP byte stream, so one lost packet stalls every stream until retransmission — HTTP/2 concentrates the loss that HTTP/1.1 spread across six connections (Head-of-Line Blocking). The connection still costs a TCP round trip plus one or two for TLS. It is bound to a four-tuple, so a phone moving from Wi-Fi to cellular loses every in-flight stream. And TCP is implemented in kernels and inspected by middleboxes, so changing it (new options, new loss recovery) takes years to reach users — the protocol has *ossified*.

    HTTP/3 (HTTP/3 and QUIC) runs over QUIC, a transport in user space over UDP with TLS 1.3 built in. Streams are the unit of loss recovery, so a lost packet blocks only the streams it carried — cross-stream HOL is gone, intra-stream HOL is not. The transport and crypto handshakes merge into one round trip, 0-RTT on resumption. Connections are identified by a connection ID rather than the four-tuple, so they survive an address change. Packet numbers never repeat, which makes loss detection unambiguous, and being in user space means Chrome or a CDN can ship a congestion-control change in weeks. Header compression becomes QPACK, redesigned so a lost header packet does not necessarily block other streams.

    When *not* to: when UDP is blocked or throttled — some corporate networks and ISPs do exactly that — so every deployment must keep a TCP fallback and discovery is via Alt-Svc or the HTTPS DNS record, meaning the *first* visit is still TCP. When server CPU per byte matters: user-space packet handling without the offloads TCP enjoys (segmentation, checksum, kTLS) costs measurably more CPU, though UDP GSO has narrowed the gap. When observability and tooling matter — L4 load balancers must route on connection ID rather than four-tuple, firewalls and packet captures see opaque UDP, and existing dashboards are TCP-shaped. And when the network is already good: inside a datacenter or on a wired LAN with ~0 loss and sub-millisecond RTT, the wins are near zero; the gains are at the tail on lossy, high-latency, mobile paths. gRPC between services stays on HTTP/2 for good reason.

    Full interview question, with follow-ups and red flags →
  2. What is head-of-line blocking? Where does it occur in TCP, in HTTP/1.1 and in HTTP/2, and what does HTTP/3 actually change about it?

    Show a strong answer

    It is a queueing pattern: a shared, ordered queue in which the first element cannot be delivered, so nothing behind it is either — even if those later elements are complete and unrelated. The question is always *what is the queue, what does "delivered" mean, and why must it be in order*. Networking has at least three instances stacked on top of each other, and each was introduced to fix the one above it.

    TCP. TCP promises an ordered byte stream. If segment 5 is lost and 6–20 arrive, the kernel keeps 6–20 in the receive buffer and gives the application nothing until 5 is retransmitted — at best one RTT later (fast retransmit after duplicate ACKs), at worst a retransmission timeout, which on Linux is at least 200 ms. The application sees a stall, not a loss. That is the price of in-order delivery, and it is paid by every byte behind the hole regardless of what those bytes mean. See Head-of-Line Blocking and Packet Loss: Duplicate ACKs, Fast Retransmit and the RTO.

    HTTP/1.1. One request is in flight per connection; pipelining was specified but browsers abandoned it because responses had to come back in order, so a slow first response blocked the rest — application-level HOL. Browsers work around it with ~6 parallel connections per host, which is why HTTP/1.1: Persistent Connections and Their Limits sites sharded domains. HTTP/2 multiplexes many streams over *one* TCP connection with framing, so a slow response no longer blocks the others at the HTTP layer — but now all streams share a single TCP byte stream, so one lost packet stalls every stream until it is retransmitted. Under a few percent of loss HTTP/2 over one connection can be *slower* than HTTP/1.1 over six, because the six connections lose independently. HTTP/2 moved HOL from the HTTP layer down to TCP and made the blast radius larger.

    HTTP/3. QUIC makes streams the unit of loss recovery: each stream has its own ordered byte space, so a lost packet blocks only the streams whose data it carried; the others keep delivering. That removes cross-stream HOL. It does not remove HOL *within* a stream — a lost packet in the middle of one large response still stalls the rest of that response — and QPACK header compression can reintroduce a small cross-stream dependency if a header block references a dynamic-table entry that has not arrived yet. The trade-off is that QUIC does all of this in user space over UDP: more CPU per byte, less hardware offload, and a fallback to TCP whenever UDP is blocked. See HTTP/3 and QUIC.

    Full interview question, with follow-ups and red flags →
  3. A browser visits your site for the first time. Which protocol does the first request use, and why?

    Show a strong answer

    TCP + HTTP/2 (or 1.1): the browser learns HTTP/3 is available from the Alt-Svc header or an HTTPS DNS record and switches on later requests; it also races or falls back to TCP if QUIC stalls.

    Full interview question, with follow-ups and red flags →