Everyways Β· how-to

How the Internet Works

Every time you open a web page, a small parcel of data leaves your device, crosses a dozen machines it has never met, and comes back with an answer β€” usually in less time than it takes to blink. Here is what actually happens, one step at a time.

β–ΆWatch a request happen

A single page load, played out across a small island. Drag to pan, rotate the view with the arrow buttons, and switch scenarios to see what happens when things go wrong.

Packet Park β€” request simulator
elapsed 0 ms packets delivered 0 lost 0
1

Loading… Starting the simulation.

Keyboard: focus the map, then use ← β†’ to rotate, + βˆ’ to zoom and space to pause. The clock is slowed down enormously β€” in reality the whole journey takes a few hundred milliseconds.

01The internet is a network of networks

There is no single machine called "the internet", and nobody owns it. What exists is roughly seventy-five thousand independent networks β€” universities, phone companies, hosting providers, governments, cloud platforms β€” that have each agreed to carry one another's traffic. Each of those networks is called an autonomous system.

Your home network is a tiny one, attached to your internet service provider's much bigger one. Their network connects to others, often at a shared building called an internet exchange point, where hundreds of networks plug into a common switch and swap traffic. The internet is the sum of those agreements.

The one idea to keep

The network makes no promises. It will do its best to move a parcel of data towards its destination, and that is all. Everything that feels reliable β€” a video that does not stutter, a payment that does not go through twice β€” is built on top of an unreliable network by software at the two ends.

02Addresses, names, and the phone book

Every device reachable on the internet has an IP address: a number that identifies where it is on the network. IPv4 addresses look like 93.184.216.34 and there are about four billion of them, which ran out years ago. IPv6 addresses look like 2606:2800:220:1:248:1893:25c8:1946 and there are enough for every grain of sand to have several trillion.

People are bad at remembering numbers, so we use names. The Domain Name System translates between them. When you ask for example.com, your device asks a resolver β€” usually run by your ISP or a public service β€” which walks down a hierarchy: the root servers know who runs .com, the .com servers know who runs example.com, and that final authoritative server knows the actual address.

QuestionAsked ofAnswer
Where is example.com?Your resolverLet me find out…
Who handles .com?A root serverThese thirteen servers do
Who handles example.com?A .com serverThis name server does
What is example.com's address?That name server93.184.216.34

Every answer comes with a time-to-live, so the resolver can remember it. That is why the first visit to a site feels slightly slower than the second: the phone book lookup only happens once.

03Everything travels as packets

Data is never sent as one continuous stream down a wire. It is chopped into packets β€” typically around 1,500 bytes each β€” and every packet travels independently. A photo might be five hundred packets; they may take different routes and arrive out of order.

Each packet is an envelope inside an envelope:

Link header

Which machine on this cable or Wi-Fi network to hand it to next. Rewritten at every hop.

IP header

The source and destination addresses. Survives the whole journey unchanged.

TCP/UDP header

Port numbers, sequence numbers β€” which application, and where this piece fits.

Payload

The actual bytes you care about: a fragment of HTML, a slice of video, part of a key exchange.

This is why the internet scales. Nothing reserves a private line between you and a server. Packets from millions of unrelated conversations are interleaved on the same fibres, each one handled on its own merits and forgotten immediately afterwards.

04Routing: nobody knows the whole way

No device on the internet knows the full path to your destination. A router only knows one thing: given this destination address, which neighbour should I hand it to? It makes that decision in microseconds and moves on. The path emerges from thousands of such local decisions, like water finding its way downhill.

Routers learn from each other using the Border Gateway Protocol, in which networks announce which addresses they can reach and how. It is a system built largely on trust, which is why a mistaken announcement in one country can occasionally pull a service offline on the other side of the planet.

# what the path actually looks like $ traceroute example.com 1 router.home 1.2 ms ← your own Wi-Fi router 2 isp-access-gw 8.9 ms ← your ISP's local exchange 3 isp-core-ams 11.4 ms ← their national backbone 4 ix-peering-fabric 12.1 ms ← an internet exchange 5 edge-cache-ams 12.6 ms ← a copy of the site, nearby

Each line is one hop, and the numbers are round-trip times. Notice how little time the last few hops add β€” and how much a hop across an ocean would.

05TCP: making an unreliable network feel reliable

Since packets can be lost, duplicated or reordered, something has to clean up. That something is TCP, running on your device and on the server β€” not in the network in between.

  1. The handshake. Your device sends SYN, the server replies SYN-ACK, your device confirms with ACK. Now both sides agree a conversation exists.
  2. Numbering. Every byte gets a sequence number, so the receiver can reassemble the stream in the right order.
  3. Acknowledgement. The receiver says what it has. Anything not acknowledged in time gets sent again.
  4. Congestion control. Senders start slow, speed up while things go well, and back off sharply at the first sign of loss.

