How the Internet Works
Understand packets, IP addresses, routers, clients and servers so the rest of web development has a mental model to hang on.
Beginner · about 3 hours · difficulty 1/5
The internet is a network of networks. Your laptop, a phone tower, a data centre in another country: all of them agree to speak the same protocols, so data can hop between them without anyone owning the whole path.
The core ideas
- IP addresses identify machines. IPv4 looks like
93.184.216.34; IPv6 is longer and exists because we ran out of IPv4 addresses. - Packets are small chunks of data. A web page is split into many packets that may take different routes and get reassembled at the other end.
- TCP guarantees ordered, complete delivery (it retransmits lost packets). UDP is faster but fire-and-forget, which suits video calls and games. HTTP/3 runs over QUIC, which is built on UDP.
- Ports let one machine run many services: 443 for HTTPS, 80 for HTTP, 5173 for your local Vite dev server.
- Clients and servers: the browser is a client that asks; a server is a program that listens and answers.
Why a frontend developer cares
Latency (how long a round trip takes) often matters more than bandwidth. Every extra request to a far-away server costs tens or hundreds of milliseconds, which is why CDNs, caching and bundling exist. When a page is "slow" you need to know whether the network, the server or your JavaScript is to blame.
Good enough to move on
You can explain, in plain words, what happens between a click and a response: the name is resolved to an IP, a TCP (or QUIC) connection is opened, TLS encrypts it, a request is sent and a response streams back. You do not need to memorise the OSI model layer by layer.
Key concepts
- IP addresses (IPv4 and IPv6)
- Packets and routing
- TCP vs UDP: Reliability versus speed
- Ports and sockets
- Client-server model
- Latency vs bandwidth
- QUIC and HTTP/3 transport
Mini project
Run traceroute (tracert on Windows) and ping against three sites on different continents, then write a short note explaining the hop counts and latency differences you observed.
Check yourself
Why does a site hosted on another continent feel slower even when your connection has plenty of bandwidth?
Free resources
- How does the Internet work? (MDN)
- Cloudflare Learning Center (Cloudflare)