<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-ietf-pce-segment-routing-13" ipr="trust200902">
  <front>
    <title abbrev="PCEP Extensions for Segment Routing">
    PCEP Extensions for Segment Routing</title>

    <author fullname="Siva Sivabalan" initials="S." surname="Sivabalan">
      <organization>Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <street>2000 Innovation Drive</street>
          <city>Kanata</city>
          <region>Ontario</region>
          <code>K2K 3E8</code>
          <country>Canada</country>
        </postal>
        <email>msiva@cisco.com</email>
      </address>
    </author>


    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils">
      <organization>Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <street>Pegasus Parc</street>
          <city>De kleetlaan 6a</city>
          <region>DIEGEM</region>
          <code>BRABANT 1831</code>
          <country>BELGIUM</country>
        </postal>
        <email>cfilsfil@cisco.com</email>
      </address>
    </author>



    <author fullname="Jeff Tantsura" initials="J." surname="Tantsura">
      <organization>Individual</organization>
      <address>
        <postal>
          <street>444 San Antonio Rd, 10A</street>
          <city>Palo Alto</city>
          <region>CA</region>
          <code>94306</code>
          <country>USA</country>
        </postal>
        <email>jefftant.ietf@gmail.com</email>
      </address>
    </author>

    <author fullname="Wim Henderickx" initials="W." surname="Henderickx">
      <organization>Nokia</organization>
      <address>
        <postal>
          <street>Copernicuslaan 50 </street>
          <city>Antwerp 2018</city>
          <region>CA</region>
          <code>95134</code>
          <country>BELGIUM</country>
        </postal>
        <email>wim.henderickx@alcatel-lucent.com</email>
      </address>
    </author>

    <author fullname="Jon Hardwick" initials="J." surname="Hardwick">
   <organization>Metaswitch Networks</organization>
      <address>
        <postal>
          <street>100 Church Street</street>
          <city>Enfield</city>
          <region>Middlesex</region>
          <country>UK</country>
        </postal>
        <email>jonathan.hardwick@metaswitch.com</email>
      </address>
    </author>

    <date day="12" month="October" year="2018" />

    <workgroup>PCE</workgroup>

<abstract>

<t>Segment Routing (SR) enables any head-end node to select any path without relying on a hop-by-hop signaling technique (e.g., LDP or RSVP-TE). It depends only on "segments" that are advertised by Link-State Interior Gateway Protocols (IGPs). A Segment Routed Path can be derived from a variety of mechanisms, including an IGP Shortest Path Tree (SPT), explicit configuration, or a Path Computation Element (PCE). This document specifies extensions to the Path Computation Element Communication Protocol (PCEP) that allow a stateful PCE to compute and initiate Traffic Engineering (TE) paths, as well as a PCC to request a path subject to certain constraints and optimization criteria in SR networks.
</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>Segment Routing (SR) technology leverages the source routing and tunneling paradigms. A source node can choose a path without relying on hop-by-hop signaling protocols such as LDP or RSVP-TE. Each path is specified as a set of "segments" advertised by link-state routing protocols (IS-IS or OSPF). <xref target="RFC8402"/> provides an introduction to the SR architecture. The corresponding IS-IS and OSPF extensions are specified in <xref target="I-D.ietf-isis-segment-routing-extensions"/> and <xref target="I-D.ietf-ospf-segment-routing-extensions"/>, respectively. The SR architecture defines a "segment" as a piece of information advertised by a link-state routing protocols, e.g., an IGP prefix or an IGP adjacency. Several types of segments are defined. A Node segment represents an ECMP-aware shortest-path computed by IGP to a specific node, and is always identified uniquely within the SR/IGP domain. An Adjacency Segment represents a unidirectional adjacency. An Adjacency Segment is local to the node which advertises it. Both Node segments and Adjacency segments can be used for SR Traffic Engineering (SR-TE).</t>

<t>The SR architecture can be implemented using either an MPLS forwarding plane <xref target="I-D.ietf-spring-segment-routing-mpls"/> or an IPv6 forwarding plane <xref target="I-D.ietf-6man-segment-routing-header"/>.  The MPLS forwarding plane can be applied to SR without any change, in which case an SR path corresponds to an MPLS Label Switching Path (LSP). This document is relevant to the MPLS forwarding plane only. In this document, "Node-SID" and "Adjacency-SID" denote Node Segment Identifier and Adjacency Segment Identifier respectively.</t>

<t>A Segment Routed path (SR path) can be derived from an IGP Shortest Path Tree (SPT). SR-TE paths may not follow an IGP SPT. Such paths may be chosen by a suitable network planning tool and provisioned on the ingress node of the SR-TE path.</t>

<t> <xref target="RFC5440"/> describes the Path Computation Element Communication Protocol (PCEP) for communication between a Path Computation Client (PCC) and a Path Computation Element (PCE) or between a pair of PCEs. A PCE computes paths for MPLS Traffic Engineering LSPs (MPLS-TE LSPs) based on various constraints and optimization criteria. <xref target="RFC8231"/> specifies extensions to PCEP that allow a stateful PCE to compute and recommend network paths in compliance with <xref target="RFC4657"/> and defines objects and TLVs for MPLS-TE LSPs. Stateful PCEP extensions provide synchronization of LSP state between a PCC and a PCE or between a pair of PCEs, delegation of LSP control, reporting of LSP state from a PCC to a PCE, controlling the setup and path routing of an LSP from a PCE to a PCC. Stateful PCEP extensions are intended for an operational model in which LSPs are configured on the PCC, and control over them is delegated to the PCE.</t>

<t>A mechanism to dynamically initiate LSPs on a PCC based on the requests from a stateful PCE or a controller using stateful PCE is specified in <xref target="RFC8281"/>. This mechanism is useful in Software Defined Networking (SDN) applications, such as on-demand engineering, or bandwidth calendaring.</t>

<t>It is possible to use a stateful PCE for computing one or more SR-TE paths taking into account various constraints and objective functions. Once a path is chosen, the stateful PCE can initiate an SR-TE path on a PCC using PCEP extensions specified in <xref target="RFC8281"/> using the SR specific PCEP extensions specified in this document. Additionally, using procedures described in this document, a PCC can request an SR path from either a stateful or a stateless PCE.</t>

<t>This specification relies on the procedures specified in <xref target="RFC8408"/> to exchange the segment routing capability and to specify that the path setup type of an LSP is segment routing.</t>

<t>This specification provides a mechanism for a network controller (acting as a PCE) to instantiate candidate paths for an SR Policy onto a head-end node (acting as a PCC) using PCEP.  For more information on the SR Policy Architecture, see <xref target="I-D.ietf-spring-segment-routing-policy"/>.</t>

</section> <!-- Introduction -->

<section title="Terminology">

<t>The following terminologies are used in this document:

	<list style="hanging">
	    <t hangText="ERO:"> Explicit Route Object</t>
     	<t hangText="IGP:"> Interior Gateway Protocol</t>
     	<t hangText="IS-IS:"> Intermediate System to Intermediate System</t>
    	<t hangText="LSR:"> Label Switching Router</t>
    	<t hangText="MSD:"> Maximum SID Depth</t>
     	<t hangText="NAI:"> Node or Adjacency Identifier</t>
    	<t hangText="OSPF:"> Open Shortest Path First</t>
    	<t hangText="PCC:"> Path Computation Client</t>
    	<t hangText="PCE:"> Path Computation Element</t>
     	<t hangText="PCEP:"> Path Computation Element Communication Protocol</t>
    	<t hangText="RRO:"> Record Route Object</t>
    	<t hangText="SID:"> Segment Identifier</t>
    	<t hangText="SR:"> Segment Routing</t>
      <t hangText="SR-DB:"> Segment Routing Database (as defined in <xref target="I-D.ietf-spring-segment-routing-policy"/>)</t>
    	<t hangText="SR-TE:"> Segment Routing Traffic Engineering</t>
  </list>

