Chapter 33 of 48

HTTP/2, HTTP/3 & QUIC

A modern web page is not one file. It is an HTML document plus dozens of CSS files, scripts, images and API calls. In the HTTP & HTTPS chapter you saw a quick summary: HTTP/2 adds multiplexing and header compression, and HTTP/3 runs over QUIC instead of TCP. In this chapter we look at why these versions were created and how they actually work.

The important thing to understand first is that HTTP/2 and HTTP/3 did not change what HTTP means. Methods (GET, POST), status codes (200, 404), headers and URLs are exactly the same. What changed is how those messages are carried over the network.

HTTP/2 → Same HTTP, but sent as binary frames, with many requests multiplexed over one TCP connection.

QUIC → A new transport protocol built on top of UDP, with reliability, streams and encryption built in.

HTTP/3 → Same HTTP, carried over QUIC instead of TCP.


The Problems with HTTP/1.1

HTTP/1.1 is a text protocol, and on one connection it handles requests one after another: the next response cannot start until the previous one has finished.

One HTTP/1.1 connection:

  GET /style.css   ->  [ wait for the whole style.css ]
  GET /app.js      ->                                   [ wait for app.js ]
  GET /logo.png    ->                                                       [ ... ]

This causes several problems:

  • Head-of-line (HOL) blocking at the HTTP level: one slow response blocks every request queued behind it on that connection. (HTTP/1.1 pipelining was meant to help, but it was so unreliable that browsers do not use it.)

  • Many connections: to get parallelism, browsers open around 6 TCP connections per host. Each one needs its own TCP and TLS handshake and its own slow start.

  • Repeated, uncompressed headers: every request resends long text headers such as User-Agent and Cookie, often hundreds of bytes, even though they hardly change.

Web developers invented workarounds: combining many files into one (bundling), merging small images into one "sprite", and spreading files over several domain names (domain sharding) to get more connections. HTTP/2 was designed to make these hacks unnecessary.


What Is HTTP/2?

HTTP/2 was standardised in 2015 (RFC 7540) and updated in 2022 (RFC 9113). It grew out of Google's experimental SPDY protocol. Its key ideas are:

  1. Binary framing instead of plain text

  2. Multiplexing: many requests and responses in parallel over one TCP connection

  3. Header compression with HPACK

  4. Flow control per stream and per connection

In practice, browsers use HTTP/2 only over TLS (HTTPS). The client and server agree to use it during the TLS handshake using ALPN (Application-Layer Protocol Negotiation), where HTTP/2 is identified by the string h2.


Frames, Streams and Messages

HTTP/2 introduces three terms:

  • Frame: the smallest unit sent on the connection. Every frame starts with a 9-byte header.

  • Stream: one request/response exchange, identified by a stream ID. Many streams share one connection.

  • Message: a complete HTTP request or response, made of one or more frames (a HEADERS frame and usually DATA frames).

+-----------------------------------------------+
|                 Length (24 bits)              |
+---------------+---------------+---------------+
| Type (8 bits) | Flags (8 bits)|
+-+-------------+---------------+-------------------------------+
|R|                 Stream Identifier (31 bits)                 |
+-+-------------------------------------------------------------+
|                   Frame Payload (Length bytes)                |
+---------------------------------------------------------------+

So the frame header is 24 + 8 + 8 + 1 + 31 = 72 bits = 9 bytes. By default a frame payload can be at most 16,384 bytes (214); a receiver can allow up to 224 − 1 bytes using a setting.

Frame Type

Code

Purpose

DATA

0x0

Carries the request or response body

HEADERS

0x1

Carries compressed headers; opens a stream

RST_STREAM

0x3

Cancels one stream without closing the connection

SETTINGS

0x4

Connection parameters (max frame size, initial window, ...)

PUSH_PROMISE

0x5

Server push (now effectively obsolete, see below)

PING

0x6

Measures RTT and checks the connection is alive

GOAWAY

0x7

Graceful shutdown of the whole connection

WINDOW_UPDATE

0x8

Flow control: "you may send this many more bytes"

CONTINUATION

0x9

Continues a header block that did not fit in one frame

Stream IDs follow simple rules:

  • Streams opened by the client use odd numbers: 1, 3, 5, ...

  • Streams opened by the server use even numbers.

  • Stream 0 means "the connection itself" and is used for SETTINGS, PING, GOAWAY and connection-level WINDOW_UPDATE.

  • Stream IDs only increase and are never reused on the same connection.


Multiplexing

