HTTP is the protocol behind almost every click, every API call and every app update. It exists today in three versions that are all in active use: HTTP/1.1 from 1997, HTTP/2 from 2015 and HTTP/3 from 2022. They share the same meaning – the same methods, status codes and headers – but they put very different bytes on the wire, and they behave very differently when the network is slow or loses packets.
This article explains the three versions with academic care and practical focus. It covers where each version came from and why it was created, how each one encodes the same request byte by byte, which problems each version solved and which new problems it introduced, how they compare in real page loads and on lossy mobile networks, and how to choose, configure and debug them. It builds on my article The OSI Model in Practice, but it can be read on its own.
1. One Protocol, Three Wire Formats
The most important idea for understanding HTTP versions is the difference between semantics and wire format. The semantics say what a message means: "get the resource /api/posts/42", "the resource was created", "this response may be cached for one hour". The wire format says how that meaning is turned into bytes that travel over the network.
Since June 2022, the IETF (Internet Engineering Task Force) describes HTTP exactly this way. One document, RFC 9110 "HTTP Semantics", defines the meaning for all versions. Separate documents define how each version maps that meaning to bytes:
| Document | Year | Content |
|---|---|---|
| RFC 9110 | 2022 | HTTP semantics: methods, status codes, header fields, content negotiation – valid for every version |
| RFC 9111 | 2022 | HTTP caching – valid for every version |
| RFC 9112 | 2022 | HTTP/1.1 message syntax: text messages over a TCP connection |
| RFC 9113 | 2022 | HTTP/2: binary frames and multiplexed streams over one TCP connection |
| RFC 9114 | 2022 | HTTP/3: frames on QUIC streams over UDP |
This structure has a practical consequence that many developers do not realise: an application does not need to change when the HTTP version changes. A GET is a GET, a 404 is a 404, a Cache-Control header has the same effect in all three versions. A Spring Boot controller, an Express route or a Django view returns the same response whether the client speaks HTTP/1.1, HTTP/2 or HTTP/3. The version is negotiated and handled by the web server, the proxy or the CDN (content delivery network) in front of the application.
What changes between the versions is everything that affects performance, efficiency and robustness: how many connections are needed, how many round trips pass before the first byte arrives, how much space the headers take, what happens when a packet is lost, and which attacks are possible. That is what this article is about.
1.1 The Layers Involved
The three versions sit on different stacks. The application layer is the same, but everything below it changes:
HTTP/1.1 HTTP/2 HTTP/3
Semantics RFC 9110 RFC 9110 RFC 9110
Wire format text messages binary frames binary frames
Header coding plain text HPACK QPACK
Multiplexing none streams (in HTTP/2) streams (in QUIC)
Security TLS (optional) TLS (in practice) TLS 1.3 (built in)
Transport TCP TCP QUIC over UDP
Network IP IP IP
The most radical change happens between HTTP/2 and HTTP/3: HTTP/3 is not an update of HTTP/2 but a mapping of the same ideas onto a completely different transport protocol, QUIC. To see why that was necessary, we have to follow the history.
2. A Short History: From a One-Line Protocol to QUIC
HTTP started as a very small protocol for one purpose: fetching hypertext documents at CERN, the European research centre for particle physics. Each new version answered the problems that the web of its time had created.
| Year | Event | Meaning |
|---|---|---|
| 1989 | Tim Berners-Lee proposes the World Wide Web at CERN | Hypertext documents linked across computers |
| 1991 | HTTP/0.9 | One line GET /page, only HTML, no headers, no status codes |
| 1996 | HTTP/1.0 (RFC 1945, informational) | Headers, status codes, methods POST and HEAD, any media type |
| 1997 | HTTP/1.1 (RFC 2068) | Persistent connections, Host header, chunked transfer, caching rules |
| 1999 | HTTP/1.1 revised (RFC 2616) | The reference version for 15 years |
| 2009 | Google announces SPDY | Experimental binary protocol with multiplexing and header compression |
| 2012 | IETF starts HTTP/2, using SPDY as the starting point | Standardisation of the SPDY ideas |
| 2012–2013 | Google develops and deploys QUIC | A new transport over UDP, first used between Chrome and Google services |
| 2014 | HTTP/1.1 rewritten (RFC 7230–7235) | Clarified, more precise specification |
| 2015 | HTTP/2 (RFC 7540) and HPACK (RFC 7541) | Binary framing, streams, header compression |
| 2016 | IETF QUIC working group is formed | Standardisation of QUIC as a general transport |
| 2018 | The name "HTTP/3" is agreed | HTTP over QUIC becomes its own version |
| 2021 | QUIC (RFC 9000, 9001, 9002) | Transport, TLS integration, loss detection and congestion control |
| 2022 | HTTP/3 (RFC 9114), QPACK (RFC 9204), RFC 9110–9113 | HTTP/3 standardised; all HTTP documents reorganised |
| 2023 | HTTP/2 "Rapid Reset" attack; HTTPS DNS records (RFC 9460) | Record DDoS attacks; DNS can announce HTTP/3 support |
| 2024 | HTTP/2 "CONTINUATION flood" vulnerabilities | Another class of resource-exhaustion attacks on HTTP/2 servers |
Three forces drove this evolution:
- Pages became applications. A web page of 1996 was one HTML document with a few images. A typical page today loads dozens of scripts, style sheets, fonts, images and API responses. HTTP/1.1 was not designed for that number of parallel requests.
- Latency, not bandwidth, became the limit. Connections became much faster, but the speed of light did not change. Every round trip (RTT, the time for a message to travel to the server and back) still costs tens or hundreds of milliseconds. The later versions mainly reduce the number of round trips.
- Mobile networks became the normal case. Phone networks have higher latency, more packet loss and frequent changes of IP address. HTTP/3 and QUIC were designed with exactly these conditions in mind.
HTTP/1.1 optimised for simplicity, HTTP/2 optimised for many parallel requests, and HTTP/3 optimised for unreliable networks.
3. What Never Changes: HTTP Semantics
Before comparing wire formats, it helps to list what all three versions share. RFC 9110 defines these elements once, and every version must preserve them exactly.
- Methods:
GET,HEAD,POST,PUT,DELETE,CONNECT,OPTIONS,TRACE(andPATCHfrom RFC 5789). Their properties are the same everywhere:GETis safe and idempotent,POSTis neither. - Status codes: the classes 1xx (informational), 2xx (success), 3xx (redirection), 4xx (client error) and 5xx (server error), with the same meaning in every version.
- Header fields:
Content-Type,Cache-Control,Authorization,Cookieand hundreds more. A header has the same effect in every version, but the versions encode it differently. - The request target: the resource is identified by a scheme (
https), an authority (blog.example.com) and a path (/api/posts/42). - Message body and trailers: content of any media type, optionally followed by trailer fields after the body.
- Intermediaries: proxies, gateways and caches, which may translate between versions. A CDN commonly speaks HTTP/3 with the browser and HTTP/1.1 or HTTP/2 with the origin server.
There are a few visible differences in how the versions represent these elements, which matter when you debug:
| Element | HTTP/1.1 | HTTP/2 and HTTP/3 |
|---|---|---|
| Method, path, scheme, authority | Request line and Host header | Pseudo-header fields :method, :path, :scheme, :authority |
| Status code | Status line HTTP/1.1 200 OK | Pseudo-header field :status: 200 (no reason phrase) |
| Header names | Case-insensitive, any case | Must be lowercase on the wire |
| Connection-specific headers | Connection, Keep-Alive, Transfer-Encoding, Upgrade | Forbidden; the framing layer handles these functions |
| End of the body | Content-Length or chunked transfer coding | A flag on the last frame of the stream |
Because the meaning is identical, a proxy can translate a message from one version to another without losing information. This is how the three versions coexist on the same Internet, and why you can enable HTTP/3 on your CDN without touching your application.
4. HTTP/1.1: Text over TCP
HTTP/1.1 (RFC 2068 in 1997, today RFC 9112) is the version every developer has seen. Its messages are human-readable text, which makes it easy to learn, to debug and to implement. It is still widely used: between proxies and origin servers, in internal services, in embedded devices and as the fallback for every client.
4.1 Message Format
A request consists of a request line, header fields, an empty line and an optional body. Each line ends with the two bytes carriage return and line feed (\r\n). This is the example request we use throughout the article:
GET /api/posts/42 HTTP/1.1
Host: blog.example.com
Accept: application/json
On the wire, this request is exactly 80 bytes: 28 for the request line, 24 for the Host line, 26 for the Accept line and 2 for the empty line. The response has the same structure, with a status line instead of the request line:
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 61
{"id":42,"title":"The OSI Model in Practice","comments":1280}
The receiver reads bytes until it finds the empty line, parses the header fields and then uses Content-Length to know how many bytes of body follow. Without this information, it could not know where one message ends and the next one begins, because TCP delivers a stream of bytes without any boundaries.
4.2 What HTTP/1.1 Added to HTTP/1.0
HTTP/1.0 opened a new TCP connection for every request and closed it after the response. With HTTP/1.1 came four changes that made the modern web possible:
- Persistent connections by default. A connection stays open for further requests unless one side sends
Connection: close. This saves the TCP handshake (and later the TLS handshake) for every request after the first. - The mandatory
Hostheader. The client must name the host it wants. This allows one IP address to serve many websites (virtual hosting), which is the basis of all shared hosting and CDNs. - Chunked transfer coding. A server can send a body in pieces of announced size (
Transfer-Encoding: chunked) when it does not know the total length in advance, for example for a response that is generated while it is sent. - Better caching and conditional requests.
Cache-Control,ETagandIf-None-Matchallow a client to check whether its cached copy is still valid and receive a small304 Not Modifiedinstead of the full resource.
4.3 Pipelining: The Idea That Did Not Work
HTTP/1.1 also introduced pipelining: a client may send several requests on one connection without waiting for the responses. The server must answer them in exactly the order in which they arrived. In theory this saves a round trip per request. In practice, it failed:
- If the first response is slow (for example, a database query), all following responses must wait behind it, even if they are ready. This is called head-of-line blocking.
- Many proxies and servers implemented pipelining incorrectly, which led to mixed-up or lost responses.
- If the connection breaks, the client cannot know which of the pipelined requests were processed.
For these reasons, all major browsers disabled pipelining by default. In practice, an HTTP/1.1 connection carries one request at a time: send a request, wait for the complete response, send the next request.
5. The Problems of HTTP/1.1
The one-request-at-a-time rule is the root of most HTTP/1.1 problems. A page that needs 80 resources needs 80 sequential request-response cycles per connection. The web worked around this for almost twenty years, and the workarounds show very clearly what HTTP/2 later had to solve.
5.1 Head-of-Line Blocking and the Six-Connection Limit
To load resources in parallel, browsers open several TCP connections to the same host, usually up to six. Each connection carries one request at a time, so at most six requests are in progress at once. A seventh request waits until one of the six connections is free.
This has three costs. Each additional connection needs its own TCP handshake and TLS handshake (one to three round trips). Each connection starts with TCP slow start (a small sending window that grows only over several round trips), so short-lived connections rarely reach full speed. And the six connections compete with each other for bandwidth instead of cooperating, because each one runs its own congestion control.
HTTP/1.1, one host, six connections, 18 resources, each taking one round trip:
connection 1 [res 1 ][res 7 ][res 13]
connection 2 [res 2 ][res 8 ][res 14]
connection 3 [res 3 ][res 9 ][res 15]
connection 4 [res 4 ][res 10][res 16]
connection 5 [res 5 ][res 11][res 17]
connection 6 [res 6 ][res 12][res 18]
| RTT | RTT | RTT | -> 3 round trips for 18 resources
5.2 The Workarounds
Web developers invented a whole set of techniques to live with these limits. Each one was rational under HTTP/1.1, and several became harmful under HTTP/2:
| Workaround | How it works | Problem it causes |
|---|---|---|
| Domain sharding | Spread resources over img1.example.com, img2.example.com to get six connections per host name | More DNS lookups and handshakes; works against HTTP/2 |
| Concatenation (bundling) | Combine many scripts or style sheets into one large file | A small change invalidates the whole cached bundle |
| Image sprites | Combine many small images into one image and show parts of it with CSS | Hard to maintain; the whole sprite must load |
| Inlining | Embed small images (as data URLs) or CSS directly in the HTML | Cannot be cached separately |
| Cookie-free domains | Serve static files from another domain so that cookies are not sent | Extra DNS lookup and connection |
5.3 Header Overhead
HTTP/1.1 sends all header fields as plain text with every request, even when they are identical to the previous request. A typical browser request carries 500 to 800 bytes of headers: User-Agent, Accept, Accept-Language, Accept-Encoding, cookies and more. Cookies alone can reach several kilobytes. For 80 requests, that is 40 to 60 KB of mostly repeated text in the upload direction. On mobile networks, where the upload is often slower than the download, this alone can delay a page noticeably.
5.4 Parsing Ambiguity and Request Smuggling
Text formats are easy to read but hard to parse identically. HTTP/1.1 allows the message length to be defined in two ways (Content-Length and Transfer-Encoding: chunked), tolerates different line endings and whitespace in some implementations, and allows header lines to be folded in old implementations. When a front-end proxy and a back-end server interpret the same byte stream differently, an attacker can hide a second request inside the body of the first. This is called HTTP request smuggling. It was first described publicly in 2005 and became widely known in 2019, when security researcher James Kettle showed practical attacks against major websites. The defence is strict parsing on every hop. RFC 9112 tightens the rules: a message that contains both Content-Length and Transfer-Encoding may be rejected; if it is processed, Transfer-Encoding wins and the connection must be closed afterwards. In practice, rejecting such messages is the safest choice.
5.5 What HTTP/1.1 Does Well
It would be wrong to see HTTP/1.1 only as a legacy protocol. Its simplicity is a real strength:
- It is easy to debug: you can read it in any packet capture and even type it by hand with
telnetornc. - It is cheap to implement: a minimal server fits on a microcontroller.
- It works with every proxy, firewall and load balancer in existence.
- For a few large requests (for example, file downloads or server-to-server API calls over a long-lived connection), its performance is close to HTTP/2.
This is why HTTP/1.1 remains the common language between components, and why a reverse proxy often speaks HTTP/2 or HTTP/3 to browsers but HTTP/1.1 to the application server behind it.
6. From SPDY to HTTP/2
By 2009, the limits of HTTP/1.1 were costing real money: studies at Google, Amazon and others showed that even small delays of a few hundred milliseconds measurably reduced user engagement and sales. In November 2009, Google announced SPDY (pronounced "speedy"), an experimental protocol that kept HTTP semantics but replaced the text format with binary frames. Google could test it at scale because it controlled both a major browser (Chrome) and major websites (Search, Gmail, YouTube).
SPDY introduced the four ideas that define HTTP/2 today:
- Multiplexing: many requests and responses travel at the same time over a single TCP connection, interleaved as small frames.
- Header compression: repeated header fields are not sent again in full.
- Prioritisation: the client tells the server which responses are most important.
- Server push: the server can send resources before the client asks for them.
In 2012, the IETF HTTP working group (called "httpbis") decided to use SPDY as the starting point for HTTP/2. The final standard, RFC 7540, and its header compression format HPACK, RFC 7541, were published in May 2015. Google then retired SPDY, and Chrome removed SPDY support in 2016. In 2022, RFC 9113 replaced RFC 7540 with a cleaner text; the most important change was that the original prioritisation scheme was deprecated (section 9.2).
The design goals of HTTP/2 were explicit: keep the semantics of HTTP/1.1 exactly, so that existing applications need no change; use one connection per origin instead of six; reduce latency by multiplexing; reduce overhead by compressing headers; and make the protocol efficient to parse by using a binary format with explicit lengths.
6.1 HTTP/2 and Encryption
The HTTP/2 standard allows two variants: h2 (HTTP/2 over TLS) and h2c (HTTP/2 over plain TCP, the "c" stands for cleartext). However, all major browsers decided to support HTTP/2 only over TLS. This was a deliberate policy decision to push the web towards encryption, and it also had a technical reason: middleboxes (devices in the network path such as proxies, firewalls and filters) often break unknown protocols on port 80, but cannot see inside TLS on port 443. As a result, HTTP/2 on the public web is practically always encrypted. h2c is still used inside data centres, for example by gRPC (a remote procedure call framework from Google that runs on HTTP/2) between services.
HTTP/2 over TLS requires TLS 1.2 or newer and forbids a list of weak cipher suites. The version is chosen during the TLS handshake with ALPN (Application-Layer Protocol Negotiation, RFC 7301): the client offers h2 and http/1.1, and the server picks one, without any extra round trip.
7. HTTP/2: Binary Framing and Streams
HTTP/2 inserts a framing layer between the HTTP semantics and TCP. Every message is split into frames, and every frame belongs to a stream. A stream is one request-response exchange; many streams share one TCP connection.
7.1 The Frame Header
Every HTTP/2 frame starts with the same 9-byte header:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-----------------------------------------------+---------------+
| Length (24 bits) | Type (8) |
+---------------+---------------+---------------+---------------+
| Flags (8) |R| Stream Identifier (31 bits) |
+---------------+-+---------------------------------------------+
| Frame Payload (Length bytes) ... |
- Length: the size of the payload. The default maximum is 16,384 bytes; the receiver can allow up to 16,777,215 with a setting.
- Type: what the frame contains (table below).
- Flags: type-specific bits, for example
END_STREAM(0x1: this is the last frame of the message) andEND_HEADERS(0x4: the header block is complete). - R: one reserved bit, always 0.
- Stream identifier: the stream the frame belongs to. Stream 0 is reserved for frames that concern the whole connection.
The explicit length is a major improvement over HTTP/1.1: a parser never has to search for line endings, it always knows exactly how many bytes to read next. This makes parsing faster and removes the length ambiguities of HTTP/1.1 within an HTTP/2 connection. (Smuggling can still appear when a proxy translates HTTP/2 into HTTP/1.1 for a back-end server, a variant described in 2021.)
7.2 Frame Types
| Type | Code | Purpose |
|---|---|---|
| DATA | 0x0 | Carries the message body |
| HEADERS | 0x1 | Opens a stream and carries a compressed header block |
| PRIORITY | 0x2 | Stream priority in the original scheme (deprecated) |
| RST_STREAM | 0x3 | Cancels one stream immediately, without closing the connection |
| SETTINGS | 0x4 | Connection parameters, sent at the start and acknowledged |
| PUSH_PROMISE | 0x5 | Announces a server push (section 9.3) |
| PING | 0x6 | Measures round-trip time and checks that the connection is alive |
| GOAWAY | 0x7 | Starts a graceful shutdown: no new streams above a given ID |
| WINDOW_UPDATE | 0x8 | Flow control: grants the sender more window (section 9.1) |
| CONTINUATION | 0x9 | Continues a header block that did not fit into one frame |
7.3 Starting a Connection
After TLS (with ALPN h2) is established, the client sends a fixed 24-byte connection preface, followed by a SETTINGS frame. The preface is designed so that an HTTP/1.1 server that receives it by mistake sees an invalid request and fails clearly:
PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n
0000 50 52 49 20 2a 20 48 54 54 50 2f 32 2e 30 0d 0a
0010 0d 0a 53 4d 0d 0a 0d 0a
A typical client SETTINGS frame that disables server push, allows 100 parallel streams and offers a 10 MB flow-control window per stream is 27 bytes long (9 bytes header, three settings of 6 bytes each):
0000 00 00 12 04 00 00 00 00 00 00 02 00 00 00 00 00
0010 03 00 00 00 64 00 04 00 a0 00 00
00 00 12 length 18
04 type SETTINGS
00 flags none
00 00 00 00 stream 0 (connection)
00 02 00000000 SETTINGS_ENABLE_PUSH = 0
00 03 00000064 SETTINGS_MAX_CONCURRENT_STREAMS = 100
00 04 00a00000 SETTINGS_INITIAL_WINDOW_SIZE = 10,485,760
The server sends its own SETTINGS frame, and each side acknowledges the other's settings with an empty SETTINGS frame that has the ACK flag set.
7.4 Streams and Multiplexing
A client opens a new stream by sending a HEADERS frame with a new stream ID. Client-initiated streams use odd numbers (1, 3, 5, ...), server-initiated streams (push) use even numbers. Stream IDs only grow; a connection that runs out of IDs must be replaced. Each stream goes through a small state machine: idle, open, half-closed (one side has finished sending) and closed.
Because frames of different streams can be interleaved, a slow response no longer blocks a fast one at the HTTP level:
HTTP/2, one connection, frames of three streams interleaved:
client -> server HEADERS(1) HEADERS(3) HEADERS(5)
server -> client HEADERS(3) DATA(3) HEADERS(1) DATA(1) DATA(3, END) DATA(1, END)
HEADERS(5) DATA(5, END)
stream 3 finishes first, although it was requested second
This single change removes the need for six connections, domain sharding, sprites and most bundling. One connection also means one TCP slow start, one congestion controller and one TLS handshake, so the connection reaches full speed sooner and shares bandwidth fairly with other traffic.
8. HPACK: Header Compression for HTTP/2
SPDY originally compressed headers with the general-purpose DEFLATE algorithm. In 2012, the CRIME attack showed that this was dangerous: when secret data (such as a cookie) and attacker-controlled data (such as a URL) are compressed together, the attacker can guess the secret byte by byte by observing how the compressed size changes. HTTP/2 therefore uses its own, purpose-built format, HPACK (RFC 7541), which avoids this weakness by design.
8.1 How HPACK Works
HPACK replaces repeated header fields with small index numbers. It uses three tools:
- A static table of 61 common header fields, defined in the standard. For example, index 2 is
:method: GET, index 7 is:scheme: https, index 8 is:status: 200, index 19 is the nameacceptand index 58 is the nameuser-agent. - A dynamic table that both sides build during the connection. When a field is sent as a "literal with incremental indexing", both encoder and decoder add it to their dynamic table, and later requests can refer to it with a single byte. The default size is 4,096 bytes.
- Huffman coding for literal strings: a fixed code table assigns shorter bit sequences to frequent characters, which typically saves 20 to 30 percent on text such as URLs. Huffman coding is optional for each string.
Because the dynamic table only contains whole header fields and matches must be exact, an attacker cannot learn a secret by guessing it one character at a time. In addition, an encoder can mark sensitive fields such as Authorization or Cookie as "never indexed", so that they never enter the dynamic table at all.
8.2 Our Request in HPACK, Byte by Byte
Here is our example request (GET https://blog.example.com/api/posts/42 with accept: application/json) as an HPACK header block. For readability, the strings are not Huffman-coded; a browser would make them 20 to 30 percent shorter.
0000 82 87 44 0d 2f 61 70 69 2f 70 6f 73 74 73 2f 34
0010 32 41 10 62 6c 6f 67 2e 65 78 61 6d 70 6c 65 2e
0020 63 6f 6d 53 10 61 70 70 6c 69 63 61 74 69 6f 6e
0030 2f 6a 73 6f 6e
| Bytes | Meaning |
|---|---|
82 | Indexed field, static index 2: :method: GET (1 byte) |
87 | Indexed field, static index 7: :scheme: https (1 byte) |
44 0d + 13 bytes | Literal with incremental indexing, name from static index 4 (:path), value /api/posts/42 |
41 10 + 16 bytes | Literal with incremental indexing, name from static index 1 (:authority), value blog.example.com |
53 10 + 16 bytes | Literal with incremental indexing, name from static index 19 (accept), value application/json |
The header block is 53 bytes. Wrapped in a HEADERS frame with the flags END_STREAM and END_HEADERS (0x05) on stream 1, it becomes a 62-byte frame:
00 00 35 01 05 00 00 00 01 + 53 bytes header block
00 00 35 length 53
01 type HEADERS
05 flags END_STREAM | END_HEADERS (a GET has no body)
00 00 00 01 stream 1
8.3 The Second Request Shows the Real Gain
The first request is only slightly smaller than HTTP/1.1 (62 instead of 80 bytes). The real gain comes with the next request on the same connection. After the first request, the dynamic table contains three new entries: :path: /api/posts/42, :authority: blog.example.com and accept: application/json. A request for /api/posts/43 now looks like this:
0000 82 87 44 0d 2f 61 70 69 2f 70 6f 73 74 73 2f 34
0010 33 c0 bf
82 :method: GET (static index 2)
87 :scheme: https (static index 7)
44 0d ... :path: /api/posts/43 (new literal, added to the dynamic table)
c0 :authority: blog.example.com (dynamic index 64)
bf accept: application/json (dynamic index 63)
The new :path entry is added first and takes the newest position (index 62), so the two older entries move to 63 and 64. The whole header block is now 19 bytes, a 28-byte frame, compared with 80 bytes in HTTP/1.1. With a real browser request of 600 bytes of headers, including a long cookie, the difference is even larger: after the first request, a repeated request often needs only 20 to 40 bytes of headers.
The response is compressed the same way. :status: 200 is the single byte 88 (static index 8), and a response that repeats the same content-type as the previous one costs one byte for that field as well.
8.4 The Cost: Shared State
HPACK has one structural weakness that becomes important later. The dynamic table is shared state that both sides must update in exactly the same order. The decoder must process header blocks in the order in which the encoder produced them. Over TCP this is automatic, because TCP delivers bytes in order. But it means that header blocks can never be decoded out of order, which is why HTTP/3 needed a different design (section 12).
9. Flow Control, Prioritisation and Server Push
Multiplexing many streams over one connection raises new questions: how to stop one large download from consuming all memory, which response to send first when many are ready, and whether the server can send resources the client has not asked for yet.
9.1 Flow Control
HTTP/2 has its own flow control, on two levels: per stream and per connection. Each receiver announces a window (65,535 bytes by default, adjustable with SETTINGS) and the sender may not send more DATA bytes than the window allows. As the receiver consumes data, it sends WINDOW_UPDATE frames to open the window again. This lets a client, for example, pause a large video download in a background tab without blocking the page's other streams. Flow control in HTTP/2 applies only to DATA frames; header frames are not flow-controlled.
Note the duplication: TCP has its own flow control underneath. HTTP/2 flow control is needed because TCP sees only one byte stream and cannot distinguish between streams.
9.2 Prioritisation
When thirty responses are ready at the same time, the order matters: the CSS that blocks rendering should come before an image at the bottom of the page. RFC 7540 defined a complex dependency tree: each stream could depend on another stream and have a weight from 1 to 256. In practice, this scheme failed. Browsers built very different trees, many servers ignored the signals or implemented them incorrectly, and CDNs found it hard to apply the tree across many connections.
RFC 9113 (2022) therefore deprecated the tree, and RFC 9218, "Extensible Prioritization Scheme for HTTP", replaced it with a simple model that works for both HTTP/2 and HTTP/3. A client sends a Priority header (or a PRIORITY_UPDATE frame) with two parameters:
priority: u=1, i
u = urgency from 0 (highest) to 7 (lowest), default 3
i = incremental: the response is useful in parts (for example a progressive image)
9.3 Server Push: A Promising Idea That Failed
Server push allows the server to send a resource before the client requests it. When the browser asks for index.html, the server can send a PUSH_PROMISE frame ("I will send you /style.css on stream 2") and then the CSS itself, saving one round trip. In theory this was one of the biggest benefits of HTTP/2. In practice, it rarely helped:
- The server does not know what the browser already has in its cache, so it often pushed resources that were not needed, wasting bandwidth.
- Pushed resources competed with the resources the browser actually requested.
- Correct configuration was difficult, and measured benefits were small or negative.
Chrome removed support for server push in 2022, and Firefox disabled it by default in 2024. The recommended replacement is the 103 Early Hints status code (RFC 8297): the server sends an informational response with Link: </style.css>; rel=preload headers while it is still preparing the main response. The browser decides itself whether to fetch the resource, based on its cache. HTTP/3 also defines server push, but browsers do not support it either.
10. The Problems of HTTP/2
HTTP/2 solved head-of-line blocking at the HTTP level and made the web faster on most connections. But it kept TCP as its transport, and that decision moved the problem one layer down. It also introduced new attack surfaces through its complexity.
10.1 TCP Head-of-Line Blocking
TCP guarantees that bytes arrive in order. If one TCP segment is lost, the receiving TCP stack holds back all data that arrives after it until the lost segment has been retransmitted, at least one round trip later. TCP does not know that the bytes after the gap belong to other HTTP/2 streams that do not depend on the lost data.
One lost TCP segment on an HTTP/2 connection:
segments sent [s1: stream 1][s2: stream 3][s3: stream 5][s4: stream 3]
network LOST
received [s1] [ gap ] [s3] [s4]
delivered s1 -- wait for retransmission of s2 (>= 1 RTT) --
then s2, s3, s4 together
streams 5 and 3 wait, although their data (s3, s4) has already arrived
With six HTTP/1.1 connections, a lost packet blocks only one of six connections. With one HTTP/2 connection, a lost packet blocks everything. On a clean network, this rarely matters. On a mobile or Wi-Fi network with 1 to 2 percent packet loss, HTTP/2 can be slower than HTTP/1.1. This was the main motivation for HTTP/3.
10.2 Handshake Latency
HTTP/2 does not reduce the setup cost of a connection. Before the first request, the client still needs a TCP handshake (one round trip) and a TLS handshake (one round trip with TLS 1.3, two with TLS 1.2). On a mobile connection with 100 ms RTT, that is 200 to 300 ms before the first byte of the request is sent.
10.3 Connection Changes
A TCP connection is bound to the IP addresses and ports of both ends. When a phone moves from Wi-Fi to the mobile network, its IP address changes and every TCP connection breaks. The HTTP/2 connection, with its dynamic HPACK table and all open streams, must be rebuilt from the beginning.
10.4 Resource Exhaustion Attacks
HTTP/2 gives a client many cheap ways to make the server do work: open streams, cancel them, send tiny frames, send many settings. Several serious vulnerabilities came from this:
- HPACK bomb (2016): a small header block that expands to a very large header list in the decoder's memory.
- Rapid Reset (CVE-2023-44487, October 2023): the attacker opens a stream and cancels it immediately with RST_STREAM, thousands of times per second. The stream never counts against the limit of concurrent streams, but the server has already started to process each request. Google reported a peak of 398 million requests per second, by far the largest DDoS attack it had seen at the time. Almost every HTTP/2 implementation needed a patch.
- CONTINUATION flood (April 2024): the attacker sends an endless sequence of CONTINUATION frames without ever ending the header block. Many servers buffered all of it in memory or spent CPU time decoding it, and some crashed.
The defences are limits everywhere: on the number of resets per time window, on header block size, on CONTINUATION frames, on settings changes and on PING frequency. A modern HTTP/2 server must enforce all of them.
10.5 Complexity and Middleboxes
HTTP/2 is much harder to implement correctly than HTTP/1.1. Flow control with two levels, priority trees, HPACK state and stream state machines all interact. Many bugs in proxies and servers came from these interactions. And because HTTP/2 needs TLS in practice, network operators lost the ability to inspect or optimise HTTP traffic, which some saw as a benefit (privacy) and others as a loss (troubleshooting, caching proxies).
10.6 Summary: HTTP/2 Solved One Problem and Exposed Another
| Problem | HTTP/1.1 | HTTP/2 |
|---|---|---|
| One request at a time per connection | Yes | Solved: streams |
| Six connections per host | Yes | Solved: one connection |
| Repeated headers | Yes | Solved: HPACK |
| Head-of-line blocking at HTTP level | Yes | Solved |
| Head-of-line blocking at TCP level | Limited to one of six connections | Affects all streams |
| Handshake round trips | 2–3 | 2–3 |
| Survives an IP address change | No | No |
11. QUIC: A New Transport on UDP
The problems in section 10 have one thing in common: they come from TCP, not from HTTP. Changing TCP itself was practically impossible. TCP is implemented in the kernels of billions of devices, which update slowly, and countless firewalls, NAT devices (network address translation, as in every home router) and load balancers inspect and sometimes modify TCP headers. A new TCP option often does not survive the path through the Internet. This effect is called protocol ossification: the network has "learned" what TCP looks like and breaks anything different.
Google's answer, first developed in 2012 and deployed between Chrome and Google services from 2013, was QUIC: a new transport protocol that runs on top of UDP. UDP passes through almost every network, because DNS, video calls and games depend on it. By building on UDP, QUIC can be deployed without any change to kernels or network devices, and because QUIC runs in user space (inside the browser or the server application), it can be updated as quickly as any other software.
The IETF formed a QUIC working group in 2016 and turned Google's protocol into a general standard. The IETF version differs considerably from Google's original (often called "gQUIC"); most notably, it uses standard TLS 1.3 for its handshake. QUIC version 1 was published in May 2021 as RFC 9000 (transport), RFC 9001 (TLS integration) and RFC 9002 (loss detection and congestion control).
11.1 What QUIC Provides
QUIC combines the functions of TCP, TLS and part of HTTP/2 into one protocol:
| Function | In the TCP world | In QUIC |
|---|---|---|
| Reliable, ordered delivery | TCP (one byte stream) | Per stream, many independent streams |
| Encryption and authentication | TLS on top of TCP | Built in, always TLS 1.3, cannot be switched off |
| Multiplexing | HTTP/2 streams | QUIC streams, in the transport itself |
| Flow control | TCP window + HTTP/2 windows | Per stream and per connection, in the transport |
| Congestion control | In the kernel | In user space, pluggable (NewReno, CUBIC, BBR) |
| Connection identity | IP addresses and ports (4-tuple) | Connection IDs, independent of addresses |
| Handshake | TCP (1 RTT) + TLS 1.3 (1 RTT) | Combined: 1 RTT, or 0 RTT on resumption |
11.2 Packets and Frames
A QUIC packet is sent in a UDP datagram, and several QUIC packets can share one datagram. There are two header forms:
- Long header packets are used during the handshake:
Initial,0-RTT,HandshakeandRetry. They contain the QUIC version and both connection IDs. - Short header packets are used after the handshake (1-RTT packets). They contain only a few flag bits, the destination connection ID and the packet number.
Inside each packet are frames, similar to HTTP/2 frames: STREAM frames carry application data, ACK frames acknowledge packets, CRYPTO frames carry the TLS handshake, and further frames handle flow control (MAX_DATA, MAX_STREAM_DATA, MAX_STREAMS), stream cancellation (RESET_STREAM, STOP_SENDING), connection IDs (NEW_CONNECTION_ID) and path checks (PATH_CHALLENGE, PATH_RESPONSE).
QUIC encodes most numbers as variable-length integers: the two highest bits of the first byte give the length (1, 2, 4 or 8 bytes). Small values such as stream 0 or a short length need only one byte.
11.3 Encryption of Almost Everything
QUIC encrypts the payload of every packet with an AEAD cipher (authenticated encryption, the same kind as in TLS 1.3), and it additionally applies header protection, which hides the packet number and some flag bits. After the handshake, an observer on the path sees only UDP ports, the connection ID, the packet size and timing. During the handshake, long-header packets also show the QUIC version and both connection IDs, and Initial packets are protected with keys that anyone can derive from the packet itself, so an observer can still read the ClientHello, including the server name (SNI). Even acknowledgements and stream numbers are encrypted.
This is deliberate. Because middleboxes cannot read QUIC's control information, they cannot learn to depend on it, and QUIC can evolve without ossifying again. The price is that network operators lose the visibility they had with TCP, where sequence numbers and acknowledgements revealed loss and retransmissions. QUIC offers one optional, visible spin bit that lets an observer estimate the round-trip time and nothing more.
11.4 Independent Streams
QUIC streams are identified by a number in which the two lowest bits encode who opened the stream and in which direction it carries data:
| Lowest two bits | Stream type | Example IDs |
|---|---|---|
00 | Client-initiated, bidirectional | 0, 4, 8, 12 |
01 | Server-initiated, bidirectional | 1, 5, 9, 13 |
10 | Client-initiated, unidirectional | 2, 6, 10, 14 |
11 | Server-initiated, unidirectional | 3, 7, 11, 15 |
The key property: QUIC delivers data in order within a stream, but independently across streams. If a packet with data for stream 4 is lost, only stream 4 waits for the retransmission. Data for streams 0 and 8 that arrived after the loss is delivered to the application immediately. This removes the TCP head-of-line blocking of section 10.1.
One lost packet on a QUIC connection:
packets sent [p1: stream 0][p2: stream 4][p3: stream 8][p4: stream 4]
network LOST
received [p1] [ gap ] [p3] [p4]
delivered p1 (stream 0) p3 (stream 8) immediately
stream 4 waits for the retransmission of p2, then gets p2 + p4
11.5 Better Loss Recovery
QUIC also improves the details of loss detection. Every packet gets a new, strictly increasing packet number, and a retransmission is sent in a new packet with a new number. TCP reuses the same sequence numbers for retransmitted data, so when an acknowledgement arrives, TCP cannot always tell whether it acknowledges the original or the retransmission (the "retransmission ambiguity"). QUIC can, which gives it more accurate RTT measurements. Its ACK frames can also report many ranges of received packets at once and include the time the receiver waited before acknowledging, which further improves the RTT estimate.
11.6 Connection IDs and Migration
A QUIC connection is identified by connection IDs chosen by each endpoint, not by IP addresses and ports. When a phone switches from Wi-Fi to the mobile network, its address changes, but the connection continues: the client sends packets from the new address, the server checks the new path with a PATH_CHALLENGE and PATH_RESPONSE exchange, and the transfer goes on. To prevent observers from linking the old and the new path, the client switches to a fresh connection ID that the server issued earlier with a NEW_CONNECTION_ID frame.
Connection IDs also help load balancers: a server can encode routing information in the connection ID it issues, so that every packet of a connection reaches the same server even after the client's address changes.
11.7 Protection Against Amplification
Because UDP has no handshake, an attacker could send a small packet with a forged source address and make the server send a large response to a victim. QUIC prevents this in two ways. The client's first datagram must be at least 1,200 bytes long (padded if necessary), and until the server has confirmed the client's address, it may send at most three times as many bytes as it has received. A server under load can also send a Retry packet with a token and require the client to repeat its first packet with that token, which proves that the client can receive packets at its claimed address.
12. HTTP/3: HTTP on QUIC Streams
HTTP/3 (RFC 9114, June 2022) is the mapping of HTTP semantics onto QUIC. Because QUIC already provides streams, flow control and encryption, HTTP/3 is much simpler than HTTP/2. It keeps only what QUIC does not offer: request and response framing, header compression and some control functions.
12.1 How Requests Map to Streams
Each request-response exchange uses one client-initiated bidirectional QUIC stream. The first request uses stream 0, the next stream 4, then 8, and so on. The client sends a HEADERS frame (and DATA frames for a body), then closes its sending direction with the QUIC FIN flag. The server answers on the same stream and closes it the same way. To cancel a request, either side resets the QUIC stream with an HTTP/3 error code; there is no separate RST_STREAM frame in HTTP/3.
In addition, each side opens a few unidirectional streams for control purposes:
| Stream type code | Purpose |
|---|---|
| 0x00 | Control stream: carries SETTINGS (first frame), GOAWAY and other connection-level frames |
| 0x01 | Push stream (server push, not used by browsers) |
| 0x02 | QPACK encoder stream: updates for the dynamic header table |
| 0x03 | QPACK decoder stream: acknowledgements back to the encoder |
12.2 HTTP/3 Frames
HTTP/3 frames have no fixed header. Each frame starts with two variable-length integers, the type and the length, followed by the payload:
| Type | Code | Purpose |
|---|---|---|
| DATA | 0x00 | Message body |
| HEADERS | 0x01 | QPACK-encoded header block |
| CANCEL_PUSH | 0x03 | Cancels a server push |
| SETTINGS | 0x04 | Connection parameters (only on the control stream) |
| PUSH_PROMISE | 0x05 | Announces a server push |
| GOAWAY | 0x07 | Graceful shutdown |
| MAX_PUSH_ID | 0x0d | Limits the number of pushes |
Compare this with the ten frame types of HTTP/2: WINDOW_UPDATE, RST_STREAM, PING and CONTINUATION are gone, because QUIC provides flow control, stream reset and liveness checks, and because a header block in HTTP/3 is simply one frame of any length. PRIORITY is gone as well; prioritisation uses the Priority header and the PRIORITY_UPDATE frame of RFC 9218.
Note that the frame type codes of HTTP/2 and HTTP/3 look similar but are separate registries. In HTTP/3, codes that would conflict with HTTP/2 meanings, such as 0x02, 0x06, 0x08 and 0x09, are reserved and must not be used.
13. QPACK: Header Compression Without Head-of-Line Blocking
HPACK cannot be used with QUIC. HPACK requires that header blocks are decoded in exactly the order in which they were encoded, because each block may change the shared dynamic table. With independent QUIC streams, the HEADERS frame of stream 8 can arrive before the HEADERS frame of stream 4. If stream 8 refers to a table entry that stream 4 was supposed to add, the decoder would have to wait, which brings head-of-line blocking back through the header compression.
QPACK (RFC 9204, June 2022) solves this by separating table updates from header blocks:
- Table updates travel on a separate stream. The encoder adds entries to the dynamic table by sending instructions on its unidirectional encoder stream, not inside the HEADERS frames.
- Each header block declares what it needs. It starts with a prefix that contains the Required Insert Count: the number of table insertions the decoder must have received before it can decode this block. A block that only uses the static table has a Required Insert Count of 0 and can always be decoded immediately.
- The decoder acknowledges. On its decoder stream, the decoder tells the encoder which insertions and header blocks it has processed, so the encoder knows which entries it can safely reference.
- The encoder chooses the trade-off. It may reference only acknowledged entries (never blocking) or allow a limited number of streams to be blocked while waiting for table updates (better compression). The decoder sets this limit with the setting
SETTINGS_QPACK_BLOCKED_STREAMS.
QPACK's static table has 99 entries (indices 0 to 98), more than HPACK's 61, and it is ordered differently. It contains complete common fields such as :method: GET (index 17), :scheme: https (index 23), :status: 200 (index 25) and accept: */* (index 29). One important default: the dynamic table capacity is 0 unless the decoder allows more with SETTINGS_QPACK_MAX_TABLE_CAPACITY. A minimal implementation can therefore use only the static table and Huffman coding, and never deal with blocking at all.
14. The Same Request in Three Versions
Now we can compare the same request, GET https://blog.example.com/api/posts/42 with the header accept: application/json, in all three wire formats. All strings are shown without Huffman coding, so the comparison shows the structure and not the string compression.
14.1 HTTP/1.1
0000 47 45 54 20 2f 61 70 69 2f 70 6f 73 74 73 2f 34 GET /api/posts/4
0010 32 20 48 54 54 50 2f 31 2e 31 0d 0a 48 6f 73 74 2 HTTP/1.1..Host
0020 3a 20 62 6c 6f 67 2e 65 78 61 6d 70 6c 65 2e 63 : blog.example.c
0030 6f 6d 0d 0a 41 63 63 65 70 74 3a 20 61 70 70 6c om..Accept: appl
0040 69 63 61 74 69 6f 6e 2f 6a 73 6f 6e 0d 0a 0d 0a ication/json....
80 bytes of text. Every request on this connection repeats all of it.
14.2 HTTP/2
A 9-byte frame header and the 53-byte HPACK block from section 8.2, 62 bytes in total, on stream 1:
00 00 35 01 05 00 00 00 01
82 87 44 0d 2f 61 70 69 2f 70 6f 73 74 73 2f 34 32 41 10 62 6c 6f 67
2e 65 78 61 6d 70 6c 65 2e 63 6f 6d 53 10 61 70 70 6c 69 63 61 74 69
6f 6e 2f 6a 73 6f 6e
The next request to the same host costs only 28 bytes (section 8.3).
14.3 HTTP/3
A QUIC STREAM frame on stream 0 that contains an HTTP/3 HEADERS frame with a QPACK block. The QPACK block uses only the static table, which is the default:
0000 0b 00 3a 01 38 00 00 d1 d7 51 0d 2f 61 70 69 2f
0010 70 6f 73 74 73 2f 34 32 50 10 62 6c 6f 67 2e 65
0020 78 61 6d 70 6c 65 2e 63 6f 6d 5f 0e 10 61 70 70
0030 6c 69 63 61 74 69 6f 6e 2f 6a 73 6f 6e
| Bytes | Layer | Meaning |
|---|---|---|
0b | QUIC | STREAM frame type with the LEN and FIN bits: length follows, this is the end of the stream |
00 | QUIC | Stream ID 0, the first client-initiated bidirectional stream |
3a | QUIC | Length of the stream data: 58 bytes |
01 | HTTP/3 | Frame type HEADERS |
38 | HTTP/3 | Frame length: 56 bytes |
00 00 | QPACK | Prefix: Required Insert Count 0, Base 0 (static table only, never blocks) |
d1 | QPACK | Indexed field, static index 17: :method: GET |
d7 | QPACK | Indexed field, static index 23: :scheme: https |
51 0d + 13 bytes | QPACK | Literal with static name reference 1 (:path), value /api/posts/42 |
50 10 + 16 bytes | QPACK | Literal with static name reference 0 (:authority), value blog.example.com |
5f 0e 10 + 16 bytes | QPACK | Literal with static name reference 29 (accept), value application/json |
The HEADERS frame is 58 bytes and the QUIC STREAM frame 61 bytes. The FIN bit on the STREAM frame plays the role of HTTP/2's END_STREAM flag: the client has nothing more to send on this request.
14.4 The Complete Packets
The header block is only part of the cost. Each version adds the overhead of the layers below. With TLS 1.3, TCP with the usual timestamp option and IPv4, our first request becomes:
| Layer | HTTP/1.1 | HTTP/2 | HTTP/3 |
|---|---|---|---|
| HTTP message or frame | 80 | 62 | 58 |
| Framing below HTTP | – | – | 3 (QUIC STREAM frame) |
| Encryption overhead | 22 (TLS record) | 22 (TLS record) | 27 (QUIC short header 11 + tag 16) |
| Transport header | 32 (TCP) | 32 (TCP) | 8 (UDP) |
| IPv4 header | 20 | 20 | 20 |
| IP packet | 154 | 136 | 116 |
The QUIC short header in this example has 1 flag byte, an 8-byte connection ID and a 2-byte packet number. For the first request, the three versions are close. The real differences appear across many requests (compression), across many resources (multiplexing) and under packet loss (independent streams), as the next section shows.
15. Performance in Practice
Protocol discussions often end with "HTTP/3 is faster". The honest answer is more precise: each version removes specific delays, and whether that matters depends on the round-trip time, the packet loss and the shape of the page. The following models use a round-trip time of 50 ms, ignore server processing time and assume that bandwidth is not the limit. They are simplified on purpose, so that the effect of each protocol feature is visible.
15.1 Time to the First Response
Before the first response byte arrives, a new connection must be set up and the request must travel to the server and back:
| Setup | Round trips | Time at 50 ms RTT |
|---|---|---|
| HTTP/1.1 or HTTP/2, TCP + TLS 1.2 | 4 | 200 ms |
| HTTP/1.1 or HTTP/2, TCP + TLS 1.3 | 3 | 150 ms |
| HTTP/3, new connection (QUIC 1-RTT) | 2 | 100 ms |
| HTTP/3, resumed connection (0-RTT) | 1 | 50 ms |
TCP + TLS 1.3 (HTTP/1.1, HTTP/2) QUIC (HTTP/3)
RTT 1 SYN -> / <- SYN-ACK RTT 1 Initial(ClientHello) ->
RTT 2 ClientHello -> / <- ServerHello... <- Initial(ServerHello),
RTT 3 request -> / <- response Handshake(... Finished)
RTT 2 Finished + request ->
<- response
On a mobile connection with an RTT of 150 ms, the difference between 3 and 2 round trips is 150 ms on every new connection, a delay users clearly notice. On a fibre connection with 10 ms RTT, it is 10 ms, which nobody notices.
15.2 A Page with Thirty Resources
A page consists of an HTML document and 30 small resources (scripts, styles, images), each small enough to be sent within one round trip:
- HTTP/1.1: the HTML arrives after 3 RTT. The browser then opens five more connections, which need 2 RTT for their handshakes, while the first connection already fetches two resources. The remaining 28 resources are spread over six connections, one at a time per connection: 5 more rounds. Total: about 10 RTT, or 500 ms.
- HTTP/2: the HTML arrives after 3 RTT. The browser sends all 30 requests at once on the same connection. The responses arrive within 1 to 2 RTT, depending on how far TCP slow start has opened the congestion window. Total: about 4 to 5 RTT, or 200 to 250 ms.
- HTTP/3: the HTML arrives after 2 RTT, and the resources follow as with HTTP/2. Total: about 3 to 4 RTT, or 150 to 200 ms; on a resumed connection one round trip less.
Two lessons follow. The biggest step is from HTTP/1.1 to HTTP/2, because multiplexing removes most of the waiting. The step from HTTP/2 to HTTP/3 is smaller on a clean network, and comes mainly from the faster handshake.
15.3 Packet Loss Changes the Picture
Now add packet loss. Each lost packet costs at least one extra round trip until the retransmission arrives, but the protocols differ in what has to wait:
| Situation | HTTP/1.1 (6 connections) | HTTP/2 (1 TCP connection) | HTTP/3 (1 QUIC connection) |
|---|---|---|---|
| One packet lost | One connection stalls | All streams stall | Only the affected stream stalls |
| Loss during the handshake | One connection delayed | Whole page delayed | Whole page delayed |
| Many losses (2 % or more) | Degrades gradually | Can be slower than HTTP/1.1 | Degrades gradually |
| Network change (Wi-Fi to mobile) | All connections break | Connection breaks | Connection migrates |
This is why measured gains of HTTP/3 are largest where networks are worst: on mobile networks, in regions with long distances to the server, on congested Wi-Fi and for users with older equipment. On a fast and stable connection close to the server, the three versions are often within a few percent of each other, and HTTP/2 can even be slightly faster for very large downloads, because its kernel TCP stack uses less CPU (section 16.2).
15.4 What Really Determines Performance
The HTTP version is one factor among several, and often not the largest one. In practice, the following usually matter more:
- Distance to the server: a CDN edge server 10 ms away beats any protocol optimisation on a server 150 ms away.
- Number of origins: every additional host name (fonts, analytics, advertising) needs its own DNS lookup and its own connection, whatever the version.
- Page weight and critical path: a 2 MB JavaScript bundle that must run before anything is shown dominates the load time.
- Caching: a resource that is not requested at all is faster than any protocol.
Enable HTTP/2 and HTTP/3, but measure your real users before you expect miracles. Protocol upgrades remove latency that is already small on good networks and large on bad ones.
16. The Problems of HTTP/3
HTTP/3 removes the transport limits of HTTP/2, but it brings its own costs and risks. A professional deployment has to plan for them.
16.1 UDP Is Not Always Allowed
Some corporate networks, hotel networks and older firewalls block or throttle UDP on port 443, because they were configured when UDP traffic meant only DNS and VPNs. QUIC therefore always needs a fallback to TCP. Browsers handle this automatically: they remember which hosts support HTTP/3 and fall back to HTTP/2 if QUIC does not work, often by racing both connections in parallel. Servers must therefore always offer HTTP/2 or HTTP/1.1 as well. A side effect is that the first visit to a site often uses HTTP/2, and HTTP/3 is used only from the second connection on, after the client has learned that the server supports it (section 17).
16.2 Higher CPU Cost
TCP has been optimised for decades. Network cards can split large TCP segments in hardware (TSO, TCP segmentation offload), and the kernel processes many packets in one batch. QUIC runs in user space, encrypts every packet individually and must pass every UDP datagram through the system call interface. Early measurements showed QUIC using considerably more CPU per transferred byte than TCP with TLS. Modern implementations close much of this gap with UDP batching (GSO and GRO, generic segmentation and receive offload), but on very fast links, QUIC can still reach lower throughput per CPU core than TCP. For a CDN or a large API platform, this is a capacity planning question.
16.3 Less Visibility for Operators
Because QUIC encrypts its headers, tools that diagnosed TCP problems from packet captures (loss, retransmissions, window sizes) see almost nothing. Debugging QUIC needs the cooperation of the endpoints: they write qlog files (a structured event log format for QUIC and HTTP/3) or export TLS keys so that tools like Wireshark can decrypt captured traffic. Network-level intrusion detection systems lose insight as well.
16.4 0-RTT Replay
The 0-RTT feature lets a returning client send its request together with the first handshake packet. But an attacker who records that packet can send it again (replay it), and the server may process the request twice. 0-RTT data is therefore only safe for idempotent requests, such as GET without side effects. Servers must either reject 0-RTT for other requests or detect replays. RFC 8470 defines the Early-Data: 1 header (set by a proxy when it forwards a request received as early data) and the status code 425 Too Early, with which a back-end server can ask the client to repeat the request after the handshake. The same risk exists for TLS 1.3 0-RTT over TCP.
16.5 Load Balancing and DDoS Protection
Classic load balancers distribute connections by IP address and port. With QUIC connection migration, the client's address can change in the middle of a connection, so the load balancer must route by connection ID instead, which requires QUIC-aware load balancers or a shared encoding of server identity in the connection ID. DDoS protection also becomes harder: UDP floods are easy to generate, and a mitigation system cannot use the TCP handshake to separate real clients from forged source addresses. QUIC's Retry mechanism helps, but it costs the client an extra round trip.
16.6 Ecosystem Maturity
Implementing QUIC is a large project: transport, loss recovery, congestion control and TLS integration in one library. For years, the most widely used TLS library, OpenSSL, did not offer the interfaces QUIC needed, which slowed adoption in open-source servers. OpenSSL added QUIC support in stages (client support in version 3.2 in 2023 and server support in version 3.5 in 2025). In the meantime, servers relied on other libraries such as BoringSSL, quictls, ngtcp2, quiche, msquic or s2n-quic. Today, every major browser, CDN and many web servers support HTTP/3, but support in application servers, API gateways, service meshes and client libraries in various programming languages is still uneven.
16.7 UDP and NAT Timeouts
Home routers and mobile networks keep state for UDP flows for a shorter time than for TCP connections, often only 30 seconds without traffic. A QUIC connection that is idle for longer may lose its NAT mapping. Implementations therefore send small keep-alive packets (QUIC PING frames) or accept that idle connections are closed and resumed with 0-RTT.
17. Discovery and Negotiation
A client must decide which version to use before it sends the first request. For HTTP/1.1 and HTTP/2, this is simple, because both use TLS over TCP on port 443. HTTP/3 uses a different transport, so the client must first learn that the server supports it.
17.1 ALPN: Choosing Between HTTP/1.1 and HTTP/2
During the TLS handshake, the client lists the protocols it supports in the ALPN extension, and the server selects one. The registered identifiers are http/1.1, h2 and h3 (the last one inside QUIC's TLS handshake). The choice costs no extra round trip. The older mechanism of upgrading an HTTP/1.1 connection to cleartext HTTP/2 with an Upgrade: h2c header was never widely deployed and was deprecated by RFC 9113.
17.2 Alt-Svc: "I Also Speak HTTP/3"
The classic way to announce HTTP/3 is the Alt-Svc response header (RFC 7838, 2016). The server sends it on a normal HTTP/1.1 or HTTP/2 response:
alt-svc: h3=":443"; ma=86400
This means "the same service is available via HTTP/3 on UDP port 443 of this host, and you may remember this for 86,400 seconds (one day)". The browser stores this information and uses HTTP/3 for its next connection to the host. The weakness is obvious: the first connection is always over TCP.
17.3 HTTPS DNS Records: Knowing Before Connecting
The HTTPS resource record (RFC 9460, November 2023) moves this information into DNS. The client asks for it together with the IP address and learns the supported protocols before it opens any connection:
blog.example.com. 3600 IN HTTPS 1 . alpn="h3,h2" ipv4hint=203.0.113.10
The record says: priority 1, the same host name (.), supported protocols HTTP/3 and HTTP/2, and an address hint. With this record, even the very first connection can use HTTP/3. The same record type can also carry the keys for Encrypted Client Hello (ECH), which hides the server name in the TLS handshake from observers. Most major browsers query HTTPS records today, and many DNS providers and CDNs publish them automatically.
17.4 Racing and Fallback
Because UDP may be blocked, browsers do not rely on QUIC alone. A common strategy is to start a QUIC connection and, if it does not answer within a short time, start a TCP connection in parallel and use whichever succeeds first. This is similar to "Happy Eyeballs" (RFC 8305), which races IPv6 and IPv4. If QUIC fails repeatedly for a host, the browser marks HTTP/3 as broken for that host for some time.
18. Security Comparison
The three versions share the same application-level risks (injection, broken authentication, insecure deserialisation), because the semantics are the same. They differ in the risks that come from the wire format and the transport.
| Area | HTTP/1.1 | HTTP/2 | HTTP/3 |
|---|---|---|---|
| Encryption | Optional (HTTPS is TLS on top) | Required by browsers (TLS 1.2+) | Always TLS 1.3, built into QUIC |
| Parsing risks | Text parsing; request smuggling | Binary, explicit lengths; smuggling when downgraded to HTTP/1.1 | Binary, explicit lengths; same downgrade risk |
| Header compression risk | None (no compression) | HPACK, designed against CRIME | QPACK, same design principle |
| Resource exhaustion | Slow requests (Slowloris) | Rapid Reset, CONTINUATION flood, HPACK bomb | Similar stream and frame floods; needs the same limits |
| Transport attacks | TCP SYN flood (SYN cookies help) | TCP SYN flood | UDP floods, amplification (limited by the 3x rule and Retry) |
| Metadata visible to observers | Everything without TLS; with TLS, server name and sizes | Server name (SNI) and sizes | Server name (SNI) and sizes; transport headers encrypted |
| Replay | Not applicable without 0-RTT | TLS 1.3 0-RTT if enabled | QUIC 0-RTT if enabled |
Three practical conclusions follow:
- Translation points are the weak spots. When a proxy receives HTTP/2 or HTTP/3 and forwards HTTP/1.1 to the back end, every difference in how the two sides interpret a message can be exploited. Use strict parsers on both sides, and keep the proxy and the server up to date.
- Multiplexing needs limits. A protocol that lets one client open hundreds of streams with a few bytes needs limits on streams, resets, header sizes and frame rates. Default limits in current server versions are usually good; old versions are dangerous.
- Encryption is no longer optional. With HTTP/2 in browsers and HTTP/3 everywhere, the modern web is encrypted by design. The remaining metadata, mainly the server name, is being closed by Encrypted Client Hello.
19. Measuring and Debugging
You cannot optimise what you cannot see. Each version needs slightly different tools, and HTTP/3 in particular needs some preparation because its traffic is fully encrypted.
19.1 Which Version Is Used?
curl can force a version and report which one was used. The option --http3 requires a curl build with HTTP/3 support; curl --version lists HTTP3 among the features if it is available.
# force a version and print the one that was actually used
curl -s -o /dev/null -w '%{http_version}\n' --http1.1 https://blog.example.com/
curl -s -o /dev/null -w '%{http_version}\n' --http2 https://blog.example.com/
curl -s -o /dev/null -w '%{http_version}\n' --http3 https://blog.example.com/
# show the negotiation and the alt-svc header
curl -sv -o /dev/null https://blog.example.com/ 2>&1 | grep -iE 'alpn|alt-svc|HTTP/'
In the browser, open the developer tools, go to the Network tab, right-click the column header and enable the Protocol column. It shows http/1.1, h2 or h3 for every request. If you see h2 for the first request and h3 for later ones, the browser learned about HTTP/3 from the Alt-Svc header.
19.2 Timing Breakdown
curl can also break down where the time goes, which makes the handshake differences of section 15 directly visible:
curl -s -o /dev/null --http2 https://blog.example.com/ -w \
'dns %{time_namelookup} connect %{time_connect} tls %{time_appconnect}
first byte %{time_starttransfer} total %{time_total}\n'
For HTTP/2, time_connect (TCP) and time_appconnect (TLS) are separate steps. For HTTP/3, the QUIC handshake replaces both, and time_appconnect is reached about one round trip earlier.
19.3 Looking at Frames
To see HTTP/2 frames, use nghttp from the nghttp2 project. It prints every frame with its type, flags and stream ID:
nghttp -nv https://blog.example.com/api/posts/42
For load tests, h2load from the same project sends many requests over HTTP/1.1, HTTP/2 or (if built with QUIC support) HTTP/3 and reports requests per second and latency percentiles.
19.4 Decrypting Captures
Packet captures of HTTP/2 and HTTP/3 are encrypted. To read them in Wireshark, export the TLS session keys from the client. Chrome, Firefox and curl write them to a file named in the SSLKEYLOGFILE environment variable; Wireshark can then decrypt both TLS over TCP and QUIC:
export SSLKEYLOGFILE="$HOME/tls-keys.log"
curl --http3 https://blog.example.com/ -o /dev/null
# in Wireshark: Preferences > Protocols > TLS > (Pre)-Master-Secret log filename
Treat this file like a password: anyone who has it can decrypt the recorded traffic. Use it only for test sessions and delete it afterwards.
For QUIC-specific problems such as loss recovery, congestion control or migration, qlog files are more useful than packet captures. Many QUIC libraries can write them, and the visualisation tool qvis shows them as sequence diagrams and congestion graphs.
19.5 Real User Measurements
Laboratory tests show what is possible; real user monitoring shows what happens. The browser's Navigation Timing and Resource Timing APIs report the protocol of every resource in the field nextHopProtocol. Collecting this field together with load times lets you compare HTTP/2 and HTTP/3 for your real users on their real networks:
performance.getEntriesByType('resource').forEach((r) => {
console.log(r.nextHopProtocol, Math.round(r.duration), r.name);
});
20. Choosing and Configuring
Since the semantics are the same, the choice of version is an operations decision, not an application decision. In most cases, the answer is "all of them": offer HTTP/3 where possible, HTTP/2 everywhere, and HTTP/1.1 as the universal fallback.
20.1 Recommendations by Scenario
| Scenario | Recommendation | Reason |
|---|---|---|
| Public website or API behind a CDN | Enable HTTP/2 and HTTP/3 at the CDN | The CDN handles QUIC, fallback and DDoS protection |
| Public website on your own server | HTTP/2 always; HTTP/3 if the server supports it and UDP 443 is open | HTTP/3 helps mobile users most |
| Reverse proxy to application server | HTTP/1.1 with keep-alive, or HTTP/2 | Low latency inside the data centre; simple and robust |
| Service-to-service RPC | HTTP/2 (for example gRPC) | Multiplexing, streaming, binary efficiency |
| Embedded devices, very simple clients | HTTP/1.1 | Smallest implementation |
| Networks with blocked UDP | HTTP/2 | QUIC fallback is automatic in browsers, but not in every client library |
20.2 Remove the HTTP/1.1 Workarounds
When you move to HTTP/2 or HTTP/3, review the optimisations of the HTTP/1.1 era (section 5.2):
- Stop domain sharding. Several host names prevent connection reuse and cost extra handshakes.
- Use moderate bundles. Very large bundles invalidate caches with every change; many tiny files cause overhead in the browser. A few medium-sized, well-cached bundles are usually best.
- Drop image sprites in favour of individual, modern formats (WebP, AVIF) and SVG.
- Do not use server push. Use
103 Early Hintsand<link rel=preload>instead. - Keep the number of origins small. Each third-party host costs a separate connection in every version.
20.3 Example: nginx
Since version 1.25, nginx supports HTTP/3 in the standard distribution (when built with QUIC support). A minimal configuration that offers all three versions:
server {
listen 443 ssl; # TCP: HTTP/1.1 and HTTP/2
listen 443 quic reuseport; # UDP: HTTP/3
http2 on;
http3 on;
server_name blog.example.com;
ssl_certificate /etc/ssl/blog.example.com.pem;
ssl_certificate_key /etc/ssl/blog.example.com.key;
ssl_protocols TLSv1.2 TLSv1.3;
# tell clients that HTTP/3 is available
add_header Alt-Svc 'h3=":443"; ma=86400' always;
}
Two points are easy to forget: the firewall must allow UDP on port 443 in addition to TCP, and the reuseport parameter may only appear once per address and port across all server blocks.
20.4 Other Servers
- Caddy enables HTTP/1.1, HTTP/2 and HTTP/3 by default for HTTPS sites, including the
Alt-Svcheader. - Apache httpd supports HTTP/2 through
mod_http2(Protocols h2 http/1.1), but has no native HTTP/3 support; it is usually placed behind a CDN or a proxy that provides HTTP/3. - Spring Boot enables HTTP/2 on its embedded server with one property; for browsers the server must use TLS, otherwise it runs cleartext h2c (with prior knowledge or, depending on the embedded server, the HTTP/1.1 Upgrade mechanism):
server.http2.enabled=true
server.ssl.enabled=true
- Node.js includes an
http2module in its standard library; for HTTP/3, applications usually rely on a proxy or CDN in front.
20.5 Limits and Updates
Whatever server you use, keep it up to date. Most of the HTTP/2 vulnerabilities of 2023 and 2024 were fixed by setting limits in the server software, not by configuration. Check that your version includes the fixes for Rapid Reset (CVE-2023-44487) and the CONTINUATION flood (2024), and review the limits on concurrent streams, header size and request rate. The defaults of current versions are a good starting point.
21. The Three Versions on One Page
| Aspect | HTTP/1.1 | HTTP/2 | HTTP/3 |
|---|---|---|---|
| Standardised | 1997 (RFC 2068); today RFC 9112 (2022) | 2015 (RFC 7540); today RFC 9113 (2022) | 2022 (RFC 9114) |
| Origin | IETF, evolution of HTTP/1.0 | Google SPDY (2009) | Google QUIC (2012) |
| Transport | TCP | TCP | QUIC over UDP |
| Encryption | Optional (TLS) | TLS in practice (browsers require it) | Always TLS 1.3 |
| Wire format | Text | Binary frames, 9-byte header | Binary frames, variable-length header |
| Parallel requests | One per connection; 6 connections per host | Many streams on one connection | Many independent streams on one connection |
| Header compression | None | HPACK (static table 61 entries) | QPACK (static table 99 entries) |
| Head-of-line blocking | Per connection | At TCP level, across all streams | Only within the affected stream |
| New connection (TLS 1.3) | 2 RTT before the request | 2 RTT before the request | 1 RTT (0 RTT on resumption) |
| Connection migration | No | No | Yes (connection IDs) |
| Prioritisation | None | Tree (deprecated), now RFC 9218 | RFC 9218 |
| Server push | No | Specified, disabled in browsers | Specified, not used by browsers |
| Typical weak spots | Request smuggling, slow requests | Rapid Reset, CONTINUATION flood | UDP blocking, CPU cost, 0-RTT replay |
| Best suited for | Simple clients, back-end hops, debugging | Most websites and APIs, gRPC | Mobile and long-distance users, lossy networks |
22. Conclusion
HTTP/1.1, HTTP/2 and HTTP/3 are not competitors but three answers to the same question asked in three different eras: how do we move HTTP messages across the network as quickly and safely as possible? The meaning of HTTP has stayed remarkably stable for almost thirty years. What changed is the wire format and, with HTTP/3, the transport underneath.
- HTTP/1.1 made the web practical with persistent connections and virtual hosting. Its text format is simple and universal, but it handles only one request at a time per connection.
- HTTP/2 brought multiplexing and header compression, removed the need for most performance workarounds and made one connection per origin the norm. Its reliance on TCP means that one lost packet still stalls every stream, and its complexity opened new attack surfaces.
- HTTP/3 moved HTTP onto QUIC, which brings independent streams, faster handshakes, connection migration and always-on encryption. It costs more CPU, needs UDP and gives operators less visibility.
For most teams, the practical path is clear: serve all three versions, let clients and the CDN negotiate the best one, remove the HTTP/1.1-era workarounds, keep servers updated, and measure the effect on real users. The largest gains are not where networks are already fast, but where they are slow, distant or unreliable, which is exactly where many of the world's users are.
Which version do your users actually get? Open the Protocol column in your browser's developer tools on your own site and find out: the answer is often more interesting than expected.
Sources and Further Reading
| Topic | Source |
|---|---|
| HTTP semantics and caching | RFC 9110, RFC 9111 |
| HTTP/1.1 | RFC 9112 (earlier RFC 2068, RFC 2616, RFC 7230–7235); HTTP/1.0: RFC 1945 |
| HTTP/2 | RFC 9113 (earlier RFC 7540), HPACK: RFC 7541 |
| HTTP/3 and QPACK | RFC 9114, RFC 9204 |
| QUIC | RFC 9000 (transport), RFC 9001 (TLS), RFC 9002 (loss recovery and congestion control) |
| Prioritisation | RFC 9218 |
| Discovery and negotiation | RFC 7301 (ALPN), RFC 7838 (Alt-Svc), RFC 9460 (SVCB and HTTPS records) |
| Early Hints and 0-RTT | RFC 8297 (103 Early Hints), RFC 8470 (Early-Data, 425 Too Early) |
| TLS 1.3 | RFC 8446 |
| HTTP/2 attacks | CVE-2023-44487 (Rapid Reset); CERT/CC vulnerability note VU#421644 (CONTINUATION flood, 2024) |
| Books | Ilya Grigorik, High Performance Browser Networking (O'Reilly, free online); Daniel Stenberg, HTTP/3 explained (free online) |