</t>

</section> <!-- Terminology -->

<section anchor="Operation-Overview" title="Overview of PCEP Operation in SR Networks">

<t>In an SR network, the ingress node of an SR path prepends an SR header to all outgoing packets.  The SR header consists of a list of SIDs (or MPLS labels in the context of this document).    The header has all
   necessary information so that, in combination with the information
   distributed by the IGP, the packets can be guided from the ingress
   node to the egress node of the path; hence, there is no need for
   any signaling protocol.
</t>

<t>
   In PCEP messages, LSP route information is carried in the Explicit
   Route Object (ERO), which consists of a sequence of subobjects.
   In SR networks, an ingress node of an SR path
   prepends an SR header to all outgoing packets.  The SR header
   consists of a list of SIDs (or MPLS labels in the context of this
   document).  SR-TE paths computed by a PCE can be represented in an ERO in one
   of the following forms:

<list style="symbols">

<t>An ordered set of IP addresses representing network nodes/links.</t>

<t>An ordered set of SIDs, with or without the corresponding IP addresses.</t>

<t>An ordered set of MPLS labels, with or without corresponding IP address.</t>

</list>

The PCC converts these into an MPLS label stack and next hop, as described in <xref target="SR-ERO-INTERPRET"/>.

</t>

<t>This document defines a new ERO subobject denoted by "SR-ERO subobject" capable of carrying a SID as well as the identity of the node/adjacency represented by the SID. SR-capable PCEP speakers should be able to generate and/or process such ERO subobject. An ERO containing SR-ERO subobjects can be included in the PCEP Path Computation Reply (PCRep) message defined in <xref target="RFC5440"/>, the PCEP LSP Initiate Request message (PCInitiate) defined in <xref target="RFC8281"/>, as well as in the PCEP LSP Update Request (PCUpd) and PCEP LSP State Report (PCRpt) messages defined in <xref target="RFC8231"/>.</t>

<t>When a PCEP session between a PCC and a PCE is established, both PCEP speakers exchange their capabilities to indicate their ability to support SR-specific functionality.</t>

<t>A PCE can update an LSP that is initially established via RSVP-TE signaling to use an SR-TE path, by sending a PCUpd to the PCC that delegated the LSP to it (<xref target="RFC8231"/>).  A PCC can update an undelegated LSP that is initially established via RSVP-TE signaling to use an SR-TE path as follows.  First, it requests an SR-TE Path from a PCE by sending a PCReq message.  If it receives a suitable path, it establishes the path in the data plane, and then tears down the original RSVP-TE path.  If the PCE is stateful, then the PCC sends PCRpt messages indicating that the new path is set up and the old path is torn down, per <xref target="RFC8231"/>.</t>

<t>Similarly, a PCE or PCC can update an LSP initially created with an SR-TE path to use RSVP-TE signaling, if necessary. This capability is useful for rolling back a change when a network is migrated from RSVP-TE to SR-TE technology.</t>

<t>A PCC MAY include an RRO containing the recorded LSP in PCReq and PCRpt messages as specified in <xref target="RFC5440"/> and <xref target="RFC8231"/>, respectively. This document defines a new RRO subobject for SR networks. The methods used by a PCC to record the SR-TE LSP are outside the scope of this document.</t>

      <t>In summary, this document:

      <list style="symbols">

        <t>Defines a new ERO subobject, a new RRO subobject and new PCEP error codes.</t>

        <t>Specifies how two PCEP speakers can establish a PCEP session that can carry information about SR-TE paths.</t>

	      <t>Specifies processing rules for the ERO subobject.</t>

        <t>Defines a new path setup type to be used in the PATH-SETUP-TYPE and PATH-SETUP-TYPE-CAPABILITY TLVs (<xref target="RFC8408"/>).</t>

	      <t>Defines a new sub-TLV for the PATH-SETUP-TYPE-CAPABILITY TLV.</t>

      </list>

      </t>

<t>The extensions specified in this document complement the existing PCEP specifications to support SR-TE paths. As such, the PCEP messages (e.g., Path Computation Request, Path Computation Reply, Path Computation Report, Path Computation Update, Path Computation Initiate, etc.,) MUST be formatted according to <xref target="RFC5440"/>, <xref target="RFC8231"/>, <xref target="RFC8281"/>, and any other applicable PCEP specifications.</t>

</section> <!-- Overview of PCEP Operation in SR Networks -->

<section anchor="PCEP-messages" title="SR-Specific PCEP Message Extensions">

<t>As defined in <xref target="RFC5440"/>, a PCEP message consists of a common header followed by a variable length body made up of mandatory and/or optional objects. This document does not require any changes in the format of the PCReq and PCRep messages specified in <xref target="RFC5440"/>, PCInitiate message specified in <xref target="RFC8281"/>, and PCRpt and PCUpd messages specified in <xref target="RFC8231"/>.</t>

</section> <!-- PCEP-message -->

<section anchor="object-formats" title="Object Formats">

<section anchor="open-object-fmt" title="The OPEN Object">

<section anchor="cap-negotiation" title="The SR PCE Capability sub-TLV">

<t>This document defines a new Path Setup Type (PST) for SR, as follows:
      <list style="symbols">
        <t>PST = 1: Path is setup using Segment Routing Traffic Engineering.</t>
      </list>
</t>

<t>A PCEP speaker SHOULD indicate its support of the function described in this document by sending a PATH-SETUP-TYPE-CAPABILITY TLV in the OPEN object with this new PST included in the PST list.</t>

<t>This document also defines the SR-PCE-CAPABILITY sub-TLV.  PCEP speakers use this sub-TLV to exchange information about their SR capability. If a PCEP speaker includes PST=1 in the PST List of the PATH-SETUP-TYPE-CAPABILITY TLV then it MUST also include the SR-PCE-CAPABILITY sub-TLV inside the PATH-SETUP-TYPE-CAPABILITY TLV.</t>

<t>The format of the SR-PCE-CAPABILITY sub-TLV is shown in the following figure:</t>

<figure anchor="Capability-TLV-Fmt" title="SR-PCE-CAPABILITY sub-TLV format">
            <artwork align="center"><![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=26            |            Length=4           |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |         Reserved              |   Flags   |N|L|      MSD      |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

            ]]></artwork>
          </figure>

<t>The code point for the TLV type is 26. The TLV length is 4 octets.</t>

<t>The 32-bit value is formatted as follows.
  <list style="hanging">
    <t hangText="Reserved:"> MUST be set to zero by the sender and MUST be ignored by the receiver.</t>
    <t hangText="Flags:"> This document defines the following flag bits.  The other bits
      MUST be set to zero by the sender and MUST be ignored by the receiver.
      <list style="symbols">
        <t>N: A PCC sets this bit to 1 to indicate that it is capable of resolving a Node or Adjacency Identifier (NAI) to a SID.</t>
        <t>L: A PCC sets this bit to 1 to indicate that it does not impose any limit on the MSD.</t>
      </list>
    </t>
    <t hangText="Maximum SID Depth (MSD):"> specifies the maximum number of SIDs (MPLS label stack depth in the context of this document) that a PCC is capable of imposing on a packet.  <xref target="SR-CAP-PROCESS"/> explains the relationship between this field and the L bit.</t>
  </list>
