Networks and addresses

BGP (Border Gateway Protocol)

The protocol networks use to tell each other which IP prefixes they can reach. It is how the internet routes between autonomous systems.


BGP is the routing protocol between networks. Each autonomous system announces the prefixes it originates and passes on what it learned from its neighbours, with the path of AS numbers the announcement has travelled. A router picks the best path for each prefix by policy: shortest AS path, local preference, what the operator has configured.

A BGP session runs between two routers over TCP, usually on a direct link or across an internet exchange. Upstream providers (transit) carry your prefixes to the whole internet; peers exchange only their own and their customers' routes with each other.

BGP trusts what it is told, which is why a mistyped announcement in one network can take another network offline. RPKI adds a signed record of who may originate which prefix, and most large networks now drop announcements that contradict it. Running BGP needs an AS number, address space to announce, and at least one neighbour willing to take the session.

Network