BGP path attributes

Path attributes classification

BGP path attributes are a group of parameters encapsulated in the path attributes field of update messages. They give detailed route attributes information that can be used for route filtering and selection.

Path attributes fall into the following categories:

The usage of each BGP path attribute is described in the following table.

Table 7: Usage of BGP path attributes

Name

Category

ORIGIN

Well-known mandatory

AS_PATH

Well-known mandatory

NEXT_HOP

Well-known mandatory

LOCAL_PREF

Well-known discretionary

ATOMIC_AGGREGATE

Well-known discretionary

AGGREGATOR

Optional transitive

COMMUNITY

Optional transitive

MULTI_EXIT_DISC (MED)

Optional non-transitive

ORIGINATOR_ID

Optional non-transitive

CLUSTER_LIST

Optional non-transitive

Usage of BGP path attributes

Figure 76: AS_PATH attribute

Generally, a BGP router does not receive routes containing the local AS number to avoid routing loops.


[NOTE: ]

NOTE:

The current implementation supports using the peer allow-as-loop command to receive routes containing the local AS number in order to meet special requirements.


Use the AS_PATH attribute for route selection and filtering. BGP gives priority to the route with the shortest AS_PATH length, if other factors are the same. As shown in Figure 76, the BGP router in AS 50 gives priority to the route passing AS 40 for sending data to the destination 8.0.0.0.

In some applications, you can apply a routing policy to control BGP route selection by modifying the AS_PATH length.

By configuring an AS path filtering list, you can filter routes based on AS numbers contained in the AS_PATH attribute.

Figure 77: NEXT_HOP attribute

Figure 78: MED attribute

In general, BGP compares MEDs of routes received from the same AS only.


[NOTE: ]

NOTE:

The current implementation supports using the compare-different-as-med command to force BGP to compare MED values of routes received from different ASs.


Figure 79: LOCAL_PREF attribute