Network Bytes · Episode 7 · CCNA 1.5
What happens when you type a URL?
You type a web address and press Enter. Here are the six steps that happen before the page appears, often in well under a second.
Steps 1 and 2: find the server, then say hello
Your computer can't use a name like example.com to reach a website. It needs the server's IP address, so it first asks DNS, the internet's contacts list: "what's the address for example.com?" DNS answers with a number, such as 203.0.113.10.
Next, your computer and that server do the TCP three-way handshake: your computer sends SYN, the server answers SYN-ACK, and your computer replies ACK. Now both sides know the other is there and ready to talk.
Step 3: lock the connection
If the address starts with https://, the two sides then do a TLS handshake. They check that the server is really who it says it is and agree on secret keys. From then on, everything they send is scrambled, so anyone in between (on public Wi-Fi, for example) sees only gibberish. That's what the little padlock in your browser bar means.
Steps 4 to 6: ask, receive, draw
With a safe connection open, your browser sends an HTTP request, basically "please send me this page." The simplest one is GET /, which asks for the site's home page.
The server answers with the page as code: HTML that describes what's on the page. Your browser reads that code, notices it also needs pictures and style sheets (CSS), asks for those too, and then renders the page: it works out where every heading, image and paragraph goes and draws them on your screen.
Try it yourself
Open any website, then open your browser's developer tools (F12 on Windows, Option+Command+I on a Mac) and click the Network tab. Reload the page. Every line is one request: the first is the page's HTML, and the rest are the pictures, styles and scripts the browser fetched after reading it. Click the padlock in the address bar to see the site's certificate from step 3.
Good to know
- This is a simplified overview. Steps can be skipped or combined: if your computer already has the DNS answer saved (cached), step 1 is skipped.
- Newer sites using HTTP/3 run over QUIC (on UDP), which merges the handshake and the encryption setup into one step.
- Each step gets its own episode, and the long-form video goes through them one by one.
For CCNA learners
This ties together CCNA 200-301 exam topics 1.5, compare TCP to UDP (the three-way handshake) and 4.3, explain the role of DHCP and DNS: be able to put DNS resolution, the TCP handshake and the application request in order.
Test your knowledge
Quick quiz: What happens when you type a URL?
4 multiple-choice questions. Pick one answer for each, then check how you did.
Sources
- MDN Web Docs, "Populating the page: how browsers work": DNS lookup, TCP handshake, TLS negotiation, HTTP request and response, then rendering
- Cloudflare Learning Center, "What happens in a TLS handshake?": the two sides agree on session keys; this is how HTTPS is secured
- Cloudflare Learning Center, "What is DNS?": DNS turns a name into an IP address
- Cisco, CCNA 200-301 v1.1 exam topics: 1.5 TCP and UDP; 4.3 DNS
Video transcript
You type a web address and press Enter. Six things happen before you can blink.
One: your computer asks DNS for the site's IP address. Two: it does the three-way handshake with that server, to make sure both sides are ready.
Three: for a site that starts with HTTPS, they agree on a secret key, so nobody in between can read your data. That's the little padlock in your browser bar. Four: your browser sends a request, basically "please send me this page."
Five: the server sends the page back as code. Six: your browser reads that code, fetches the pictures and styles it needs, and draws the page on your screen.
Six steps, often in well under a second. Every single time.
More from Network Bytes
- EP02Router vs switch vs modem
- EP03What is an IP address?
- EP04What is a MAC address?
- EP05Public vs private IP