REQUEST · written by your browserRESPONSE · written by the serverGET /index.htmlGET /index.htmlGET /index.html200 OK200 OK200 OKSID
Cards: the request and the response, as text you can readRail: the connection; its plaque says which HTTP and transportEnvelopes: messages on their way; the label is the first line or streamJar: the cookies your browser keeps for each siteYour browser (192.0.2.7) opens a TCP connection to www.example.com (203.0.113.10) on port 80 and writes a request: GET /index.html HTTP/1.1, a Host header, an empty line. The server answers with a status line (HTTP/1.1 200 OK), headers that describe the body, an empty line and the page. A 301 sends the browser to another address; two identical requests show that HTTP keeps no memory, until a cookie set at login comes back on every later request. Then the same messages ride faster: one kept-alive HTTP/1.1 connection, HTTP/2 streams side by side, and HTTP/3 over QUIC and UDP, where one lost packet delays only its own stream. 192.0.2.7 and 203.0.113.10 are RFC 5737 documentation addresses and www.example.com is reserved for examples (RFC 2606), the same ones the TCP and HTTPS lessons use.

The request

  1. You type http://www.example.com. DNS gave the browser 203.0.113.10, so it opens a TCP connection to port 80: SYN, SYN-ACK, ACK. HTTP messages are just text that rides on this connection.

The response

State and cookies

Faster versions

The messages, step by step

;; step 1/11 · connect
;; client → server
TCP 192.0.2.7:51514 → 203.0.113.10:80
SYN → · ← SYN-ACK · ACK →   (the TCP lesson's three-way handshake)
port 80 = plain http://   (https:// uses 443 and adds TLS first)
TCP delivers the bytes in order; HTTP decides what they say

Illustrative values: the page size (1256 bytes), the paths, the login form and the port 51514. The cookie value SID=31d4d96e407aad42 is the example from RFC 6265. The cards show a shortened message: a real browser sends more headers (User-Agent, Accept-Language, Accept-Encoding …) and the server adds Date, Server and others.