Because every frame carries its stream ID, frames from different streams can be interleaved on the same connection, and the receiver puts them back together by stream ID.

One TCP connection, three requests in parallel:

  -> HEADERS(1)  HEADERS(3)  HEADERS(5)                 (requests)
  <- HEADERS(3) DATA(3) HEADERS(1) DATA(1) DATA(3) DATA(5) DATA(1) ...
       \______ frames from streams 1, 3 and 5 mixed together ______/

A slow response on stream 1 no longer blocks streams 3 and 5 at the HTTP level. One connection is enough for a whole site, so the browser needs only one TCP handshake, one TLS handshake and one congestion window that grows to a useful size.

Worked example: a page needs 1 HTML file and then 10 small images from the same server. RTT = 50 ms. Ignore TLS, transmission time and server processing time.

HTTP/1.1, one persistent connection, no pipelining:
  TCP handshake          1 RTT
  HTML request           1 RTT
  10 images, one by one 10 RTT
  Total                 12 RTT = 12 x 50 = 600 ms

HTTP/2, one connection:
  TCP handshake          1 RTT
  HTML request           1 RTT
  10 images multiplexed  1 RTT (all 10 requests sent together)
  Total                  3 RTT =  3 x 50 = 150 ms

Real pages also spend time transmitting bytes, so the actual gain is smaller, but the idea of saving round trips is exactly why HTTP/2 helps.


HPACK Header Compression

HTTP/2 headers are compressed with HPACK (RFC 7541). It uses three tricks:

  1. Static table: 61 common header entries known to both sides in advance. For example, entry 2 is :method: GET, so the whole header can be sent as a single byte, 0x82.

  2. Dynamic table: headers sent earlier on the connection (for example, a long Cookie or User-Agent) are remembered, and later requests refer to them by index instead of resending them.

  3. Huffman coding: literal strings are encoded with a fixed Huffman code that gives common characters shorter bit patterns.

HTTP/2 also replaces the HTTP/1.1 request line with pseudo-headers that start with a colon, and header names must be lowercase:

HTTP/1.1 (text)                 HTTP/2 (before HPACK compression)
GET /index.html HTTP/1.1        :method: GET
Host: example.com               :scheme: https
                                :authority: example.com
                                :path: /index.html

Why not just use gzip on the headers? An earlier approach that used general compression (in SPDY) was vulnerable to the CRIME attack, where an attacker could guess secret cookie values by watching the compressed size. HPACK was designed to be resistant to this kind of attack.


Flow Control, Priorities and Server Push

Flow Control

HTTP/2 has its own flow control, separate from TCP's, at two levels: per stream and for the whole connection. Each starts at a window of 65,535 bytes, and the receiver opens it with WINDOW_UPDATE frames. This stops one big download from using all the buffer space and starving other streams. Only DATA frames are flow-controlled.

Priorities

The original HTTP/2 had a complex dependency-tree priority scheme that few servers implemented well. RFC 9113 deprecated it. Today, clients can use the simpler Extensible Priorities scheme (RFC 9218), which works for both HTTP/2 and HTTP/3. It sends a Priority header such as u=1, i, where urgency u is 0 (most urgent) to 7, with a default of 3.

Server Push

HTTP/2 allowed a server to push files (for example, a CSS file) before the browser asked. In practice it often pushed files the browser already had in its cache, wasting bandwidth. Chrome removed it in version 106 (2022) and Firefox turned it off in version 132 (2024). The recommended replacements are the 103 Early Hints status code and <link rel="preload">, which tell the browser what to fetch while still letting it check its cache.


Encoding HTTP/2 Frame Headers in Python

This program encodes and decodes the 9-byte frame header for a few typical frames. Flags 0x1 means END_STREAM (or ACK for SETTINGS), and 0x4 means END_HEADERS, so 0x5 is both.

import struct

FRAME_TYPES = {0x0: "DATA", 0x1: "HEADERS", 0x3: "RST_STREAM", 0x4: "SETTINGS",
               0x6: "PING", 0x7: "GOAWAY", 0x8: "WINDOW_UPDATE"}

def encode_frame_header(length, ftype, flags, stream_id):
    # 24-bit length | 8-bit type | 8-bit flags | 1 reserved bit + 31-bit stream id
    return struct.pack("!I", length)[1:] + struct.pack("!BBI", ftype, flags,
                                                       stream_id & 0x7FFFFFFF)

