BGP Extensions of SR Policy for Composite Candidate Path
Hao Li
New H3C Technologies
lihao@h3c.com
Mengxiao Chen
New H3C Technologies
chen.mengxiao@h3c.com
Changwang Lin
New H3C Technologies
linchangwang.04414@h3c.com
Wenying Jiang
China Mobile
jiangwenying@chinamobile.com
Weiqiang Cheng
China Mobile
chengweiqiang@chinamobile.com
30 August 2022
General
Network Working Group
Segment Routing
SR Policy
BGP
Segment Routing is a source routing paradigm that explicitly indicates the forwarding path for packets at the ingress node. An SR Policy is associated with one or more candidate paths. A candidate path is either dynamic, explicit or composite. This document defines extensions to BGP to distribute SR policies carrying composite candidate path information. So that composite candidate paths can be installed when the SR policy is applied.

Introduction
Segment routing (SR) [RFC8402] is a source routing paradigm that explicitly indicates the forwarding path for packets at the ingress node. The ingress node steers packets into a specific path according to the Segment Routing Policy (SR Policy) as defined in [RFC9256]. In order to distribute SR policies to the headend, [I-D.ietf-idr-segment-routing-te-policy] specifies a mechanism by using BGP.
An SR Policy is associated with one or more candidate paths. A composite candidate path acts as a container for grouping of SR Policies. As described in section 2.2 in [RFC9256], the composite candidate path construct enables combination of SR Policies, each with explicit candidate paths and/or dynamic candidate paths with potentially different optimization objectives and constraints, for a load-balanced steering of packet flows over its constituent SR Policies.
[I-D.draft-jiang-spring-parent-sr-policy-use-cases] describes some use cases for SR policy group composite candidate path.
This document defines extensions to Border Gateway Protocol (BGP) to distribute SR policies carrying composite candidate path information. So that composite candidate paths can be installed when the SR policy is applied.

Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

Constituent SR Policy Attributes in SR Policy
As defined in [I-D.ietf-idr-segment-routing-te-policy], the SR policy encoding structure is as follows:

SR Policy SAFI NLRI: <Distinguisher, Policy-Color, Endpoint>
    Attributes:
        Tunnel Encaps Attribute (23)
            Tunnel Type: SR Policy
                Binding SID
                SRv6 Binding SID
                Preference
                Priority
                Policy Name
                Policy Candidate Path Name
                Explicit NULL Label Policy (ENLP)
                Segment List
                    Weight
                    Segment
                    Segment
                    ...
                ...

As described in section 2.2 in [RFC9256], the endpoints of the constituent SR Policies and the parent SR Policy MUST be identical, and the colors of each of the constituent SR Policies and the parent SR Policy MUST be different. Therefore a constituent SR Policy is referenced only by color in the composite candidate path since its headend and endpoint are identical to the parent SR policy.
SR policy with composite candidate path information is expressed as below:

SR Policy SAFI NLRI: <Distinguisher, Policy-Color, Endpoint>
    Attributes:
        Tunnel Encaps Attribute (23)
            Tunnel Type: SR Policy
                Binding SID
                SRv6 Binding SID
                Preference
                Priority
                Policy Name
                Policy Candidate Path Name
                Explicit NULL Label Policy (ENLP)
                Segment List
                    Weight
                    Segment
                    Segment
                    ...
                Constituent SR Policy
                    Weight
                ...

Constituent SR Policy Sub-TLV
The Constituent SR Policy sub-TLV encodes a single composite path towards the endpoint. The Constituent SR Policy sub-TLV is an optional sub-TLV of BGP Tunnel Encapsulation Attribute, and MAY appear multiple times in the SR Policy encoding. The ordering of Constituent SR Policy sub-TLVs does not matter. The Constituent SR Policy sub-TLV MAY contain a Weight sub-TLV.
Since a candidate path is either dynamic, explicit or composite, the Constituent SR Policy sub-TLV and the Segment List sub-TLV SHOULD NOT appear in the same candidate path.
The Constituent SR Policy sub-TLV has the following format:

0                   1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      Type     |    Length     |           RESERVED            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             Color                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            sub-TLVs                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

where:
- Type: to be assigned by IANA.
- Length: the total length of the value field not including Type and Length fields.
- RESERVED: 2 octet of reserved bits. SHOULD be set to zero on transmission and MUST be ignored on receipt.
- Color: 4-octet value identifying the constituent SR policy.
- sub-TLVs currently defined:
  - An optional single Weight sub-TLV which is defined in section 2.4.4.1 in [I-D.ietf-idr-segment-routing-te-policy]. According to [RFC9256], the fraction of flows steered into each constituent SR Policy is equal to the relative weight of each constituent SR Policy.

Operations
The document does not bring new operation beyond the description of operations defined in [I-D.ietf-idr-segment-routing-te-policy]. The existing operations defined in [I-D.ietf-idr-segment-routing-te-policy] can apply to this document directly.
Typically but not limit to, the SR policies carrying composite candidate path information are configured by a controller.
After configuration, the SR policies carrying path composite candidate path information will be advertised by BGP update messages. The operation of advertisement is the same as defined in [I-D.ietf-idr-segment-routing-te-policy], as well as the receiption.

Security Considerations
Procedures and protocol extensions defined in this document do not affect the security considerations discussed in [I-D.ietf-idr-segment-routing-te-policy].

IANA Considerations
This document defines a new Sub-TLV in registries "SR Policy List Sub-TLVs" [I-D.ietf-idr-segment-routing-te-policy]:
Value | Description | Reference
TBA | Constituent SR Policy Sub-TLV | This document

Normative References
[I-D.ietf-idr-segment-routing-te-policy]

Advertising Segment Routing Policies in BGP
Stefano Previdi
Clarence Filsfils
Ketan Talaulikar
Paul Mattes
Eric Rosen
Dhanendra Jain
Steven Lin
27 July 2022
Internet-Draft draft-ietf-idr-segment-routing-te-policy-20
[RFC2119]

Key words for use in RFCs to Indicate Requirement Levels
S. Bradner
March 1997
BCP 14
RFC 2119
DOI 10.17487/RFC2119
[RFC8174]

Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words
B. Leiba
May 2017
BCP 14
RFC 8174
DOI 10.17487/RFC8174
[RFC8402]

Segment Routing Architecture
C. Filsfils, Ed.
S. Previdi, Ed.
L. Ginsberg
B. Decraene
S. Litkowski
R. Shakir
July 2018
RFC 8402
DOI 10.17487/RFC8402

Informative References
[RFC9256]

Segment Routing Policy Architecture
Clarence Filsfils
Ketan Talaulikar
Daniel Voyer
Alex Bogdanov
Paul Mattes
July 2022
RFC 9256
DOI 10.17487/RFC9256
[I-D.draft-jiang-spring-parent-sr-policy-use-cases]

Use Cases for Parent SR Policy
Wenying Jiang
Weiqiang Cheng
Changwang Lin
Yuanxiang Qiu
9 July 2022
Internet-Draft draft-jiang-spring-parent-sr-policy-use-cases-00