8.2 BGP Path Attributes and Route Selection
Key Takeaways
Evaluate route eligibility and next-hop resolution before comparing attractive attributes.
LOCAL_PREF prefers higher values within an AS; MED prefers lower values when comparison applies.
AS_PATH length follows earlier policy criteria and does not measure physical delay.
Mandatory attributes apply to relevant advertisements, not every withdrawal-only UPDATE.
A simplified attribute example is not the complete configurable SR OS path-selection algorithm.
Read what an advertisement says
A BGP route contains more than a destination prefix. Its path attributes describe origin, AS traversal, next-hop information, and policy preferences. This lesson adds detail to the current course's introductory BGP topic; it does not imply that every advanced tie-breaker is a separate published 4A0-100 objective.
Begin with eligibility. A route rejected by import policy or lacking a usable next hop cannot become a usable path merely because it has an attractive AS_PATH. The selected BGP path must also compete appropriately with other route sources in the routing context.
Attribute categories
| Category | Recognition and propagation | Examples |
|---|---|---|
| Well-known mandatory | Recognized by compliant speakers; required in applicable conventional reachability advertisements | ORIGIN, AS_PATH, NEXT_HOP |
| Well-known discretionary | Recognized, included as required by its rules | LOCAL_PREF, ATOMIC_AGGREGATE |
| Optional transitive | An unrecognized attribute can be preserved and passed with required flags | COMMUNITY, AGGREGATOR |
| Optional non-transitive | An unrecognized attribute is not passed onward | MED |
“Mandatory” does not mean every UPDATE packet contains all three familiar attributes. An UPDATE can only withdraw routes, and multiprotocol address families carry next-hop information in their applicable structures. Attribute presence and error handling must be interpreted in the message's actual context.
AS_PATH and ORIGIN
AS_PATH records AS traversal. An ordinary external advertisement prepends the sending AS. A receiver normally rejects a path containing its own AS to avoid an interdomain control-plane loop. Explicit features such as confederations or local-AS handling introduce additional rules; the basic model assumes these are absent.
A shorter AS_PATH can be preferred after earlier selection criteria tie. AS prepending repeats an ASN to influence another network's selection. It is a suggestion through attributes, not an instruction that overrides the other network's policies. Fewer AS entries do not guarantee lower delay.
ORIGIN has values IGP, EGP, and INCOMPLETE, ordered 0, 1, and 2 for ordinary comparisons. It describes how a route was introduced into BGP under the originating configuration. “IGP” is not a certificate of route stability, and a route learned through another protocol does not universally acquire a particular ORIGIN without considering export policy and implementation behavior.
NEXT_HOP must resolve
NEXT_HOP identifies where traffic toward the advertised destination should be sent. The BGP peer that delivered an update and the forwarding next hop need not be the same router.
Suppose a border router learns 203.0.113.0/24 externally with next hop 192.0.2.2 and advertises it internally. If an internal peer has no route resolving 192.0.2.2, the BGP session can be healthy while the path is unusable. The operator can provide suitable next-hop reachability or intentionally rewrite the next hop with a supported policy.
This reachability is recursive: the router resolves the advertised next hop through its routing and, where applicable, tunnel information until it has usable forwarding. A route's presence in a BGP display is not proof that it is active in the main FIB.
LOCAL_PREF and MED
LOCAL_PREF expresses internal preference for an exit. Higher values are preferred; SR OS uses 100 as its ordinary default. It is distributed within the AS, rather than normally advertised to external peers. Confederation behavior is a special case outside the simple model.
If two eligible paths to one prefix have LOCAL_PREF 200 and 100, the first normally wins before AS_PATH length is considered. This can intentionally prefer a longer AS path for business or policy reasons.
MULTI_EXIT_DISC (MED) suggests an entry preference to a neighboring AS. Lower values are preferred when MED is compared. By default, ordinary comparison is between applicable paths from the same neighboring AS; configuration can alter this behavior.
Neither attribute guarantees a particular traffic pattern. Route eligibility, more-specific destination advertisements, policy on other routers, and failures can change actual forwarding. LOCAL_PREF affects a route choice inside the AS; it is not a direct setting for all Internet senders.
A bounded selection example
The following simplified comparison assumes eligible conventional IPv4 BGP paths, equal route preference, no earlier differentiating feature, and ordinary path-selection settings. It illustrates common criteria rather than claiming an exhaustive SR OS algorithm.
| Candidate | LOCAL_PREF | AS_PATH length | ORIGIN |
|---|---|---|---|
| A | 100 | 2 | IGP |
| B | 100 | 3 | IGP |
| C | 100 | 2 | INCOMPLETE |
LOCAL_PREF ties. Candidate B loses on AS_PATH length. A then beats C on ORIGIN. There is no need to compare their MED or internal next-hop distance after a winner is determined.
With LOCAL_PREF 200 on B instead, B wins the illustrated comparison despite its longer AS path. Always stop at the first applicable criterion that resolves the comparison.
When later criteria are needed, route source, next-hop distance, and identifier tie-breaks can matter. Consult the matching SR OS manual and configured path-selection options. Do not insert a Cisco-specific Weight mnemonic and call it Nokia's complete algorithm.
Verify the selected result
Inspect BGP route details for the prefix, peer, path attributes, and selection reason. Then inspect the main route table. A path selected as BGP's best can still lose to an eligible static route for the exact same prefix.
For a packet, perform longest-prefix match over installed routes afterward. An installed /25 can override an installed /24 for matching destinations regardless of the relative LOCAL_PREF used when each prefix's BGP path was chosen. Keeping these steps distinct avoids a common confusion between BGP path selection and packet forwarding.
Primary references
BGP specification and Nokia SR OS documentation, checked October 20, 2026. Use current release documentation for the full configurable selection procedure.
Which category includes AS_PATH in an applicable conventional IPv4 reachability advertisement?
Well-known discretionary
Optional non-transitive
Well-known mandatory
Optional transitive
In an ordinary non-confederation AS, eligible paths for the same destination are available through two exits. Which attribute can express a stronger internal preference for one exit?
LOCAL_PREF; a higher value is preferred and it is propagated exclusively among internal IBGP peers
MED; a higher value is preferred and it is propagated across EBGP peers to the upstream provider
LOCAL_PREF; a lower value is preferred and it is advertised across EBGP links to upstream transit providers
ORIGIN; setting the attribute to INCOMPLETE ensures outbound preference within the local AS
Eligible conventional IPv4 BGP paths have equal route preference, no earlier differing feature, equal LOCAL_PREF, and equal AS_PATH length. In the simplified ordinary comparison taught here, which attribute comes next?
MED
ORIGIN type
Ethernet source MAC
TCP source port
Sections you finish are checked off in the contents.