Why the internet does not collapse

That last point is quietly extraordinary. Bandwidth is shared, and no central authority allocates it. It works because virtually every device voluntarily slows down when it detects congestion. Politeness, implemented in software, is what keeps the shared road moving.

Not everything wants this. Video calls and games often use UDP, which has no handshake and no retransmission: for live media, a late packet is worse than a missing one. Modern web traffic increasingly uses QUIC, which rebuilds TCP's reliability on top of UDP and folds the encryption handshake into the same round trip.

06HTTPS: the padlock, explained

Packets pass through equipment owned by strangers. TLS β€” the S in HTTPS β€” makes that acceptable by doing three things at once:

Identity

The server presents a certificate signed by an authority your device already trusts, proving it is who the name says.

Secrecy

Both sides derive a shared key that no eavesdropper can compute, and encrypt everything that follows.

Integrity

Any tampering en route is detected, because modified data fails its authentication check.

What is not hidden: the fact that you contacted that server at all. Addresses have to stay readable, or routers could not do their job. Encryption protects the contents of the envelope, not the fact that an envelope was sent.

07HTTP: asking for the actual page

After all that setup, the request itself is almost anticlimactic β€” a short block of text naming a method, a path, and some headers. The response is a status code, more headers, and the content.

GET /index.html HTTP/2 host: example.com accept: text/html accept-encoding: gzip, br ──────────── the reply ──────────── HTTP/2 200 OK content-type: text/html; charset=utf-8 cache-control: max-age=3600 content-encoding: br

One page is never one request. The HTML comes back first, and the browser reads it to discover the stylesheets, fonts, scripts and images it also needs β€” then repeats the whole process for each of them, dozens of times over, in parallel. A typical page today pulls in something like seventy separate resources from a handful of different companies.

08Caches: the trick that makes it feel fast

Physics sets a floor on speed. Light in fibre travels about 200,000 km per second, so a round trip from Amsterdam to Sydney cannot beat roughly 160 milliseconds no matter how much you spend. The only real fix is to not make the trip.

So the web is layered with copies. Your browser keeps recently used files on disk. Your operating system remembers DNS answers. And content delivery networks place thousands of caching servers inside ISPs around the world, each holding copies of popular content. When you request a page, you usually reach one of those β€” tens of kilometres away instead of thousands.

Try it in the simulation

Run "Full journey (cache miss)" and then "Second visit (cache hit)". Same page, same bytes, but the second run never crosses the ocean. Fewer hops means less waiting, less equipment doing work, and less electricity spent on the same result.

09Underneath it all: glass, copper and radio

The internet is often described as a cloud, which is almost exactly wrong. It is one of the heaviest pieces of infrastructure humanity has built.

When a fishing anchor damages a cable off the coast of Egypt, latency changes in India. The abstraction is thinner than it looks.

10What all of this costs

Every hop in the simulation is a real machine drawing real power. Data centres and data transmission networks together account for roughly 1–1.5% of global electricity use β€” each broadly comparable to the aviation industry's share of emissions, and growing as demand grows.

The useful mental model is that energy is spent in three places: the device in your hands, the network moving the bytes, and the servers producing them. Design decisions move work between those three, and the greenest request is still the one that never has to be made.

Send less

Compression, right-sized images and fewer third-party scripts cut work at every hop simultaneously.

Send it less far

Caching at the edge removes entire ocean crossings from the picture.

Send it at a better time or place

The carbon intensity of electricity varies by hour and by region; shifting flexible work follows the clean power.

If you want the formal version of that accounting, the Green Software Foundation's Software Carbon Intensity specification defines how to calculate it properly.

✳Glossary

TermIn one line
IP addressThe number identifying a device's location on the network.
DNSThe system that turns names into IP addresses.
PacketA small, independently routed chunk of data with addressing headers attached.
RouterA machine that decides which neighbour to forward each packet to.
ISPThe company connecting your network to the rest of the internet.
IXPA shared facility where many networks interconnect and exchange traffic.
TCPThe protocol that turns lossy packet delivery into an ordered, reliable stream.
UDPFire-and-forget delivery, preferred when timeliness beats completeness.
TLS / HTTPSEncryption and server identity checks layered under HTTP.
CDNA distributed set of caches holding copies of content close to users.
LatencyHow long a round trip takes; bounded by distance and by queueing.
BandwidthHow much data a link can carry per second; shared between everyone using it.

β†’Go deeper