Christmas Offer - Every Learner Must Check Out - Flat 88% OFF on All Access Pass
00
days
:
00
hours
:
00
minutes
:
00
seconds
PyNet Labs- Network Automation Specialists

What are BGP Attributes?

Author : PyNet Labs
Last Modified: February 13, 2024 
A blog featured image with text - What are BGP Attributes and an image of BGP attribute types.

Introduction

Border Gateway Protocol (BGP) is the routing protocol utilized for exchanging network reachability information between AS (Autonomous System) on the Internet. BGP facilitates the advertisement of its own network prefixes by each AS. This allows them to gain knowledge about prefixes of other ASes thereby ensuring end-to-end connectivity across the global network.

An essential aspect of BGP is its ability to allow each AS to apply its customized policies and preferences when it comes to routing traffic in and out of its network. These policies and preferences are conveyed through BGP attributes. These can be defined as the pieces of information attached to each prefix advertisement.

BGP attributes play a major role in influencing path selection, managing routing information distribution, and providing information regarding the network topology. In this blog, we will explain the BGP attribute types, their classification along their use.

Before getting into more details, let’s first understand what are attributes in BGP.

What are BGP Attributes?

BGP attributes refer to the components that a BGP router attaches while describing various prefixes included in its BGP update messages. A prefix represents a network address along with its subnet mask, such as 192.168.1.0/24. In this context, a BGP update message denotes a communication sent by a BGP router to its peers (other BGP routers) for the purpose of advertising or withdrawing prefixes from their knowledge base. For instance, a BGB router might send an update message informing its peers that it can reach network 1.0.0.0/24 via a designated pathway.

BGP attributes provide information about the characteristics and preferences of each path, including its origin, length, weight, local preference, and more. BGP routers utilize these attributes to apply policies and preferences when determining the best path for each destination. For instance, a BGP router might prioritize a path with a higher weight or a lower AS path length compared to another path.

There are four types of BGP attributes:

  1. Well-known mandatory
  2. Well-known discretionary
  3. Optional transitive
  4. Optional non-transitive

Let’s now understand the four BGP attribute types in detail.

BGP Attributes divided into two types - Well-known and Optional, which are further divided into Mandatory, Descretionary, Transitive, and Non-transitive.

Well-Known Mandatory BGP Attributes

These attributes are crucial and must be included in every route advertisement. They are universally recognized by all BGP speakers. These attributes play a major role in ensuring BGP functions correctly. Apart from this, intermediate BGP speakers can’t remove or modify them. Below, we have discussed different types of well-known mandatory attributes.

AS-PATH

The AS-Path attribute comprises a list of numbers that the prefix has traversed before reaching the local router. Let’s take a case where a prefix has traversed AS 100, AS 200, and AS 300 before it reaches the router. Let’s say, for instance, that a prefix has traversed AS 100, AS 200, and AS 300 before it reaches the router. In this case, the AS Path attribute will be represented as 100 200 300. The purpose of the AS Path attribute is to avoid routing loops and choose the shortest path in order to reach the destination. A shorter AS-Path signifies a path that’s more favored or preferred path.

NEXT-HOP

The next hop attribute refers to the IP address of the router that serves as the step in reaching a destination prefix. For example, if a local router receives information about a prefix like 1.0.0.0/24 from its neighboring router at 192.168.1.1, then the next hop attribute will be set as 192.168.1.1. This attribute helps determine which interface should be used for forwarding packets towards the intended destination.

Origin

The origin attribute indicates how a particular prefix originated in the BGP (Border Gateway Protocol) system and has three values: IGP, EGP, or Incomplete. IGP signifies that the prefix originated from a gateway protocol (such as RIP, OSPF, or EIGRP). EGP indicates that it originated from a gateway protocol (like BGP itself). Incomplete means that the origin of the prefix is unknown or unspecified. When choosing between paths, a path with an IGP origin is preferred over one with an EGP origin, which in turn is preferred over one with an Incomplete origin.

