edubun
English

What happens when you open a web page

With a 50 ms round trip, an HTTPS page needs at least 4 round trips, 200 ms, before the first byte of HTML arrives. HTTP/3 cuts one.

Seven forty in the morning. A student on a crowded train taps a link to the school lunch menu on mobile data, and a moment later today's menu appears. (This is a made-up scene.) In that moment the phone did everything from the last five units: a DNS lookup, a TCP connection, an encrypted session, and an HTTP request answered with a status code. Follow the phone through it and count the waits.

First the phone reads the link

Say the link is https://www.example.com/index.html. MDN breaks a URL into parts. https is the scheme: use HTTP over an encrypted TLS connection, on port 443 unless another port is written. www.example.com is the host, the name DNS will turn into an address. /index.html is the path, the resource asked for on that server. A URL can also carry a query after a question mark and a fragment after a hash sign. The fragment points to a spot inside the page and is never sent to the server.

Four round trips before the first byte

The time for a message to reach the server and for the reply to come back is the round-trip time (RTT). Count the round trips and you can see where the wait comes from. One: if the name is not cached, the DNS lookup costs about one round trip to the resolver. Two: the TCP handshake, SYN out and SYN-ACK back. Three: TLS 1.3 (RFC 8446) agrees on keys in one round trip, and the client's last handshake message can travel with the HTTP request. Four: the request goes out and the response comes back. With a 50 ms RTT, that is 200 ms before the first byte of the menu, even if the server answers instantly.

Loading

Drag to turn. Scroll or pinch to zoom.

Press Next step to add each message, or Show all. Switch between HTTPS, plain HTTP and HTTP/3 and move the round-trip slider. The count at the left edge shows how many round trips have passed. Server thinking time and page size are left out.

HTTP/3 (RFC 9114) runs on QUIC (RFC 9000) instead of TCP. QUIC sits on UDP and sets up the connection and the TLS keys together, so the separate TCP round trip disappears: DNS, one handshake round trip, then the request, three in all. Plain HTTP on port 80 skips TLS and also needs three, but then anyone on the path, such as whoever runs a café's Wi-Fi, can read or change the page. The padlock in the address bar means the connection to that domain is encrypted. It does not mean the site itself is honest.

The menu arrives with a number in front

The reply starts with a three-digit status code. RFC 9110 groups codes by their first digit: 1xx informational, 2xx success, 3xx redirection, 4xx client error and 5xx server error. The ones you will meet most are 200 OK, 301 Moved Permanently (the page has a new address), 404 Not Found and 500 Internal Server Error. If the school had moved the menu page, the phone would first get a 301 and then ask again at the new address. A 404 means the server answered and had nothing at that path, so the network itself was working.

One page, many files

The HTML is rarely the whole page. Say it mentions a style sheet, a script and five images. If the phone opened a new connection for each, every file would pay the TCP and TLS round trips again. Instead the browser keeps the connection open and sends the next requests on it, and with HTTP/2 and HTTP/3 several requests travel on one connection at the same time. Browsers also keep their own cache. When a response says it may be reused for a while, the next visit loads that file from storage without sending any request. Only when the files are in does the browser lay out and paint what you see. That is why the menu page the student opens every morning appears faster than a site opened for the first time, even on the same network.

RTTRound-trip time: there and back
200OK
301Moved Permanently
404Not Found
500Internal Server Error
HTTP/3HTTP over QUIC, which runs on UDP
  1. RTT is 50 ms. How long before the first byte of an HTTPS page (TCP + TLS 1.3), counting the DNS lookup?
  2. Same 50 ms RTT, but over HTTP/3. How long?
  3. RTT is 80 ms and the name is already cached. How long does an HTTPS page over TCP take?
  4. Put these in order for loading an HTTPS page.
  5. What does 404 mean?
    • Not Found
    • OK
    • Moved Permanently
    • Server error
  6. Which class of status codes means redirection?
    • 3xx
    • 2xx
    • 4xx
    • 5xx
  7. Which port does https:// use when no port is written?
  8. In https://www.example.com/index.html, what is /index.html?
    • The path
    • The scheme
    • The host
    • The port
  9. Which transport does HTTP/3 run on?
    • QUIC over UDP
    • TCP
    • DNS
    • ICMP
  10. What does the padlock in the address bar tell you?
    • The connection to that domain is encrypted
    • The site is safe and honest
    • The site has no ads
    • The page loaded with HTTP/3
