How Computers Work

HTTP and the Web

Tim Berners-Lee's 1989 proposal at CERN, which he called Mesh, and the NeXT cube labelled DO NOT POWER IT DOWN that served the first website; a raw HTTP exchange with info.cern.ch read line by line in curl -v; status codes, headers, a real 304 Not Modified, and cookies; TLS 1.3 and the certificate chain behind a padlock, taken apart with openssl s_client, down to a post-quantum key exchange; HTTP/2 and HTTP/3 in brief; and everything a browser does between Enter and a painted page.

  • 11 min
  • 10 steps
  • 8 questions
  • 6 hands-on
  • Lesson 21 of 24 in How Computers Work
  • Drafted by Opus 5.5

In this lesson

  1. Mesh, then the Web
  2. A request in plain text
  3. Status codes
  4. Headers, caches, and cookies
  5. Locks and keys
  6. HTTP/2 and HTTP/3
  7. From Enter to page
  8. Try it on Linux
  9. The web’s first pages, still online
  10. Read a site’s papers

Mesh, then the Web

In March 1989 Tim Berners-Lee, a British scientist at CERN, wrote “Information Management: A Proposal” 1 2. Its complaint was practical. People stayed about two years, and when they left, what they knew about the machines left with them. His answer was a distributed hypertext: documents anywhere, linked to each other, readable from any computer. The only name he had for it then was “Mesh”; he settled on “World Wide Web” while writing the code in 1990 1.

By the end of 1990 he had the first server and browser running on a NeXT computer in his office, with a handwritten label to keep it switched on. The first site was info.cern.ch 2.

In a glass display case, a black NeXT monitor and keyboard, both labelled PROPRIETE CERN, beside a black cube-shaped NeXT computer. On the cube's side a peeling sticker reads, in red handwriting, This machine is a server. DO NOT POWER IT DOWN!! In front lie a printed copy of Information Management: A Proposal, with its diagram of linked circles, and an open old book.
Tim Berners-Lee's NeXTcube, the first web server, on display at CERN in 2005 with a copy of his proposal. Credit: Coolcaesar, via Wikimedia Commons · CC BY-SA 3.0 · Source

Nicola Pellow, a student on placement, wrote a simple line-mode browser that ran anywhere. The software went to CERN colleagues in March 1991 and was announced on internet newsgroups that August; the first server in the US came up at SLAC in December 1991 2. Volunteers wrote graphical browsers, among them Erwise, by Finnish students at the Helsinki University of Technology. Early in 1993 the National Center for Supercomputing Applications at the University of Illinois released Mosaic, and on 30 April 1993 CERN made the web software free of royalties. By the end of 1994 there were 10,000 servers and 10 million users 2.

A request in plain text

The language between browser and server is HTTP. Version 1.1 is plain text, and curl -v shows all of it: * lines are curl’s own notes, > lines what it sent, < lines what came back 3. Here it is against the first website, which is still running:

