rfc-9830

Advertising Segment Routing Policies in BGP

S. Previdi, C. Filsfils, K. Talaulikar (Editor), P. Mattes, D. Jain
date2025-09 streamIETF areartg wgidr statusPROPOSED STANDARD pages36 canonicalhttps://www.rfc-editor.org/rfc/rfc9830 doi10.17487/RFC9830
A Segment Routing (SR) Policy is an ordered list of segments (also referred to as "instructions") that define a source-routed policy. An SR Policy consists of one or more Candidate Paths (CPs), each comprising one or more segment lists. A headend can be provisioned with these CPs using various mechanisms such as Command-Line Interface (CLI), Network Configuration Protocol (NETCONF), Path Computation Element Communication Protocol (PCEP), or BGP. This document specifies how BGP can be used to distribute SR Policy CPs. It introduces a BGP SAFI for advertising a CP of an SR Policy and defines sub-TLVs for the Tunnel Encapsulation Attribute to signal information related to these CPs. Furthermore, this document updates RFC 9012 by extending the Color Extended Community to support additional steering modes over SR Policy.

updates

Extracted elements (31)

design-rationale §2.4.4

The Segment List, SR Policy Candidate Path Name, and SR Policy Name sub-TLVs are assigned code points ≥128 to trigger the 2-octet Length field encoding defined in RFC 9012, because these sub-TLVs may exceed 255 bytes in length due to large numbers of segments or long symbolic names.

routing, bgp

design-rationale §2.4

The separate SRv6 Binding SID sub-TLV (Type 20) was introduced in later draft versions to support advertising of SRv6 Endpoint Behavior and SID Structure without breaking backward compatibility with early implementations that used only the original Binding SID sub-TLV (Type 13) for both SR-MPLS and SRv6.

routing, bgp

interoperability-note §2.4.2

The original Binding SID sub-TLV (Type 13) is retained for signaling SRv6 BSIDs to preserve backward compatibility with early implementations; however, the SRv6 Binding SID sub-TLV (Type 20) is RECOMMENDED for new SRv6 BSID signaling because it can specify the SRv6 Endpoint Behavior.

routing, bgp

normative-requirement §5 MUST NOT

A BGP implementation MUST NOT perform semantic verification of SR Policy sub-TLV fields, nor treat the SR Policy update as invalid based on such verification; field validation is the responsibility of the SRPM.

routing, bgp

normative-requirement §4.2.3 MUST NOT

A BGP node MUST NOT alter the SR Policy information carried in the Tunnel Encapsulation Attribute during propagation.

routing, bgp

normative-requirement §2.2 MUST

A BGP UPDATE carrying MP_REACH_NLRI or MP_UNREACH_NLRI with SR Policy SAFI MUST also carry the BGP mandatory attributes. The Tunnel Encapsulation Attribute MUST be attached and MUST contain a Tunnel Type TLV set to SR Policy (15); any other Tunnel Type MUST be treated as malformed via treat-as-withdraw.

routing, bgp

normative-requirement §2.2 MUST NOT

A Tunnel Encapsulation Attribute MUST NOT contain more than one TLV of type 'SR Policy'; such updates MUST be considered malformed and handled by treat-as-withdraw.

routing, bgp

normative-requirement §4.2.1 MUST

An SR Policy update MUST have either the NO_ADVERTISE community, at least one Route Target extended community in IPv4-address format, or both. If neither is present, the update MUST be considered malformed.

routing, bgp

normative-requirement §4.2.2 MUST

If one or more Route Targets are present, at least one MUST match the receiver's BGP Identifier (a 4-octet unsigned non-zero integer per RFC 6286) for the SR Policy NLRI to be considered usable locally.

routing, bgp

normative-requirement §5 MUST

Malformed SR Policy NLRIs where the error allows skipping MUST be handled as treat-as-withdraw. Where encoding errors prevent processing the entire BGP UPDATE, the router SHOULD apply AFI/SAFI disable or MUST perform session reset if AFI/SAFI disable is not possible.

routing, bgp

normative-requirement §4.2.3 MUST NOT

SR Policy NLRIs carrying the NO_ADVERTISE community MUST NOT be propagated. By default, a BGP node MUST NOT propagate SR Policy NLRIs to any EBGP neighbor; explicit configuration is required to enable inter-AS propagation.

routing, bgp

normative-requirement §2.1 MUST

The AFI used with SR Policy SAFI 73 MUST be IPv4 (1) or IPv6 (2). When AFI=1, NLRI Length MUST be 96 bits; when AFI=2, NLRI Length MUST be 192 bits.

routing, bgp

normative-requirement §4.2.2 MUST

When an update for an SR Policy NLRI results in it becoming unusable, BGP MUST delete its corresponding SR Policy CP from the SRPM.

routing, bgp

protocol-element §2.2

SR Policy Candidate Path content is encoded in the BGP Tunnel Encapsulation Attribute (RFC 9012) using Tunnel Type 15 ('SR Policy'). The attribute carries sub-TLVs for Binding SID, Preference, Priority, Names, ENLP, and one or more Segment Lists, each containing Weight and Segment sub-TLVs.

routing, bgp, mpls

protocol-element §3

The Color Extended Community Flags field is extended with a 2-bit Color-Only Type (bits 0–1): Type 0 requires specific Endpoint match, Type 1 allows specific or null Endpoint, Type 2 allows specific, null, or any Endpoint, and Type 3 is reserved and MUST be treated as Type 0.

