BGP (Border Gateway Protocol) is the routing protocol that makes the global internet work. It is the system by which autonomous systems (AS) — the networks run by ISPs, cloud providers, universities, and large organizations — exchange information about which IP address ranges they can reach and the best paths to reach them.

How BGP Works

Each autonomous system (AS) is assigned an ASN (Autonomous System Number). BGP routers at the edges of these networks (border routers) form peering sessions with neighbouring AS border routers and exchange route information. Each router builds a table of known routes and selects the best path based on policy and metrics.

Two Types of BGP

TypeWhere UsedPurpose
eBGP (External BGP)Between different autonomous systemsInternet-wide routing — connects ISPs and networks
iBGP (Internal BGP)Within a single autonomous systemDistributes external routes to all routers inside a network

BGP Hijacking

Because BGP operates on trust — routers announce routes and neighbours accept them — it is vulnerable to hijacking. A misconfigured or malicious AS can announce that it owns an IP range it does not own, causing traffic to be rerouted through it. BGP hijacking incidents have affected major providers including AWS, Google, and Cloudflare.

BGP Security Improvements

  • RPKI (Resource Public Key Infrastructure) — Cryptographically signs route announcements, allowing routers to reject invalid routes
  • BGPsec — An extension that signs BGP messages to prevent route manipulation
  • Route filtering — ISPs can filter announcements from neighbours to only accept expected prefixes

People Also Ask

What does BGP have to do with internet outages?
Many major internet outages are caused by BGP misconfigurations. A routing error at one large AS can propagate and cause traffic for large portions of the internet to be misdirected or dropped. The 2021 Facebook outage was caused by a BGP configuration error that withdrew its own routes, making its servers unreachable globally.
What is an ASN and how does it relate to BGP?
An ASN (Autonomous System Number) is the unique identifier for each network that participates in BGP. When you look up an IP address, the ASN tells you which organization owns that IP range and participates in global routing. You can look up any ASN with our ASN Lookup tool.

Related: ASN lookup | Autonomous system numbers | ASN Lookup