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. The most recent route
  10. The lowest BGP router ID.

m00nie 🙂

Comments

  • Dear Sir,

    Thanks a lot for these wonderful info.

    I am preparing for my ROUTE exam. I request to kindly explain what is defined as Type 3 in the last paragraph, that is order in choosing a route .

    Is locally Originated Route a route available in the routing table of the same BGP router or announced by any router in the same Autonomous System?

    Thank you very much.

    Amit Raj

  • Hi Amit

    “Prefer a route that is locally sourced” just means a route that the BGP router has injected into the BGP table itself.
    Hope that makes it a bit clearer.
    Good luck 🙂

    m00nie

  • Dear Sir,

    I had a doubt regarding the locally originated routes are routes obtained from the same BGP router or a route announced from any other BGP Router in the same AS. Now it is clear.

    Thanks for this wonderful site and request you to kindly add more contents.

    Thank you again… 🙂

    Amit.

Leave a Reply