BGP Attributes

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
1 ORIGIN Well-known mandatory
2 AS_PATH Well-known mandatory
3 NEXT_HOP Well-known mandatory
4 MULTI_EXIT_DISC (MED) Optional non-transitive
5 LOCAL_PREF Well-known discretionary
6 ATOMIC_AGGREGATE Well-known discretionary
7 AGGREGATOR Optional transitive
8 COMMUNITY Optional transitive
9 ORIGINATOR_ID 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
16 Extended communities
256 Reserved for future development

BGP works through these attributes in this specific order when choosing a path.

  1. Highest weight (This is a cisco proprietary value)
  2. Highest LOCAL_PREF
  3. Prefer a route that is locally sourced
  4. Shortest AS_PATH
  5. ORIGIN
  6. Lowest MED
  7. External BGP routes are preferred over internal BGP routes
  8. If no external route select path with the lowest IGP cost to the next hop router for IBGP.
  9. Routes with a longer age are preferred over "newer" routes or routes with a shorter age
  10. The lowest BGP router ID.

m00nie :)