def decode_frame_header(h):
    length = int.from_bytes(h[0:3], "big")
    ftype, flags = h[3], h[4]
    stream_id = int.from_bytes(h[5:9], "big") & 0x7FFFFFFF  # drop reserved bit
    return length, FRAME_TYPES.get(ftype, hex(ftype)), flags, stream_id

frames = [
    (0,     0x4, 0x1, 0),   # SETTINGS with ACK flag, on stream 0 (connection)
    (14,    0x1, 0x5, 1),   # HEADERS, END_STREAM|END_HEADERS, stream 1
    (16384, 0x0, 0x0, 3),   # DATA, maximum default frame size, stream 3
    (8,     0x0, 0x1, 3),   # last DATA frame of stream 3 (END_STREAM)
]
for f in frames:
    raw = encode_frame_header(*f)
    length, name, flags, sid = decode_frame_header(raw)
    print(f"{raw.hex(' ')}  ->  {name:<8} len={length:<5} flags=0x{flags:02x} stream={sid}")

Output:

00 00 00 04 01 00 00 00 00  ->  SETTINGS len=0     flags=0x01 stream=0
00 00 0e 01 05 00 00 00 01  ->  HEADERS  len=14    flags=0x05 stream=1
00 40 00 00 00 00 00 00 03  ->  DATA     len=16384 flags=0x00 stream=3
00 00 08 00 01 00 00 00 03  ->  DATA     len=8     flags=0x01 stream=3

Look at the third line: 00 40 00 is the 24-bit length 0x004000 = 16,384, the default maximum payload. The SETTINGS frame with the ACK flag has length 0 and uses stream 0 because it is about the connection, not a request. The 0x7FFFFFFF mask drops the reserved bit so only the 31-bit stream ID is used.


The Problem HTTP/2 Could Not Fix: TCP Head-of-Line Blocking

HTTP/2 removed head-of-line blocking at the HTTP level, but it still runs over TCP, and TCP is one ordered stream of bytes. TCP knows nothing about HTTP/2 streams.

If one TCP segment is lost, TCP holds back all data that arrived after it until the lost segment is retransmitted, even data belonging to completely different HTTP/2 streams.

TCP byte stream:  [A1] [B1] [C1] [A2] [B2] [C2]
                         X lost
Receiver has A1, C1, A2, B2, C2 ... but TCP may only hand A1 to HTTP/2.
Streams A and C are stuck waiting for B1, although their own data has arrived.

On a clean network this rarely matters. On a lossy mobile or Wi-Fi network, a single lost packet stalls every request on the connection, and HTTP/2 can even perform worse than HTTP/1.1 with 6 connections (where a loss stalls only one of them).

The simulation below makes this concrete. Three streams send 2 packets each, one packet every 10 ms with 50 ms one-way delay. Packet B1 is lost, and its retransmission arrives at 160 ms.

# Three streams (A, B, C) of 2 packets each, sent interleaved, one every 10 ms.
# One-way delay is 50 ms. Packet B1 is lost; its retransmission arrives at 160 ms.
order = ["A1", "B1", "C1", "A2", "B2", "C2"]
arrival = {pkt: 50 + 10 * i for i, pkt in enumerate(order)}
arrival["B1"] = 160                       # lost, then retransmitted

def tcp_delivery():
    # TCP is ONE ordered byte stream: a packet is handed to the app only
    # after every earlier packet in the stream has arrived.
    delivered, latest = {}, 0
    for pkt in order:
        latest = max(latest, arrival[pkt])
        delivered[pkt] = latest
    return delivered

def quic_delivery():
    # QUIC orders data per stream: only earlier packets of the SAME stream matter.
    delivered, latest = {}, {}
    for pkt in order:
        s = pkt[0]
        latest[s] = max(latest.get(s, 0), arrival[pkt])
        delivered[pkt] = latest[s]
    return delivered

for name, d in [("HTTP/2 over TCP", tcp_delivery()), ("HTTP/3 over QUIC", quic_delivery())]:
    done = {s: max(t for p, t in d.items() if p[0] == s) for s in "ABC"}
    print(f"{name:<17} stream A: {done['A']} ms, B: {done['B']} ms, C: {done['C']} ms")

Output:

HTTP/2 over TCP   stream A: 160 ms, B: 160 ms, C: 160 ms
HTTP/3 over QUIC  stream A: 80 ms, B: 160 ms, C: 100 ms

Over TCP, all three streams finish at 160 ms because everything waits for B1. With per-stream ordering (which is what QUIC provides), only stream B waits; stream A finishes at 80 ms and stream C at 100 ms.

