JOVANA
Explore Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

The Shape of the Internet: Tiers, Transit, and Peering

Guide 1 gave you the autonomous system as a building block. Now we step back and look at how tens of thousands of them are wired together into a single planet-sized network, and discover the surprise at its heart: the shape of the Internet is drawn by money and contracts, not by the shortest path.

From one network to a network of networks

In the previous rung you watched routers inside a single network share what they can reach and compute least-cost paths with an interior gateway protocol like OSPF. In guide 1 of this rung you met the autonomous system, an AS: one network under one administration, run as a single unit, wearing a number called its ASN. Hold both ideas in your head, because the Internet is built from exactly two layers. Inside each AS, an interior protocol finds good paths over wires the operator owns. Between ASes, a different protocol stitches the islands together. That two-level split is hierarchical routing, and it is the only reason routing scales to the whole planet.

Why split it at all? Picture the scale. There are well over a hundred thousand autonomous systems in the world. If every router on Earth had to know a path to every other router individually, the tables would be impossibly huge and the chatter to keep them fresh would never settle. Hierarchy hides the detail: a router in Tokyo does not need to know the wiring inside a network in Brazil, it only needs to know which neighbouring AS to hand a packet to so it travels in the right general direction. An AS is a black box to everyone outside it. You see only the door, never the rooms.

Three kinds of network: who sells reach to whom

Not all ASes are equal, and the inequality is mostly about reach. At the bottom are stub or edge networks: a university, a company, a content provider. They buy connectivity but do not carry strangers' traffic through themselves. In the middle are regional and national ISPs, who connect customers below them and buy onward reach from someone bigger. At the very top sit a small club, perhaps a couple of dozen, of tier-1 ISPs: the global backbones. A tier-1 is defined by a remarkable property, it can reach every destination on the Internet without ever paying anyone for transit. It buys reach from no one. It is, by definition, the top of the pile.

Between any two ASes that connect, the relationship is one of two kinds, and which one it is decides everything. The first is the provider-customer relationship, also called transit. The customer pays the provider for reach to the entire Internet. Money flows up; routes flow down and up. Think of it like a small shop renting a unit inside a giant shopping mall: the shop pays rent, and in return the mall connects it to every shopper and every other mall in the chain. The customer's own routes get advertised by the provider to the whole world, and the world's routes get handed down to the customer. Transit is the relationship that actually sells you the Internet.

The second kind is peering, and it is the clever shortcut. Two ASes of roughly comparable size notice that a lot of traffic flows between their customers, and that they are each paying a provider to carry it the long way round. So they agree to connect directly and exchange that traffic for free, settlement-free as the jargon goes. The crucial rule: peering only carries traffic between the two peers' own customers, never to the rest of the Internet. Two neighbouring malls might build a private bridge so their shoppers can cross over directly, but neither mall lets a stranger use that bridge to reach a third, distant mall for free. Peering saves money and cuts latency; it does not make you anyone's free transit.

Where the wires actually meet: the IXP

If hundreds of networks in a city all want to peer with one another, connecting each pair with its own private cable would be a combinatorial nightmare. The elegant answer is a shared meeting room: an Internet exchange point, an IXP. Physically it is often a big neutral building (or several, linked) full of racks, with a large, fast switch in the middle. Each participating network runs one cable into the building, plugs into the switch, and is now one hop away from everybody else plugged in. Instead of building a road to every neighbour, you all drive to the same car park and meet there.

At the IXP, two networks that want to peer set up a peering session with each other across that shared switch and start exchanging routes for their customers. A single physical port can thus carry sessions to dozens or hundreds of peers at once. This is why a packet from your home in one city often reaches a video service across town without ever touching a tier-1 backbone, it crosses a local IXP and is done. IXPs are the unglamorous civic infrastructure of the Internet: keeping traffic local, cheap, and fast.

The big surprise: routing by policy, not by distance

Here is the idea that trips up almost everyone, and it is the whole point of this guide. Inside an AS, routing genuinely tries to find the shortest, cheapest path, that is what OSPF computes. Between ASes, it does not. Inter-domain routing is about policy and economics, not about distance. An AS will quite happily steer your traffic down a longer path if the shorter one costs it money. The shape of a packet's journey across the Internet is drawn far more by who-pays-whom than by which way is geographically nearest.

The logic falls straight out of the money. Sending traffic to a customer earns you money (they pay you), so a route via a customer is the most attractive of all. Sending it over a peering link is free. Sending it up to a provider costs you money. So almost every network on Earth follows the same instinctive ranking when it has a choice of next hop: prefer routes learned from a customer, then routes learned from a peer, and only as a last resort use routes learned from a provider. This rule of thumb is so universal it has a name, and it explains the bulk of how traffic actually moves.

Two routes to the same destination D, seen by network X:

  Route A:  X -> (customer) -> D      cheapest: customer pays X
  Route B:  X -> (provider) -> ... -> D   most expensive: X pays provider

  X picks Route A  --  even if Route B has FEWER AS hops.

Preference ranking almost every AS uses:
     customer  >  peer  >  provider
     (earns money) (free)  (costs money)
An AS prefers the route that makes money over the one that costs money, even when the cheaper-to-it route is the longer one. Policy beats distance.

This has a profound consequence that the old shortest-path protocols simply could not handle: the path the Internet picks is often not the shortest one, and that is by design, not a bug. It also means the inter-domain protocol cannot just compute distances and minimise them. It has to let each network express its own private business rules and keep them secret from everyone else, while still producing a coherent global system. Building a protocol that does that is genuinely hard, and it is exactly what guide 3 introduces: BGP.

The glue: a glimpse of BGP and the path it carries

The protocol that lets independent kingdoms advertise reachability to one another is the Border Gateway Protocol, BGP. Guide 3 takes it apart properly; here we just need its shape so the economics above has something to stand on. BGP does not advertise distances or link costs. Instead, when an AS tells a neighbour it can reach some block of addresses, it attaches the full list of ASes the announcement has passed through to get there. That list is the AS path: not 'this is 9 hops away' but 'to reach there, go through AS 174, then AS 3356, then AS 15169'.

Carrying the whole path, rather than just a number, is what makes BGP a path-vector protocol, and it buys two things at once. First, a network can apply policy: looking at the AS path, it can see whether a route would force its traffic through a competitor or a provider it dislikes, and refuse it. Second, the path is a built-in loop detector. If an AS ever sees its own number already in an arriving AS path, it knows the announcement has looped back to itself and silently drops it. No counting to infinity, no guesswork, the evidence of the loop is right there in the list.

Now you can see the two layers click together. Inside each AS, an interior protocol finds genuine shortest paths over owned wires. Between ASes, BGP carries reachability with full AS paths so that every network can apply its own customer-over-peer-over-provider economics and refuse anything that violates policy. Distance rules the inside; policy rules the outside. With that mental model in place, you are ready for guide 3, where we watch a route actually get advertised, hop by hop, across the seam between two networks.