Skip to content
Reticux Engineering by Reticux Engineering

Day 93 — BGP SR Policy: Advertising Candidate Paths with SAFI 73

Reticux Engineering —

1. Opening

An SR Policy defines how a headend should steer selected traffic through a Segment Routing domain. BGP can distribute candidate paths for those policies, allowing a controller to program headends using the same scalable control-plane machinery already used elsewhere. The important distinction is between BGP receiving the policy and the Segment Routing subsystem selecting and installing a candidate path.

The central operational rule in this module is that BGP can distribute information that is consumed by something other than the ordinary IP unicast RIB. FlowSpec rules can program traffic filtering actions. BGP-LS can feed a controller topology database. SR Policy NLRI can instantiate candidate paths at a headend. SRv6 service attributes can program service SIDs. MVPN NLRI can build multicast VPN state.

That means a green BGP summary is only the first checkpoint. The engineer has to identify the consumer of each BGP family and verify that the received information was accepted, installed and used by the correct subsystem.

2. Concept and standards behavior

RFC 9256 defines SR Policy architecture: a policy is identified by color and endpoint and contains one or more candidate paths and segment lists. RFC 9830, published September 2025, now defines the standards-track BGP encoding for advertising SR Policy candidate paths. It introduces SAFI 73 for IPv4/IPv6 AFIs and encodes an SR Policy NLRI using a distinguisher, color and endpoint. The policy content is carried in the Tunnel Encapsulation Attribute using SR Policy tunnel type 15.

RFC 9830 also clarifies that BGP advertises a candidate path of an SR Policy; BGP itself is not the consumer that installs/executes the path. Malformed SR Policy tunnel encoding is handled using treat-as-withdraw rules aligned with RFC 7606.

A disciplined troubleshooting sequence is:

  1. prove the TCP/BGP session;
  2. prove the intended AFI/SAFI capability;
  3. inspect the family-specific NLRI and attributes;
  4. inspect inbound route-policy;
  5. inspect the consumer database or installed object;
  6. inspect forwarding/action state;
  7. run a positive test;
  8. run a negative containment test.

This prevents an engineer from clearing a healthy BGP session merely because the downstream consumer has rejected or failed to program the information.

3. Scenario

Controller1 advertises to Edge1 an SR Policy candidate path for Color 100, Endpoint 192.0.2.12. The candidate contains an explicit SR-MPLS segment list in the lab. A service route later carries Color 100 so Edge1 can steer matching traffic into the installed SR Policy.

Common lab control plane

Controller/PCE ---- BGP ---- RR/Edge1 ---- Core ---- Edge2
                         \                 /
                          \---- Services --/

Documentation-safe values:

  • Provider ASN: AS65000
  • Controller loopback: 192.0.2.200
  • Edge1: 192.0.2.11
  • Edge2: 192.0.2.12
  • Test IPv4 destination: 203.0.113.0/24
  • Test IPv6 destination: 2001:db8:100::/48
  • VRF BLUE RT: 65000:100

Success criteria

  1. Only the intended family is exchanged.
  2. The BGP route/object is visible with correct attributes.
  3. The appropriate consumer installs or uses the information.
  4. A malformed, unauthorized or unrelated object is not acted upon.
  5. Rollback removes only the new service state and leaves other BGP families healthy.

4. Topology diagram

A matching editable SVG and PNG are stored under media/diagrams/.

5. Prerequisites

  • IOS XR 24.x documentation baseline and exact product feature support verified.
  • Underlay reachability between BGP endpoints.
  • Explicit route-policy on eBGP/controller sessions where required.
  • Independent management path.
  • Logging and time synchronization.
  • Consumer subsystem enabled only after its safety policy is documented.
  • No production credentials, customer prefixes or attack signatures in the lab.

6. Baseline configuration

Topic-specific IOS XR excerpt — not a complete deployable configuration.

router bgp 65000
 address-family ipv4 sr-policy
 !
 neighbor 192.0.2.200
  remote-as 65000
  update-source Loopback0
  address-family ipv4 sr-policy
   route-policy PASS in
  !
 !
!
! Exact controller-originated SR Policy NLRI generation and platform
! feature support must be validated against IOS XR release documentation.

The exact commands must be validated on the selected IOS XR image. Where current standards are newer than vendor documentation, the post describes the standards behavior without inventing unverified CLI.

7. Verification before modification

show bgp summary
show bgp neighbors
show logging
show bgp ipv4 sr-policy
show segment-routing traffic-eng policy
show segment-routing traffic-eng policy detail
show bgp ipv4 unicast 203.0.113.0/24

The evidence set must include both BGP state and the destination consumer. For example, BGP-LS data received by BGP is not automatically installed into the IGP; FlowSpec NLRI received by BGP is not proof that the forwarding hardware accepted the filter.

8. Controlled modification

Advertise one candidate path for Color 100 / Endpoint 192.0.2.12. Verify the BGP SR Policy route appears, then verify the SR-TE subsystem instantiates/selects the candidate path and programs the expected segment list. Only then attach a Color 100 service route for steering.

Before commit, write the expected BGP object and the expected consumer-side state. If either expectation is ambiguous, the change is not ready.

9. Fault injection

Illustrative lab — not a real incident.

Advertise the SR Policy to the wrong headend or with an unauthorized color/endpoint tuple. The BGP session remains healthy, but policy import/route-target/controller authorization must prevent installation.