Fixing this needs a change in the transport layer, not in HTTP. That is what QUIC does.


What Is QUIC?

QUIC is a general-purpose, connection-oriented, encrypted transport protocol that runs on top of UDP. It started at Google and was standardised by the IETF in May 2021 as RFC 9000 (with RFC 9001 for its use of TLS and RFC 9002 for loss detection and congestion control). The name is not an acronym.

     HTTP/1.1 and HTTP/2                 HTTP/3
   +---------------------+       +---------------------+
   |   HTTP/1.1 or h2    |       |       HTTP/3        |
   +---------------------+       +---------------------+
   |         TLS         |       |  QUIC (includes     |
   +---------------------+       |  TLS 1.3, streams,  |
   |         TCP         |       |  reliability,       |
   +---------------------+       |  congestion control)|
   |         IP          |       +---------------------+
   +---------------------+       |         UDP         |
                                 +---------------------+
                                 |         IP          |
                                 +---------------------+

QUIC provides what TCP provides (reliable delivery, ordering, flow control, congestion control) plus several new things:

  • Independent streams: each stream is ordered on its own, so a lost packet only delays the streams whose data it carried. This removes transport-level HOL blocking.

  • Built-in encryption: QUIC always uses TLS 1.3 (you will study TLS versions in the SSL/TLS chapter). There is no unencrypted QUIC. Even parts of the packet header, such as the packet number, are protected.

  • Faster handshake: the transport handshake and the TLS handshake happen together, in 1 RTT, and repeat visits can send data in 0 RTT.

  • Connection migration: connections are identified by Connection IDs, not by the IP/port 4-tuple, so they can survive a change of network.

  • Better loss recovery: packet numbers are never reused. A retransmission goes in a new packet with a new number, so the sender always knows whether an ACK is for the original or the retransmission (TCP cannot always tell).


Why Build QUIC on UDP?

Why not just design a brand-new transport protocol next to TCP and UDP? Two practical reasons:

  1. Middleboxes. Firewalls and NAT devices across the Internet only understand TCP and UDP. Packets of a new IP protocol type would simply be dropped by many of them. UDP passes through almost everywhere.

  2. Speed of change. TCP is implemented inside the operating system kernel, so improving it means waiting years for every OS to update. QUIC runs in user space (inside the browser or server application), so it can be updated as fast as an app.

UDP only gives QUIC ports and a checksum. Everything else (handshake, ACKs, retransmission, congestion control) is done by QUIC itself. This is the "UDP itself is not reliable, but a protocol on top of it can be" idea from the TCP & UDP chapter.


Handshake Round Trips Compared

The biggest everyday win of QUIC is fewer round trips before the first response. Counting RTTs until the first byte of the HTTP response arrives (ignoring DNS and server time):

Setup

Transport

TLS

HTTP request/response

Total

HTTP over TCP (no TLS)

1 RTT

-

1 RTT

2 RTT

HTTPS over TCP + TLS 1.2

1 RTT

2 RTT

1 RTT

4 RTT

HTTPS over TCP + TLS 1.3

1 RTT

1 RTT

1 RTT

3 RTT

HTTP/3 over QUIC, first visit

1 RTT (combined)

1 RTT

2 RTT

HTTP/3 over QUIC, 0-RTT resumption

0 RTT (request sent with the first packet)

1 RTT

1 RTT

Worked example: a user in India opens a site whose server is far away, with RTT = 80 ms.

TCP + TLS 1.2 : 4 x 80 = 320 ms
TCP + TLS 1.3 : 3 x 80 = 240 ms
QUIC (new)    : 2 x 80 = 160 ms
QUIC (0-RTT)  : 1 x 80 =  80 ms

That is a saving of 80 ms on every new connection compared with TCP + TLS 1.3, and on high-latency mobile networks the difference is very noticeable.

A caution about 0-RTT: 0-RTT data can be replayed by an attacker who captures it and sends it again. So 0-RTT should only be used for safe, idempotent requests (such as a plain GET), never for something like "transfer money".


Connection Migration

A TCP connection is identified by its 4-tuple (source IP, source port, destination IP, destination port). If your phone moves from Wi-Fi to mobile data, your IP address changes and every TCP connection breaks; the app must reconnect and redo the handshakes.

QUIC identifies a connection by a Connection ID carried in each packet:

Wi-Fi:        192.168.1.5:50000  --[ConnID 7f3a...]-->  server
(walk out of the house, phone switches to 4G)
Mobile data:  100.64.20.9:41022  --[ConnID 7f3a...]-->  server
              -> same QUIC connection, server checks the new path and continues

