Octet

What changed between HTTP/1.1, HTTP/2 and HTTP/3?

Show the answer

Say this first

HTTP/1.1 is text over TCP with persistent connections, but one request at a time per connection, so browsers open about six connections per host. HTTP/2 keeps TCP but switches to binary frames and multiplexes many streams over one connection, with HPACK header compression; one lost TCP segment still stalls every stream. HTTP/3 runs over QUIC on UDP 443, with streams that are independent at the transport layer, TLS 1.3 built in and QPACK compression.

Go deeper

Side by side

HTTP/1.1HTTP/2HTTP/3
TransportTCPTCPQUIC over UDP
FormatTextBinary framesBinary frames
Requests per connectionOne at a time (pipelining unused)Many concurrent streamsMany concurrent streams
Header compressionNoneHPACKQPACK
EncryptionOptional (HTTPS)Browsers require TLSAlways TLS 1.3
Lost packet blocksThat connectionAll streams on the connectionOnly the affected stream
Setup round trips with TLS 1.32 (TCP + TLS)2 (TCP + TLS)1, or 0 on resumption

How the client chooses

  • HTTP/2: ALPN in the TLS handshake. The client offers h2,http/1.1 and the server picks.
  • HTTP/3: the server advertises it, either with an Alt-Svc: h3=":443" response header or a DNS HTTPS record. The browser then tries QUIC and falls back to TCP if UDP 443 is blocked.

RFCs

HTTP semantics RFC 9110, HTTP/1.1 RFC 9112, HTTP/2 RFC 9113 (originally 7540), HTTP/3 RFC 9114, QUIC RFC 9000.

Traps

  • Saying HTTP/2 needs TLS by specification. The spec allows cleartext h2c; browsers only use h2 over TLS.
  • Saying HTTP/3 uses TCP 443.