BGP (Border Gateway Protocol)
The protocol that makes the internet work by routing traffic between different autonomous systems (ASes).
Detailed Explanation
BGP is like the GPS for the internet. It allows large networks (ISPs, big tech companies) to tell each other which IP addresses they own and the best path to reach them. BGP is notoriously complex and fragile, a single misconfiguration can 'blackhole' massive amounts of traffic or lead to global internet outages.
Quick Summary
BGP is the routing protocol that knits the internet's tens of thousands of independent networks together. It works on trust, which is also why a single misconfigured announcement can take large chunks of the internet offline.
Key Takeaways
- Networks (Autonomous Systems / ASes) announce which IP prefixes they own and how to reach them.
- Routing decisions are policy-based: cheapest path, preferred peer, shortest AS path , not always shortest physically.
- Famous outages (Facebook 2021, Cloudflare/Verizon 2019) traced to BGP misconfigurations.
- RPKI (Resource Public Key Infrastructure) cryptographically validates route announcements to prevent hijacks.
- Most app developers will never touch BGP, but understanding it explains many otherwise-mysterious internet failures.
When to use it
- Multi-homing: a company with two ISPs uses BGP to announce its IPs through both for redundancy.
- Anycast deployments: same IP advertised from many locations; BGP routes users to the nearest.
- DDoS mitigation: "blackhole" or "sinkhole" routes withdraw or redirect traffic to attacked IPs.
- Cloud peering arrangements (AWS Direct Connect, Azure ExpressRoute) speak BGP between cloud and customer networks.
Common Mistakes
- Accidentally announcing more-specific prefixes for IPs you don't own , hijacking traffic, intentional or not.
- Leaks where a customer's routes are re-announced to peers as if originating from the leaker.
- Skipping RPKI validation; route hijacking attacks become much easier.
- Assuming "shortest AS path" = "fastest"; policy and peering can route traffic dramatically out of the way.
BGP (Border Gateway Protocol), Frequently Asked
Why do BGP outages take down so much of the internet at once?
Because announcements propagate globally in seconds, and many networks act on them without strong validation. A bad announcement can redirect huge swaths of traffic to the wrong place , or withdraw routes so users can't reach a service at all.
Do I need to know BGP as a developer?
Not in detail. But understanding that the internet's reachability is policy-driven, not engineered top-down, explains why "my service is up but unreachable from some networks" is a real and common situation.