BGP (Border Gateway Protocol)
The routing protocol that ties the internet's ~75,000 independent networks together — deciding how traffic finds its way between them. Foundational, trust-based, and famously fragile.
What is BGP?
BGP (Border Gateway Protocol) is the routing protocol that makes the global internet function as one network. The internet isn’t a single network — it’s tens of thousands of independent networks (called Autonomous Systems, or ASes — ISPs, cloud providers, large enterprises, universities), each identified by an AS number. BGP is how these ASes exchange reachability information and decide how to route traffic between each other: it’s the protocol that lets a packet on one network find its way across a chain of other networks to reach a destination anywhere on Earth. It’s often called “the protocol that holds the internet together,” and that’s not hyperbole — without BGP, the networks that make up the internet couldn’t route to one another.
How it works — and why it’s built on trust
BGP works by having ASes advertise the IP address blocks (prefixes) they can reach to their neighbors, who propagate that information onward, building up each router’s picture of “to reach this destination, send traffic toward this neighboring AS.” Unlike interior routing protocols that optimize for shortest path within one network, BGP is a path-vector protocol that chooses routes based on policy — business relationships, peering agreements, cost, and path length — because routing between independent organizations is as much about economics and policy as about technical efficiency (an ISP routes based on who it has paid/peering arrangements with, not just the shortest hop count). The crucial and sobering property is that classic BGP operates largely on trust: when an AS advertises “I can reach this prefix,” neighbors have historically just believed it, with no built-in cryptographic verification that the advertiser actually owns or legitimately serves that address space. This trust-based design, adequate for the small, collegial early internet, is the root of BGP’s most serious problems at today’s scale.
Why it’s fragile — hijacks, leaks, and outages
BGP’s trust model makes it powerful but fragile, and the failure modes are consequential enough that engineers should recognize them. Route hijacking: an AS (maliciously or by accident) advertises prefixes it doesn’t own, and because neighbors trust the advertisement, traffic destined for those addresses gets misrouted to the wrong network — used to intercept traffic, black-hole it, or steal cryptocurrency, and responsible for numerous real incidents. Route leaks: an AS improperly propagates routes it shouldn’t (e.g., re-advertising a provider’s routes to another provider), causing traffic to flood through unintended paths. Misconfiguration outages: a single fat-fingered BGP change can withdraw or corrupt routes and take large services or even whole countries offline — the 2021 Facebook global outage was a BGP misconfiguration that made its networks unreachable, and Cloudflare and others have had similar incidents. The mitigations, deployed gradually across the industry, address the missing trust: RPKI (Resource Public Key Infrastructure) cryptographically validates that an AS is authorized to announce a given prefix (Route Origin Validation), and initiatives like MANRS promote filtering and good hygiene. These help but aren’t universally adopted, so BGP security remains a work in progress. For most application engineers BGP is invisible infrastructure run by network operators and cloud providers — but understanding it explains a class of large-scale internet outages and interception incidents that no amount of application-level correctness can prevent, and it’s directly relevant to anyone operating their own AS, doing multi-homing, or running anycast.
What people get wrong
- Assuming BGP verifies advertisements — classic BGP trusts what neighbors announce, which is exactly why route hijacks and leaks misdirect traffic; RPKI is the (partial) fix.
- Treating outages as always application-level: a single BGP misconfiguration can take global services offline regardless of how healthy the servers are — it’s an infrastructure failure class of its own.
- Overlooking policy vs shortest-path — BGP routes by business/policy relationships, not just technical shortest path, so traffic doesn’t always take the geographically obvious route.
Primary source: RFC 4271: A Border Gateway Protocol 4 (BGP-4)
Historical figures and technical concepts for informational purposes only. Not technical, professional, legal, or financial advice. Sources: Official Documentation.