BGP: The Protocol That Routes the Internet
The internet is not a single network — it's a collection of tens of thousands of independently operated networks called Autonomous Systems (ASes). BGP (Border Gateway Protocol) is the routing protocol that connects them all.
Each AS is assigned a unique ASN (Autonomous System Number) by IANA. BGP peers (neighbours) establish TCP sessions on port 179 and exchange reachability information: "I can reach these IP prefixes, and here is the AS path to get there." Routers choose the best path based on a series of attributes — including AS path length, local preference, MED, and more.
There are two flavours: iBGP (within an AS) and eBGP (between ASes). eBGP is what glues the internet together; your ISP uses eBGP to announce your IP block to the rest of the world.
BGP is famously flexible but also notoriously easy to misconfigure. A single route leak or hijack can misdirect global internet traffic — as demonstrated by several high-profile incidents. Route origin validation via RPKI has emerged as the industry standard for securing BGP announcements.
← Back to Blog