CHAPTER 1 OF 28EASY
The Big Picture: What Happens When You Open a Website
Questions from the notes answered here: How the web actually works. How the internet works.
Every website you have ever opened followed the same journey. You type google.com, press Enter, and in under two seconds a page appears. Behind that moment, at least six separate systems worked together. This chapter gives you the whole map first. Every later chapter zooms into one stop on this map.
The six stops, in plain words
- 1. You type a URL. The browser reads the address and works out what you want (Chapter 3).
- 2. DNS lookup. Computers do not understand names like google.com. DNS translates the name into an IP address, like a phone book (Chapter 5).
- 3. Connection. Your computer opens a reliable connection to that IP address on a port, using TCP (Chapters 4 and 6).
- 4. Security. If the address starts with https, TLS encrypts the connection so nobody in between can read it (Chapter 9).
- 5. Request and response. The browser sends an HTTP request ("give me this page"). The server sends back an HTTP response with a status code, headers and the page itself (Chapters 2, 8, 10, 11).
- 6. Rendering. The browser reads the HTML, CSS and JavaScript and paints the page on your screen (Chapter 13).
KEY IDEAThe internet is the road network (cables, routers, Wi-Fi, mobile towers). The web is one kind of traffic on those roads: pages and data moved using HTTP. WhatsApp, email and online games also use the internet, but not always the web.
EASY ANALOGYThink of ordering food by post. You know the restaurant's name (URL). You look up its street address in a directory (DNS). The postal service delivers your letter in numbered envelopes and confirms each one arrived (TCP). You seal the letter so the postman cannot read it (TLS). The restaurant reads your order and sends back the food with a note saying "order OK" (response with status 200).
TRY IT YOURSELF (2 MINUTES)Open any website in Chrome, press F12, click the Network tab and reload the page. Every row you see is one request and response. Click the first row and look at Status, Request URL and Headers. By the end of Part 1 you will understand every field on that screen.
THE RULE
The Six Stops Rule
Every page load is URL, DNS, TCP, TLS, HTTP, render. When something breaks, find which stop failed.
Check yourself
1. What does DNS do?
2. The internet and the web are...