Inter-Domain Routing & BGP

BGP peering

Two networks cannot exchange routes by shouting into the void; they must first agree to talk. BGP peering is that agreement plus the actual conversation: two BGP routers establish a session and begin exchanging route advertisements. Think of it like two neighbouring postal services signing a deal to hand each other's mail across the border, then setting up a dedicated counter where the bags get swapped.

Mechanically, a BGP session runs over an ordinary TCP connection (on TCP port 179) between two configured routers. Each side is told the other's IP address and AS number in advance — BGP does not auto-discover neighbours, you configure them explicitly. Once the TCP connection is up, the routers swap OPEN messages to agree on parameters, then dump their full routing tables to each other, and from then on send only incremental UPDATE messages (new routes, withdrawals) plus periodic KEEPALIVE messages so each side knows the other is still alive. If keepalives stop arriving, the session is declared down and all routes learned from that neighbour are withdrawn.

The word peering is overloaded, and the distinction matters for the economics of the Internet. In the strict sense, settlement-free peering means two networks of roughly comparable size connect to exchange traffic between their own customers for free, because it benefits both. That is different from a customer paying a provider for transit (the right to reach the whole Internet). Both are implemented with BGP sessions, but the business relationship — peer versus provider versus customer — is what drives the routing policy each side applies.

Two ISPs both present at an Internet exchange point in Frankfurt configure each other as BGP peers: router 10.0.0.1 (AS64500) and router 10.0.0.2 (AS64501). Each advertises only its own customers' prefixes to the other, settlement-free, so a packet from a customer of one to a customer of the other no longer has to detour through a paid transit provider.

A BGP session is a configured TCP connection on port 179; "peering" often also means a free, mutual-benefit relationship.

"Peer" in BGP can mean any configured neighbour, OR specifically a settlement-free equal — don't assume two networks running BGP between them are exchanging traffic for free.

Also called
peering對等互連BGP 鄰接