How the Internet Works
Follow a web request from your device to a server and back, and learn what packets, IP addresses, routers, DNS, TCP and HTTP each contribute.
Welcome back!
Step 1 of 15Learn
What happens when you press Enter
You type example.com into a browser and press Enter. Less than a second later, a page appears. In that moment, your request may have crossed an ocean and back, passing through a dozen machines owned by different companies, none of which had heard of you before.
The internet is a network of networks: billions of devices connected through home routers, internet service providers, undersea cables and data centers. No single company runs it. It works because every device follows the same protocols, agreed rules for formatting and exchanging data.
Here's the route, simplified:
- DNS lookup: your device asks, "What is the IP address of example.com?"
- Connection: your device opens a connection to that address using TCP, usually secured with TLS encryption.
- Request: the browser sends an HTTP request: "GET the home page, please."
- Routing: the request is split into packets, which hop from router to router toward the server.
- Response: the server sends back the page's HTML, again as packets.
- Rendering: your browser reassembles the packets and draws the page, often making dozens more requests for images, styles and scripts.
Each step is handled by a different protocol, stacked in layers, another example of abstraction. The browser doesn't care whether the packets traveled over Wi-Fi, fiber or a phone network.
Step 2 of 15Practice · Put in order
Put these steps of loading a web page in order.
Drag the items, or use the arrow buttons, to put them in order.
- The browser asks DNS for the site's IP address
- The browser sends an HTTP request for the page
- The browser opens a secure connection to that IP address
- The server sends back the page as packets
- The browser reassembles the data and displays the page
Step 3 of 15Diagram
Loading example.com
Tap a shape with to see more.
- DNS lookup
Name → IP address.
- Secure connection
TCP connection plus a TLS handshake.
- HTTP request
GET / for the page.
- Response in packets
Packets may travel different routes.
- Browser renders
Then requests images, styles and scripts the same way.
Step 4 of 15Learn
Addresses and packets
Every device on the internet needs an address, just as every house needs one for mail. An IP address (Internet Protocol address) identifies where data should go.
The original version, IPv4, uses 32-bit addresses written as four numbers from 0 to 255, like 93.184.215.14. That gives 232, about 4.3 billion addresses, fewer than the number of devices now online. The newer IPv6 uses 128-bit addresses, giving about 3.4 × 1038 possibilities, enough for every grain of sand on Earth to have trillions. Your home router also uses a trick called NAT to let many devices share one public IPv4 address.
Data doesn't travel as one big block. It's split into packets, small chunks typically up to about 1,500 bytes, each labeled with the source and destination addresses and a sequence number. Routers pass each packet one hop closer to its destination, choosing paths based on current network conditions. Packets from the same message may take different routes and arrive out of order.
Why packets? If one link fails or gets congested, packets simply route around it. Many users can share the same cables at once, with their packets interleaved. This design, called packet switching, came from research in the 1960s on building networks that keep working even when parts fail.
Step 5 of 15Practice · Diagram
How many addresses?
Tap the number that is smaller than the world's population.
Tap the shape that answers the question, then press Check.
- IPv4 addresses (2^32)
About 4.3 billion.
- People on Earth
About 8.1 billion in 2024.
- IPv6 addresses (2^128)
About 340 undecillion: effectively unlimited.
Step 6 of 15Practice · Work it out
A 6,000,000-byte photo is sent in packets that each carry 1,500 bytes of data. How many packets are needed?
Step 7 of 15Learn
DNS, TCP and HTTP
DNS (Domain Name System) is the internet's phone book. People remember names like example.com; routers need numbers. When you visit a site, your device asks a DNS resolver, which may ask a chain of servers (root, then .com, then the site's own name server) until it gets the IP address. Answers are cached for a while, so the next lookup is instant.
TCP (Transmission Control Protocol) makes unreliable packet delivery reliable. It numbers every packet, puts them back in order, asks for missing ones to be resent and slows down when the network is congested. Some apps, like video calls and online games, use UDP instead, which skips these guarantees for speed: a late video frame is useless anyway.
HTTP (Hypertext Transfer Protocol) is the language of the web. A browser sends a request with a method and a path, such as GET /index.html, and the server replies with a status code and content. You've seen some codes: 200 means OK, 404 means not found, 500 means the server had an error.
HTTPS is HTTP inside an encrypted TLS connection. The padlock in the address bar means others on the network can't read or alter the data in transit, though it says nothing about whether the site itself is trustworthy.
Step 8 of 15Practice · Match the pairs
Match each protocol with its job.
Tap an answer, then tap the place where it belongs (or drag it there).
- DNS
- IP
- TCP
- HTTP
- TLS
Step 9 of 15Diagram
The layers of a web request
Tap a shape with to see more.
- HTTP
Requests and responses: GET this page, here it is.
- TLS
Encrypts everything above it; the S in HTTPS.
- TCP
Reliable, in-order delivery.
- IP
Addresses and routing of packets.
- Wi-Fi, Ethernet, fiber
Moves bits across one physical hop.
Step 10 of 15Note
Step 11 of 15Note
Step 12 of 15Practice · Choose one
You click a link and see "404 Not Found." What does this tell you?
Step 13 of 15Practice · True or false
Every packet of a single file always follows exactly the same route across the internet.
Step 14 of 15Note
Step 15 of 15Practice · Select all that apply
Which statements about HTTPS are true? Select all that apply.
Select all that apply.
Lesson complete!