BGP is the routing protocol that holds the internet together. It allows autonomous systems (independent networks) to exchange reachability information, determining how IP traffic is routed between every network on the planet.
The internet is composed of tens of thousands of autonomous systems (ASes), each identified by a unique Autonomous System Number (ASN). Each AS controls a set of IP prefixes and uses BGP to announce those prefixes to its neighbors. When an AS receives an announcement, it evaluates the route using local policy and path attributes, decides whether to accept it, and may propagate it further to its own neighbors.
BGP routers maintain a table of all reachable prefixes, the AS path to reach each one, and associated attributes. When multiple paths exist for the same prefix, the router selects the best one based on a decision process that considers local preference, AS path length, origin type, multi-exit discriminator (MED), and other attributes.
BGP sessions run over TCP (port 179). Routers exchange UPDATE messages to advertise new routes or withdraw previously announced ones. The protocol is incremental: after the initial full table exchange, only changes are sent.
BGP was designed in an era of implicit trust between network operators. There is no built-in mechanism to verify that an AS is authorized to announce a given prefix. A BGP hijack occurs when an AS announces a prefix it does not own, either by accident (misconfiguration) or deliberately (attack).
Because BGP routers prefer more specific prefixes, an attacker can hijack traffic by announcing a longer prefix than the legitimate one. For example, if the real owner announces 1.0.0.0/16, an attacker announcing 1.0.0.0/24 will attract traffic for that /24 block from much of the internet.
Hijacks can redirect traffic for interception, blackhole it to cause outages, or reroute it to impersonate services. Notable incidents have affected major cloud providers, CDNs, and even cryptocurrency exchanges.
Resource Public Key Infrastructure (RPKI) is the primary defense against BGP hijacking. It works by creating cryptographically signed objects called Route Origin Authorizations (ROAs) that bind an IP prefix to the ASN authorized to announce it.
The process works as follows:
RPKI adoption has grown significantly. Major networks including Cloudflare, Google, AT&T, and NTT now perform Route Origin Validation and drop RPKI-invalid routes. However, coverage is not yet universal, and many prefixes still lack ROAs.
BGP routing directly affects the latency, availability, and security of your services:
Look up BGP routing information for any IP address or autonomous system number.
Look up BGP routing for any IP or ASN