The download or video call continues without a new handshake. The same feature also helps when a NAT device changes the client's port after a period of silence (NAT rebinding). To protect privacy, the client switches to a fresh Connection ID on the new path so observers cannot easily link the two paths.


A Peek Inside QUIC: Variable-Length Integers

QUIC encodes many numbers (stream IDs, lengths, frame types) as variable-length integers. The first two bits say how many bytes the number uses, so small numbers take less space:

First 2 bits

Total Length

Usable Bits

Maximum Value

00

1 byte

6

63

01

2 bytes

14

16,383

10

4 bytes

30

1,073,741,823

11

8 bytes

62

4,611,686,018,427,387,903

This program encodes and decodes the four example values given in RFC 9000:

def encode_varint(v):
    """QUIC variable-length integer (RFC 9000, section 16)."""
    if v < 2**6:
        return v.to_bytes(1, "big")                       # prefix 00
    if v < 2**14:
        return (v | 0x4000).to_bytes(2, "big")            # prefix 01
    if v < 2**30:
        return (v | 0x80000000).to_bytes(4, "big")        # prefix 10
    if v < 2**62:
        return (v | 0xC000000000000000).to_bytes(8, "big")  # prefix 11
    raise ValueError("too large for a QUIC varint")

def decode_varint(data):
    length = 1 << (data[0] >> 6)          # top 2 bits: 1, 2, 4 or 8 bytes
    value = data[0] & 0x3F                # remaining 6 bits of first byte
    for b in data[1:length]:
        value = (value << 8) | b
    return value, length

for v in [37, 15293, 494878333, 151288809941952652]:
    enc = encode_varint(v)
    dec, n = decode_varint(enc)
    print(f"{v:>20} -> {enc.hex():<16} ({n} byte{'s' if n > 1 else ''}) -> {dec}")

Output:

                  37 -> 25               (1 byte) -> 37
               15293 -> 7bbd             (2 bytes) -> 15293
           494878333 -> 9d7f3e7d         (4 bytes) -> 494878333
  151288809941952652 -> c2197c5eff14e88c (8 bytes) -> 151288809941952652

For example, 15293 needs more than 6 bits, so it uses 2 bytes: 15293 = 0x3bbd, and setting the prefix 01 in the top two bits gives 0x3bbd | 0x4000 = 0x7bbd. When decoding, the top two bits of 0x7b are 01, so the reader knows to read 2 bytes.


What Is HTTP/3?

HTTP/3 (RFC 9114, June 2022) is HTTP mapped onto QUIC. Each request/response uses its own QUIC stream, so the multiplexing that HTTP/2 did itself is now done by the transport.

Key points:

  • QPACK instead of HPACK: HPACK assumes headers arrive in exact order, which QUIC streams no longer guarantee across streams. QPACK (RFC 9204) is a version of the same idea (static table, dynamic table, Huffman coding) that avoids reintroducing head-of-line blocking.

  • Same HTTP semantics: pseudo-headers, methods and status codes are the same as HTTP/2.

  • Runs on UDP port 443, with ALPN identifier h3.

How Does a Browser Know a Site Supports HTTP/3?

A browser cannot just assume HTTP/3, because some networks block UDP. Two common ways it finds out:

  1. Alt-Svc header: the first visit uses HTTP/2 over TCP, and the server's response includes a header like the one below. Later connections then try HTTP/3.

  2. HTTPS DNS record (RFC 9460): the DNS answer itself can advertise alpn="h3", so even the first connection can use HTTP/3.

HTTP/2 200
alt-svc: h3=":443"; ma=86400

This means "HTTP/3 is available on UDP port 443 of this host; remember it for 86,400 seconds (1 day)". If QUIC packets are blocked, browsers quietly fall back to HTTP/2 or HTTP/1.1 over TCP.


HTTP/1.1 vs HTTP/2 vs HTTP/3

Feature

HTTP/1.1

HTTP/2

HTTP/3

Standard

RFC 9112 (originally 1997/1999)

RFC 9113 (originally RFC 7540, 2015)

RFC 9114 (2022)

Format

Text

Binary frames

Binary frames

Transport

TCP

TCP

QUIC over UDP

Encryption

Optional (TLS)

TLS in practice (browsers)

Always (TLS 1.3 built into QUIC)

Requests per connection at once

One at a time

Many (multiplexed)

Many (QUIC streams)

