Sitemap

LSED: Border Gateway Protocol

2 min readNov 24, 2014

The Border Gateway Protocol (BGP) is a protocol used by routers to exchange routing table information. Today, BGP is primary used to enable peering between Autonomous Systems (AS).

An Autonomous System (AS) can be thought of as a registered “network off of the internet”. For example, a company that owns several subnets can register those subnets collectively under a single AS. Registration is completed by a central authority called IANA, which assigns the AS a unique ID called a Autonomous System Number (ASN). For example, Google’s 15169.

Get Rob McQueen’s stories in your inbox

Join Medium for free to get updates from this writer.

Peering is when two AS’s establish a BGP session. In this session, AS’s share routing tables. A routing table is a mapping from Destination Subnet -> Next Hop IP. For example, when a AS receives a packet destined for 8.6.7.6, it will look at its routing table to see if there’s a Destination Subnet that matches that IP. If yes, then it forwards the packet to the Next Hop IP matched by that Destination Subnet. If no, it can route the packet to a “Default” next hop.

Peering is usually done at Exchange Points. These are physical locations where organizations put hardware to advertise their AS. For example, the Amsterdam Internet Exchange is one of the largest exchange points in the world, housing hundreds of peers

BGP sessions can be negotiated by organizations on a per peering basis; this is called bilateral peering. However, negotiating each peering session can be inefficient. To make it easier, router servers enable Multilateral Peering (MLPE), which allows a group of AS to communicate with other AS without having a direct agreement.

BGP also supports communities. A community is extra information sent with the routing table that act as rules for specific subnets. This gives the ASN control over how its subnets are advertised by upstream peers.

Rob McQueen
Rob McQueen

Written by Rob McQueen

Developer at MoPub. MIT '12 Computer Science. Startups. Freelance work. Artisan Bread Baker. Jazz Pianist. The Tech Newspaper. Sigma Phi Epsilon.