BGP Attributes and Determining the Best Path

Border Gateway Protocol (BGP) is the primary routing protocol used on the internet, enabling routers to exchange information and determine the best path for data transmission. Unlike Internal Gateway Protocols (IGPs) such as EIGRP and OSPF, which typically select routes based on the shortest path or lowest cost, BGP relies on BGP attributes to determine the best path. This is necessary because the shortest path on the internet is not always the most efficient or reliable.

Receiving BGP Information About Multiple Paths

To illustrate this process, consider a host with an IP address of 20.20.20.10 attempting to reach a web server at 30.30.30.10. The routers within Autonomous System (AS) 140 are aware of the 30.30.30.0/24 network since it belongs to this AS. BGP propagates this information to neighboring ASes via BGP updates, ensuring that all ASes recognize AS 140 as the owner of the network.

Routers in other ASes will then receive this information, along with the Autonomous System Path (AS Path), which describes the sequence of ASes a route must traverse to reach the destination. For example, BGP router R1 in AS 100 may receive two possible AS paths:

  1. AS Path: 100 → 150 → 140 (Green Path)
  2. AS Path: 100 → 190 → 160 → 140 (Red Path)

BGP updates provide not only AS Path information but also a variety of attributes associated with each route. The BGP router must then analyze these attributes to determine the optimal path to be installed in the routing table.

Attribute Evaluation Process

BGP evaluates attributes in a specific order to determine the best path. If a tie occurs at any step, the process continues with the next attribute in the sequence. The key attributes considered are:

1. Weight

This is a Cisco-specific attribute used to influence outbound path selection. The higher the weight, the more preferred the path. Since it is proprietary, it is not included in the official BGP specification but is widely supported by many vendors.

2. Local Preference

Local Preference (Local Pref) is used within an AS to indicate the preferred outbound path. Higher local preference values are preferred over lower values.

3. Locally Originated Routes

Routes that originate from the local router are preferred over those learned from other routers.

4. AS Path

This attribute represents the sequence of ASes that a route must traverse to reach its destination. Shorter AS paths are preferred, although this is only the fourth criterion in the selection process.

While shortest path routing is not BGP’s primary concern, AS Path length does play a role in path selection. If all other settings are at their defaults, the shorter AS Path will typically be chosen. In our example, assuming all other attributes are equal, the Green Path (100 → 150 → 140) would be preferred over the Red Path (100 → 190 → 160 → 140) due to its shorter AS Path.

5. Origin

This attribute signifies the source of the path information. Routes learned via an Interior Gateway Protocol (IGP) are preferred over those learned via BGP.

6. Multi-Exit Discriminator (MED)

The MED attribute is used to inform neighboring ASes about the preferred entry point into an AS when multiple connections exist between two ASes. A lower MED value is preferred.

7. eBGP Over iBGP

Paths learned via External BGP (eBGP) are preferred over those learned via Internal BGP (iBGP).

8. Shortest IGP Path to the BGP Next Hop

If previous attributes do not break the tie, the path with the shortest distance to the BGP next-hop router, based on an IGP metric, is preferred.

9. Oldest Path (For eBGP Routes)

For eBGP routes, if all attributes are still equal, the oldest path is preferred.

10. Lowest Originator Router ID

If a tie persists, the path with the lowest router ID of the originating BGP router is chosen.

11. Lowest Neighbor BGP Router ID

If all else remains equal, the final tiebreaker is the lowest BGP router ID among neighboring routers. This ensures that a definitive best path is always selected.

BGP Attributes and Determining the Best Path
BGP Attributes and Determining the Best Path - telecomTech.io

Attribute Types

BGP attributes are classified into two categories:

  1. Mandatory Attributes: These must be included in every BGP update. Examples include AS Path, Next Hop, and Origin.
  2. Optional Attributes: These may or may not be included, depending on the implementation and routing policy. Examples include MED, Local Preference, and Weight.

Different vendors may implement BGP attributes in slightly varying ways, but the fundamental selection process remains the same. Not all attributes are always used in every scenario, making BGP highly flexible and adaptable.

BGP Attributes and Determining the Best Path – Summary

BGP routers often receive multiple paths to a given destination, each accompanied by a set of attributes. The BGP selection process involves evaluating these attributes in a specific order to determine the best path. If two or more paths are equal for a given attribute, the next attribute in the sequence is considered until a definitive best path is identified.

BGP’s complexity allows it to accommodate the diverse routing needs of the internet, providing flexibility and control over traffic flow. Understanding these attributes and their order of evaluation is essential for network engineers and administrators who manage BGP-based routing.

For more detailed information, refer to the official BGP standard published in the appropriate RFC document, which is freely available for public viewing.

Also read: What is VXLAN?

About:

Welcome to telecomTech, where telecom and networking technologies… are simply explained! I’m Lazarus, a telecom professional with over 25 years of experience in network design, architecture, and telecom technologies. Over my career, I’ve led major projects, trained professionals, and helped countless individuals earn certifications and advance their careers.  

My goal is to make networking and telecom concepts clear, practical, and engaging—the way I wish they were taught when I started learning!

Whether you’re a student, a professional growing your skills, or preparing for certifications like Cisco, telecomTech is here to guide you.
Join me as we explore telecom and networking as a lifelong passion, not just a job. Let’s make this journey of growth and discovery together!

Visited 19 times, 1 visit(s) today

Leave A Comment

Your email address will not be published. Required fields are marked *