Trace what happens between typing a web address and seeing the page: DNS, IP addresses, packets and HTTP.
Why it matters
Cloud dashboards, lab instruments that upload results, online code editors, a smart meter on a building: almost every tool you will use at work talks over the internet. When something "won't load", knowing the steps a request goes through lets you narrow the problem down instead of guessing. It is also the foundation for later courses on networking, web development and cybersecurity.
The core idea: a network of networks
The internet is millions of separate networks (homes, companies, universities, phone carriers) connected so they can pass data to each other. The web is one service that runs on top of it: pages and apps fetched with a protocol called HTTP. Email, video calls and file sync are other services on the same internet.
Four ideas explain most of what happens.
1. Every device has an IP address
An IP address is a number that identifies a device on a network, like a postal address. IPv4 addresses look like 93.184.215.14; the newer IPv6 addresses look like 2606:2800:21f:cb07:6820:80da:af6b:8b2c.
2. DNS turns names into addresses
People remember names like codinghelp.org; computers route by IP address. The Domain Name System (DNS) is the internet's phone book. Your device asks a DNS resolver "what is the address for this name?" and gets an IP back. Results are cached, so repeat visits are faster.
3. Data travels in packets
Data is split into small packets. Each packet carries the destination address and travels hop by hop through routers, which pass it towards its destination. Packets from the same file can take different routes. TCP numbers the packets, puts them back in order at the other end and asks for any lost ones to be sent again, so you get the whole file intact.
4. HTTP is the conversation between browser and server
Once connected, your browser sends an HTTP request ("please give me this page") and the server sends an HTTP response with a status code and the content. HTTPS is HTTP inside an encrypted connection (TLS), so nobody on the path can read or change the data. The padlock in the address bar means the connection is encrypted; it does not mean the site is honest.
Anatomy of a URL
https://www.example.com:443/docs/start?lang=en#install
\___/ \_____________/ \_/\_________/\______/\______/
scheme host port path query fragment
- Scheme: how to talk (
https). - Host: the server's name, looked up with DNS.
- Port: which service on that server (443 is the default for HTTPS, so it is usually hidden).
- Path: which resource.
- Query: extra parameters, often for searches or filters.
- Fragment: a spot within the page; it never leaves your browser.
Worked example: loading a page
You type https://www.example.com/docs and press Enter.
- The browser checks its cache, then asks DNS for the IP address of
www.example.com. - It opens a TCP connection to that IP on port 443 and sets up TLS encryption, checking the site's certificate.
- It sends a request:
GET /docs HTTP/1.1
Host: www.example.com
Accept: text/html
- The request travels as packets through your router, your internet provider, and several other networks to the server.
- The server replies:
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
followed by the HTML of the page.
- The browser reads the HTML, finds images, styles and scripts it also needs, and requests each of them the same way.
- It draws the page.
All of this usually takes well under a second.
Status codes worth knowing
- 200 OK: it worked.
- 301 / 302: moved; the browser follows the new address.
- 404 Not Found: the server is fine but that path does not exist.
- 401 / 403: you are not signed in, or not allowed.
- 500 / 503: something went wrong on the server, or it is temporarily unavailable.
Common mistakes
- "The internet is down" when only DNS or one site is. If one site fails and others work, the problem is probably that site, not your connection.
- Trusting the padlock as proof of safety. HTTPS protects the connection; criminals can get certificates too. Check the domain name itself.
- Mixing up the internet and the web. The web is one service on the internet.
- Thinking data goes in one piece. It travels in packets, which is why a weak connection makes pages load in bits.
Quick recap
- The internet connects networks; the web is HTTP on top of it.
- DNS turns names into IP addresses.
- Data moves in packets through routers; TCP reassembles them reliably.
- A browser sends HTTP requests and receives responses with status codes; HTTPS encrypts them.
Try it
Open the Do tab and take the quiz. To see real requests, open your browser's developer tools (F12, or Cmd + Option + I on a Mac), choose the Network tab and reload any page.