me@linuxbox:~$ curl -sv -o /dev/null http://info.cern.ch/
* Host info.cern.ch:80 was resolved.
* IPv4: 188.184.67.127
*   Trying 188.184.67.127:80...
* Established connection to info.cern.ch (188.184.67.127 port 80) from 192.168.1.23 port 61950
> GET / HTTP/1.1
> Host: info.cern.ch
> User-Agent: curl/8.21.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Sun, 15 Nov 2026 20:04:05 GMT
< Server: Apache
< Last-Modified: Wed, 05 Feb 2014 16:00:31 GMT
< ETag: "286-4f1aadb3105c0"
< Accept-Ranges: bytes
< Content-Length: 646
< Connection: close
< Content-Type: text/html
<
{ [646 bytes data]
  • GET / HTTP/1.1 is the request line: method, path, version.
  • Host: names the site, because one address can serve many; HTTP/1.1 requires it 4.
  • The empty > line ends the headers. Every line ends in a carriage return and line feed 4.
  • HTTP/1.1 200 OK is the status line.
  • Server, Last-Modified, ETag, Content-Length, Content-Type describe the reply: the software, when the page last changed, a tag for this version, its size in bytes, and what kind of data it is 5.
  • After the empty < line come the 646 bytes of HTML that -o /dev/null threw away.

Status codes

Every response starts with a three-digit status. The first digit is the class 5:

Class Meaning Common codes
1xx informational, keep going 100
2xx success 200 OK
3xx go somewhere else, or use what you have 301 Moved Permanently, 304 Not Modified
4xx the request was at fault 403 Forbidden, 404 Not Found
5xx the server failed 500 Internal Server Error, 503 Service Unavailable

A client must understand at least the class: an unknown 471 is treated as a 400 5. Ask for http://snl.no/ and the answer is a 301 pointing at the https:// address, the encrypted version.

Match up

Match each status code to its meaning.

This exercise needs JavaScript.

Quick check

A browser receives status code 471, which it has never heard of. How should it treat it?

Headers, caches, and cookies

The ETag lets a browser ask “has it changed?” without downloading the page again. Send the tag back in If-None-Match, and if it still matches, the server answers 304 with no body: use the copy you have 5.

me@linuxbox:~$ curl -sv -o /dev/null -H 'If-None-Match: "286-4f1aadb3105c0"' http://info.cern.ch/ 2>&1 | grep '^<'
< HTTP/1.1 304 Not Modified
< Date: Sun, 15 Nov 2026 20:37:41 GMT
< Server: Apache
< Last-Modified: Wed, 05 Feb 2014 16:00:31 GMT
< ETag: "286-4f1aadb3105c0"

HTTP forgets you between requests. Cookies paper over that: a server sends Set-Cookie: SID=31d4d96e407aad42, and the browser returns Cookie: SID=31d4d96e407aad42 with every later request to that site, so the server can recognize a session. The same exchange lets advertisers track you: a page that pulls in content from an ad network hands that network its own cookie, and it recognizes you again on every other site that carries its content 6.

Sort

Sort the header lines by who sends them.

This exercise needs JavaScript.

Fill the blanks

Fill in the headers and status of a browser checking whether its copy of a page is still current.

This exercise needs JavaScript.

Locks and keys

Everything above crossed the internet readable by every router on the way. HTTPS is the same HTTP inside TLS. In TLS 1.3 the two sides agree on keys in one round trip, every handshake message after the server’s opening hello is encrypted, and the old cipher families were dropped, leaving only authenticated encryption 7.

Encryption alone isn’t enough: you might be talking privately to an impostor. So the server presents a certificate, and the client must check that it matches the host in the address, using a set of trusted roots it already holds; that is what stops someone who controls your DNS or sits on the path from posing as the site 5. SSH faces the same problem without issuers: as SSH to Other Machines showed, you check the server’s key fingerprint yourself the first time, and ~/.ssh/known_hosts remembers it 8.

Four stacked certificate cards, joined by arrows labelled signs. Top, the root, SSL.com TLS ECC Root CA 2022, already in your trust store, shipped with the operating system or browser. It signs the intermediate SSL.com TLS Transit ECC CA R2, valid 2022 to 2037, which signs the intermediate Cloudflare TLS Issuing ECC CA 3, valid 2025 to 2035, which signs the server's own certificate, naming example.com and *.example.com, valid 26 September to 25 December 2026, about 90 days, with a P-256 key. Footer: check every signature up to a trusted root, then that it names the host; openssl reported Verification: OK.
A padlock means a chain of signatures ends at a root your computer already trusts, and the last link names the site. Credit: StudyCorner original diagram from openssl s_client output, after RFC 9110 · CC BY 4.0 · Source

The certificate above is good for about 90 days. The CA/Browser Forum, where certificate issuers and browser makers set the rules, voted in 2025 to cut the maximum lifetime from 398 days to 47 by March 2029, in steps starting in March 2026; Apple, Google, Microsoft, and Mozilla all voted yes 9.

Quick check

What does a valid certificate chain let your computer check?

Estimate

The CA/Browser Forum voted in 2025 to cut the maximum lifetime of a certificate in steps. To about how many days by March 2029?

This exercise needs JavaScript.

HTTP/2 and HTTP/3

HTTP/1.0 allowed one request at a time on a connection, so browsers opened several; HTTP/1.1’s pipelining helped only a little. HTTP/2 keeps the same methods and headers but sends them as binary frames, compressed, with many requests interleaved on one TCP connection. A single lost TCP segment still stalls all of them, since TCP delivers bytes strictly in order 10.

HTTP/3 leaves TCP. It runs on QUIC, a transport over UDP that keeps each stream’s reliability separate and has TLS 1.3 built in, so the transport and encryption handshakes happen together 11. Servers announce it in a header; example.com’s reply carried alt-svc: h3=":443"; ma=86400, meaning HTTP/3 is available on UDP port 443 11.

Select all that apply

Which are true of HTTP/3? Pick all that apply.

This exercise needs JavaScript.

From Enter to page

Type snl.no and press Enter, and the browser works through a fixed sequence 12:

Seven numbered steps down a line for loading https://snl.no/. 1, parse the address: scheme https, host snl.no, path slash. 2, DNS lookup: snl.no to 34.120.43.127, then cached. 3, TCP handshake to port 443: SYN, SYN-ACK, ACK. 4, TLS 1.3 handshake: agree keys, check the certificate. 5, HTTP request and response: GET slash, then status, headers, the HTML. 6, parse HTML into the DOM and fetch the CSS, scripts, fonts, and images it names. 7, style, lay out, paint: CSSOM plus DOM to render tree to pixels. A bracket marks steps 3 to 5 as three round trips before the first byte of the page. Footer: steps 6 and 7 repeat as each new file arrives; HTTP/3 folds 3 and 4 together.
Three round trips pass before the first byte of the page arrives; most of the rest is the browser's own work. Credit: StudyCorner original diagram after MDN's How browsers work and RFC 8446 · CC BY 4.0 · Source

The name lookup, TCP handshake, and TLS handshake come before a single byte of the page, and each costs at least one round trip 12 7. Then the HTML arrives, and the browser builds a tree of its elements, the DOM, while a preload scanner looks ahead for stylesheets, scripts, fonts, and images to fetch, with a new DNS lookup for every other host they live on. CSS becomes a second tree; the two combine into a render tree, which is laid out and painted 12.

Put in order

Put what a browser does for https://snl.no/ in order.

This exercise needs JavaScript.

Try it on Linux

openssl s_client is a bare TLS client for poking at servers; -servername sends the site’s name in the handshake so a shared server knows which certificate to show 13. Trimmed:

me@linuxbox:~$ openssl s_client -connect example.com:443 -servername example.com < /dev/null
Connecting to 104.20.23.154
depth=3 C=US, O=SSL Corporation, CN=SSL.com TLS ECC Root CA 2022
verify return:1
depth=2 C=US, O=SSL Corporation, CN=SSL.com TLS Transit ECC CA R2
verify return:1
depth=1 C=US, O=SSL Corporation, CN=Cloudflare TLS Issuing ECC CA 3
verify return:1
depth=0 CN=example.com
verify return:1
---
Certificate chain
 0 s:CN=example.com
   i:C=US, O=SSL Corporation, CN=Cloudflare TLS Issuing ECC CA 3
   a:PKEY: EC, (prime256v1); sigalg: ecdsa-with-SHA256
   v:NotBefore: Sep 26 22:49:11 2026 GMT; NotAfter: Dec 25 22:56:35 2026 GMT
[three more certificates, then this one in base64]
Negotiated TLS1.3 group: X25519MLKEM768
---
SSL handshake has read 5070 bytes and written 1631 bytes
Verification: OK
---
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
  • depth=3 down to depth=0: the chain from root to site; verify return:1 means each link checked out.
  • s: is the subject, i: the issuer who signed it, v: the dates it’s valid.
  • X25519MLKEM768: the key exchange mixes the classic X25519 with ML-KEM, a post-quantum algorithm; OpenSSL 3.5 offers it by default 14.
  • TLSv1.3 with an AES-GCM cipher, one of the authenticated ciphers TLS 1.3 kept 7.

-brief boils it down to protocol, cipher, peer certificate, and Verification: OK 13.

The web’s first pages, still online

  • The first web page, http://info.cern.ch/hypertext/WWW/TheProject.html, is served again at its original address 2. Open it in a browser, then in curl, and compare.
  • Berners-Lee’s proposal is on the W3C’s site, diagrams and all; it takes twenty minutes 1.
  • CERN’s “A short history of the Web” covers the line-mode browser, the SLAC server, and the 1993 release 2.

Read a site’s papers

Pick three sites you use. For each, run curl -sv -o /dev/null on the http:// address and note the status and where any 301 points. Then run openssl s_client -brief -connect SITE:443 -servername SITE < /dev/null and note the protocol, the group, and the issuer. Finally pipe the full output into openssl x509 -noout -dates to see when each certificate expires, and check again next month.

Lesson complete

Nice work.

1day streak
0/1today's goal
–correct

Teach it back

In two sentences, explain HTTP and the Web to a friend who missed it.

Up next · 12 min

Algorithms and Turing Machines

Turing’s 1936 machine can only read one square of tape, write a symbol, and step left or right. Given unlimited time and tape, what can a laptop compute that it can’t?

Next lesson

Related lessons

Among the stars
Sources for this lesson
  1. 1
    Information Management: A Proposal. W3C (HTML version of the CERN document). 1989. verifiedRead November 15, 2026. CERN, March 1989, redistributed May 1990; concerns managing information about accelerators and experiments, lost as people come and go (two years a typical stay); proposes a distributed hypertext system; Berners-Lee's note: the only name he had then was 'Mesh', and he chose 'World Wide Web' while writing the code in 1990.
  2. 2
    A short history of the Web. CERN. verifiedRead November 15, 2026. Tim Berners-Lee wrote the first proposal for the Web in March 1989; with Robert Cailliau it became a management proposal in November 1990; by the end of 1990 he had the first server and browser running at CERN on a NeXT computer labelled 'This machine is a server. DO NOT POWER IT DOWN!!'; info.cern.ch was the first website, first page address http://info.cern.ch/hypertext/WWW/TheProject.html; Nicola Pellow wrote the line-mode browser; the software went to CERN colleagues in March 1991 and was announced on internet newsgroups in August 1991; the first US server, at SLAC, came online in December 1991; early X browsers included Erwise, by Finnish students at Helsinki University of Technology; NCSA at the University of Illinois released Mosaic early in 1993; on 30 April 1993 CERN made the WorldWideWeb software available royalty-free; by late 1993 there were over 500 known web servers and the web was 1% of internet traffic; by the end of 1994, 10,000 servers and 10 million users.
  3. 3
    curl(1) manual page. man7.org (Linux man-pages). verifiedRead November 15, 2026. -v, --verbose: a line starting with '>' is header data sent by curl, '<' header data received, '*' additional information from curl; -i or -D for headers only; --trace for more detail.
  4. 4
    RFC 9112: HTTP/1.1. IETF. 2022. verifiedJune 2022. An HTTP/1.1 message is a start-line (a request-line or a status-line) followed by CRLF, header field lines each ending in CRLF, an empty line, and an optional body; a client must send a Host header field in every HTTP/1.1 request.
  5. 5
    RFC 9110: HTTP Semantics. IETF. 2022. verifiedJune 2022. Section 15: a status code is a three-digit integer from 100 to 599; the first digit gives the class: 1xx informational, 2xx successful, 3xx redirection, 4xx client error, 5xx server error; a client must understand the class and treat an unknown code as the x00 of its class (an unknown 471 as 400). Defines methods, header fields, and codes such as 200 OK, 301 Moved Permanently, 304 Not Modified, 404 Not Found, 500 Internal Server Error, 503 Service Unavailable. 304 means a conditional GET would have given 200, but the client already holds a valid copy, so nothing is sent. ETag (8.8.3) gives an opaque entity tag for the current representation; Last-Modified (8.8.2) a timestamp; If-None-Match (13.1.2) makes a request conditional on the server not having a matching tag; Server (10.2.4) names the server software. 4.3.4: for https a client must verify that the certificate's identity matches the URI's host, using a configured set of trust anchors, to prevent impersonation by an on-path attacker or one who controls name resolution.
  6. 6
    RFC 6265: HTTP State Management Mechanism. IETF. 2011. verifiedApril 2011. Defines the Cookie and Set-Cookie header fields, which let servers keep a stateful session over the mostly stateless HTTP protocol; example: the server sends 'Set-Cookie: SID=31d4d96e407aad42' and the browser returns 'Cookie: SID=31d4d96e407aad42' in later requests within the cookie's scope. 7.1: third-party cookies are 'particularly worrisome': resources a page loads from other servers, such as advertising networks, can set cookies that let those servers track the user between every site carrying their content.
  7. 7
    RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3. IETF. 2018. verifiedAugust 2018. The handshake negotiates a version and algorithms, authenticates the server (optionally the client), and establishes shared keys, after which application traffic is protected. Changes from TLS 1.2: legacy ciphers removed, only AEAD algorithms remain; static RSA and Diffie-Hellman removed, so all public-key exchanges give forward secrecy; all handshake messages after ServerHello are encrypted; a zero round-trip (0-RTT) mode was added; the full handshake takes one round trip (1-RTT). The server_name extension (RFC 6066) names the host the client wants.
  8. 8
    ssh(1) manual page. man7.org (Linux man-pages). verifiedOpenSSH remote login client; on first connection the server's host key fingerprint is shown (check with ssh-keygen -l -f on the server's host key) and stored in ~/.ssh/known_hosts; ~/.ssh/authorized_keys lists public keys allowed to log in as the user; a command given after the host runs instead of a login shell.

    Also cited in SSH to Other Machines, Backups and Health Checks.

  9. 9
    Ballot SC081v3: Introduce Schedule of Reducing Validity and Data Reuse Periods. CA/Browser Forum. 2025. verifiedVoting ended April 11, 2025; read November 15, 2026. Reduces the maximum validity of public TLS certificates from 398 days to 47 days in steps from March 2026 to March 2029; 25 certificate issuers voted yes, none no, five abstained; Apple, Google, Microsoft and Mozilla all voted yes; the ballot passed.
  10. 10
    RFC 9113: HTTP/2. IETF. 2022. verifiedJune 2022. HTTP/1.0 allowed one outstanding request per TCP connection; HTTP/1.1 pipelining only partly helped and still suffers head-of-line blocking, so clients open several connections; HTTP/2 interleaves messages on one connection with binary framing and compressed fields, but does not solve TCP head-of-line blocking.
  11. 11
    RFC 9114: HTTP/3. IETF. 2022. verifiedJune 2022. HTTP/3 maps HTTP semantics onto QUIC, a UDP-based transport (RFC 9000) with stream multiplexing, per-stream flow control and reliability at the stream level, and TLS 1.3 built in; servers advertise it with the Alt-Svc response header, e.g. Alt-Svc: h3=":50781"; servers may use any UDP port; UDP blocking can make it fail.

    Also cited in IP, TCP, and DNS.

  12. 12
    How browsers work. MDN Web Docs (Mozilla). verifiedRead November 15, 2026. Navigation: DNS lookup (cached afterwards; one per hostname the page uses), TCP three-way handshake, TLS negotiation for HTTPS, then an HTTP GET for the HTML; the browser parses HTML into the DOM, a preload scanner fetches CSS, scripts and fonts, CSS becomes the CSSOM, the two combine into a render tree, then layout, paint, and compositing. (Its figure of five TLS round trips describes older TLS; RFC 8446 gives one.)
  13. 13
    openssl-s_client (OpenSSL 3.5 manual). OpenSSL Project. verifiedRead November 15, 2026. s_client implements a generic SSL/TLS client and is a diagnostic tool for TLS servers; -connect host:port; -servername sets the SNI extension in the ClientHello (defaulting to the -connect name); -brief prints only a short summary of the connection parameters.
  14. 14
    OpenSSL 3.5 release notes. OpenSSL Library. verifiedRead November 15, 2026. OpenSSL 3.5 adds post-quantum algorithms including ML-KEM, prefers hybrid PQC key-exchange groups, and changes the default TLS keyshares to offer X25519MLKEM768 and X25519; adds server-side QUIC (RFC 9000).