Octet

What are BGP path attributes, and how are they classified?

Show the answer

Say this first

Attributes are the properties carried with every route; BGP uses them for loop prevention and best path selection. There are four classes. Well-known mandatory: ORIGIN, AS_PATH and NEXT_HOP, present in every UPDATE. Well-known discretionary: LOCAL_PREF and ATOMIC_AGGREGATE. Optional transitive: COMMUNITY and AGGREGATOR, passed on even by routers that do not understand them. Optional non-transitive: MED, ORIGINATOR_ID and CLUSTER_LIST, dropped if not understood. Cisco's weight is not an attribute at all: it never leaves the router.

Go deeper

AttributeType codeClassWhat it does
ORIGIN1Well-known mandatoryHow the route entered BGP: IGP (i), EGP (e), incomplete (?)
AS_PATH2Well-known mandatoryASes crossed; loop prevention and path length
NEXT_HOP3Well-known mandatoryAddress to forward to
MULTI_EXIT_DISC (MED)4Optional non-transitiveHint to a neighbor AS about which entry link to use
LOCAL_PREF5Well-known discretionaryExit preference shared inside the AS
ATOMIC_AGGREGATE6Well-known discretionaryFlags that aggregation lost path detail
AGGREGATOR7Optional transitiveAS and router ID that built the aggregate
COMMUNITY8Optional transitiveTags for policy (RFC 1997)
ORIGINATOR_ID9Optional non-transitiveSet by route reflectors
CLUSTER_LIST10Optional non-transitiveSet by route reflectors
MP_REACH_NLRI, MP_UNREACH_NLRI14, 15Optional non-transitiveCarry IPv6, VPNv4, EVPN and other families
EXTENDED COMMUNITIES16Optional transitiveRoute targets, site of origin
LARGE_COMMUNITY32Optional transitive12-byte communities for 4-byte ASNs (RFC 8092)

What the classes mean in practice

  • Well-known: every BGP implementation must recognise them.
  • Mandatory: every UPDATE that advertises a prefix must carry them. LOCAL_PREF is sent on iBGP only.
  • Transitive: an optional attribute the router does not understand is still passed along, with the Partial bit set. That is how communities spread before every router supported them.
  • Non-transitive: an unknown optional non-transitive attribute is dropped.

Traps

  • Listing weight as a BGP attribute. It is a Cisco-local value that is never advertised.
  • Calling MED transitive. It crosses one AS boundary and stops.
How did you do?Book 4.1 Global Internet