Change one attribute, family or consumer dependency at a time. Capture state before resetting anything.

10. Step-by-step troubleshooting

  1. Confirm endpoint reachability and BGP Established state.
  2. Confirm the exact AFI/SAFI is negotiated.
  3. Inspect the expected NLRI/attribute.
  4. Confirm route-policy permits the object.
  5. Confirm next-hop or target/headend identity where relevant.
  6. Confirm the consumer received the object from BGP.
  7. Confirm the consumer accepted/programmed it.
  8. Inspect forwarding/action state.
  9. Compare local object with controller/source intent.
  10. Verify timestamps/sequence/freshness where applicable.
  11. Test the intended behavior.
  12. Test that an unauthorized object has no effect.
  13. Correct the earliest failed invariant.
  14. Re-run the full evidence chain.
  15. Avoid resetting unrelated address families.

11. Root cause and correction

The controller-to-headend authorization is too broad or the policy target is wrong. Restrict SR Policy NLRI by intended headend/route target/color/endpoint and withdraw the incorrect candidate. Verify the SR-TE subsystem removes the policy before restoring service steering.

A correction that restores service by disabling validation, broadening controller trust or installing a permit-all policy is not considered a successful fix.

12. Post-fix verification

Verify the family-specific BGP table, route-policy, consumer database, programmed action/forwarding state, positive service behavior and negative containment. Confirm unrelated IPv4/IPv6/VPN families did not reset or change.

13. Rollback

Rollback the new AFI/SAFI, route-policy, controller advertisement or consumer programming while preserving the base BGP session where possible. Use IOS XR commit/rollback discipline and retain a pre-change evidence snapshot.

Rollback immediately if:

  • a FlowSpec rule matches traffic outside its authorized scope;
  • a controller receives topology outside its permitted domain;
  • an SR Policy is installed on the wrong headend or color/endpoint;
  • an SRv6 service SID resolves to the wrong service table;
  • MVPN signaling leaks multicast state across VRFs;
  • a change resets unrelated BGP families or services.

14. Deep-dive engineering notes

NLRI identity

RFC 9830 uses <Distinguisher, Color, Endpoint>. The distinguisher lets multiple candidate-path advertisements for the same color/endpoint coexist without unwanted BGP best-path collapse.

Candidate path content

Preference, priority, Binding SID, segment-list and other data are encoded in the SR Policy Tunnel Encapsulation Attribute. The SR subsystem evaluates the candidate according to SR Policy architecture; BGP is transport/distribution.

Steering is another layer

A service prefix with a Color Extended Community can resolve over an SR Policy with matching color/endpoint according to RFC 9256 behavior. A healthy SR Policy with no service steering produces no service change. A colored route with no valid matching policy may fall back or fail according to configured steering behavior.

Current-standard correction

Vendor documents may still refer to the long-running IETF draft that preceded standardization. As of September 2025, RFC 9830 is the normative BGP SR Policy advertisement standard and should replace draft references in new training content.

Security

RFC 9830 expects these policies within a trusted SR domain. A controller that can inject arbitrary segment lists can steer traffic through unintended nodes. Treat policy distribution as a privileged management-plane function.

15. Production workflow

  1. Define trusted controller/headend relationships.
  2. Allowlist headend, color and endpoint scopes.
  3. Establish SAFI 73 with explicit route policy.
  4. Advertise one candidate path.
  5. Verify BGP receipt.
  6. Verify SR Policy candidate-path status.
  7. Verify segment-list resolution.
  8. Add one colored service route.
  9. Verify actual traffic steering.
  10. Withdraw the candidate and observe service behavior.
  11. Attempt one unauthorized headend/color advertisement.
  12. Confirm it is not installed.
  13. Preserve controller intent and router installed-state evidence.

16. Production lessons

  • Use RFC 9830 as the current BGP SR Policy advertisement standard.
  • BGP distributes candidate paths; SR-TE consumes them.
  • Verify policy installation before service steering.
  • Authorize headend/color/endpoint scope tightly.
  • Monitor colored routes with no valid policy and policies with no consumers.
  • Treat controller compromise as a traffic-steering threat.

17. Knowledge check

  1. Why is an Established BGP session insufficient evidence for this service?
  2. Which state proves that the downstream consumer actually accepted the BGP object?
  3. What negative test proves the control plane did not broaden its trust or forwarding scope?

Answers

  1. BGP may be carrying the family correctly while policy, consumer validation or forwarding programming fails.
  2. The feature-specific installed database/forwarding state plus service behavior.
  3. Inject or inspect an unauthorized family object/prefix/headend/VRF and verify it is not installed or acted upon.

18. Sources

  • RFC 9830 — Advertising Segment Routing Policies in BGP (September 2025)
  • RFC 9256 — Segment Routing Policy Architecture
  • RFC 9012 — BGP Tunnel Encapsulation Attribute
  • RFC 7606 — Revised Error Handling for BGP UPDATE Messages
  • Cisco IOS XR 24.x Segment Routing Configuration Guide — SR-TE Policies/BGP SR Policy
Written by Reticux Engineering

Practical, lab-tested network engineering: Cisco, Juniper and Fortinet configurations, troubleshooting steps and exam-focused practice.

No comments:

Learn BGP, Cisco routing and network security with daily lab-driven lessons, from CCNA basics to CCNP level policy design.