<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
     please see http://xml.resource.org/authoring/README.html. -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="3"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-dong-pcep-flowspec-srv6-00"
     ipr="trust200902">
  <front>
    <title abbrev="PCEP Flow Specification for SRv6 ">PCEP Extension for SRv6
    Flow Specification</title>

    <author fullname="Jie Dong" initials="J." surname="Dong">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>156 Beiqing Road</street>

          <city>Beijing, 100095</city>

          <country>P.R. China</country>
        </postal>

        <email>jie.dong@huawei.com</email>
      </address>
    </author>

    <author fullname="Christoph Loibl" initials="C" surname="Loibl">
      <organization>Next Layer Communications</organization>

      <address>
        <postal>
          <street>Mariahilfer Guertel 37/7</street>

          <city>Vienna</city>

          <region/>

          <code>1150</code>

          <country>AT</country>
        </postal>

        <email>cl@tix.at</email>
      </address>
    </author>

    <author fullname="Gyan S. Mishra" initials="G" surname="Mishra">
      <organization>Verizon Inc.</organization>

      <address>
        <postal>
          <street>13101 Columbia Pike</street>

          <city>Silver Spring</city>

          <code>MD 20904</code>

          <country>USA</country>
        </postal>

        <phone>301 502-1347</phone>

        <email>gyan.s.mishra@verizon.com</email>
      </address>
    </author>

    <author fullname="Yongqing Zhu" initials="Y. " surname="Zhu">
      <organization>China Telecom</organization>

      <address>
        <postal>
          <street>109, West Zhongshan Road, Tianhe District</street>

          <city>Guangzhou</city>

          <code>510000</code>

          <country>China</country>
        </postal>

        <email>zhuyq8@chinatelecom.cn</email>
      </address>
    </author>

    <author fullname="Shunwan Zhuang" initials="S." surname="Zhuang">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>156 Beiqing Road</street>

          <city>Beijing</city>

          <code>100095</code>

          <country>P.R. China</country>
        </postal>

        <email>zhuangshunwan@huawei.com</email>
      </address>
    </author>

    <date day="28" month="October" year="2026"/>

    <workgroup>PCEP Working Group</workgroup>

    <!---->

    <abstract>
      <t>This document specifies extensions to the Path Computation Element
      Communication Protocol (PCEP) to support Flow Specification for Segment
      Routing over IPv6 (SRv6). Building upon the PCEP Flow Specification
      framework defined in RFC 9168, this specification introduces new PCEP
      Flow Specification TLVs to enable filtering and steering of IPv6 packets
      based on the structural components of standard SRv6 Segment Identifiers
      (SIDs) or SRv6 Compressed SID (CSID) containers present in IPv6
      Destination Addresses or Segment Routing Headers (SRH).</t>

      <t/>
    </abstract>

    <note title="Requirements Language">
      <t>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
      <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when,
      they appear in all capitals, as shown here.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t><xref target="RFC9168"/> defines extensions to the Path Computation
      Element Communication Protocol (PCEP) <xref target="RFC5440"/> to
      support the dissemination of Flow Specification rules using PCEP
      messages. A PCEP FLOWSPEC object carries match conditions and filtering
      actions managed by a Path Computation Element (PCE) and enforced by a
      Path Computation Client (PCC).</t>

      <t/>

      <t>Segment Routing over IPv6 (SRv6) <xref target="RFC8754"/> leverages
      the IPv6 data plane using a Segment Routing Header (SRH) to instantiate
      paths. The SRv6 Network Programming architecture <xref
      target="RFC8986"/> defines standard SID structures (LOC:FUNCT:ARG).
      Furthermore, <xref target="RFC9800"/> defines Compressed SRv6 SIDs
      (CSIDs), supporting NEXT-CSID and REPLACE-CSID flavors where multiple
      CSIDs are packed into a 128-bit IPv6 Destination Address (DA)
      container.</t>

      <t>While <xref target="RFC9168"/> supports basic IP and IPv6 Flow
      Specification matching, it lacks mechanisms to parse and filter traffic
      based on the internal structure of SRv6 SIDs or dynamic CSID
      containers.</t>

      <t>This document extends <xref target="RFC9168"/> by defining two new
      PCEP Flow Specification TLV types to be carried within the PCEP FLOWSPEC
      object:</t>

      <t><list style="numbers">
          <t>SRv6 Standard SID Structure Match TLV <xref
          target="RFC8986"/>.</t>

          <t>SRv6 CSID Dynamic Structure Match TLV <xref
          target="RFC9800"/>.</t>
        </list>The matching field is evaluated against the IPv6 Destination
      Address (or active SID within an SRH when present, as shown in <xref
      target="matchSID"/>).</t>

      <t><figure anchor="matchSID" title="Match Field">
          <artwork><![CDATA[
            +-----------------------------+
 IPv6 Header|     SA      |     DA        |<-- Match Field
            +--------------------^--------+
                                 |
            +--------------------|--------+
            |             +-------------+ |     +-------------------+
            |             | Segment[0]  +-------> Loc | Func | Arg  |
            |             +-------------+ |     +-------------------+
            |             | Segment[1]  | |
            |             +-------------+ |
            |             |    ...      | |
   SR Header|             +-------------+ |
  (RFC 8754)|             | Segment[n]  | |
            |             +-------------+ |
            |             +-------------+ |
            |             ~  Option TLV ~ |
            |             +-------------+ |
            +-----------------------------+]]></artwork>
        </figure></t>
    </section>

    <section title="Definitions and Acronyms">
      <t>This document uses terminology defined in <xref target="RFC5440"/>,
      <xref target="RFC9168"/>, <xref target="RFC8754"/>, <xref
      target="RFC8986"/>, and <xref target="RFC9800"/>.<list style="symbols">
          <t>CSID: Compressed Segment Identifier <xref target="RFC9800"/></t>

          <t>FS: Flow Specification</t>

          <t>NEXT-CSID: NEXT-CSID Flavor defined in <xref
          target="RFC9800"/></t>

          <t>PCEP FS: PCEP Flow Specification</t>

          <t>REPLACE-CSID: REPLACE-CSID Flavor defined in <xref
          target="RFC9800"/></t>

          <t>SID: Segment Identifier</t>

          <t>SR: Segment Routing</t>

          <t>SRH: SR Header</t>

          <t>SRv6: IPv6 Segment Routing, SRv6 is a method of forwarding IPv6
          packets on the network based on the concept of source routing.</t>
        </list>In this document, the length parameters defining the
      constituent parts of a SID or CSID structure are defined as follows:</t>

      <t><list style="symbols">
          <t>LOC-Len: Locator Length in bits for a standard 128-bit SRv6 SID
          (Component Type TBD1).</t>

          <t>LB-Len: Locator-Block Length in bits for a CSID structure
          (Component Type TBD2).</t>

          <t>LN-Len: Locator-Node Length in bits for a CSID structure.</t>

          <t>F-Len: Function Length in bits for a SID or CSID structure.</t>

          <t>ARG-Len: Argument Length in bits for a standard 128-bit SRv6
          SID.</t>
        </list>In addition, the sum of LN-Len and F-Len (LN-Len + F-Len)
      represents the total length of a single CSID (also referred to as the
      "CSID length").</t>
    </section>

    <section title="PCEP Capability Advertisement">
      <t>A PCEP speaker (PCE or PCC) indicates its support for SRv6 Flow
      Specification extensions during the PCEP session establishment
      phase.</t>

      <t><xref target="RFC9168"/> defines the FLOWSPEC-CAPABILITY TLV carried
      in the OPEN object. This document defines a new flag bit in the Flags
      field of the FLOWSPEC-CAPABILITY TLV:</t>

      <t><list style="symbols">
          <t>Bit TBD (S-bit - SRv6 FlowSpec Support): Set to 1 by a PCEP
          speaker to indicate capability to process SRv6 Standard SID
          Structure and CSID Dynamic Structure Match TLVs.</t>
        </list>If both PCEP peers advertise the S-bit capability, SRv6
      FlowSpec TLVs MAY be included in PCEP messages (e.g., PCUpd, PCInitiate,
      or PCRpt).</t>
    </section>

    <section title="PCEP Flow Specification Extensions for SRv6">
      <t>Flow Specification match conditions in PCEP are carried within the
      FLOWSPEC object <xref target="RFC9168"/>. This document defines two new
      TLVs for inclusion in the FLOWSPEC object.</t>

      <!---->

      <section title="SRv6 Standard SID Structure Match TLV (Type TBD1)">
        <t>The SRv6 Standard SID Structure Match TLV allows a PCE to instruct
        a PCC to match packets against individual or combined fields (Locator,
        Function, and Argument) of a standard SRv6 SID <xref
        target="RFC8986"/>.</t>

        <t>The format of the SRv6 Standard SID Structure Match TLV is as
        follows:</t>

        <t><figure>
            <artwork align="left"><![CDATA[
 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 (TBD1)       |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   LOC-Len     |   FUNCT-Len   |    ARG-Len    |   Reserved    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       [op, value] +                           |
|                             ...                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Padding (0-3 octets)                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
          </figure>Where:</t>

        <t><list style="symbols">
            <t>Type (16 bits): TBD1, assigned for SRv6 Standard SID Structure
            Match TLV.</t>

            <t>Length (16 bits): Total length of the TLV in octets.</t>

            <t>LOC-Len (8 bits): Length of the Locator field in bits.</t>

            <t>FUNCT-Len (8 bits): Length of the Function field in bits.</t>

            <t>ARG-Len (8 bits): Length of the Argument field in bits.</t>

            <t>Reserved (8 bits): MUST be set to zero and ignored on
            receipt.</t>

            <t>[op, value]+: A sequence of one or more {operator, value} pairs
            specifying the matching logic applied to the SID sub-fields,
            following the operator encoding rules in <xref target="RFC9168"/>
            and <xref target="I-D.ietf-idr-flowspec-srv6"/>.</t>

            <t>Padding (variable): Padding octets (0-3) to align the TLV
            length to a 4-octet boundary.</t>
          </list></t>
      </section>

      <section title="SRv6 CSID Dynamic Structure Match TLV (Type TBD2)">
        <t>The SRv6 CSID Dynamic Structure Match TLV allows matching against
        dynamic Compressed SID containers (NEXT-CSID and REPLACE-CSID flavors)
        <xref target="RFC9800"/>.</t>

        <t>The format of the SRv6 CSID Dynamic Structure Match TLV is as
        follows:</t>

        <t><figure>
            <artwork align="left"><![CDATA[
 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 (TBD2)       |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    LB-Len     |    LN-Len     |     F-Len     |   Reserved    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       [op, value] +                           |
|                             ...                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Padding (0-3 octets)                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
          </figure>Where:</t>

        <t><list style="symbols">
            <t>Type (16 bits): TBD2, assigned for SRv6 CSID Dynamic Structure
            Match TLV.</t>

            <t>Length (16 bits): Total length of the TLV in octets.</t>

            <t>LB-Len (8 bits): Locator-Block Length in bits.</t>

            <t>LN-Len (8 bits): Locator-Node Length in bits.</t>

            <t>F-Len (8 bits): Function Length in bits.</t>

            <t>Reserved (8 bits): MUST be set to zero and ignored on
            receipt.</t>

            <t>[op, value]+: A sequence of {operator, value} pairs evaluating
            Locator-Block, Active CSID, and Next CSID fields as defined in
            <xref target="I-D.ietf-idr-flowspec-srv6"/>.</t>

            <t>Padding (variable): Padding octets (0-3) to align the TLV
            length to a 4-octet boundary.</t>
          </list></t>

        <t/>
      </section>
    </section>

    <section title="PCEP Operational Procedures">
      <t/>

      <section title="Validation and Length Rules">
        <t>Upon receiving an SRv6 FlowSpec TLV, the PCC MUST validate the
        structural lengths:</t>

        <t><list style="numbers">
            <t>For Standard SID Structure (Type TBD1): The sum of LOC-Len,
            FUNCT-Len, and ARG-Len MUST NOT exceed 128 bits.</t>

            <t>For CSID Dynamic Structure (Type TBD2): The sum of LB-Len,
            LN-Len, and F-Len MUST NOT exceed 128 bits.</t>
          </list>If a structural validation fails, the TLV MUST be considered
        malformed.</t>
      </section>

      <section title="Error Handling">
        <t>If a PCC receives an SRv6 FlowSpec TLV when the S-bit capability
        was not negotiated, or if the received TLV is malformed, the PCC MUST
        send a PCErr message with:<list style="symbols">
            <t>Error-Type = 30 (FlowSpec Error) [RFC9168]</t>

            <t>Error-Value = TBD_EV (Unsupported or Malformed SRv6 FlowSpec
            Component)</t>
          </list></t>

        <t/>
      </section>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>The security considerations outlined in <xref target="RFC5440"/>,
      <xref target="RFC9168"/>, and <xref target="RFC8231"/> apply to the
      extensions defined in this document. Appropriate transport security
      (e.g., TLS or TCP-AO) MUST be employed to prevent unauthorized insertion
      or modification of SRv6 FlowSpec rules.</t>
    </section>

    <section title="IANA Considerations">
      <t>IANA is requested to make the following allocations in the "PCEP
      Numbers" registry:</t>

      <t><figure>
          <artwork align="left"><![CDATA[
   1. **FLOWSPEC-CAPABILITY TLV Flag Field**:
      * Bit TBD: S-bit (SRv6 FlowSpec Support)

   2. **PCEP Flow Specification TLV Types**:
      * TBD1: SRv6 Standard SID Structure Match TLV
      * TBD2: SRv6 CSID Dynamic Structure Match TLV
]]></artwork>
        </figure></t>
    </section>

    <!--
-->

    <section anchor="Acknowledgments" title="Acknowledgments">
      <t>The authors would like to thank Joel Halpern, Jeffrey Haas, Ketan
      Talaulikar, Aijun Wang, Dhruv Dhody, Ming Shen and Rainsword Wang for
      their valuable suggestions and comments.</t>
    </section>

    <section title="Contributors ">
      <t><figure>
          <artwork align="left"><![CDATA[
   Lei Li
   Huawei
   Email: lily.lilei@huawei.com

   Zhenbin Li
   Huawei
   Email: robinli314@163.com

   Huaimo Chen
   Futurewei
   Email: hchen.ietf@gmail.com

   Yanhe Fan
   Casa Systems
   Email: yfan@casa-systems.com
   
   Lei Liu
   Fujitsu
   Email: liulei.kddi@gmail.com

   Xufeng Liu
   Volta Networks
   Email: xufeng.liu.ietf@gmail.com

]]></artwork>
        </figure></t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include='reference.RFC.2119'?>

      <?rfc include='reference.RFC.5440'?>

      <?rfc include='reference.RFC.8174'?>

      <?rfc include='reference.RFC.8986'?>

      <?rfc include='reference.RFC.9168'?>

      <?rfc include='reference.RFC.9800'?>

      <?rfc include='reference.I-D.ietf-idr-flowspec-srv6'?>
    </references>

    <references title="Informative References">
      <?rfc include='reference.RFC.8231'?>

      <?rfc include='reference.RFC.8754'?>
    </references>
  </back>
</rfc>
