1. Opening
FlowSpec turns BGP into a distribution mechanism for traffic classification and actions. That is powerful because a mitigation controller can install a rule across many edge routers quickly. It is dangerous for exactly the same reason: one over-broad rule can drop legitimate traffic across the network faster than a human operator can react.
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 8955 defines the current IPv4 Flow Specification NLRI and traffic-filtering actions and obsoletes the older RFC 5575/7674 baseline. RFC 8956 extends the mechanism to IPv6 and uses AFI 2 with SAFI 133 for global IPv6 FlowSpec and SAFI 134 for VPN FlowSpec. The match components form the FlowSpec NLRI; actions are typically encoded with extended communities. A valid FlowSpec route is therefore a policy object, not an IP prefix that should be installed as ordinary unicast reachability.
FlowSpec ordering and validation matter. The implementation must determine rule precedence in a deterministic manner and should prevent unauthorized BGP speakers from injecting arbitrary traffic policy. Operational designs normally treat the FlowSpec source/controller as a highly privileged control-plane system.
A disciplined troubleshooting sequence is:
- prove the TCP/BGP session;
- prove the intended AFI/SAFI capability;
- inspect the family-specific NLRI and attributes;
- inspect inbound route-policy;
- inspect the consumer database or installed object;
- inspect forwarding/action state;
- run a positive test;
- 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
A mitigation controller at 192.0.2.200 sends IPv4 FlowSpec to Edge1/Edge2. The authorized lab rule matches TCP traffic destined to 203.0.113.10/32 on destination port 443 and applies a rate/discard action selected by the controlled exercise. A second unauthorized rule deliberately covers the entire 203.0.113.0/24 to prove policy containment.
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
- Only the intended family is exchanged.
- The BGP route/object is visible with correct attributes.
- The appropriate consumer installs or uses the information.
- A malformed, unauthorized or unrelated object is not acted upon.
- 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.
route-policy FLOWSPEC-IN
pass
end-policy
!
router bgp 65000
address-family ipv4 flowspec
!
neighbor 192.0.2.200
remote-as 65000
update-source Loopback0
address-family ipv4 flowspec
route-policy FLOWSPEC-IN in
!
!
!
! Install/redirect actions are feature- and platform-specific.
! Validate the exact IOS XR FlowSpec server/client/local-install model before execution.
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 flowspec
show bgp ipv6 flowspec
show flowspec afi-all
show flowspec ipv4 detail
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
Start with a non-dropping or tightly rate-limited lab rule matching one /32 and one destination port. Confirm the FlowSpec NLRI is received, then confirm the local FlowSpec/forwarding subsystem has installed the exact match/action. Only then test traffic.
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 a FlowSpec rule with a destination component broader than the controller authorization policy. The BGP session remains healthy, but the rule must be rejected or prevented from local installation by policy.
Change one attribute, family or consumer dependency at a time. Capture state before resetting anything.
10. Step-by-step troubleshooting
- Confirm endpoint reachability and BGP Established state.
- Confirm the exact AFI/SAFI is negotiated.
- Inspect the expected NLRI/attribute.
- Confirm route-policy permits the object.
- Confirm next-hop or target/headend identity where relevant.
- Confirm the consumer received the object from BGP.
- Confirm the consumer accepted/programmed it.
- Inspect forwarding/action state.
- Compare local object with controller/source intent.
- Verify timestamps/sequence/freshness where applicable.
- Test the intended behavior.
- Test that an unauthorized object has no effect.
- Correct the earliest failed invariant.
- Re-run the full evidence chain.
- Avoid resetting unrelated address families.
11. Root cause and correction
The fault is excessive FlowSpec authorization scope. Tighten the controller import policy/validation so only approved destination prefixes, component types and actions can be installed. Do not remove FlowSpec validation just to make the route visible.
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
Match components versus actions
FlowSpec NLRI describes the flow using ordered components such as destination/source prefix, protocol/next-header, ports, TCP flags, packet length, DSCP and fragmentation criteria. Traffic actions are carried separately. Troubleshooting must capture both; a correct match with the wrong action can be more damaging than no rule.
IPv4 and IPv6 are not identical encodings
RFC 8956 adds IPv6-specific component handling, including offset information for IPv6 prefixes and next-header semantics. Do not generate IPv6 rules by string-replacing IPv4 prefixes.
Controller trust boundary
A FlowSpec controller is effectively a distributed firewall/QoS policy source. Protect its BGP session, restrict accepted rule space, apply maximum rule limits, log every change and maintain an emergency kill/withdraw workflow.
Validation and reachability
FlowSpec rules are often validated against unicast routing/origin context so a speaker cannot arbitrarily mitigate someone else's address space. The exact IOS XR validation options and deployment mode must be checked against current documentation.
Redirect is not only discard
Modern IOS XR FlowSpec can support actions such as redirect to VRF or SR Policy in supported designs. That increases usefulness and also increases the consequences of a bad action. Treat redirect targets as an allowlisted resource.
15. Production workflow
- Define controller identity and BGP authentication policy.
- Define allowed destination prefixes and maximum prefix lengths.
- Define permitted component types and actions.
- Set a maximum FlowSpec rule count and alert threshold.
- Start in report/non-destructive lab mode.
- Advertise one narrow rule.
- Compare controller intent, BGP route and installed FlowSpec entry.
- Generate matching and nonmatching traffic.
- Verify counters increase only for matching traffic.
- Attempt one unauthorized broad rule.
- Confirm it is rejected or not installed.
- Test withdrawal and restoration of traffic.
- Store the controller rule and router evidence together.
16. Production lessons
- Treat FlowSpec as privileged distributed policy, not ordinary routing.
- Authorize destinations and actions separately.
- Verify BGP reception and hardware/action installation.
- Keep IPv4 and IPv6 rule construction family-specific.
- Use narrow canary rules before production-wide DDoS automation.
- Test withdrawal as carefully as activation.
17. Knowledge check
- Why is an Established BGP session insufficient evidence for this service?
- Which state proves that the downstream consumer actually accepted the BGP object?
- What negative test proves the control plane did not broaden its trust or forwarding scope?
Answers
- BGP may be carrying the family correctly while policy, consumer validation or forwarding programming fails.
- The feature-specific installed database/forwarding state plus service behavior.
- Inject or inspect an unauthorized family object/prefix/headend/VRF and verify it is not installed or acted upon.
18. Sources
- RFC 8955 — Dissemination of Flow Specification Rules (obsoletes RFC 5575 and RFC 7674)
- RFC 8956 — Dissemination of Flow Specification Rules for IPv6
- RFC 5575bis-era operational concepts as replaced by RFC 8955/8956
- Cisco IOS XR BGP Configuration Guide for Cisco 8000 Series — BGP FlowSpec (updated June 2026)
No comments:
Post a Comment