BGP

Why
BGP is monumentally important because it allows subnets to be come recognized by the internet as a whole and it allows each AS in the Internet knows how to get to new subnets

What
BGP is an interdomain routing process and it stands for Border Gateway Protocol. BGP provides the following features

Features

 * Obtain subnet reachability information from neighboring ASs
 * Propagate the reachability information to all routers inside the AS
 * Determine "good" routes to subnets based on reachability information and on AS policy

Basic Configuration

 * Pairs of nodes in BGP are connected over semipermanent TCP connections on port 179
 * The two nodes on either side of the BGP connection are known as BGP peers
 * The BGP connection and all of the messages sent across the connection is referred to as the BGP session
 * BGP sessions in the same AS are known as iBGP or internal BGP
 * BGP sessions between AS are known as eBGP or external BGP

Advanced Details

 * Each AS in BGP will have a unique identifier known as a Autonomous System Number or ASN
 * When a router advertises a prefix across a BGP session, it will include with it a number of attributes. The combination of prefix and attributes is known as a route

AS-PATH
AS-PATH is an attribute in a BGP route that holds a list of ASN that the advertisement has passed through. BGP uses this attribute to prevent looping advertisements. If an AS sees that its ASN is already in the path, it will disregard the advertisement

NEXT-HOP
The NEXT-HOP attribute is the interface to the router that began the advertisement. It is used for the routers to correctly set up their routing tables

Route Selection

 * Routes are assigned a local preference. These values are arbitrary and can be set by a network admin.
 * From these remaining routes, the route with the shortest AS-PATH is selected
 * From these routes, the path with the closest NEXT-HOP is selected
 * If any remain, we use BGP identifiers to select the route