Common mistakes
  • "The padlock means the site is safe." The padlock only says the connection to that domain is encrypted with TLS. A scam site can have one too, so check that the domain is the one you meant.
  • "Incognito mode hides what I visit from my ISP and my school." Incognito mode stops the browser keeping history and site data on your device after the session ends. Google's Chrome Help says the sites you visit, and organisations that manage your network such as a school, an employer or an internet service provider, may still be able to observe your activity. Your packets cross the same routers either way.
  • "A 404 means the internet is down." A 404 is an answer from the server: it was reached and has nothing at that path. When the network really is down, no status code arrives at all.
  • "The part after # in a link is sent to the server." The fragment stays in the browser and only picks a spot inside the page. It is never sent to the server.
Teacher's noteThis unit pulls the whole course together, so before showing the diagram, ask learners to explain the order in their own words: why the name must become an address before any connection, and why encryption has to be set up before the request goes. Counting round trips is the part that stays with them. Work 50 ms by hand, then have them predict the total before they move the slider. The padlock and incognito mistakes are not about speed, but give them a few minutes anyway, because learners act on both beliefs.
Key points
  • A URL has a scheme (https), a host (DNS name) and a path.
  • HTTPS over TCP: DNS + TCP + TLS 1.3 + request = 4 round trips before the first byte.
  • HTTP/3 over QUIC merges the handshakes: 3 round trips.
  • Status codes: 2xx success, 3xx redirection, 4xx client error, 5xx server error.
Sources for this course (28)
  • (checked 2026-10-17; reordered 2026-10-19: standards first, then official documentation, then operators and papers, history sources last)
  • IETF RFCs (rfc-editor.org): RFC 768 UDP (1980, 8-byte header)
  • RFC 791 IPv4 (1981, 32-bit addresses, "does not provide a reliable communication facility", TTL field "measured in units of seconds" but every module must decrease it by at least one, so it is only an upper bound)
  • RFC 792 ICMP (Time Exceeded)
  • RFC 801 NCP/TCP transition plan (1 January 1983)
  • RFC 894 Ethernet (1500-byte payload)
  • RFC 1034 and RFC 1035 DNS (1987, HOSTS.TXT kept by SRI-NIC, labels up to 63 octets and names up to 255, TTL in seconds)
  • RFC 1122 (127.0.0.0/8 loopback)
  • RFC 1918 private addresses (10/8, 172.16/12, 192.168/16)
  • RFC 2131 DHCP, RFC 3022 NAT, RFC 3596 AAAA records, RFC 3849 and RFC 5737 documentation addresses, RFC 4271 BGP-4, RFC 4291 IPv6 text form, RFC 6298 TCP retransmission timer (initial RTO 1 second)
  • RFC 6335 port ranges (0-1023, 1024-49151, 49152-65535)
  • RFC 7766 DNS over TCP, RFC 8200 IPv6 (128-bit addresses, Hop Limit)
  • RFC 8446 TLS 1.3 (one round-trip handshake)
  • RFC 9000 QUIC and RFC 9114 HTTP/3, RFC 9110 HTTP semantics (status code classes)
  • RFC 9293 TCP (three-way handshake, sequence numbers)
  • IANA: ip-parameters registry (recommended default TTL 64)
  • IPv4 free pool depleted 3 February 2011 (NRO and ARIN announcements)
  • Official documentation: MDN Web Docs "How does the Internet work?" (45 cables for 10 computers, switches, routers, MAC and IP addresses, internet and web)
  • "What is a URL?", "HTTP response status codes" (developer.mozilla.org)
  • Cloudflare Learning Center: "What is DNS?" (four kinds of DNS server, 8 steps of an uncached lookup, browser and OS caches, TTL)
  • "What is HTTP/3?" (cloudflare.com/learning)
  • Google Chrome Help, "Browse in Incognito mode" (support.google.com/chrome/answer/95464, checked 2026-10-19: Incognito limits what is saved to the device; websites and organisations that manage your network, like your school, employer or internet service provider, may be able to observe your activity)
  • Operators and papers: root-servers.org (13 root name servers run by 12 organisations, 2047 instances on 2026-10-17)
  • Jacobson and Karels 1988, Congestion Avoidance and Control (loss mostly congestion)
  • History blocks only: UCLA Samueli School of Engineering, Internet50 (first ARPANET message "LO", UCLA to SRI, 29 October 1969, 22:30)
  • historyofinformation.com and Wikipedia ARPANET (Kline)
  • Spiceworks/SRI history (HOSTS.TXT kept by SRI-NIC)
  • Numbers (2^32, 2^96, 45 and 6 cables, packet counts, round-trip times)

Checked: 2026-10-17