Internet routing and BGP
Autonomous systems, how they announce address blocks and why one mistake can take sites offline.
The internet is a network of networks. Each large network (an ISP, a cloud provider, a university) is an autonomous system (AS) with a number such as AS15169. Inside an AS, an interior protocol finds paths. BGP (Border Gateway Protocol) is the protocol that ASes use to tell each other which address blocks they can reach.
- An AS announces (originates) prefixes it owns, for example
203.0.113.0/24. - Neighbours pass the announcement on, adding their own AS number to the AS path.
- Routers pick the best path using policy first (preferred customer, peer or provider) and then the shortest AS path.
- Business relationships decide: a network normally prefers routes from customers (they pay), then peers (free), then providers (it pays).
The trust problem
BGP was designed on trust. If an AS announces a prefix it does not own (a route leak or hijack), others may believe it and send traffic to the wrong place. Several large outages and traffic diversions have come from configuration mistakes like this.
- RPKI lets prefix owners publish signed authorisations (ROAs) that say which AS may originate their prefix, so other networks can reject invalid announcements.
- More specific prefixes win: a hijacker who announces a /24 inside your /22 can attract the traffic.
- Operators filter what customers may announce, and monitor their prefixes for unexpected origins.
NoteAnycast reuses BGP on purpose: the same address is announced from many places and each user reaches the nearest one. DNS root servers and CDNs work this way.
Test yourself
Answer all the questions, then check them. Finish with every answer right to mark the lesson as done.