Networkingborder gateway protocolautonomous systemasnas path

BGP (Border Gateway Protocol)

Definition

BGP exchanges reachability information between autonomous systems: each announces the prefixes it can deliver to, along with the path of AS numbers, and each router picks routes by local policy.

In practice

The internet is tens of thousands of autonomous systems (ISPs, clouds, large companies) joined at routers. BGP is how a route to your prefix spreads across all of them, and how traffic reroutes when a link fails: the withdrawn route disappears and neighbours fall back to the next best path. Anycast, used by DNS and CDNs, works by announcing the same prefix from many locations.

BGP chooses by policy and business relationships, not by latency, so the chosen path is not always the fastest. It also trusts announcements by default: a misconfigured or malicious network can announce someone else's prefix and pull their traffic away (a route leak or hijack). RPKI route origin validation reduces this risk but is not universal.

Example

A CDN announces 198.51.100.0/24 from 40 cities; when the Frankfurt site withdraws the route for maintenance, European users shift to Amsterdam within seconds.