What is Boarder Gateway Protocol (BGP)
Border Gateway Protocol (BGP) is a set of rules and procedures that help an autonomous system (AS) exchange routing information over the internet. An AS is a network of computers run by an entity, e.g., a university or a large corporation, controlling a range of IP addresses.
Every AS manages a table containing all of its known routes to other networks, which is then propagated to neighboring networks (a.k.a., peers). The BGP decision-making mechanism analyzes the data and selects the best route for the next network hop.
BGP is the basis for the transfer of data between locations over the internet. It can also be used to manage routing within large networks, such as ISPs, layer 3 VPN services, IP telephony, large-scale web caching, or as a way to improve network stability.
BGP path selection process
BGP routers use Cisco’s best path algorithm to determine the best route to an AS, which is then stored for future reference.
To determine the best path to an AS, the algorithm compares each valid path with all other paths in a routing table according to the following criteria:
Weight – A Cisco-defined attribute that is local to the router on which it was configured. Weight is higher by default for routes that originate at the router. If there are multiple paths to a given IP address, BGP chooses the route with the highest weight.
Local Preference – The preferred path for exiting the AS to reach a certain network. The default is 100, but paths with higher weights are given priority. Routers within the same AS share the local preference attribute.
Locally Generated – Selects a path that originates locally via an aggregate or a network. The aggregation of network routes saves space in the routing table.
Shortest AS_Path – Selects an AS path for each route, which shows the number of AS hops to reach a given destination. This selection criterion chooses the shortest AS path, i.e., the path with the fewest hops.
Lowest Origin Type – Assigns higher preference to Exterior Gateway Protocol (EGP) vs. Interior Gateway Protocol (IGP).
Lowest Multi-Exit Discriminator (MED) – Tells other routers the preferred route for entry into an AS.
eBGP over iBGP – Assigns higher preference to external BGP over internal BGP used within an AS.
Lowest IGP Metric – Selects the path with the lowest Interior Gateway Protocol (IGP) metric for the next hop.
Multiple Paths – Indicates if multiple routes need to be installed in the routing table.
External Paths – Out of several external paths, selects the first received path.
Lowest Router ID – Selects the path to the external BGP router with the lowest router ID.
Minimum Cluster List – If more than one path has the same router ID, selects the path with minimum cluster list length.
Lowest Neighbor Address – Selects the path originating from the lowest neighbor address.


