BGP

Also known as: Border Gateway Protocol

Border Gateway Protocol — the routing protocol that directs traffic between the ~75,000 autonomous systems that make up the public internet.

Last updated:

What is BGP?

BGP (Border Gateway Protocol) is the protocol that carries routing information between the networks that make up the internet. Each independently operated network — an autonomous system (AS) — announces which IP prefixes it owns, and BGP propagates those announcements so every router on earth knows how to reach any IP address. Without BGP, the global internet would be a collection of disconnected islands.

How BGP moves traffic

A BGP speaker at the edge of an AS exchanges prefix announcements with the BGP speakers of neighboring networks. Each announcement carries an "AS path" — the ordered list of autonomous systems a packet would cross to reach that prefix. Routers prefer shorter AS paths, giving BGP the character of a distance-vector protocol stretched over tens of thousands of nodes. Two relationships dominate the graph: peering (settlement-free exchange of traffic between networks of similar size) and transit (a smaller network paying a larger upstream to reach the rest of the internet).

BGP in IP investigations

When you look up an IP, the AS that originates its prefix tells you who operates the network — a residential ISP, a datacenter, a hosting provider, or a state-run telecom. BGP routing tables are public; projects like RouteViews, RIPE RIS, and bgp.tools archive them and expose the origin AS, upstream providers, and prefix size for every announced prefix. WHOIS and RDAP then return the registered owner of each AS number, linking IP behavior back to an accountable organization.

See the AS number, upstream routing context, and registered operator behind any IP with our WHOIS lookup tool.

Frequently Asked Questions

OSPF (Open Shortest Path First) is an interior routing protocol — it shares routes inside a single autonomous system, computing the shortest path across that organization's own routers. BGP is an exterior routing protocol — it exchanges routes between autonomous systems on the public internet. OSPF cares about shortest distance; BGP cares about policy, peering relationships, and AS path length. The two complement each other: OSPF inside an AS, BGP between them.
A BGP route hijack happens when one autonomous system announces IP prefixes it does not own — either by mistake (a misconfigured router) or maliciously (to intercept traffic). Other networks see the false announcement, prefer it because it looks more specific or has a shorter AS path, and start sending the victim's traffic to the attacker. Famous examples include the 2008 YouTube hijack by Pakistan Telecom and the 2018 Amazon Route 53 hijack that stole cryptocurrency. RPKI is the modern defense — it cryptographically validates which AS is allowed to announce which prefix.
A new or withdrawn BGP route typically reaches every major network within 30 seconds to a few minutes, but full convergence across the long tail of the internet can take 10-30 minutes for complex changes. Route propagation depends on the AS path length, route-flap dampening at each hop, and policy filters. This is why DNS-based traffic shifts (which propagate in TTL seconds) are usually faster than BGP-based ones (anycast withdrawals, DDoS scrubbing redirects).
Every network operator that runs an autonomous system — about 75,000 organizations as of 2025, ranging from giant Tier-1 ISPs (Lumen/CenturyLink, Telia, NTT, Cogent) and cloud providers (AWS, Google, Cloudflare, Microsoft) down to small regional ISPs, universities, and large enterprises that multi-home for reliability. BGP is configured router-to-router by network engineers; there is no central BGP authority — the global routing table is the emergent result of every AS's individual policy choices.
BGP peering is when two autonomous systems agree to exchange traffic directly with each other, typically without payment, on the assumption that the traffic flows benefit both sides roughly equally. This contrasts with transit, where one AS pays another to carry its traffic to the rest of the internet. Peering happens at internet exchange points (IXPs) like LINX, DE-CIX, and AMS-IX, or via private cross-connects in shared datacenters. Major networks have hundreds to thousands of peering relationships.