BGP
Border Gateway Protocol
- Pronunciation
- bee-jee-PEE
In short
BGP (Border Gateway Protocol) is the routing protocol that links the internet's autonomous systems by letting them announce which IP ranges they can reach.
What is BGP?
The internet is made of tens of thousands of separate networks run by internet providers, cloud companies, universities and large businesses. Each is an autonomous system (AS) with its own number. BGP is how they exchange reachability: a network announces "these address prefixes are reachable through me", and its neighbors pass the information on, adding themselves to the path.
BGP is a path-vector protocol. Each route carries the list of autonomous systems it has passed through, which prevents loops and lets each network choose routes according to its own policies, such as preferring cheaper links or customers over peers, rather than simply the shortest path. The version used today, BGP-4, dates from 1994.
Because BGP relies largely on trust, mistakes and attacks spread quickly. A route leak or hijack, where a network announces addresses it doesn't own, can send traffic to the wrong place, and misconfigurations have taken large services offline; in 2021 Facebook disappeared from the internet for hours after its routes were withdrawn by accident. RPKI lets networks cryptographically check which AS may announce a prefix.
A common misconception is that BGP matters only to internet providers. Any organization connecting to several providers, running its own address space or using anycast for a CDN or DNS service uses BGP, and cloud networks expose it for private connections between data centers and the cloud.
Key takeaways
- BGP routes traffic between the internet's autonomous systems.
- Networks announce the IP prefixes they can reach to their neighbors.
- Routes carry the path of AS numbers and follow each network's policies.
- Leaks, hijacks and errors can spread widely; RPKI adds validation.
- Multi-provider networks, anycast and cloud interconnects use it too.
Readers ask
What is an autonomous system?
A network or group of networks under one organization's control with a single routing policy, identified by an autonomous system number (ASN). Internet providers, cloud companies and large enterprises each run one or more.
What is a BGP hijack?
When a network announces IP prefixes that belong to someone else, by mistake or on purpose, so that traffic for those addresses is routed to it. RPKI route origin validation helps networks reject such announcements.
What is the difference between BGP and OSPF?
OSPF is an interior gateway protocol that finds the best paths inside one organization's network. BGP is an exterior gateway protocol that exchanges routes between different organizations' networks according to their policies.
See also
- RouterNetworking, p. 25A router is a networking device that forwards packets between different networks, choosing the next hop for each one based on its destination IP address.
- IP AddressNetworking, p. 10An IP address is a numeric label assigned to each device on a network so that data can be routed to it, much like a postal address for a house.
- CIDRNetworking, p. 4CIDR (Classless Inter-Domain Routing) writes an IP range as an address and prefix length, like 10.0.0.0/16; the prefix counts the leading network bits.
- PacketNetworking, p. 20A packet is a small, formatted unit of data sent across a network, made of a header with addressing information and a payload that carries the actual data.
- WANNetworking, p. 37A WAN is a network that connects devices and local networks across large distances, such as cities or countries, often over links rented from telecom providers.
- CDNDevOps & Cloud, p. 7A CDN is a network of servers spread around the world that stores copies of website content and delivers it to each user from the nearest location.
Spotted a mistake or something missing on this page?Suggest an edit