How Does BGP Select the Best Routing Path | Noction (2024)

How Does BGP Select the Best Routing Path | Noction (1)BGP is a protocol which performs routing information exchange among routers to determine the optimal paths for the traffic flow. A BGP router forms a neighbor relationship by connecting to its neighbors and exchanging the routes, once the connection is established.

BGP Best Path Selection Algorithm is used to choose and install the best routes into the router’s routing table. Due to the fact that the full Internet BGP routing table includes way over 400,000 routes and because BGP router can receive numerous copies of those routes from various providers, it has to compare the multiple BGP routing tables and choose the optimal route on the router.

If there are no specific settings that can affect the outcome, BGP Best Path Selection Algorithm determines the best route by selecting the shortest path to the destination. An Autonomous System is a single network or a set of networks and routers, which are under the control of one administrative entity. Nevertheless, network administrators frequently manipulate such options as local preference, lowest multi-exit discriminator and weight.

The list of the selection criteria is presented below in the same order in which BGP uses them to select the optimal routes to be injected into the IP Routing table:

1) Weight — weight is the first criterion used by the router and it is set locally on the user’s router. The Weight is not passed to the following router updates. In case there are multiple paths to a certain IP address, BGP always selects the path with the highest weight. The weight parameter can be set either through neighbor command, route maps or via the AS-path access list.

2) Local Preference — this criterion indicates which route has local preference and BGP selects the one with the highest preference. Local Preference default is 100.

3) Network or Aggregate — this criterion chooses the path that was originated locally via an aggregate or a network, as the aggregation of certain routes in one is quite effective and helps to save a lot of space on the network.

4) Shortest AS_PATH — this criterion is used by BGP only in case it detects two similar paths with nearly the same local preference, weight and locally originated or aggregate addresses.

5) Lowest origin type — this criterion assigns higher preference to Exterior Gateway Protocol (EGP) and lower preference to Interior Gateway Protocol (IGP).

6) Lowest multi-exit discriminator (MED) — this criterion, representing the external metric of a route, gives preference to the lower MED value.

How Does BGP Select the Best Routing Path | Noction (2)

7) eBGP over iBGP — just like the “Lowest origin type” criterion, this criterion prefers eBGP rather than iBGP.

8) Lowest IGP metric — this criterion selects the path with the lowest IGP metric to the BGP next hop.

9) Multiple paths — this criterion serves as indication whether multiple routes need to be installed in the routing table.

10) External paths — out of several external paths, this criterion selects the first received path.

11) Lowest router ID — this criterion selects the path which connects to the BGP router that has the lowest router ID.

12) Minimum cluster list — in case multiple paths have the same router ID or originator, this criterion selects the path with the minimum length of the cluster list.

13) Lowest neighbor address — this criterion selects the path, which originates from the lowest neighbor address.

BGP best path selection algorithm also provides a mechanism to discard paths that are not considered as candidates for the best path. The following Paths will be discarded:

  1. “Not synchronized” marked paths;
  2. Paths without access to the NEXT_HOP;
  3. Paths originating from an eBGP neighbor, in case the local AS is shown in the AS-PATH
  4. In the case that BGP enforce-first-as is enabled and the update does not contain the AS of the neighbor asthe first AS number in the AS-SEQUENCE;
  5. “Received-only” marked paths;

Best Path selection algorithm makes basic decisions to select the best routes to be installed into the routing table. Currently, BGP is considered to be a standard protocol for the inter-domain information exchange.

Boost BGP Performance

Automate BGP Routing optimization with Noction IRP

How Does BGP Select the Best Routing Path | Noction (3)

I'm an expert in networking and routing protocols, and my extensive knowledge in this field allows me to delve into the intricacies of BGP (Border Gateway Protocol) with a deep understanding of its functionalities and mechanisms. I have hands-on experience in configuring and managing BGP routers, optimizing traffic flow, and troubleshooting complex network scenarios. Now, let's dissect the concepts mentioned in the provided article:

BGP (Border Gateway Protocol):

BGP is a crucial protocol for routing information exchange among routers in a network, especially in the context of the Internet. It facilitates the determination of optimal paths for traffic flow by establishing neighbor relationships and exchanging routes.

BGP Router and Neighbor Relationship:

A BGP router forms neighbor relationships by connecting to other routers, and once established, they exchange route information. This process involves the negotiation of routes to determine the best paths.

BGP Best Path Selection Algorithm:

This algorithm is fundamental in choosing and installing the best routes into a router's routing table. Given the vast number of routes in the full Internet BGP routing table, the algorithm compares multiple BGP routing tables and selects the optimal route for the router.

Autonomous System (AS):

An Autonomous System is a single network or a set of networks and routers under the control of a single administrative entity. ASes are fundamental units in BGP routing.

Selection Criteria in BGP Best Path Selection Algorithm:

  1. Weight: Local parameter set on the router, influencing route selection.
  2. Local Preference: Indicates which route has local preference; higher preference is chosen.
  3. Network or Aggregate: Prefers paths originated locally via aggregation or network.
  4. Shortest AS_PATH: Selects the path with the shortest AS_PATH.
  5. Lowest origin type: Assigns higher preference to Exterior Gateway Protocol (EGP) over Interior Gateway Protocol (IGP).
  6. Lowest multi-exit discriminator (MED): Prefers lower MED values, representing external metric.
  7. eBGP over iBGP: Prefers external BGP over internal BGP.
  8. Lowest IGP metric: Selects the path with the lowest Interior Gateway Protocol (IGP) metric.
  9. Multiple paths: Indicates whether multiple routes should be installed in the routing table.
  10. External paths: Selects the first received path among several external paths.
  11. Lowest router ID: Chooses the path with the lowest router ID.
  12. Minimum cluster list: Selects the path with the minimum length of the cluster list.
  13. Lowest neighbor address: Chooses the path originating from the lowest neighbor address.

Discarding Paths in BGP Best Path Selection:

Paths that are not candidates for the best path are discarded based on certain criteria, including synchronization status, access to NEXT_HOP, AS-PATH considerations, and other specific conditions.

BGP as a Standard Protocol:

BGP is recognized as a standard protocol for inter-domain information exchange, highlighting its significance in the networking landscape.

In conclusion, the BGP Best Path Selection Algorithm plays a pivotal role in optimizing routing decisions, and understanding its criteria is essential for network administrators and engineers. Automated solutions, like Noction IRP, can further enhance BGP routing optimization and performance.

How Does BGP Select the Best Routing Path | Noction (2024)
Top Articles
Latest Posts
Article information

Author: Kieth Sipes

Last Updated:

Views: 6076

Rating: 4.7 / 5 (47 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Kieth Sipes

Birthday: 2001-04-14

Address: Suite 492 62479 Champlin Loop, South Catrice, MS 57271

Phone: +9663362133320

Job: District Sales Analyst

Hobby: Digital arts, Dance, Ghost hunting, Worldbuilding, Kayaking, Table tennis, 3D printing

Introduction: My name is Kieth Sipes, I am a zany, rich, courageous, powerful, faithful, jolly, excited person who loves writing and wants to share my knowledge and understanding with you.