BGP Routing Basics

Updated: 2026-05-31

BGP (Border Gateway Protocol) is how the world's ~75,000 autonomous systems agree on where traffic should go. There is no central map of the Internet; instead, each network announces the IP prefixes it can deliver, and these announcements ripple out across the globe.

Announcements and paths

When AS64500 announces 203.0.113.0/24, its neighbours learn "to reach that block, come through AS64500." Each network that re-announces it prepends its own ASN, building an AS path such as AS64999 AS64998 AS64500. Routers prefer the most specific prefix, then the shortest/most-preferred path.

Key ideas

Term Meaning
Prefix A block of IPs being announced (e.g. a /24)
Origin AS The AS that first announces the prefix
AS path The chain of ASes a route traversed
Peering / transit Whether networks exchange routes as equals or one pays the other

Why hijacks happen

BGP trusts what it is told. If a network announces a prefix it does not own — by mistake or maliciously — and its announcement is more specific or shorter-path, traffic can be diverted. Famous outages have come from exactly this. The mitigation is RPKI route origin validation, which lets networks reject announcements from unauthorized origins — see RPKI and ROA explained.

Find the origin AS and prefix for any IP with our ASN lookup, then validate it with the RPKI/ROA checker. Background: what is an ASN.

Note: BGP optimizes for reachability and policy, not security or shortest geographic path. That pragmatism is why the Internet scales — and why origin validation matters.

Sources