Read alongside
Computer Networks: A Systems Approach: 4.1 Global Internet
Main reading: routing areas and interdomain routing with BGP.
Objectives
- Explain autonomous systems, BGP sessions and AS_PATH-based loop prevention in a path-vector protocol.
- Apply the BGP decision order (local preference before AS-path length) and customer/peer/provider export rules to predict the chosen route.
- Explain how more-specific prefixes and AS-path prepending are used for traffic engineering.
- Distinguish route leaks from prefix hijacks and explain what prefix filtering and RPKI origin validation prevent and do not prevent.
Why it matters
Network-facing roles and networking research expect you to explain how Internet routing actually works, read an incident report about a leak or hijack, and reason about anycast, multi-homing and cloud interconnects. In general infrastructure work, BGP misconfigurations cause some of the most visible outages.
Core ideas
Autonomous systems and path vectors. The Internet is a collection of autonomous systems (ASes), each a network under one administration with its own AS number. BGP speakers exchange routes for prefixes over TCP sessions; each route carries attributes including the AS_PATH, the list of ASes it has traversed. A router discards routes that already contain its own AS (loop prevention) and selects among the rest. Unlike link-state protocols inside a network (OSPF, IS-IS), no router has a global map.
Policy before path length. Route selection applies local preference first (set by the operator, usually from business relationships), then AS-path length, then tie-breakers such as MED and the internal cost to the exit. Export policy decides which routes are announced to whom. The common model: an AS prefers routes from customers (who pay it), then from peers (settlement-free), then from providers (whom it pays); it exports customer routes to everyone but peer and provider routes only to customers. These rules keep paths "valley-free" and stop networks from carrying traffic they are not paid for.
More-specific wins in forwarding. Forwarding uses longest-prefix match, so a more-specific announcement attracts traffic even when a legitimate less-specific route exists. Traffic engineering uses this deliberately (announcing more-specifics, or prepending one's own AS to make a path look longer); mistakes and attacks exploit it.
Leaks and hijacks. A route leak is an announcement propagated beyond its intended scope, for example a customer re-announcing one provider's routes to another provider, which can pull traffic through a network unable to carry it. A hijack is the announcement of someone else's prefix, or a more-specific of it, as if one originated it. Defenses include prefix filters built from registry data, maximum-prefix limits on sessions, RPKI route origin validation (signed statements of which AS may originate a prefix) and baseline practices promoted by initiatives such as MANRS. Origin validation checks only the origin AS, not the rest of the path.
Common misconceptions
- "BGP picks the shortest path." Local preference and export policy come first; AS-path length only breaks ties among equally preferred routes.
- "RPKI stops all hijacks." It rejects announcements from the wrong origin AS, but not leaks or forged paths that keep the correct origin.
- "BGP converges quickly." Path exploration and timers can take seconds to minutes, during which traffic may be dropped or misrouted.
- "Anycast gives automatic failover." Only if a failing site withdraws its routes; a broken site that keeps announcing keeps attracting traffic.
How to approach it
Learn the decision order and the export rules, then explain one public leak or hijack post-mortem in those terms. Look up real AS paths for a prefix you know in a public route collector.
Self-check before you finish
- Why would an AS prefer a longer path through a customer over a shorter one through a provider?
- How does BGP prevent routing loops between ASes?
- Why does announcing a /24 inside someone else's /16 attract their traffic?
- Which export rule does a customer break when it leaks one provider's routes to another provider?
- What does AS-path prepending do, and why is it only a hint to other networks?