BGP
Path-vector routing protocol that exchanges reachability information between autonomous systems on the internet.
BGP (Border Gateway Protocol) is the routing protocol that holds the public internet together. It runs between autonomous systems and exchanges reachability information about IP prefixes — which networks each AS can deliver traffic to, and through which sequence of other AS-es. Unlike interior protocols such as OSPF or IS-IS, BGP is not concerned with shortest hop count; it is a policy-driven, path-vector protocol designed to scale to hundreds of thousands of prefixes and tens of thousands of networks.
Each BGP announcement carries a prefix (for example 192.0.2.0/24) and a list of attributes, the most important being the AS_PATH. The path lists every ASN the announcement has traversed and is used both to detect loops and to compare routes. When a router holds several candidate paths to the same prefix, it walks an ordered decision process: LOCAL_PREF (operator policy), then shortest AS_PATH, then origin type, then MED, then eBGP over iBGP, and finally tie-breakers such as router ID. The result is that route selection reflects business relationships at least as much as topology.
BGP is used in two roles. External BGP (eBGP) runs between routers in different ASNs and is where prefixes enter and leave a network. Internal BGP (iBGP) carries those prefixes inside an AS so that every border router agrees on which external paths are available. The prefixes a network announces over eBGP, and the ones it accepts from neighbours, are filtered by policy that encodes the peering and transit relationships an operator has agreed to.
BGP-driven announcements are also what make anycast work: the same prefix can be originated from many locations, and each remote network will pick the path its BGP decision process considers best. Operationally, BGP is sensitive to misconfiguration — a leaked or hijacked prefix can divert traffic globally, which is why RPKI origin validation and route filtering at AS boundaries have become standard hygiene.
Key Points
- Inter-AS routing protocol used across the public internet
- Path-vector design carries the full
AS_PATHper prefix - Route selection is policy-first (
LOCAL_PREF,AS_PATH,MED, …) - eBGP runs between ASNs, iBGP distributes routes inside an AS
- Implements peering and transit relationships through filters
- Underpins anycast by allowing the same prefix from many origins
- Vulnerable to leaks and hijacks without RPKI and prefix filtering