Inter-Domain Routing & BGP

routing policy

Inside a single network, routing usually means "find the shortest path." Between networks, that instinct is wrong. Routing policy is the set of business and engineering rules an autonomous system uses to decide which routes to accept from neighbours, which routes to prefer when several reach the same destination, and which routes to pass on to whom. Think of it as a network's house rules for traffic: not "what is shortest?" but "what is best for us, and what are we contractually allowed to do?"

Policy lives at three points in the BGP conversation. On IMPORT, an AS filters which advertised routes it will even accept (rejecting bogus prefixes, or routes from a neighbour that shouldn't be offering them), and tags accepted routes with attributes like local preference to mark which it favours. In SELECTION, when several routes reach the same prefix, the BGP decision process picks one — local preference first, then shorter AS path, then other tie-breakers. On EXPORT, the AS decides which of its chosen routes to advertise onward, and to whom, following customer/peer/provider conventions. A typical money-driven policy is: prefer routes through customers (you get paid), then peers (free), then providers (you pay) — last resort.

Policy is the whole reason inter-domain routing exists as a separate, complicated thing. If the Internet only wanted shortest paths, a single link-state protocol could compute them. But networks are independent businesses with contracts, preferences, and competitors, and they will NOT simply hand traffic to whoever is geographically closest. BGP's design — advertising full paths, letting each AS apply its own filters and preferences — exists precisely to express policy while still producing loop-free, working routes.

An AS learns two routes to the same prefix: one through a paid provider (AS path length 2) and one through a settlement-free peer (AS path length 4). A shortest-path protocol would pick the provider. BGP policy here sets a higher local preference on the peer route, so the AS deliberately chooses the LONGER but FREE peer path, saving money — exactly the opposite of "shortest wins."

Policy can override path length: a network often prefers a longer, cheaper route over a shorter, costly one.

Routing policy means the path your packets take is decided by other networks' business interests, not by what's fastest for you — and you usually have no visibility into or control over those decisions.

Also called
BGP policy路由政策路由策略