What happens when you open a website
You type an address and see the page a moment later. In between, a dozen messages travel between the browser, DNS and the server. Walk through them one by one.
The tool could not be loaded. Check your connection and reload the page.
Use the arrow keys to move between steps. Click a term to see what it means, or any row of the timeline.
Terms in this step
Sent
Inside the message
Certificate checks
What someone on the network sees
Where the time goes
Times are typical values for illustration, not measurements.
How it works
First the browser needs the IP address. It asks a DNS resolver (usually your provider's or 1.1.1.1), which, if the answer is not cached, walks the hierarchy: root servers, the .com servers and finally the domain's authoritative server.
Then it opens a connection. HTTP/1.1 and HTTP/2 need a TCP handshake followed by TLS; HTTP/3 uses one QUIC connection over UDP that does both at once. TLS 1.3 takes one round trip, TLS 1.2 two.
The browser checks the certificate: the chain to a trusted authority, the validity dates, the host name and the signature. If anything is wrong it closes the connection before sending any data.
The server builds the page and sends the HTML. The browser turns it into the DOM, downloads the CSS (which blocks rendering) and then lays out and paints the page. Timings are typical values; real ones depend on the network and the server.
When it helps
- Interview preparation: "what happens when you type a URL into the browser" is a classic question.
- Explaining to a client why the site is slower on mobile and what helps (caching, HTTP/3, a CDN).
- Understanding what your provider or a public Wi-Fi can see of HTTPS traffic.
Glossary 43 terms
- Cache
- A stored copy of an answer, so it doesn't have to be fetched or computed again. The browser, for example, remembers a site's IP address until its TTL runs out.
- IP address
- The numeric address of a computer on the internet, such as 203.0.113.10. Routers deliver data by it, like the post delivers by the address on an envelope.
- DNS
- The phone book of the internet. It turns names like example.com into the IP addresses computers understand.
- DNS resolver
- A server that walks the DNS servers for you and brings back the answer. Usually run by your internet provider, or by Cloudflare (1.1.1.1) and others.
- UDP
- A quick way to send data without setting up a connection: the packet is simply sent. If it gets lost, the sender has to ask again. DNS and QUIC use it.
- DNS root server
- The top of the DNS hierarchy. It doesn't know specific addresses, but it knows who runs each ending (.com, .org, .uk).
- TLD (top-level domain)
- The ending of a domain, like .com or .org. Its servers know where to find the servers of each domain.
- NS record
- A DNS pointer saying "for this domain, ask over there". It names the servers that hold the domain's answers.
- Authoritative DNS server
- The server that manages a domain's records and knows the definitive answer. Everyone else only passes it on or remembers it.
- A record
- A DNS record that maps a domain name to an IPv4 address. The IPv6 equivalent is the AAAA record.
- TTL (time to live)
- How long others may remember an answer before they have to ask again, for example 300 seconds.
- TCP
- Reliable data transfer: it numbers the packets, checks they arrived and resends lost ones. Both sides shake hands before any data flows.
- SYN
- The first packet of a TCP connection: "I'd like to connect, I'll count from this number." The server replies SYN-ACK, agreeing and sending its own number.
- ACK
- An acknowledgement: "got it". The third message of the handshake (ACK) completes the connection, then ACKs keep confirming received data.
- Port
- A door number on a computer that tells which service the data is for. The web uses 443 (HTTPS) or 80 (HTTP), mail uses 587 among others.
- Round trip (RTT)
- The time a message takes to reach the server and the reply to come back. A few milliseconds on fibre, tens on mobile. Every extra round trip adds delay.
- QUIC
- A newer transport protocol over UDP that HTTP/3 runs on. It sets up the connection and the encryption at once, saving a round trip.
- TLS
- The encryption layer that turns HTTP into HTTPS. Nobody can read or change the data, and you know you are talking to the right server.
- ClientHello
- The browser's first message of a secure connection: which versions and ciphers it supports, which site it wants and, in TLS 1.3, its half of the key.
- SNI
- The site name the browser sends at the very start, so a server hosting hundreds of sites knows which certificate to show. Observers can usually read it.
- Cipher suite
- A combination of algorithms for encrypting and checking data, such as TLS_AES_128_GCM_SHA256. The browser offers a list, the server picks one.
- ServerHello
- The server's answer: the chosen TLS version and cipher, and its half of the key. From here on the rest of the handshake can be encrypted.
- Certificate
- A server's digital ID: "this key belongs to example.com", signed by a trusted authority. It is valid for a limited time.
- Finished
- The closing handshake message with a checksum of everything sent so far. If anyone tampered with the handshake on the way, the connection fails.
- Certificate authority
- An organisation browsers trust to issue certificates only to the right people, such as Let's Encrypt. It checks that you really control the domain.
- Digital signature
- Proof made with a private key that anyone can check with the public key. It can't be forged and reveals any change to the signed data.
- TLS alert
- An error message of a secure connection. A fatal alert ends the connection at once and the browser shows a warning page.
- HTTP
- The language the browser and a website speak: "GET /page", and the server answers with a status and the content. Without TLS it all travels readable.
- HTTP/2
- A newer HTTP that sends many files over one connection at the same time and compresses headers. It runs over TCP and TLS.
- HTTP/3
- The latest HTTP, running over QUIC instead of TCP. It connects faster and copes better with lost packets on mobile.
- Cookie
- A small piece of data a site stores in your browser, which sends it with every request. It typically keeps you logged in, so it is valuable.
- Encryption
- Turning data into a form nobody can read without the key. Only a meaningless jumble of bytes travels over the network.
- Man-in-the-middle attack
- An attacker sits on the path between you and the server, for example on a fake Wi-Fi, and reads or changes unencrypted traffic. HTTPS prevents it.
- Backend
- The part of a website that runs on the server: the application, the database, the logic. Visitors don't see it, only the HTML it produces.
- TTFB (time to first byte)
- The time from sending a request until the first byte of the answer arrives. It shows how quickly the server prepares the page.
- HTTP status code
- A three-digit number in the response: 200 means OK, 301 a redirect, 404 not found, 500 a server error.
- HTML
- Text with tags that describes the content and structure of a page: headings, paragraphs, links, images.
- Compression (gzip)
- Shrinking data before sending; the browser unpacks it. The text of a page can shrink to a quarter and arrive sooner.
- DOM
- The tree of page elements the browser builds from the HTML. Styles and JavaScript work on it.
- CSS
- A page's styles: colours, fonts, layout. The browser waits for them before drawing, so the page doesn't flash without its look.
- Render-blocking resource
- A file the browser won't start drawing without, typically CSS in the head. Each one delays the first pixels.
- Layout and paint
- The browser works out where everything goes (layout), draws it (paint) and stacks the layers into the final image (composite).
Frequently asked questions
// 01 Why is HTTP/3 faster?
HTTP/3 runs over QUIC, which combines setting up the connection and TLS into one round trip. The separate TCP handshake disappears, which is noticeable on a mobile network with 60 ms latency.
// 02 What does my provider see of HTTPS?
IP addresses, the domain name (in the ClientHello, unless the site uses Encrypted Client Hello) and the amount and timing of data. Not the page, the cookies or the content.
// 03 Why does DNS caching help?
An answer stored in the browser or by the resolver saves the whole trip through the DNS hierarchy. The record's TTL decides how long it may be reused.
You may also need
Did this save you time?
The tools and simulations are free, ad-free and need no sign-up. If they helped you, you can send a contribution for coffee and new tools.
Donate via PayPalNeed a hand?
I build and maintain web applications in Laravel and PHP. If something on these pages is giving you trouble in a project, get in touch.
Get in touch