</t>

</section>

</section>

<section anchor="rp-object-fmt" title="The RP/SRP Object">

<t>To set up an SR-TE LSP using SR, the RP or SRP object MUST include the PATH-SETUP-TYPE TLV, specified in <xref target="RFC8408"/>, with the PST set to 1 (path setup using SR-TE).</t>

<t>The LSP-IDENTIFIERS TLV MAY be present for the above PST type.</t>

</section>

<section anchor="SR-ERO" title="ERO">

<t>An SR-TE path consists of one or more SIDs where each SID MAY be associated with the identifier that represents the node or adjacency corresponding to the SID. This identifier is referred to as the 'Node or Adjacency Identifier' (NAI). As described later, a NAI can be represented in various formats (e.g., IPv4 address, IPv6 address, etc). Furthermore, a NAI is used for troubleshooting purposes and, if necessary, to derive SID value as described below.</t>

<t>The ERO specified in <xref target="RFC5440"/> is used to carry SR-TE path information. In order to carry SID and/or NAI, this document defines a new ERO subobject referred to as "SR-ERO subobject" whose format is specified in the following section. An ERO carrying an SR-TE path consists of one or more ERO subobjects, and MUST carry only SR-ERO subobjects. Note that an SR-ERO subobject does not need to have both SID and NAI. However, at least one of them MUST be present.</t>

<t>When building the MPLS label stack from ERO, a PCC MUST assume that SR-ERO subobjects are organized as a last-in-first-out stack.  The first subobject relative to the beginning of ERO contains the information about the topmost label. The last subobject contains information about the bottommost label.</t>

<section anchor="SR-ERO-SUB" title="SR-ERO Subobject">

<t>An SR-ERO subobject is formatted as shown in the following diagram.</t>

          <figure anchor="SR-ERO-SUBOBJECT" title="SR-ERO subobject format">
            <artwork><![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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |L|   Type=36   |     Length    |  NT   |     Flags     |F|S|C|M|
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                         SID (optional)                        |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  //                   NAI (variable, optional)                  //
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
          </figure>

<t>The fields in the SR-ERO Subobject are as follows:

<list style="hanging">

<t hangText="The 'L' Flag:"> Indicates whether the subobject represents a loose-hop in the LSP <xref target="RFC3209"/>. If this flag is set to zero, a PCC MUST NOT overwrite the SID value present in the SR-ERO subobject. Otherwise, a PCC MAY expand or replace one or more SID values in the received SR-ERO based on its local policy.</t>

<t hangText="Type:"> Set to 36. </t>

<t hangText="Length:"> Contains the total length of the subobject in octets, including the L, Type and Length fields. The Length MUST be at least 8, and MUST be a multiple of 4. An SR-ERO subobject MUST contain at least one of a SID or an NAI. The length should include the SID and NAI fields if and only if they are not absent. The flags described below indicate whether the SID or NAI fields are absent.</t>

<t hangText="NAI Type (NT):"> Indicates the type and format of the NAI contained in the object body. This document describes the following NT values:</t>
<t><list style="hanging">
<t hangText="NT=0">The NAI is absent.</t>
<t hangText="NT=1">The NAI is an IPv4 node ID.</t>
<t hangText="NT=2">The NAI is an IPv6 node ID.</t>
<t hangText="NT=3">The NAI is an IPv4 adjacency.</t>
<t hangText="NT=4">The NAI is an IPv6 adjacency.</t>
<t hangText="NT=5">The NAI is an unnumbered adjacency with IPv4 node IDs.</t>
</list>
</t>

<t hangText="Flags:"> Used to carry additional information pertaining to the SID. This document defines the following flag bits. The other bits MUST be set to zero by the sender and MUST be ignored by the receiver.

<list style="symbols">

<t>M: If this bit is set to 1, the SID value represents an MPLS label stack entry as specified in <xref target="RFC3032"/>. Otherwise, the SID value is an administratively configured value which represents an index into an MPLS label space (either SRGB or SRLB) per <xref target="RFC8402"/>.</t>

<t>C: If the M bit and the C bit are both set to 1, then the TC, S, and TTL fields in the MPLS label stack entry are specified by the PCE. However, a PCC MAY choose to override these values according its local policy and MPLS forwarding rules. If the M bit is set to 1 but the C bit is set to zero, then the TC, S, and TTL fields MUST be ignored by the PCC. The PCC MUST set these fields according to its local policy and MPLS forwarding rules. If the M bit is set to zero then the C bit MUST be set to zero.</t>

<t>S: When this bit is set to 1, the SID value in the subobject body is absent. In this case, the PCC is responsible for choosing the SID value, e.g., by looking up in the SR-DB using the NAI which, in this case, MUST be present in the subobject. If the S bit is set to 1 then the M and C bits MUST be set to zero.</t>

<t>F: When this bit is set to 1, the NAI value in the subobject body is absent.  The F bit MUST be set to 1 if NT=0, and otherwise MUST be set to zero.  The S and F bits MUST NOT both be set to 1.</t>

</list>
</t>

<t hangText="SID:"> The Segment Identifier. Depending on the M bit, it contains either:
  <list style="symbols">
    <t>A 4 octet index defining the offset into an MPLS label space per <xref target="RFC8402"/>.</t>
    <t>A 4 octet MPLS label, where the 20 most significant bits encode the label value per <xref target="RFC3032"/>.</t>
  </list>
</t>

<t hangText="NAI:"> The NAI associated with the SID. The NAI's format depends on the value in the NT field, and is described in the following section.</t>

</list>
At least one of the SID and the NAI MUST be included in the SR-ERO subobject, and both MAY be included.
</t>
</section>

<section anchor="SR-ERO-NODAL-32" title="NAI Associated with SID">

<t>This document defines the following NAIs:

<list style="hanging">

<t hangText="'IPv4 Node ID'">is specified as an IPv4 address. In this case, the NT value is 1 and the NAI field length is 4 octets.</t>

<t hangText="'IPv6 Node ID'">is specified as an IPv6 address. In this case, the NT value is 2 and the NAI field length is 16 octets.</t>

<t hangText="'IPv4 Adjacency'">is specified as a pair of IPv4 addresses. In this case, the NT value is 3 and the NAI field length is 8 octets.  The format of the NAI is shown in the following figure:

            <figure anchor="ADJ-SID-ERO-SUBOBJECT-32" title="NAI for IPv4 adjacency">
              <artwork><![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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                      Local IPv4 address                       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     Remote IPv4 address                       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
               ]]></artwork>
            </figure>

            </t>

<t hangText="'IPv6 Adjacency'">is specified as a pair of IPv6 addresses. In this case, the NT value is 4 and the NAI field length is 32 octets. The format of the NAI is shown in the following figure:

            <figure anchor="ADJ-SID-ERO-SUBOBJECT-128" title="NAI for IPv6 adjacency">
            <artwork><![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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  //               Local IPv6 address (16 octets)                //
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  //               Remote IPv6 address (16 octets)               //
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
               ]]></artwork>
            </figure>
</t>

