When BGP sends an UPDATE packet to a peer it sends path attributes associated with the prefix. These path attributes are then used by BGP to pick the best route to a destination. BGP attributes are similar to metrics in OSPF and EIGRP in the way it uses them to decided on the best route.
There are four categories of path attribute
- Well-known mandatory – This attribute MUST exist in the BGP UPDATE. If this attribute is missing a NOTIFICATION error is generated and the session is closed.
- Well-known discretionary – This attribute must be recognized by all BGP implementations but does not have to be included in every BGP UPDATE message.
The following two categories are optional (as the name suggests) and are not required to be supported by all BGP implementations
- Optional transitive – If the attribute is not recognized by the BGP implementation but the transitive flag is set the attribute should be accepted and passed along to other peers.
- Optional non-transitive – If the attribute is not recognized by the BGP implementation but the transitive flag is not set the attribute should be ignored and not passed on to other peers.
|Type Code byte value (as decimal)||Attribute Name||Category|
|4||MULTI_EXIT_DISC (MED)||Optional non-transitive|
|10||Cluster List||Optional non-transitive|
|11||DPA||Designation Point Attribute|
|12||Advertiser||BGP/IDRP Route Server|
|13||RCID_PATH/CLUSTER_ID||BGP/IDRP Route Server|
|14||Multiprotocol Reachable NLRI||Optional non-transitive|
|15||Multiprotocol Unreachable NLRI||Optional non-transitive|
|256||Reserved for future development|
BGP works through these attributes in this specific order when choosing a path.
- Highest weight (This is a cisco proprietary value)
- Highest LOCAL_PREF
- Prefer a route that is locally sourced
- Shortest AS_PATH
- Lowest MED
- External BGP routes are preferred over internal BGP routes
- If no external route select path with the lowest IGP cost to the next hop router for IBGP.
- Routes with a longer age are preferred over “newer” routes or routes with a shorter age
- The lowest BGP router ID.