routing, bgp

registry §6.1

IANA registered SR Policy SAFI with code point 73 in the 'SAFI Values' registry of the 'Subsequent Address Family Identifiers (SAFI) Parameters' registry group.

registry, routing, bgp

registry §6.2

IANA registered SR Policy Tunnel Type with code point 15 in the 'BGP Tunnel Encapsulation Attribute Tunnel Types' registry, and registered eight sub-TLV code points (12–15, 20, 128–130) in the 'BGP Tunnel Encapsulation Attribute Sub-TLVs' registry.

registry, routing, bgp

registry §6.5

This document creates six new registries: 'SR Policy Segment List Sub-TLVs' (IETF Review), 'SR Policy Binding SID Flags' (Standards Action), 'SR Policy SRv6 Binding SID Flags' (Standards Action), 'SR Policy Segment Flags' (IETF Review), 'Color Extended Community Color-Only Types' (Standards Action), and 'SR Policy ENLP Values' (Standards Action) in the Segment Routing registry group.

registry, routing, bgp

security-consideration §7

Exporting SR Policy information constitutes a confidentiality risk by revealing endpoint/node addresses, SR SIDs, and deployed SR Policies. Operators are responsible for ensuring only trusted nodes (routers and controller applications) within the SR domain are configured to receive SR Policy BGP updates.

routing, bgp, security

security-consideration §7

SR Policy information advertised via BGP MUST be confined to the trusted SR domain (a single AS or multiple ASes within a single provider network). BGP peering sessions for SR Policy SAFI should be isolated from EBGP sessions outside the SR domain to prevent accidental or erroneous advertisement.

routing, bgp, security

wire-format §2.4.4.2.1

Segment Type A sub-TLV (Type 1) encodes a single SR-MPLS SID as a 4-octet MPLS label stack entry: 20-bit Label, 3-bit TC, 1-bit S (MUST be zero), 8-bit TTL. TC=0 signals receiver should choose TC; TTL=255 signals receiver should choose TTL. Length MUST be 6.

routing, bgp, mpls

wire-format §2.4.4.2.2

Segment Type B sub-TLV (Type 13) encodes a single SRv6 SID as a 16-octet IPv6 address plus optional 8-octet SRv6 Endpoint Behavior and SID Structure. Length MUST be 26 when Endpoint Behavior is present, else 18. Earlier code point 2 for Type B has been deprecated.

routing, bgp

wire-format §2.4.2

The Binding SID sub-TLV (Type 13) carries BSID information: 1-octet Flags (S-Flag for Specified-BSID-Only, I-Flag for Drop-Upon-Invalid), 1-octet Reserved, and a variable Binding SID field (absent when length=2, 4-octet MPLS label when length=6, 16-octet SRv6 SID when length=18).

routing, bgp, mpls

wire-format §2.4.5

The ENLP sub-TLV (Type 14) indicates Explicit NULL Label Policy for unlabeled IP packets steered into SR Policy: 1-octet Flags, 1-octet Reserved, and 1-octet ENLP value (1=push IPv4 NULL, 2=push IPv6 NULL, 3=push both, 4=push neither). Length MUST be 3.

routing, bgp, mpls

wire-format §2.4.1

The Preference sub-TLV (Type 12) carries the SR Policy CP preference: 1-octet Flags (all reserved), 1-octet Reserved, and a 4-octet unsigned Preference value. Length MUST be 6.

routing, bgp

wire-format §2.4.4

The Segment List sub-TLV (Type 128) uses a 2-octet Length field (code point ≥128 per RFC 9012 convention) followed by 1-octet Reserved and sub-TLVs for an optional Weight and zero or more Segments. Multiple Segment List sub-TLVs may appear per SR Policy encoding.

routing, bgp, mpls

wire-format §2.4.7

The SR Policy Candidate Path Name sub-TLV (Type 129) and SR Policy Name sub-TLV (Type 130) each use a 2-octet Length field and carry a variable-length symbolic name without a NULL terminator. Names are RECOMMENDED to be limited to 255 bytes.

routing, bgp

wire-format §2.1

The SR Policy SAFI NLRI encodes a Candidate Path identifier as: 1-octet NLRI Length (96 bits for IPv4, 192 bits for IPv6), 4-octet Distinguisher, 4-octet Color, and 4- or 16-octet Endpoint address. The NLRI is carried with AFI 1 or 2 and SAFI 73.

routing, bgp

wire-format §2.4.3

The SRv6 Binding SID sub-TLV (Type 20) carries a 16-octet SRv6 SID plus optional 8-octet SRv6 Endpoint Behavior and SID Structure. Flags include S-Flag, I-Flag, and B-Flag (indicates presence of Endpoint Behavior encoding). Length MUST be 26 when Endpoint Behavior is present, else 18.

routing, bgp

wire-format §2.4.4.2.4

The SRv6 Endpoint Behavior and SID Structure field (8 octets) encodes: 2-octet Endpoint Behavior code point (0xFFFF = Opaque), 2-octet Reserved, and four 1-octet length fields for Locator Block, Locator Node, Function, and Argument in bits. The sum of all four lengths MUST be ≤128.

routing, bgp

wire-format §2.4.4.1

The Weight sub-TLV (Type 9) encodes a 4-octet unsigned integer weight for a segment list. Length MUST be 6; a weight value of zero is invalid.

routing, bgp