BGP (Border Gateway Protocol) is the protocol that manages how packets are routed between autonomous systems (AS) on the internet. As the internet's core routing protocol, BGP makes global routing decisions based on path vectors, policy rules, and network reachability information.

Autonomous Systems

An Autonomous System (AS) is a collection of IP networks and routers under the control of a single organization that presents a common routing policy to the internet. Each AS is assigned a unique ASN (Autonomous System Number).

iBGP vs eBGP

iBGP (Internal BGP) runs between routers within the same AS, while eBGP (External BGP) runs between routers in different ASes. iBGP is used to propagate external routes throughout an organization's internal network.

BGP Path Attributes

BGP uses path attributes to make routing decisions: AS-Path (list of ASes a route has traversed), Next-Hop (address to reach the destination), Local Preference, MED (Multi-Exit Discriminator), Origin, and Community.

BGP Decision Process

When multiple paths exist, BGP selects routes based on a deterministic process: highest weight (Cisco), highest local preference, shortest AS-Path, lowest origin type, lowest MED, eBGP over iBGP, and lowest IGP metric.

BGP Security

BGP security concerns include route hijacking, prefix theft, and AS-path spoofing. Solutions like RPKI (Resource Public Key Infrastructure) and BGPsec aim to address these vulnerabilities.