BGP · · 4 min read

BGP Path Attributes Explained: Well-Known vs Optional

Unlike IGPs that use a single metric (cost, bandwidth, delay), BGP makes routing decisions based on a rich set of path attributes attached to every prefix in an UPDATE message. These attributes describe the path to a destination — which ASes the traffic will cross, how the originator prefers traffic to flow, and what communities or tags are attached for policy purposes.

Path attributes are the foundation of BGP policy. Every traffic engineering technique — local preference, MED, AS-path prepending, communities — works by manipulating one or more path attributes. Before we get into the individual knobs (covered in later articles), you need to understand the attribute classification system.

Attribute Categories

BGP path attributes fall into a 2x2 matrix based on two properties:

Well-Known Mandatory

Every BGP implementation must recognize these, and they must be present in every UPDATE with NLRI. Missing one is a protocol violation that triggers a NOTIFICATION.

AttributeType CodeDescription
ORIGIN1How the prefix was injected into BGP: IGP (i), EGP (e), or Incomplete (?). IGP means it was injected via the network command; Incomplete means redistribution.
AS_PATH2The ordered list of ASes the route has traversed. Used for loop detection (if your own AS is in the path, reject it) and as a tiebreaker in best path selection (shorter is preferred).
NEXT_HOP3The IP address of the next-hop router to reach the prefix. In eBGP, set to the advertising router's interface IP. In iBGP, preserved from the original eBGP peer by default.

Well-Known Discretionary

Every BGP implementation must recognize these, but they don't have to be present in every UPDATE. They're included when relevant.

AttributeType CodeDescription
LOCAL_PREF5Used within an AS (iBGP only) to indicate the preferred exit point. Higher is better. Default is 100 on Cisco. Covered in Manipulating BGP Local Preference.
ATOMIC_AGGREGATE6Signals that the advertising router aggregated prefixes and some path information may have been lost. Informational only — does not affect path selection.

Optional Transitive

Not every implementation must recognize these, but if a router receives one it doesn't understand, it must pass it along to its peers (transitive). The Partial bit is set to indicate it wasn't fully processed.

AttributeType CodeDescription
AGGREGATOR7Identifies the AS and router ID that performed route aggregation.
COMMUNITY8A 32-bit tag for grouping routes and applying policy. Standard communities include no-export, no-advertise, and internet. Covered in BGP Communities.
EXTENDED COMMUNITY168-byte communities used for VPN route targets, site-of-origin, and other extended tagging.
LARGE COMMUNITY3212-byte communities (RFC 8092) designed for 4-byte ASNs. Format: ASN:value1:value2.

Optional Non-Transitive

Not every implementation must recognize these, and if a router doesn't understand one, it silently drops it rather than passing it along.

AttributeType CodeDescription
MED4Multi-Exit Discriminator — suggests to an external AS which entry point to prefer. Lower is better. Only compared between paths from the same neighboring AS (by default). Covered in BGP MED: Influencing Inbound Traffic.
ORIGINATOR_ID9Set by route reflectors to identify the original iBGP advertiser. Used for loop prevention in RR environments.
CLUSTER_LIST10Set by route reflectors to track which RR clusters the route has passed through. Loop prevention for hierarchical RR designs.

How Attributes Flow

The transitive/non-transitive distinction matters in multi-AS paths:

Viewing Attributes on IOS XE

R1-HQ# show ip bgp 100.64.1.0/24
BGP routing table entry for 100.64.1.0/24, version 22
Paths: (2 available, best #1, table default)
  Advertised to update-groups:
     1
  65010
    203.0.113.1 from 203.0.113.1 (203.0.113.1)
      Origin IGP, metric 0, localpref 150, valid, external, best
      Community: 65010:100 65010:200
      rx pathid: 0, tx pathid: 0x0
  65020 65010
    198.51.100.1 from 198.51.100.1 (198.51.100.1)
      Origin IGP, metric 10, localpref 100, valid, external
      Community: 65020:300
      rx pathid: 0, tx pathid: 0

Reading this output:

Attribute Flags

Each attribute is encoded with a flag byte that indicates its properties:

You'll see these flags in packet captures (Wireshark decodes them clearly), and they're useful for debugging attribute handling issues in multi-vendor environments.

Key Takeaways

Read next

© 2025 Ping Labz. All rights reserved.