How the Internet works

Applications, chapter 28 of 36

HTTP: Semantics and HTTP/1.1

Transfer-Encoding beats Content-Length: early implementations occasionally sent estimated lengths for progress bars.

Twenty-eight milliseconds after the click, the laptop holds a TLS session and finally has something to say. What it says fits into four values: the method GET, the scheme https, the authority www.example.net, and the path /. They leave in an HTTP/2 frame, and 17 ms later the answer comes back as status 200 with a field that offers HTTP/3.

26 years
from RFC 1945 to HTTP's three Internet Standards, STD 97 to STD 99
9376 s
of freshness left in the capture, from max-age=14400 and Age: 5024
$200,000
and more, paid in request smuggling bounties in two weeks of 2025 [Kettle2025]

One stream, two parsers

The attacker's POST and the next user's GET from the chapter's smuggling example, framed by a front end and a back end. Change the framing fields or the front end's rule and see where each parser ends the POST.

How did one line from 1991 become three Internet Standards?

The first HTTP had no headers, no status code, and no version number. The request was GET, a space, the document address, and CR LF, and closing the connection ended the response. RFC 1945 (May 1996) documented HTTP/1.0. RFC 2068 (January 1997) put HTTP/1.1 on the standards track with the Host field (RFC 2068, Section 14.23), which let many sites share one IPv4 address.

In June 2022 RFC 9110 took the semantics of every version, RFC 9111 caching, and RFC 9112 only what is specific to HTTP/1.1. As STD 97 to STD 99, HTTP reached the top of the track 26 years after RFC 1945.

What does a method promise?

A safe method is "essentially read-only" (RFC 9110, Section 9.2.1), so crawlers and prefetchers may follow every link. PUT, DELETE, and the safe methods are also idempotent: a client may retry them after a connection failure, and a proxy must not automatically retry anything else (RFC 9110, Section 9.2.2).

A query too large for a URI had two bad homes: an 8000-octet request line is only the recommended minimum, and a POST hides from caches and retry logic that the request is harmless. RFC 10008 (June 2026) adds QUERY, safe and idempotent, with the query as content and the content in the cache key (RFC 10008, Section 2.7).

How long may a cache keep our page?

A stored response is fresh while its age is below its freshness lifetime. The lifetime is s-maxage for a shared cache, else max-age, else Expires minus Date, else a heuristic (RFC 9111, Section 4.2.1). In our capture, Cache-Control: max-age=14400 grants four hours and Age: 5024 says the copy is already 84 minutes old, so a browser may reuse the page for about 9376 more seconds without asking anyone.

Without max-age, Chromium would take a tenth of the time since Last-Modified, the "typical setting" of RFC 9111, Section 4.2.2: 1005 seconds [Chromium2026]. The copy would have arrived already stale.

How does a client ask whether its copy is still good?

A cache with a stale copy sends its validator back, as If-None-Match or If-Modified-Since. The real server answered with 304 Not Modified and no content.

Its entity tag "6af63606-241" is not quite opaque. 0x6af63606 is the Last-Modified time in seconds after the epoch, and 0x241 is 577, the length of the page. That is the format of ngx_http_set_etag() in nginx [Nginx2026], although the Server field names only the CDN. Two edits within one second that keep the length would share the tag, the case in which RFC 9110, Section 8.8.1 says a modification time might be weak, yet nginx sends the tag as strong.

Where does an HTTP/1.1 message end?

The end of the header section is unambiguous. The end of the body follows an ordered list in RFC 9112, Section 6.3. Chunked coding applies if Transfer-Encoding ends with chunked. If it ends with another coding, a response runs until the server closes the connection, and a request draws 400 and a close. Only a message without Transfer-Encoding is framed by Content-Length, so a Content-Length next to Transfer-Encoding: gzip is no boundary at all.

The real server sent its page as one chunk: the line 241, hexadecimal for 577, then 577 octets of HTML, CR LF, and the zero-length last chunk.

How does a request get smuggled past a proxy?

A front end such as a CDN forwards the requests of many users over a few reused connections, separated only by framing. If the two sides disagree on where a message ends, the rest of one request becomes the start of the next, which may belong to someone else (RFC 9112, Section 11.2).

James Kettle's 2019 paper calls a front end that obeys Content-Length and a back end that obeys the chunked coding CL.TE. Its one-letter trick turned a victim's POST into "Unknown method GPOST" [Kettle2019]. A real attacker sends a request line and an unfinished header field, and the victim's request, cookies included, becomes the tail of the attacker's.

attackervictimfront end (Content-Length)back end (chunked) POST, CL 6, chunked, body 0 and GPOST with 6 octets of contentresponse to POST; no close, G bufferedGET /GET / on the same connection501 for method GGET, sent to the victim
From the book: A CL.TE desync: the front end sees one request where the back end sees two

The book keeps asking

This chapter has 5,646 words and 14 questions. These 8 are answered only in the book and the audiobook.

  • What did the laptop actually ask for?
  • What can a client learn from three digits?
  • What is a field, and why is Set-Cookie different?
  • How does the server choose what to send?
  • Why did pipelining never catch on?
  • What goes wrong when a connection changes protocol?
  • How does a stateless protocol remember the user?
  • How does a client prove who it is?

Open the sources

  • RFC 9110 HTTP Semantics 2022, Internet Standard, STD 97
  • RFC 9111 HTTP Caching 2022, Internet Standard, STD 98
  • RFC 9112 HTTP/1.1 2022, Internet Standard, STD 99
  • RFC 1945 Hypertext Transfer Protocol -- HTTP/1.0 1996, Informational
  • RFC 2616 Hypertext Transfer Protocol -- HTTP/1.1 1999, Draft Standard; obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235
  • RFC 6265 HTTP State Management Mechanism 2011, Proposed Standard
  • RFC 9931 Security Considerations for Optimistic Protocol Transitions in HTTP/1.1 2026, Proposed Standard
  • RFC 10008 The HTTP QUERY Method 2026, Proposed Standard

All 29 documents this chapter cites, each with a link to its publisher and a copy kept here.

Applications, chapter 29 of 36

HTTP/2: Multiplexing over One Connection

Applications, chapter 30 of 36

QUIC: A Transport in Userspace

Applications, chapter 31 of 36

HTTP/3: The Web on QUIC

Applications, chapter 32 of 36

Mail: SMTP and Forty Years of Patches

Applications, chapter 33 of 36

Time, Shells, and Files: NTP, SSH, Telnet, and FTP

The Whole Path, chapter 34 of 36

Measuring and Debugging the Path

The Whole Path, chapter 35 of 36

The Whole Journey, Byte by Byte

The Whole Path, chapter 36 of 36

Ossification and What Comes Next

You have reached the server. The book goes further.

Everything on this site is a short version. Follow the Packet is the long one: 36 chapters and about 280,000 words, with every protocol fact traced to the section of the standard that defines it, every byte dump built by a script you can run, and a directory of more than a thousand cited documents. It comes as a printable book and as an audiobook.

Hear how chapter 1 opens. 70 seconds, narrated by a synthetic voice.

Get the book or the audiobook Read the start of chapter 1 Browse every source

Cover of Follow the Packet: How the Internet Works, Layer by Layer, from ARPANET to QUIC, by Wolfgang Kerschbaumer

The signup uses double opt-in. Every message includes an unsubscribe link.

Published by Sysinit Press. The public addresses, AS numbers and names of the scenario come from ranges reserved for documentation, and the home network uses private addresses, so the site describes no real network. RFC texts are copied unchanged from the RFC Editor.