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.
|Wartość bajtowa atrybutu (dziesiętnie i szesnastkowo)||Nazwa atrybutu
|1 0x1||ORIGIN||Well-known mandatory|
|2 0x2||AS_PATH||Well-known mandatory|
|3 0x3||NEXT_HOP||Well-known mandatory|
|4 0x4||MULTI_EXIT_DISC (MED)||Optional non-transitive|
|5 0x5||LOCAL_PREF||Well-known discretionary|
|6 0x6||ATOMIC_AGGREGATE||Well-known discretionary|
|7 0x7||AGGREGATOR||Optional transitive|
|8 0x8||COMMUNITY||Optional transitive|
|9 0x9||ORIGINATOR_ID||Optional non-transitive|
|10 0xa||Cluster List||Optional non-transitive|
|11 0xb||DPA||Designation Point Attribute|
|12 0xc||Advertiser||BGP/IDRP Route Server|
|13 0xd||RCID_PATH/CLUSTER_ID||BGP/IDRP Route Server|
|14 0xe||Multiprotocol Reachable NLRI||Optional non-transitive|
|15 0xf||Multiprotocol Unreachable NLRI||Optional non-transitive|
|16 0x10||Extended communities|
|256 0x100||Reserved for future development|
BGP works through these attributes in this specific order when choosing a path. There is an order used to path selection.
(W) L L A O M N I
- Highest WEIGHT (This is a cisco proprietary value)
- Highest LOCAL_PREF
- Prefer a route that is LOCALLY SOURCED
- Shortest AS_PATH
- ORIGIN of the prefix (external, internal, unknown)
- Lowest MED
- External BGP routes are preferred over internal BGP routes (NEIGHBOR TYPE)
- If no external route select path with the lowest IGP cost to the next hop router for iBGP. (IGP COST)
- The most recent route
- The lowest BGP router ID.