<t hangText="'Unnumbered Adjacency with IPv4 NodeIDs'">is specified as a pair of Node ID / Interface ID tuples. In this case, the NT value is 5 and the NAI field length is 16 octets. The format of the NAI is shown in the following figure:
            <figure anchor="ADJ-SID-ERO-UNNUM-32" title="NAI for Unnumbered adjacency with IPv4 Node IDs">
              <artwork><![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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                      Local Node-ID                            |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                    Local Interface ID                         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                      Remote Node-ID                           |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                   Remote Interface ID                         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
               ]]></artwork>
            </figure>
            </t>
          </list>
          </t>
        </section>

</section>

<section anchor="SR-RRO" title="RRO">

<t>A PCC reports an SR-TE LSP to a PCE by sending a PCRpt message, per <xref target="RFC8231"/>.  The RRO on this message represents the SID list that was applied by the PCC, that is, the actual path taken by the LSP.  The procedures of <xref target="RFC8231"/> with respect to the RRO apply equally to this specification without change.</t>

<t>An RRO contains one or more subobjects called "SR-RRO subobjects" whose format is shown below:</t>

<figure anchor="SR-RRO-SUBOBJECT" title="SR-RRO Subobject format">
            <artwork><![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=36    |     Length    |  NT   |     Flags     |F|S|C|M|
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                              SID                              |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  //                        NAI (variable)                       //
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>

</figure>

<t>The format of the SR-RRO subobject is the same as that of the SR-ERO subobject, but without the L flag.</t>

<t>A PCC MUST order the SR-RRO subobjects such that the first subobject relative to the beginning of the RRO identifies the first segment visited by the SR-TE LSP, and the last subobject identifies the final segment of the SR-TE LSP, that is, its endpoint.</t>

</section> <!-- SR-RRO -->

<section anchor="SR-METRIC" title="METRIC Object">

<t>A PCC MAY request that PCE optimizes an individual path computation request to minimize the SID depth of the computed path by using the METRIC object defined in <xref target="RFC5440"/>.  This document defines a new type for the METRIC object to be used for this purpose, as follows:

     <list style="symbols">
        <t>T = 11: Maximum SID Depth of the requested path.</t>
     </list>
</t>

<t>If the PCC includes a METRIC object of this type on a path computation request, then the PCE MUST minimize the SID depth of the computed path.  If the B (bound) bit is set to to 1 in the METRIC object, then the PCE MUST NOT return a path whose SID depth exceeds the given metric-value.  If the PCC did not set the L bit in its SR-PCE-CAPABILITY TLV, then it MUST set the B bit to 1.  If the PCC set the L bit in its SR-PCE-CAPABILITY TLV, then it MAY set the B bit to 1 or zero.</t>

<t>If a PCEP session is established with a non-zero default MSD value, then the
   PCC MUST NOT send an MSD METRIC object with an MSD greater than
   the session's default MSD.  If the PCE receives a path computation request
   with an MSD METRIC object on such a session that is greater than the session's
   default MSD, then it MUST consider the request invalid and send
   a PCErr with Error-Type = 10 ("Reception of an invalid object") and
   Error-Value 9 ("MSD exceeds the default for the PCEP session").
</t>

</section> <!-- SR-METRIC -->

</section> <!-- object-formats -->

<section anchor="procedures" title="Procedures">

<section anchor="SR-CAP-PROCESS" title="Exchanging the SR PCE Capability">

<t>A PCC indicates that it is capable of supporting the head-end functions for SR-TE LSP by including the SR-PCE-CAPABILITY sub-TLV in the Open message that it sends to a PCE. A PCE indicates that it is capable of computing SR-TE paths by including the SR-PCE-CAPABILITY sub-TLV in the Open message that it sends to a PCC.</t>

<t>If a PCEP speaker receives a PATH-SETUP-TYPE-CAPABILITY TLV with a PST list containing PST=1, and supports that path setup type, then it checks for the presence of the SR-PCE-CAPABILITY sub-TLV.  If that sub-TLV is absent, then the PCEP speaker MUST send a PCErr message with Error-Type 10 (Reception of an invalid object) and Error-Value TBD1 (to be assigned by IANA) (Missing PCE-SR-CAPABILITY sub-TLV) and MUST then close the PCEP session.  If a PCEP speaker receives a PATH-SETUP-TYPE-CAPABILITY TLV with a SR-PCE-CAPABILITY sub-TLV, but the PST list does not contain PST=1, then the PCEP speaker MUST ignore the SR-PCE-CAPABILITY sub-TLV.</t>

<t>If a PCC sets the N flag to 1, then the PCE MAY send an SR-ERO subobject containing NAI and no SID (see <xref target="SR-ERO-PROCESS"/>).  Otherwise, the PCE MUST NOT send an SR-ERO subobject containing NAI and no SID.</t>

<t>The number of SIDs that can be imposed on a packet depends on the PCC's data plane's capability. If a PCC sets the L flag to 1 then the MSD is not used and MUST be set to zero. If a PCE receives an SR-PCE-CAPABILITY sub-TLV with the L flag set to 1 then it MUST ignore the MSD field and MUST assume that the sender can impose a SID stack of any depth.  If a PCC sets the L flag to zero, then it sets the MSD field to the maximum number of SIDs that it can impose on a packet.  If a PCE receives an SR-PCE-CAPABILITY sub-TLV with the L flag and MSD both set to zero then it MUST assume that the PCC is not capable of imposing a SID stack of any depth and hence is not SR-TE capable, unless it learns a non-zero MSD for the PCC through some other means.</t>

<t>Note that the MSD value exchanged via the SR-PCE-CAPABILITY sub-TLV indicates the SID/label imposition limit for the PCC node. However, if a PCE learns the MSD value of a PCC node via different means, e.g routing protocols, as specified in: <xref target="I-D.ietf-isis-segment-routing-msd"/>;  <xref target="I-D.ietf-ospf-segment-routing-msd"/>;  <xref target="I-D.ietf-idr-bgp-ls-segment-routing-msd"/>,  then it ignores the MSD value in the SR-PCE-CAPABILITY sub-TLV. Furthermore, whenever a PCE learns the MSD for a link via different means, it MUST use that value for that link regardless of the MSD value exchanged in the SR-PCE-CAPABILITY sub-TLV.</t>

<t>Once an SR-capable PCEP session is established with a non-zero MSD value, the corresponding PCE MUST NOT send SR-TE paths with a number of SIDs exceeding that MSD value. If a PCC needs to modify the MSD value, it MUST close the PCEP session and re-establish it with the new MSD value. If a PCEP session is established with a non-zero MSD value, and the PCC receives an SR-TE path containing more SIDs than specified in the MSD value, the PCC MUST send a PCErr message with Error-Type 10 (Reception of an invalid object) and Error-Value 3 (Unsupported number of Segment ERO subobjects). If a PCEP session is established with an MSD value of zero, then the PCC MAY specify an MSD for each path computation request that it sends to the PCE, by including a "maximum SID depth" metric object on the request, as defined in <xref target="SR-METRIC"/>.</t>

<t>The N flag, L flag and MSD value inside the SR-PCE-CAPABILITY sub-TLV are meaningful only in the Open message sent from a PCC to a PCE. As such, a PCE MUST set the N flag to zero, the L flag to 1 and MSD value to zero in an outbound message to a PCC. Similarly, a PCC MUST ignore any MSD value received from a PCE. If a PCE receives multiple SR-PCE-CAPABILITY sub-TLVs in an Open message, it processes only the first sub-TLV received.</t>

</section>

<section anchor="SR-ERO-PROCESS" title="ERO Processing">

  <section anchor="SR-ERO-VALIDATION" title="SR-ERO Validation">

    <t>If a PCC does not support the SR PCE Capability and thus cannot recognize the SR-ERO or SR-RRO subobjects, it will respond according to the rules for a malformed object per <xref target="RFC5440"/>.</t>

    <t>On receiving an SR-ERO, a PCC MUST validate that the Length field, the S bit, the F bit and the NT field are consistent, as follows.

    <list style="symbols">
    <t>If NT=0, the F bit MUST be 1, the S bit MUST be zero and the Length MUST be 8.</t>
    <t>If NT=1, the F bit MUST be zero.  If the S bit is 1, the Length MUST be 8, otherwise the Length MUST be 12.</t>
    <t>If NT=2, the F bit MUST be zero.  If the S bit is 1, the Length MUST be 20, otherwise the Length MUST be 24.</t>
    <t>If NT=3, the F bit MUST be zero.  If the S bit is 1, the Length MUST be 12, otherwise the Length MUST be 16.</t>
    <t>If NT=4, the F bit MUST be zero.  If the S bit is 1, the Length MUST be 36, otherwise the Length MUST be 40.</t>
    <t>If NT=5, the F bit MUST be zero.  If the S bit is 1, the Length MUST be 20, otherwise the Length MUST be 24.</t>
    </list></t>

    <t>If a PCC finds that the NT field, Length field, S bit and F bit are not consistent, it MUST consider the entire ERO invalid and MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = 11 ("Malformed object").</t>

    <t>If a PCC does not recognise or support the value in the NT field, it MUST consider the entire ERO invalid and MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = TBD2 ("Unsupported NAI Type in Segment ERO subobject").</t>

    <t>If a PCC receives an SR-ERO subobject in which the S and F bits are both set to 1 (that is, both the SID and NAI are absent), it MUST consider the entire ERO invalid and send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = 6 ("Both SID and NAI are absent in SR-ERO subobject").</t>

    <t>If a PCC receives an SR-ERO subobject in which the S bit is set to 1 and the F bit is set to zero (that is, the SID is absent and the NAI is present), but the PCC does not support NAI resolution, it MUST consider the entire ERO invalid and send a PCErr message with Error-Type = 4 ("Not supported object") and Error-Value = 4 ("Unsupported parameter").</t>

    <t>If a PCC receives an SR-ERO subobject in which the S bit is set to 1 and either or both of the M or C bits is set to 1, it MUST consider the entire ERO invalid and send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = 11 ("Malformed object").</t>

    <t>If a PCC receives an SR-ERO subobject in which the S bit is set to zero and the M bit is set to 1, then the subobject contains an MPLS label.  The PCC MAY choose not to accept a label provided by the PCE, based on it local policy.  The PCC MUST NOT accept MPLS label value 3 (Implicit NULL), but it MAY accept other special purpose MPLS label values.  If the PCC decides not to accept an MPLS label value, it MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error Value = 2 ("Bad label value").</t>

    <t>If both M and C bits of an SR-ERO subobject are set to 1, and if a PCC finds erroneous setting in one or more of TC, S, and TTL fields, it MAY overwrite those fields with values chosen according to its own policy. If the PCC does not overwrite them, it MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = 4 ("Bad label format").</t>

    <t>If the M bit of an SR-ERO subobject is set to zero but the C bit is set to 1, then the PCC MUST consider the entire ERO invalid and MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = 11 ("Malformed object").</t>

    <t>If a PCC receives an SR-ERO subobject in which the S bit is set to zero and the M bit is set to zero, then the subobject contains a SID index value.  If the SID is an Adjacency-SID then the L flag MUST NOT be set.  If the L flag is set for an Adjacency-SID then the PCC MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = 11 ("Malformed object").</t>

    <t>If a PCC detects that the subobjects of an ERO are a mixture of SR-ERO subobjects and subobjects of other types, then it MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = 5 ("ERO mixes SR-ERO subobjects with other subobject types").</t>

    <t>The SR-ERO subobjects can be classified according to whether they contain a SID representing an MPLS label value, a SID representing an index value, or no SID.  If a PCC detects that the SR-ERO subobjects are a mixture of more than one of these types, then it MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = TBD9 ("Inconsistent SIDs in SR-ERO / SR-RRO subobjects").</t>

    <t>If an ERO specifies a new SR-TE path for an existing LSP and the PCC determines that the ERO contains SR-ERO subobjects that are not valid, then the PCC MUST NOT update the LSP.</t>

  </section>

  <section anchor="SR-ERO-INTERPRET" title="Interpreting the SR-ERO">

    <t>
       The SR-ERO contains a sequence of subobjects.  According to
       <xref target="I-D.ietf-spring-segment-routing-policy"/>, each SR-ERO subobject in the
       sequence identifies a segment that the traffic will be directed to, in the order
       given.  That is, the first subobject identifies the first segment the traffic will
       be directed to, the second SR-ERO subobject represents the second segment,
       and so on.
    </t>
    <t>
       The PCC interprets the SR-ERO by converting it to an MPLS label stack plus a
       next hop.  The PCC sends packets along the segment routed path by prepending
       the MPLS label stack onto the packets and sending the resulting, modified
       packet to the next hop.
    </t>
    <t>
       The PCC uses a different procedure to do this conversion, depending on the
       information that the PCE has provided in the subobjects.

      <list style="symbols">
      <t>
          If the subobjects contain SID index values, then the PCC converts them into the
          corresponding MPLS labels by following the procedure defined in
          <xref target="I-D.ietf-spring-segment-routing-mpls"/>.
      </t>
      <t>
          If the subobjects contain NAI only, then the PCC first converts each NAI
          into a SID index value by looking it up in its local database, and then
          proceeds as above.
      </t>
      <t>
          If the subobjects contain MPLS labels, then the PCC looks up the offset of the first subobject's label
          in its SRGB or SRLB.  This gives the first SID.  The PCC pushes the labels in any
          remaining subobjects onto the packet (with the final subobject specifying the
          bottom-of-stack label) and then directs the packet to the segment identified by the first SID.
      </t>
      </list>
    </t>

    <section anchor="SR-ERO-INTERPRET-ERROR" title="Handling Errors During SR-ERO Conversion">

    <t>There are several errors that can occur during the process of converting an SR-ERO sequence to an MPLS label stack and a next hop.  The PCC deals with them as follows.
    <list style="symbols">
      <t>If the PCC cannot find a SID index in the SR-DB, it MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = TBD3 ("Unknown SID").</t>
      <t>If the PCC cannot find an NAI in the SR-DB, it MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = TBD4 ("NAI cannot be resolved to a SID").</t>
      <t>If the PCC needs to convert a SID into an MPLS label value but cannot find the corresponding router's SRGB in the SR-DB, it MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = TBD5 ("Could not find SRGB").</t>
      <t>If the PCC finds that a router's SRGB is not large enough for a SID index value, it MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = TBD6 ("SID index exceeds SRGB size").</t>
      <t>If the PCC needs to convert a SID into an MPLS label value but cannot find the corresponding router's SRLB in the SR-DB, it MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = TBD7 ("Could not find SRLB").</t>
      <t>If the PCC finds that a router's SRLB is not large enough for a SID index value, it MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = TBD8 ("SID index exceeds SRLB size").</t>
      <t>If the number of labels in the computed label stack exceeds the maximum number of SIDs that the PCC can impose on the packet, it MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = 3 ("Unsupported number of Segment ERO subobjects").</t>
    </list></t>
    <t>If an ERO specifies a new SR-TE path for an existing LSP and the PCC encounters an error while processing the ERO, then the PCC MUST NOT update the LSP.</t>
  </section>

  </section>
</section>

<section anchor="SR-RRO-PROCESS" title="RRO Processing">

<t>The syntax checking rules that apply to the SR-RRO subobject are identical to those of the SR-ERO subobject, except as noted below.</t>

<t>If a PCEP speaker receives an SR-RRO subobject in which both SID and NAI are absent, it MUST consider the entire RRO invalid and send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = 7 ("Both SID and NAI are absent in SR-RRO subobject").</t>

<t>If a PCE detects that the subobjects of an RRO are a mixture of SR-RRO subobjects and subobjects of other types, then it MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = 10 ("RRO mixes SR-RRO subobjects with other subobject types").</t>

<t>The SR-RRO subobjects can be classified according to whether they contain a SID representing an MPLS label value or a SID representing an index value, or no SID.  If a PCE detects that the SR-RRO subobjects are a mixture of more than one of these types, then it MUST send a PCErr message with Error-Type = 10 ("Reception of an invalid object") and Error-Value = TBD9 ("Inconsistent SIDs in SR-ERO / SR-RRO subobjects").</t>

</section>

</section> <!-- Procedures -->

<section anchor="Backward" title="Backward Compatibility">

<t>A PCEP speaker that does not support the SR PCEP capability cannot recognize the SR-ERO or SR-RRO subobjects. As such, it responds according to the rules for a malformed object, per <xref target="RFC5440"/>.</t>

<t>Some implementations, which are compliant with an earlier version of this specification, do not send the PATH-SETUP-TYPE-CAPABILITY TLV in their OPEN objects.  Instead, to indicate that they support SR, these implementations include the SR-CAPABILITY-TLV as a top-level TLV in the OPEN object. Unfortunately, some of these implementations made it into the field before this document was published in its final form.  Therefore, if a PCEP speaker receives an OPEN object in which the SR-CAPABILITY-TLV appears as a top-level TLV, then it MUST interpret this as though the sender had sent a PATH-SETUP-TYPE-CAPABILITY TLV with a PST list of (0, 1) (that is, both RSVP-TE and SR-TE PSTs are supported) and with the SR-CAPABILITY-TLV as a sub-TLV.  If a PCEP speaker receives an OPEN object in which both the SR-CAPABILITY-TLV and PATH-SETUP-TYPE-CAPABILITY TLV appear as top-level TLVs, then it MUST ignore the top-level SR-CAPABILITY-TLV and process only the PATH-SETUP-TYPE-CAPABILITY TLV.</t>

</section>

<section anchor="Management" title="Management Considerations">

<t>This document adds a new path setup type to PCEP to allow LSPs
to be set up using segment routing techniques.  This path setup
type may be used with PCEP alongside other path setup types,
such as RSVP-TE, or it may be used exclusively.</t>

<section anchor="control" title="Controlling the Path Setup Type">

<t>The following factors control which path setup type is used for
a given LSP.

<list style="symbols">
<t>  The available path setup types are constrained to those that
   are supported by, or enabled on, the PCEP speakers.  The
   PATH-SETUP-TYPE-CAPABILITY TLV indicates which path setup types
   a PCEP speaker supports.  To use segment routing as a path setup type,
   it is a prerequisite that the PCC and PCE both include PST=1 in the
   list of supported path setup types in this TLV, and also include the
   SR-PCE-CAPABILITY sub-TLV.</t>

<t>  When a PCE initiates an LSP, it proposes which path setup type
   to use by including it in the
   PATH-SETUP-TYPE TLV in the SRP object of the PCInitiate message.
   The PCE chooses the path setup type based on the capabilities of the
   network nodes on the path and on its local policy.  The PCC MAY choose
   to accept the proposed path setup type, or to reject the PCInitiate
   request, based on its local policy.</t>

<t>  When a PCC requests a path for an LSP, it can nominate a preferred
   path setup type by including it in the PATH-SETUP-TYPE TLV in the
   RP object of the PCReq message.  The PCE MAY choose to reply
   with a path of the requested type, or to reply with a path of a
   different type, or to reject the request, based on the capabilities of the
   network nodes on the path and on its local policy.</t>
</list>
</t>

<t>The operator can influence the path setup type as follows.

<list style="symbols">

<t>  Implementations MUST allow the operator to enable and disable
   the segment routing path setup type on a PCEP-speaking device.
   Implementations MAY also allow the operator to enable and disable the RSVP-TE
   path setup type.</t>

<t>  PCE implementations MUST allow the operator to specify that an LSP
   should be instantiated using segment routing or RSVP-TE as the proposed path
   setup type.  </t>

<t>  PCE implementations MAY allow the operator to configure a
   preference for the PCE to propose paths using segment routing or RSVP-TE in
   the absence of a specified path setup type.</t>

<t>  PCC implementations MUST allow the operator to specify that a path
   requested for an LSP nominates segment routing or RSVP-TE as the
   path setup type.</t>

<t>  PCC implementations MAY allow the operator to configure a preference
   for the PCC to nominate segment routing or RSVP-TE as the path
   setup type if none is specified for an LSP.</t>

<t>  PCC implementations SHOULD allow the operator to configure a PCC to
   refuse to set up an LSP using an undesired path setup type.</t>
</list>
</t>
</section>

<section anchor="migrating" title="Migrating a Network to Use PCEP Segment Routed Paths">

<t>
This section discusses the steps that the operator takes when migrating a
network to enable PCEP to set up paths using segment routing as the path
setup type.

<list style="symbols">

<t>  The operator enables the segment routing PST on the PCE servers.</t>

<t>  The operator enables the segment routing PST on the PCCs.</t>


<t>  The operator resets each PCEP session.  The PCEP sessions come
   back up with segment routing enabled.</t>

<t>  If the operator detects a problem, they can roll the network back
   to its initial state by disabling the segment routing PST on the
   PCEP speakers and resetting the PCEP sessions.</t>

</list>
</t>
<t>Note that the data plane is unaffected if a PCEP session is reset.  Any
LSPs that were set up before the session reset will remain in place and
will still be present after the session comes back up.</t>

<t>An implementation SHOULD allow the operator to manually trigger a PCEP
session to be reset.</t>

<t>An implementation MAY automatically reset a PCEP session when
an operator reconfigures the PCEP speaker's capabilities.  However, note that
if the capabilities at both ends of the PCEP session are not reconfigured
simultaneously, then the session could be reset twice, which could lead to
unnecessary network traffic.  Therefore, such implementations SHOULD allow
the operator to override this behaviour and wait instead for a manual reset.</t>

<t>Once segment routing is enabled on a PCEP session, it can be used as the
path setup type for future LSPs.</t>

<t>User traffic is not automatically migrated from existing LSPs onto
segment routed LSPs just by enabling the segment routing PST in PCEP.  The
migration of user traffic from existing LSPs onto segment routing LSPs is
beyond the scope of this document.</t>

</section>

<section anchor="verification" title="Verification of Network Operation">

<t>The operator needs the following information to verify that PCEP is
operating correctly with respect to the segment routing path setup type.

<list style="symbols">

<t>  An implementation SHOULD allow the operator to view whether the
   PCEP speaker sent the segment routing PST capability to its peer.
   If the PCEP speaker is a PCC, then the implementation SHOULD also allow
   the operator to view the values of the L and N flags that were sent, and the value of the MSD field
   that was sent.</t>

<t>  An implementation SHOULD allow the operator to view
   whether the peer sent the segment routing PST capability.  If the peer
   is a PCC, then the implementation SHOULD also allow the operator to view
   the values of the L and N flags and MSD fields that the peer sent.</t>

<t>  An implementation SHOULD allow the operator to view
   whether the segment routing PST is enabled on the PCEP session.</t>

<t>  If one PCEP speaker advertises the segment routing PST capability, but the other
   does not, then the implementation SHOULD create a log to inform the
   operator of the capability mismatch.</t>

<t>  An implementation SHOULD allow the operator to view the PST that was
   proposed, or requested, for an LSP, and the PST that was actually used.</t>

<t>  If a PCEP speaker decides to use a different PST to the one that was
   proposed, or requested, for an LSP, then the implementation SHOULD
   create a log to inform the operator that the expected PST has not been used.
   The log SHOULD give the reason for this choice (local policy,
   equipment capability etc.)</t>

<t>  If a PCEP speaker rejects a segment routed path, then it SHOULD create a log
   to inform the operator, giving the reason for the decision (local policy,
   MSD exceeded etc.)</t>
</list>
</t>
</section>

<section anchor="models" title="Relationship to Existing Management Models">

<t>The PCEP YANG module <xref target="I-D.ietf-pce-pcep-yang"/> should include:

<list style="symbols">

<t>  advertised PST capabilities and MSD per PCEP session.</t>

<t>  the PST configured for, and used by, each LSP.</t>
</list>
</t>
<t>The PCEP MIB <xref target="RFC7420"/> could also be updated to include this
information.</t>
</section>

</section>

<section anchor="Security" title="Security Considerations">

<t>The security considerations described in <xref target="RFC5440"/>, <xref target="RFC8281"/> and <xref target="RFC8408"/> are
applicable to this specification.  No additional security measure is required.</t>

<t>Note that this specification enables a network controller to instantiate a
   path in the network without the use of a hop-by-hop signaling protocol
   (such as RSVP-TE).  This creates an additional vulnerability if the security
   mechanisms of <xref target="RFC5440"/> and <xref target="RFC8281"/> are not
   used, because an attacker could create a path which is not subjected to the
   further verification checks that would be performed by the signaling
   protocol.</t>

<t>Note that this specification adds the MSD field to the OPEN message (see <xref target="cap-negotiation"/>)
   which discloses how many MPLS labels the sender can push onto packets that
   it forwards into the network. If the security mechanisms of <xref target="RFC5440"/>
   and <xref target="RFC8281"/> are not used then an attacker could use this
   new field to gain intelligence about the capabilities of the edge devices in
   the network.</t>

</section>

<section anchor="IANA" title="IANA Considerations">

      <section anchor="PCEP-Object-Codepoints" title="PCEP ERO and RRO subobjects">

      <t>This document defines a new subobject type for the PCEP
   explicit route object (ERO), and a new subobject type for the PCEP record route object (RRO).  The code points for subobject types of these objects is maintained in the RSVP parameters registry, under the EXPLICIT_ROUTE and ROUTE_RECORD objects. IANA is requested to confirm the early allocation of the following code points in the RSVP Parameters registry for each of the new subobject types defined in this document.</t>

<texttable anchor="IANA-Subobject-Type" style="none" suppress-title="true">
        <ttcol align="left" width='40%'>Object</ttcol>
        <ttcol align="left" width='40%'>Subobject</ttcol>
        <ttcol align="left" width='60%'>Subobject Type</ttcol>

        <c>---------------------</c><c>--------------------------</c><c>------------------</c>

        <c>EXPLICIT_ROUTE</c><c>SR-ERO (PCEP-specific)</c><c>36</c>
        <c>ROUTE_RECORD</c><c>SR-RRO (PCEP-specific)</c><c>36</c>
      </texttable>


      </section>

<section anchor="NAI-Type-Registry" title="New NAI Type Registry">

<t>IANA is requested to create a new sub-registry within the "Path Computation Element Protocol (PCEP) Numbers" registry called "PCEP SR-ERO NAI Types". The allocation policy for this new registry should be by IETF Review. The new registry should contain the following values:
</t>

<texttable anchor="New-PCEP-SR-ERO-NAI-value" style="none" suppress-title="true">
        <ttcol align="left" width='40%'>Value</ttcol>
        <ttcol align="left" width='75%'>Description </ttcol>
        <ttcol align="left" width='55%'>Reference </ttcol>
        <c></c><c>&nbsp;</c><c></c>
        <c>0</c><c>NAI is absent.</c><c>This document</c>
        <c>1</c><c>NAI is an IPv4 node ID.</c><c>This document</c>
        <c>2</c><c>NAI is an IPv6 node ID.</c><c>This document</c>
        <c>3</c><c>NAI is an IPv4 adjacency.</c><c>This document</c>
        <c>4</c><c>NAI is an IPv6 adjacency.</c><c>This document</c>
        <c>5</c><c>NAI is an unnumbered adjacency with IPv4 node IDs.</c><c>This document</c>
</texttable>
</section>

      <section anchor="IANA-SR-ERO-FLAG" title="New SR-ERO Flag Registry">
        <t>IANA is requested to create a new sub-registry, named
    "SR-ERO Flag Field", within the "Path Computation
    Element Protocol (PCEP) Numbers" registry to manage the Flag
    field of the SR-ERO subobject. New values are to be assigned by Standards
        Action <xref target="RFC8126"/>. Each bit should be tracked with the
        following qualities:
        <list style="symbols">
          <t>Bit number (counting from bit 0 as the most significant bit)</t>
          <t>Capability description</t>
          <t>Defining RFC</t>
        </list>
        </t>

        <t>The following values are defined in this document:</t>

        <texttable anchor="SR-ERO-Flags" style="none" suppress-title="true">
          <ttcol align="center" width='15%'>Bit</ttcol>
          <ttcol align="left" width='30%'>Description </ttcol>
          <ttcol align="left" width='55%'>Reference </ttcol>
          <c></c><c>&nbsp;</c><c></c>
          <c>0-7</c><c>Unassigned</c><c></c>
          <c>8</c><c>NAI is absent (F)</c><c>This document</c>
          <c>9</c><c>SID is absent (S)</c><c>This document</c>
          <c>10</c><c>SID specifies TC, S and TTL in addition to an MPLS label (C)</c><c>This document</c>
          <c>11</c><c>SID specifies an MPLS label (M)</c><c>This document</c>
        </texttable>
      </section> <!-- SR-ERO Flags -->

      <section anchor="IANA-Error-Object" title="PCEP-Error Object">

        <t>IANA is requested to confirm the early allocation of the code-points in the PCEP-ERROR Object Error Types and Values registry for the following new error-values:

        <vspace blankLines="1" />

        <?rfc subcompact="yes"?>

        <list style="hanging" hangIndent="13">

          <t hangText="Error-Type">Meaning</t>
          <t hangText="----------   -------"></t>
          <t hangText="10">Reception of an invalid object.
          <list style="hanging" hangIndent="37">
            <t hangText=" Error-value = 2:">Bad label value</t>
            <t hangText=" Error-value = 3:">Unsupported number of SR-ERO subobjects</t>
            <t hangText=" Error-value = 4:">Bad label format</t>
            <t hangText=" Error-value = 5:">ERO mixes SR-ERO subobjects with other subobject types</t>
            <t hangText=" Error-value = 6:">Both SID and NAI are absent in SR-ERO subobject</t>
            <t hangText=" Error-value = 7:">Both SID and NAI are absent in SR-RRO subobject</t>
            <t hangText=" Error-value = 9:">MSD exceeds the default for the PCEP session</t>
            <t hangText=" Error-value = 10:">RRO mixes SR-RRO subobjects with other subobject types</t>
            <t hangText=" Error-value = TBD1:">Missing PCE-SR-CAPABILITY sub-TLV</t>
            <t hangText=" Error-value = TBD2:">Unsupported NAI Type in SR-ERO subobject</t>
            <t hangText=" Error-value = TBD3:">Unknown SID</t>
            <t hangText=" Error-value = TBD4:">NAI cannot be resolved to a SID</t>
            <t hangText=" Error-value = TBD5:">Could not find SRGB</t>
            <t hangText=" Error-value = TBD6:">SID index exceeds SRGB size</t>
            <t hangText=" Error-value = TBD7:">Could not find SRLB</t>
            <t hangText=" Error-value = TBD8:">SID index exceeds SRLB size</t>
            <t hangText=" Error-value = TBD9:">Inconsistent SIDs in SR-ERO / SR-RRO subobjects</t>
          </list>
          </t>
        </list>
        </t>

        <t>Note to IANA: this draft originally had an early allocation for Error-value=11 (Malformed object) in the above list.  However, we have since moved the definition of that code point to RFC8408.</t>

        <t>Note to IANA: some Error-values in the above list were defined after the early allocation took place, and so do not currently have a code point assigned.  Please assign code points from the indicated registry and replace each instance of "TBD1", "TBD2" etc. in this document with the respective code points.</t>

        <t>Note to IANA: some of the Error-value descriptive strings above have changed since the early allocation. Please refresh the registry.</t>
      </section>

      <section anchor="IANA-TLV-Type-Indicators" title="PCEP TLV Type Indicators">
        <t>IANA is requested to confirm the early allocation of the following code point in the PCEP TLV Type Indicators registry.</t>

        <texttable anchor="PCEP-New-TLV-CP" style="none" suppress-title="true">
          <ttcol align="left" width='65%'>Value</ttcol>
          <ttcol align="left" width='40%'>Meaning </ttcol>
          <ttcol align="left" width='35%'>Reference </ttcol>
          <c>-------------------------</c><c>----------------------------</c><c>--------------</c>
          <c>26</c><c>SR-PCE-CAPABILITY</c><c>This document</c>
        </texttable>

      </section>

      <section anchor="IANA-PATH-SETUP-TYPE" title="New Path Setup Type">
        <t><xref target="RFC8408"/> requests that IANA creates a sub-registry within the "Path Computation Element Protocol (PCEP) Numbers" registry called "PCEP Path Setup Types". IANA is requested to allocate a new code point within this registry, as follows:</t>

      <texttable anchor="PATH-SETUP-TLV-value" style="none" suppress-title="true">
        <ttcol align="left" width='50%'>Value</ttcol>
        <ttcol align="left" width='50%'>Description </ttcol>
        <ttcol align="left" width='35%'>Reference </ttcol>

        <c>-------------------------</c><c>----------------------------</c><c>--------------</c>

        <c>1</c><c>Traffic engineering path is setup using Segment Routing.</c><c>This document</c>
      </texttable>
      </section>

      <section anchor="IANA-METRIC-TYPE" title="New Metric Type">
        <t>IANA is requested to confirm the early allocation of the following code point in the PCEP METRIC object T field registry:</t>

      <texttable anchor="METRIC-type" style="none" suppress-title="true">
        <ttcol align="left" width='50%'>Value</ttcol>
        <ttcol align="left" width='50%'>Description </ttcol>
        <ttcol align="left" width='35%'>Reference </ttcol>
        <c>-------------------------</c><c>----------------------------</c><c>--------------</c>
        <c>11</c><c>Segment-ID (SID) Depth.</c><c>This document</c>
      </texttable>
      </section>

      <section anchor="IANA-SR-PCE-CAP-FLAG" title="SR PCE Capability Flags">
        <t>IANA is requested to create a new sub-registry, named
    "SR Capability Flag Field", within the "Path Computation
    Element Protocol (PCEP) Numbers" registry to manage the Flag
    field of the SR-PCE-CAPABILITY TLV. New values are to be assigned by Standards
        Action <xref target="RFC8126"/>. Each bit should be tracked with the
        following qualities:
        <list style="symbols">
          <t>Bit number (counting from bit 0 as the most significant bit)</t>
          <t>Capability description</t>
          <t>Defining RFC</t>
        </list>
        </t>

        <t>The following values are defined in this document:</t>

        <texttable anchor="SR-PCE-CAP-Flags" style="none" suppress-title="true">
          <ttcol align="center" width='15%'>Bit</ttcol>
          <ttcol align="left" width='30%'>Description </ttcol>
          <ttcol align="left" width='55%'>Reference </ttcol>
          <c></c><c>&nbsp;</c><c></c>
          <c>0-5</c><c>Unassigned</c><c></c>
          <c>6</c><c>Node or Adjacency Identifier (NAI) is supported (N)</c><c>This document</c>
          <c>7</c><c>Unlimited Maximum SID Depth (L)</c><c>This document</c>
        </texttable>
      </section> <!-- SR PCE Capability Flags -->
    </section>

    <section anchor="Contributors" title="Contributors">

      <?rfc subcompact="yes"?>
      <t>The following people contributed to this document:
      <list style="empty">
	      <t>- Lakshmi Sharma</t>
	      <t>- Jan Medved</t>
	      <t>- Edward Crabbe</t>
	      <t>- Robert Raszuk</t>
	      <t>- Victor Lopez</t>
      </list>
      </t>
      <?rfc subcompact="no"?>
    </section>

    <section anchor="Acknowledgement" title="Acknowledgements">

      <t>We thank Ina Minei, George Swallow, Marek Zavodsky, Dhruv Dhody, Ing-Wher Chen and Tomas Janciga for the valuable comments.</t>

    </section>

 </middle>

 <back>
   <references title="Normative References">

     <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?>
     <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.3032.xml"?>
     <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.5440.xml"?>
     <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.7420.xml"?>
     <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml"?>
     <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8231.xml"?>
     <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8281.xml"?>
     <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8402.xml"?>
     <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8408.xml"?>

     <?rfc include="http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-ospf-segment-routing-extensions-25.xml"?>
     <?rfc include="http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-isis-segment-routing-extensions-19.xml"?>
     <?rfc include="http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-isis-segment-routing-msd-16.xml"?>
     <?rfc include="http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-ospf-segment-routing-msd-20.xml"?>
     <?rfc include="http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-idr-bgp-ls-segment-routing-msd-02.xml"?>
     <?rfc include="http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-pce-pcep-yang-08.xml"?>

   </references>

   <references title="Informative References">

    <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.3209.xml"?>
    <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.4657.xml"?>
    <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8126.xml"?>

    <?rfc include="http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-spring-segment-routing-mpls-14.xml"?>
    <?rfc include="http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-6man-segment-routing-header-14.xml"?>
    <?rfc include="http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-spring-segment-routing-policy-01.xml"?>

   </references>
  </back>

</rfc>