HTTP-level HOL blocking

Yes

No

No

Transport-level HOL blocking

Yes (per connection)

Yes (affects all streams)

No (only the affected stream waits)

Header compression

None

HPACK

QPACK

Handshake to first response (new connection, TLS 1.3)

3 RTT

3 RTT

2 RTT (1 RTT with 0-RTT)

Connection migration

No

No

Yes (Connection IDs)

Typical connections per host

About 6

1

1


Is HTTP/3 Always Better?

Not always. HTTP/3 is widely supported: all major browsers support it, big CDNs enable it, and in 2026 around 40% of websites advertise HTTP/3 support (W3Techs). But there are trade-offs:

  • UDP can be blocked or rate-limited by some corporate and campus networks, forcing a fallback to TCP.

  • Higher CPU cost: QUIC runs in user space and encrypts every packet, and operating systems have had decades to optimise TCP. Servers usually need more CPU per byte for QUIC.

  • Less benefit on fast, clean networks: with very little packet loss and low RTT, HTTP/2 and HTTP/3 perform similarly.

  • Harder to inspect: because almost everything is encrypted, network operators and firewalls see much less.

HTTP/3 helps most on mobile networks, lossy Wi-Fi and long-distance (high-RTT) connections, which is a large share of real-world users.

You can check which version a site uses in your browser's developer tools (Network tab, "Protocol" column shows http/1.1, h2 or h3), or with curl:

curl -sI --http2 https://example.com    # ask for HTTP/2
curl -sI --http3 https://example.com    # needs a curl build with HTTP/3 support

Common Mistakes

  • "HTTP/2 changed the HTTP methods and status codes." No. It changed only the wire format; the meaning of HTTP stays the same.

  • "HTTP/2 removed all head-of-line blocking." It removed HTTP-level HOL blocking, but TCP-level HOL blocking remains. Only QUIC removes it.

  • "HTTP/3 uses UDP, so it is unreliable." QUIC adds its own reliability, ordering, flow control and congestion control on top of UDP.

  • "QUIC is HTTP/3." QUIC is a transport protocol; HTTP/3 is one application that uses it. Other protocols (such as DNS over QUIC) also use QUIC.

  • "HTTP/3 can run without encryption." QUIC always uses TLS 1.3. There is no plaintext HTTP/3.

  • Recommending HTTP/2 Server Push today. Major browsers have removed it; use 103 Early Hints and preload instead.

  • Keeping HTTP/1.1 hacks on HTTP/2. Domain sharding defeats HTTP/2's single connection and can make things slower.


Interview Questions and Tips

Q: What is head-of-line blocking, and how do HTTP/2 and HTTP/3 deal with it?
When one delayed item blocks everything behind it. HTTP/2 removes it at the HTTP level by multiplexing streams over one connection, but a lost TCP segment still stalls all streams. HTTP/3 uses QUIC, where each stream is delivered independently, so a loss only delays the affected stream.

Q: Why is QUIC built on UDP instead of being a new protocol next to TCP?
Middleboxes only allow TCP and UDP through reliably, and building in user space over UDP allows fast deployment without kernel changes.

Q: How does QUIC save round trips?
It combines the transport and TLS 1.3 handshakes into one round trip, and supports 0-RTT resumption for returning clients.

Q: What happens to a QUIC connection when the client's IP changes?
It continues, because the connection is identified by Connection IDs instead of the IP/port 4-tuple.

Q: Why does HTTP/3 use QPACK instead of HPACK?
HPACK's dynamic table depends on headers being processed in strict order, which would bring back head-of-line blocking across QUIC streams.

Tip: a clean one-line answer that interviewers like: "HTTP/2 fixed head-of-line blocking in HTTP, HTTP/3 fixed it in the transport by moving from TCP to QUIC."

Conclusion

HTTP/2 keeps HTTP's meaning but sends it as binary frames over a single TCP connection, with multiplexed streams and HPACK header compression. Its remaining weakness is TCP head-of-line blocking.

QUIC is a new encrypted transport on top of UDP that provides independent streams, a combined 1-RTT handshake with TLS 1.3, 0-RTT resumption and connection migration.

HTTP/3 is HTTP carried over QUIC, using QPACK for headers.

The easiest way to remember them is:

HTTP/1.1 → Text, one request at a time per connection

HTTP/2 → Binary, multiplexed, one TCP connection (TCP HOL blocking remains)

HTTP/3 → HTTP over QUIC over UDP (no transport HOL blocking, faster handshakes)