Well-Known Discretionary BGP Attributes

Well-known discretionary attributes are attributes that every BGP speaker must recognize but may or may not be present in a route advertisement. They are not mandatory for BGP to function correctly but can impact the process of route selection.

Below, we have discussed different types of well-known discretionary attributes.

Local Preference

This attribute indicates the preference for a route within an AS. A higher value simply suggests a more preferred path. It is used to influence outbound traffic from an AS to destinations. For instance, if an AS has two exit points to reach network 1.0.0.0/24, it can assign a local preference to one of them, making it the preferred exit point.

Atomic aggregate

This feature shows whether a prefix has been combined by a BGP router or not. Aggregation is the process of merging prefixes into one with a subnet mask, such as combining 192.168.1.0/24 and 192.168.2.0/24 into 192.168.0./23. Aggregation also assists in reducing the size of the routing table and improves scalability, but it may also lead to some loss of information about the original prefixes, such as their AS paths or next hops.

Now, let’s discuss the other classification of BGP attributes, i.e., Optional attributes.

Optional Transitive BGP Attributes

Optional transitive attributes may not be universally supported by all BGP implementations. Noncompliant BGP routers forward them unchanged when sending updates to peers, without any modification or removal. The word transitive simply means that the attribute can be passed from one AS to another without the use of any further modifications or removal.

Community

This attribute contains one or more values that identify a group of routes sharing common properties or policies. This also assists in making routing policy configuration and management easier by applying actions to a set of routes based on their community values. Let’s understand with the help of an example.  A community value of 7474:100 means that the prefix belongs to AS 7474 and has a local preference of 100. Further, these attributes can be used to filter, modify, or accept prefixes totally based on their values.

Aggregator

This attribute is used to indicate the AS number and IP address of the router that performed route aggregation. This attribute contains the AS number and IP address of the router that created an aggregate route by summarizing multiple more specific routes. It is used to provide information about the originator of an aggregate route, which can be useful for troubleshooting or accountability purposes.

Optional Non-Transitive BGP Attributes

Optional non-transitive attributes are attributes that may or may not be recognized by every BGP speaker, but they must not be propagated beyond the next-hop router if they are not recognized. They are used to convey additional information about a route that is relevant only for the next-hop router and not for other BGP speakers. The optional non-transitive attribute is:

Multi-exit-discriminator (MED)

This attribute indicates the relative preference for a route among multiple routes from the same AS to a neighboring AS. It is used to influence the inbound traffic from a neighboring AS by indicating which entry point is preferred.

These are the various BGP Attributes.

Frequently Asked Questions

Q1. What is the BGP weight attribute?

The BGP weight attribute is specifically for the Cisco parameter that is mainly used to determine the best path for outbound traffic. More importantly, it is local to the router and is not advertised to peers.

Q2. What is the correct BGP path attribute list?

The BGP path attribute list follows:

  • Weight
  • Local preference
  • Locally originated
  • AS path length
  • Origin type
  • MED
  • EBGP over IBGP
  • Router ID

Q3. What is BGP features?

Some of the basic features of BGP include:

  • Next-hop support
  • Configurations for inter-autonomous system
  • Path information
  • Conserving network bandwidth
  • Policy support
  • Support Classless Inter-Domain Routing

Q4. What are path attributes?

Path attributes are defined as the properties of network paths that directly or indirectly affect the routing decision. It includes metrics, preferences, and many others.

Conclusion

BGP attributes are an important part of BGP routing, as they provide information about the characteristics and preferences of a route. Attributes in BGP can be classified into four categories based on their presence, recognition, and propagation. BGP speakers can also modify BGP attributes to influence the routing decisions of other BGP speakers. Understanding how BGP attributes work and how they affect the route selection process is essential for anyone who wants to master BGP routing and is taught under OSPF BGP Training.

Recent Blog Post

Leave a Reply

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

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram