What it is
The internet is a network of networks. Tens of thousands of independently operated networks, called autonomous systems (AS), each identified by a number, agree to carry traffic for each other. Your ISP is one, a cloud provider is one, a large university is one. They connect directly (peering, often at internet exchange points) or pay larger transit providers to reach everyone else.
What travels between them is IP packets: small units of data, each with a header that carries a source and a destination address. Routers at every junction read the destination and forward each packet one hop closer. Nobody controls the whole thing, and no device knows the full path.
Why it exists
A single global network run by one operator would be a single point of failure and a single point of control. Packet switching between independent networks lets each operator run its part its own way, lets links fail without stopping communication, and lets many conversations share the same cables efficiently. The price is that delivery is best effort: packets can be delayed, lost, duplicated or reordered, and the endpoints have to cope.
How it works
1. Resolve the name. A browser asked for example.com first resolves it to an IP address via DNS. The query and the answer are ordinary packets to and from a resolver, usually the one the ISP or the network configured. Only then can anything go to the server.
2. Packetise. The sender's network stack splits data into packets that fit the path's MTU, commonly 1,500 bytes on Ethernet. TCP (or QUIC over UDP) numbers the data so that the receiver can put it back in order and ask for what is missing; IP itself does not.
3. Forward hop by hop. Each router has a forwarding table of prefixes (203.0.113.0/24, 0.0.0.0/0 for "everything else") mapped to next hops. For each packet it picks the longest matching prefix and sends the packet to that neighbour. It also decrements the packet's TTL (hop limit in IPv6); a packet whose TTL reaches zero is dropped and an ICMP "time exceeded" message is sent back. Traceroute uses exactly that to reveal the routers on a path. A home router's table is tiny (local network, plus a default route to the ISP); a router in the default-free zone of the internet carries roughly a million IPv4 prefixes and a couple of hundred thousand IPv6 prefixes in 2026.
4. Exchange routes with BGP. Routers inside one network learn routes from an internal protocol (OSPF, IS-IS). Between networks, the Border Gateway Protocol carries reachability: "prefix 203.0.113.0/24 can be reached through AS 64501, AS 64510". Each network decides which announcements to accept, which to prefer and which to pass on. Best-path selection starts with policy, such as local preference that favours a cheaper customer or peer link over paid transit, and then uses attributes such as AS-path length. BGP knows nothing about current latency or congestion.
5. Route around failure. When a link or router fails, the BGP sessions over it drop and the routes learned through it are withdrawn. Neighbours fall back to their next-best paths and announce the change onward. This convergence takes from well under a second (with fast failure detection inside a network) to minutes across the internet, and during it some packets are dropped or loop until their TTL runs out.
6. Distance sets latency. Light in fibre travels about 200,000 km/s, roughly 5 µs per kilometre. A 6,000 km path costs at least 30 ms each way before any router, queue or server adds anything. Every round trip (DNS, TCP handshake, TLS handshake, each request that waits for a response) pays it again.
When to use it
This model is the background for nearly every latency and availability decision: placing servers or CDN edges near users, counting round trips in a protocol, choosing regions, understanding why a "network blip" happened, and reading traceroute output during an incident.
When not to
- Do not design as if the path is fixed or private. Routes change under you and traffic crosses networks you do not control; encrypt in transit and expect variable latency.
- Do not treat a single ISP or transit link as reliable infrastructure for critical sites; multihome with more than one upstream.
- Inside a data centre the same principles apply, but the topology (leaf-spine fabrics) and timescales (microseconds) are very different from the public internet.
Trade-offs
| Choice | You gain | You pay |
|---|---|---|
| Packet switching (shared links) | Efficient use of capacity, resilience to failures | Variable delay, possible loss and reordering |
| Policy-based BGP routing | Each network controls its own traffic and costs | Paths are not the fastest; misconfiguration can spread globally |
| Serving from one region | Simple operations, one copy of the data | Distant users pay long round trips |
| Serving from many edges (CDN, anycast) | Short round trips, absorbs attacks | Cost, cache consistency, more moving parts |
Alternatives
- Private backbones: large cloud and content providers carry traffic across their own global networks and hand it to the public internet as close to the user as possible.
- Dedicated interconnects (cloud direct-connect products, leased lines): predictable paths between your sites and a provider, without crossing the public internet.
- Overlay networks and VPNs: tunnel traffic over the internet with their own routing on top (SD-WAN, mesh VPNs).
Failure modes
- Route leaks and hijacks: a network announces prefixes it should not, and traffic is diverted or blackholed. RPKI route origin validation, now widely deployed, rejects announcements from unauthorised origins; it does not stop every leak.
- Slow convergence: after a failure, packets are dropped or loop for seconds to minutes.
- Fibre cuts and congested peering links: latency jumps or traffic reroutes onto longer paths.
- MTU problems: tunnels shrink the usable packet size; if ICMP is filtered, large packets silently disappear ("path MTU blackhole").
- DNS failure: the network works, but nothing can be found by name.
In production
Teams pick regions close to their users, put static and cacheable content on a CDN, and use anycast or global load balancers so users reach a nearby edge. Critical sites are multihomed (several upstream providers) and sign their prefixes with RPKI. During incidents, traceroute and mtr from several vantage points show where along the path latency or loss appears; BGP looking glasses and route collectors show what the rest of the internet sees.
Common misconceptions
- "The internet is one network someone runs." It is many networks with separate owners and policies.
- "My packets take the shortest path." They take the path each network's policy prefers, which can be much longer.
- "Faster servers fix latency for distant users." Propagation delay does not shrink with server speed; only moving closer or saving round trips helps.
- "A request is one packet." Most requests and nearly all responses span many packets, plus handshake packets before them.
Interview angle
You will rarely be asked to explain BGP, but you will be expected to reason about the consequences: distant users mean long round trips, so put a CDN or regional deployment in front; handshakes and DNS add round trips, so reuse connections; networks fail and reroute, so design for retries and variable latency. Being able to estimate RTT from distance (about 1 ms of round trip per 100 km of fibre) is a quick way to show you understand where latency comes from.
Model assumptions
This lesson is a scripted walk-through, not a simulation: every packet is placed by hand to show the order of hops, and routing tables and BGP state are labels. One-way latencies are illustrative (3 ms over Wi-Fi to the home router, 10 ms on the access line to the ISP, 6 ms to and from the transit network, 30 ms across a long-haul backbone link of about 6,000 km, 2 ms inside the hosting network, about 1 ms per router to forward). Real paths have more routers (often 10–20 hops), queueing delay and loss. The response is shown retracing the request's path for clarity; on the internet, return paths are often different (asymmetric routing). BGP reconvergence is compressed to a few tens of milliseconds.