<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
  <!ENTITY I-D.ietf-mpls-inband-pm-encapsulation SYSTEM 
    "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-mpls-inband-pm-encapsulation.xml">
  <!ENTITY RFC2119 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
  <!ENTITY RFC3031 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3031.xml">
  <!ENTITY RFC3032 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3032.xml">
  <!ENTITY RFC6374 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6374.xml">
  <!ENTITY RFC7876 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7876.xml">
  <!ENTITY RFC8174 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
  <!ENTITY RFC9341 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9341.xml">
  <!ENTITY RFC5481 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5481.xml">
  <!ENTITY RFC5586 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5586.xml">
  <!ENTITY RFC6790 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6790.xml">
  <!ENTITY RFC7471 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7471.xml">
  <!ENTITY RFC8126 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml">
  <!ENTITY RFC8402 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8402.xml">
  <!ENTITY RFC8570 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8570.xml">
  <!ENTITY RFC8571 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8571.xml">
  <!ENTITY RFC8668 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8668.xml">
  <!ENTITY RFC9256 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9256.xml">
  <!ENTITY RFC9356 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9356.xml">
  <!ENTITY RFC9545 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9545.xml">
  <!ENTITY RFC5082 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5082.xml">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" docName="draft-ietf-mpls-rfc6374-sr-15" category="std" ipr="trust200902" obsoletes="" updates="" xml:lang="en" sortRefs="false" consensus="yes" symRefs="true" tocInclude="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.12.3 -->
  <!-- Generated by id2xml 1.5.0 on 2020-03-06T17:47:05Z -->
    <front>
    <title abbrev="Performance Measurement for SR-MPLS">Performance Measurement for Segment Routing Networks with MPLS Data Plane</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-mpls-rfc6374-sr-15"/>
    <author fullname="Rakesh Gandhi" initials="R." role="editor" surname="Gandhi">
      <organization>Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <street>Canada</street>
        </postal>
        <email>rgandhi@cisco.com</email>
      </address>
    </author>
    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils">
      <organization>Cisco Systems, Inc.</organization>
      <address>
        <email>cfilsfil@cisco.com</email>
      </address>
    </author>
    <author fullname="Daniel Voyer" initials="D." surname="Voyer">
      <organization>Bell Canada</organization>
      <address>
        <email>daniel.voyer@bell.ca</email>
      </address>
    </author>
    <author fullname="Stefano Salsano" initials="S." surname="Salsano">
      <organization>Universita di Roma "Tor Vergata"</organization>
      <address>
        <postal>
          <street>Italy</street>
        </postal>
        <email>stefano.salsano@uniroma2.it</email>
      </address>
    </author>
    <author fullname="Mach(Guoyi) Chen" initials="M." surname="Chen">
      <organization>Huawei</organization>
      <address>
        <email>mach.chen@huawei.com</email>
      </address>
    </author>
    <date day="16" month="October" year="2024"/>
    <workgroup>MPLS Working Group</workgroup>
    <abstract>
      <t>
This document specifies the application of the MPLS loss and delay measurement
techniques, originally defined in RFC 6374, RFC 7876, and RFC 9341 within
Segment Routing (SR) networks that utilize the MPLS data plane. Segment Routing
enables the forwarding of packets through an ordered list of instructions,
known as segments, which are imposed at the ingress node. By applying the
mechanisms from RFC 6374, RFC 7876, and RFC 9341 to SR-MPLS networks, this
document facilitates accurate measurement of packet loss and delay for Segment
Routing paths. It defines the procedures and extensions necessary to perform
performance measurement and fault management in SR-MPLS environments, ensuring
that network operators can effectively measure and maintain the quality of
service across their SR-based MPLS networks. This includes coverage of links
and end-to-end SR-MPLS paths, as well as SR Policies. 
      </t>
    </abstract>
  </front>
  <middle>
    <section anchor="sect-1" numbered="true" toc="default">
      <name>Introduction</name>

      <t>
Segment Routing (SR), as specified in <xref target="RFC8402" format="default"/>, leverages the source routing
paradigm and applies to both the Multiprotocol Label Switching (SR-MPLS) and
IPv6 (SRv6) data planes. SR takes advantage of Equal-Cost Multipaths (ECMPs)
between source and transit nodes, between transit nodes, and between transit
and destination nodes. SR Policies, defined in <xref target="RFC9256" format="default"/>, are used to steer
traffic through specific, user-defined paths using a list of segments.
     </t>

      <t>
A comprehensive SR Performance Measurement toolset is one of the essential
requirements for measuring network performance to provide Service Level
Agreements (SLAs).
      </t>
      
<t>
<xref target="RFC6374" format="default"/> specifies protocol mechanisms to enable efficient and accurate measurement of packet loss, one-way and two-way delay, as well as related metrics such as delay-variation in MPLS networks.
</t>

<t>
<xref target="RFC7876" format="default"/> specifies mechanisms for sending and processing out-of-band responses over a UDP return path when receiving query messages defined in <xref target="RFC6374" format="default"/>. These mechanisms can be applied to SR-MPLS networks.
</t>

<t>
<xref target="RFC9341" format="default"/> defines the Alternate-Marking Method using block number as a data correlation mechanism for packet loss measurement.
</t>

<t>
This document utilizes the mechanisms from <xref target="RFC6374" format="default"/>, <xref target="RFC7876" format="default"/>, and <xref target="RFC9341" format="default"/> for delay and loss measurements in SR-MPLS networks. This includes coverage of links and end-to-end SR-MPLS paths, as well as SR Policies. 
</t>

<t>
This document defines Return Path and Block Number TLV extensions for <xref target="RFC6374" format="default"/> for delay and loss measurement in SR-MPLS networks. These TLV extensions also apply to MPLS Label Switched Paths (LSPs) <xref target="RFC3031" format="default"/>. However, the procedure for delay and loss measurement of MPLS LSPs is outside the scope of this document.
</t>

   </section>

    <section anchor="sect-2" numbered="true" toc="default">
      <name>Conventions Used in This Document</name>
      <section anchor="sect-2.1" numbered="true" toc="default">
        <name>Requirements Language</name>

       <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" format="default"/> <xref target="RFC8174" format="default"/>
   when, and only when, they appear in all capitals, as shown here.
   </t>
    
      </section>
      <section anchor="sect-2.2" numbered="true" toc="default">
        <name>Abbreviations</name>
        <t>
   ACH: Associated Channel Header.</t>
        <t>
   DM: Delay Measurement.</t>
        <t>
   ECMP: Equal Cost Multi-Path.</t>
        <t>
   G-ACh: Generic Associated Channel (G-ACh).</t>
        <t>
   GAL: Generic Associated Channel (G-ACh) Label.</t>
        <t>
   LM: Loss Measurement.</t>
        <t>
   LSE: Label Stack Entry.</t>
        <t>
   MPLS: Multiprotocol Label Switching.</t>
        <t>
   PSID: Path Segment Identifier.</t>
        <t>
   SID: Segment Identifier.</t>
        <t>
   SL: Segment List.</t>
        <t>
   SR: Segment Routing.</t>
        <t>
   SR-MPLS: Segment Routing with MPLS data plane.</t>
        <t>
   TC: Traffic Class.</t>
        <t>
   TE: Traffic Engineering.</t>
        <t>
   TTL: Time-To-Live.</t>
        <t>
   URO: UDP Return Object.</t>
      </section>
      <section anchor="sect-2.3" numbered="true" toc="default">
        <name>Reference Topology</name>

<t>
In the Reference Topology shown in Figure 1, the querier node Q1 initiates a query message, and the responder node R1 transmits a response message for the query message received. The response message may be sent back to the querier node Q1 on the same path (same set of links and nodes) or a different path in the reverse direction from the path taken towards the responder R1.
</t>

<t>
T1 is a transmit timestamp, and T4 is a receive timestamp, both added by node Q1. T2 is a receive timestamp, and T3 is a transmit timestamp, both added by node R1.
</t>

<t>
SR is enabled with the MPLS data plane on nodes Q1 and R1. 
The nodes Q1 and R1 are connected via a channel (Section 2.9.1 of <xref target="RFC6374" format="default"/>).
The channel may be a directly connected link enabled with MPLS (Section 2.9.1 of <xref target="RFC6374" format="default"/>) 
or a Point-to-Point (P2P) SR-MPLS path <xref target="RFC8402" format="default"/>. 
The link may be a physical interface, a virtual link, or a Link Aggregation Group (LAG) <xref target="IEEE802.1AX" format="default"/>, 
or a LAG member link. The SR-MPLS path may be an SR-MPLS Policy <xref target="RFC9256" format="default"/> 
on node Q1 (called head-end) with the destination to node R1 (called tail-end).
</t>

        <figure anchor="ure-reference-topology">
          <name>Reference Topology</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[

                       T1                T2
                      /                   \
             +-------+       Query         +-------+
             |       | - - - - - - - - - ->|       |
             |   Q1  |=====================|   R1  |
             |       |<- - - - - - - - - - |       |
             +-------+       Response      +-------+
                      \                   /
                       T4                T3
              Querier                       Responder
]]></artwork>
        </figure>
      </section>
    </section>

    <section anchor="sect-3" numbered="true" toc="default">
      <name>Overview</name>

      <t>
          In this document, the procedures defined in
<xref target="RFC6374" format="default"/>, <xref target="RFC7876" format="default"/>, and <xref target="RFC9341" format="default"/> 
are utilized for delay and loss measurement in SR-MPLS networks. Specifically,
the one-way, two-way, and round-trip delay measurements described in Section
2.4 of  <xref target="RFC6374" format="default"/> are further elaborated for application within SR-MPLS
networks. Similarly, the packet loss measurement procedures outlined in Section
2.2 of <xref target="RFC6374" format="default"/> are extended for use in SR-MPLS networks.
      </t>
      <t>
Packet loss measurement using the Alternate-Marking Method defined in <xref target="RFC9341" format="default"/> 
may employ the Block Number for data correlation. This is achieved by utilizing
the Block Number TLV extension defined in this document.
      </t>
      <t>
In SR-MPLS networks, the query and response messages defined in <xref target="RFC6374" format="default"/> are
transmitted as follows:
      </t>


<ul spacing="normal">
    <li>
    For delay measurement, the query messages MUST be sent along the same path as
the data traffic for links and end-to-end SR-MPLS paths to collect both
transmit and receive timestamps.
    </li>
    <li>
    For loss measurement, the query messages MUST be sent along the same path as
the data traffic for links and end-to-end SR-MPLS paths to collect both
transmit and receive traffic counters.
        </li>
</ul>

      <t>
If it is desired in SR-MPLS networks that the same path (i.e., the same set of
links and nodes) between the querier and responder be used in both directions
of the measurement, this can be achieved by using the Return Path TLV extension
defined in this document.
      </t>

      <t>
The performance measurement procedures for links can be used to compute
extended Traffic Engineering (TE) metrics for delay and loss, as described
herein. These metrics are advertised in the network using the routing protocol
extensions defined in <xref target="RFC7471" format="default"/>, <xref target="RFC8570" format="default"/>, and <xref target="RFC8571" format="default"/>.
      </t>

    </section>

    <section anchor="sect-4" numbered="true" toc="default">
      <name>Query and Response Messages</name>
      <section anchor="sect-4.1" numbered="true" toc="default">
        <name>Query Message for Links and SR-MPLS Policies</name>
        <section anchor="sect-4.1.1" numbered="true" toc="default">
          <name>Query Message for Links</name>

<t>
The query message, as defined in <xref target="RFC6374" format="default"/>, is sent over the links for both delay and loss measurement. In each Label Stack Entry (LSE) <xref target="RFC3032" format="default"/> in the MPLS label stack, the TTL value MUST be set to 255 <xref target="RFC5082" format="default"/>.
</t>
        </section>
        <section anchor="sect-4.1.2" numbered="true" toc="default">
          <name>Query Message for SR-MPLS Policies</name>

      <t>
      An SR-MPLS Policy Candidate-Path may contain a number of Segment Lists (SLs) 
      (i.e., a stack of MPLS labels) <xref target="RFC9256" format="default"/>. For delay and/or loss measurement for an end-to-end SR-MPLS Policy, 
      the query messages MUST be transmitted for every SL of the SR-MPLS Policy Candidate-Path, by creating a separate session for each SL. 
      Each query message of a session contains an SR-MPLS label stack of the Candidate-Path, 
      with the G-ACh Label (GAL) at the bottom of the stack (with S=1) as shown in Figure 2. 
      In each LSE in the MPLS label stack, the TTL value MUST be set to 255 <xref target="RFC5082" format="default"/>.
</t>

          <figure anchor="ure-header-for-an-end-to-end-sr-mpls-policy">
            <name>Example Query Message Header for an End-to-end SR-MPLS Policy</name>
            <artwork name="" type="" align="left" alt=""><![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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Label(1)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Label(n)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  GAL (value 13)       | TC  |1|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |0 0 0 1|Version| Reserved      |       Channel Type            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
          </figure>


<t>
The fields "0001", Version, Reserved, and Channel Type shown in Figure 2 are specified in <xref target="RFC5586" format="default"/>.
</t>

<t>
The SR-MPLS label stack can be empty in the case of a one-hop SR-MPLS Policy with an Implicit NULL label.
</t>

<t>
For an SR-MPLS Policy, to ensure that the query message is processed by the intended responder, the Destination Address TLV (Type 129) <xref target="RFC6374" format="default"/> containing the address of the responder can be sent in the query messages. The responder that supports this TLV MUST return Success in "Control Code" <xref target="RFC6374" format="default"/> if it is the intended destination for the query. Otherwise, it MUST return 0x15: Error - Invalid Destination Node Identifier <xref target="RFC6374" format="default"/>.
</t>

        </section>
      </section>
      <section anchor="sect-4.2" numbered="true" toc="default">
        <name>Response Message for Links and SR-MPLS Policies</name>
        <section anchor="sect-4.2.1" numbered="true" toc="default">
          <name>One-way Measurement Mode</name>

<t>
In one-way measurement mode defined in Section 2.4 of <xref target="RFC6374" format="default"/>, the querier can receive "out-of-band" response messages with an IP/UDP header by properly setting the UDP Return Object (URO) TLV in the query message. The URO TLV (Type=131) is defined in <xref target="RFC7876" format="default"/> and includes the UDP-Destination-Port and IP Address. When the querier sets an IP address and a UDP port in the URO TLV, the response message MUST be sent to that IP address as the destination address and UDP port as the destination port. In addition, the "Control Code" in the query message MUST be set to "out-of-band response requested" <xref target="RFC6374" format="default"/>.
</t>

        </section>
        <section anchor="sect-4.2.2" numbered="true" toc="default">
          <name>Two-way Measurement Mode</name>

      <t>
In two-way measurement mode defined in Section 2.4 of <xref target="RFC6374" format="default"/>, the response messages SHOULD be sent back in-band on the same link or the same end-to-end SR-MPLS path (same set of links and nodes) in the reverse direction to the querier.
</t>

<t>
For links, the response message as defined in <xref target="RFC6374" format="default"/> is sent back on the same incoming link where the query message is received. In this case, the "Control Code" in the query message MUST be set to "in-band response requested" <xref target="RFC6374" format="default"/>.
</t>

<t>
For end-to-end SR-MPLS paths, the responder transmits the response message (example as shown in Figure 2) on a specific return SR-MPLS path. The querier can request in the query message for the responder to send the response message back on a given return path using the MPLS Label Stack sub-TLV in the Return Path TLV defined in this document.
</t>

         </section>
        <section anchor="sect-4.2.3" numbered="true" toc="default">
          <name>Loopback Measurement Mode</name>

<t>
The loopback measurement mode defined in Section 2.8 of <xref target="RFC6374" format="default"/> is used to measure round-trip delay for a bidirectional circular SR-MPLS path. In this mode for SR-MPLS, the received query messages are not punted out of the fast path in forwarding (i.e., to the slow path or control plane) at the responder. In other words, the responder does not process the payload or generate response messages. The loopback function simply returns the received query message to the querier without responder modifications <xref target="RFC6374" format="default"/>.
</t>

<t>
The loopback mode is done by generating "queries" with the Response flag set to 1 and adding the Loopback Request object (Type 3) <xref target="RFC6374" format="default"/>. The label stack, as shown in Figure 2, in query messages in this case carries both the forward and reverse paths in the MPLS header. The GAL is still carried at the bottom of the label stack (with S=1) (example as shown in Figure 2).
</t>

         </section>
      </section>
    </section>
    <section anchor="sect-5" numbered="true" toc="default">
      <name>Delay Measurement</name>
      <section anchor="sect-5.1" numbered="true" toc="default">
        <name>Delay Measurement Message Format</name>

    <t>
As defined in <xref target="RFC6374" format="default"/>, MPLS Delay Measurement (DM) query and response messages use the Associated Channel Header (ACH) (value 0x000C for delay measurement) <xref target="RFC6374" format="default"/>, which identifies the message type and the message payload as defined in Section 3.2 <xref target="RFC6374" format="default"/> following the ACH. For delay measurement, the same ACH value is used for both links and end-to-end SR-MPLS Policies.
</t>

      </section>
    </section>
    <section anchor="sect-6" numbered="true" toc="default">
      <name>Loss Measurement</name>

      <t>
The Loss Measurement (LM) protocol can perform two distinct kinds of loss measurement as described in Section 2.9.8 of <xref target="RFC6374" format="default"/>.
</t>

<ul spacing="normal">
    <li>In inferred mode, LM will measure the loss of specially generated test messages to infer the approximate data plane loss level. Inferred mode LM provides only approximate loss accounting.</li>
    <li>In direct mode, LM will directly measure data plane packet loss. Direct mode LM provides perfect loss accounting but may require hardware support.</li>
</ul>


      <section anchor="sect-6.1" numbered="true" toc="default">
        <name>Loss Measurement Message Format</name>

<t>
As defined in <xref target="RFC6374" format="default"/>, MPLS LM query and response messages use the Associated Channel Header (ACH) (value 0x000A for direct loss measurement or value 0x000B for inferred loss measurement), which identifies the message type and the message payload defined in Section 3.1 <xref target="RFC6374" format="default"/> following the ACH. For loss measurement, the same ACH value is used for both links and end-to-end SR-MPLS Policies.
</t>

      </section>
      <section anchor="sect-6.3" numbered="true" toc="default">
        <name>Combined Loss/Delay Measurement Message Format</name>

    <t>
As defined in <xref target="RFC6374" format="default"/>, Combined DM+LM query and response messages use the Associated Channel Header (ACH) (value 0x000D for direct loss and delay measurement or value 0x000E for inferred loss and delay measurement), which identifies the message type and the message payload defined in Section 3.3 <xref target="RFC6374" format="default"/> following the ACH. For combined loss and delay measurement, the same ACH value is used for both links and end-to-end SR-MPLS Policies.
</t>

      </section>
      <section anchor="sect-6.4" numbered="true" toc="default">
        <name>Counters</name>

<t>
The Path Segment Identifier (PSID) <xref target="RFC9545" format="default"/> MUST be carried in the received data packet for the traffic flow under measurement for accounting received traffic on the egress node of the SR-MPLS Policy. In direct mode, the PSID in the received query message, as shown in Figure 3, can be used to associate the received traffic counter on the responder to detect the transmit packet loss for the end-to-end SR-MPLS Policy.
</t>

<t>
In inferred mode, the PSID in the received query messages, as shown in Figure 3, can be used to count the received query messages on the responder to detect the transmit packet loss for an end-to-end SR-MPLS Policy.
</t>

        <figure anchor="ure-with-path-segment-identifier-for-sr-mpls-policy">
          <name>Example with Path Segment Identifier for SR-MPLS Policy</name>
          <artwork name="" type="" align="left" alt=""><![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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Label(1)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Label(n)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  PSID                 | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  GAL (value 13)       | TC  |1|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |0 0 0 1|Version| Reserved      |       Channel Type            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>

    <t>
The fields "0001", Version, Reserved, and Channel Type shown in Figure 3 are specified in <xref target="RFC5586" format="default"/>.
</t>

<t>
Different values of PSID can be used per Candidate-Path for accounting received traffic to measure packet loss at the Candidate-Path level. Similarly, different values of PSID can be used per Segment List of the Candidate-Path for accounting received traffic to measure packet loss at the Segment List level. The same value of PSID can be used for all Segment Lists of the SR-MPLS Policy to measure packet loss at the SR-MPLS Policy level.
</t>

      </section>

      <section anchor="sect-6.5" numbered="true" toc="default">
        <name>Block Number for Counters</name>

    <t>
The packet loss measurement using the Alternate-Marking Method defined in <xref target="RFC9341" format="default"/> may use the block number for data correlation for the traffic flow under measurement. As defined in Section 3.1 of <xref target="RFC9341" format="default"/>, the block number is used to divide the traffic flow into consecutive blocks and count the number of packets transmitted and received in each block for loss measurement.
</t>

<t>
As described in Section 4.3 of <xref target="RFC9341" format="default"/>, a protocol-based distributed solution can be used to exchange values of counters on the nodes for loss measurement. That solution is further described in this document using the LM messages defined in <xref target="RFC6374" format="default"/>.
</t>

<t>
The querier node assigns a block number to the block of data packets of the traffic flow under measurement. The querier counts the number of packets transmitted in each block. The mechanism for the assignment of the block number is a local decision on the querier and is outside the scope of this document.
</t>

<t>
As an example, the querier can use the procedure defined in <xref target="I-D.ietf-mpls-inband-pm-encapsulation" format="default"/> for alternate marking of the data packets of the traffic flow under measurement. The responder counts the number of received packets in each block based on the marking in the received data packets. The querier and responder maintain separate sets of transmit and receive counters for each marking. The marking can be used as a block number or a separate block number can be incremented when the marking changes. Other methods can be defined for alternate marking of the data packets of the traffic flow under measurement to assign a block number for the counters.
</t>

<t>
The LM query and response messages defined in <xref target="RFC6374" format="default"/> are used to measure packet loss for the block of data packets transmitted with the previous marking while data packets carry alternate marking. Specifically, LM query and response messages carry the transmit and receive counters (which are currently not incrementing) along with their block number to correlate for loss measurement.
</t>

<t>
"The assumption of the block number mechanism is that 
the measurement nodes are time synchronized" as specified in Section 4.3 of <xref target="RFC9341" format="default"/> is not necessary, as the block number on the responder can be synchronized based on the received LM query messages.
</t>


    </section>

    </section>
    <section anchor="sect-7" numbered="true" toc="default">
      <name>TLV Extensions</name>
      <section anchor="sect-7.1" numbered="true" toc="default">
        <name>Return Path TLV Extension</name>

<t>
In two-way measurement mode, the responder may transmit the response message on a specific return path, for example, in an ECMP environment. The querier can request in the query message for the responder to send a response message back on a given return path (e.g., co-routed bidirectional path). This allows the responder to avoid creating and maintaining additional states (containing return paths) for the sessions.
</t>

<t>
The querier may not be directly reachable from the responder in a network. The querier in this case MUST send its reachability path information to the responder using the Return Path TLV.
</t>

<t>
<xref target="RFC6374" format="default"/> defines query and response messages that can include one or more optional TLVs. A new TLV Type (TBA1) is defined in this document for the Return Path TLV to carry return path information in query messages. The Return Path TLV is specific to a measurement session. The format of the Return Path TLV is shown in Figure 4:
</t>


        <figure anchor="ure-return-path-tlv">
          <name>Return Path TLV</name>
          <artwork name="" type="" align="left" alt=""><![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 = TBA1  |    Length     |      Reserved                 |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                    Return Path Sub-TLV                        |
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>


<t>
The Length is a one-byte field and is equal to the length of the Return Path Sub-TLV and the Reserved field in bytes. Length MUST NOT be 0 or 1.
</t>

<t>
The Return Path TLV is defined in the Mandatory TLV Type registry space <xref target="RFC6374" format="default"/>. The querier MUST only insert one Return Path TLV in the query message. The responder that supports this TLV MUST only process the first Return Path TLV and ignore the other Return Path TLVs if present. The responder that supports this TLV also MUST send the response message back on the return path specified in the Return Path TLV. The responder also MUST NOT add a Return Path TLV in the response message. The Reserved field MUST be set to 0 and MUST be ignored on the receive side.
</t>
    

        <section anchor="sect-7.1.1" numbered="true" toc="default">
          <name>Return Path Sub-TLV Extension</name>

      <t>
The Return Path TLV contains a Sub-TLV to carry the return path. The format of the MPLS Label Stack Sub-TLV is shown in Figure 5. The label entries in the Sub-TLV MUST be in network order. The MPLS Label Stack Sub-TLV in the Return Path TLV is of the following type:
</t>

          <ul spacing="normal">
            <li>Type (value 1): MPLS Label Stack of the Return Path</li>
          </ul>
          <figure anchor="ure-segment-list-sub-tlv-in-return-path-tlv">
            <name>MPLS Label Stack Sub-TLV in Return Path TLV</name>
            <artwork name="" type="" align="left" alt=""><![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=1     |    Length     |      Reserved                 |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Label(1)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Label(n)             | TC  |1|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
          </figure>


<t>
The MPLS Label Stack contains a list of 32-bit LSE that includes a 20-bit label value, 8-bit TTL value, 3-bit TC value, and 1-bit EOS (S) field. An MPLS Label Stack Sub-TLV may carry a stack of labels or a Binding SID label <xref target="RFC8402" format="default"/> of the Return SR-MPLS Policy.
</t>

<t>
The Length is a one-byte field and is equal to the length of the label stack field and the Reserved field in bytes. Length MUST NOT be 0 or 1.
</t>

<t>
The Return Path TLV MUST carry only one Return Path Sub-TLV. The MPLS Label Stack in the Return Path Sub-TLV MUST contain at least one MPLS Label. The responder that supports this Sub-TLV MUST only process the first Return Path Sub-TLV and ignore the other Return Path Sub-TLVs if present. The responder that supports this Sub-TLV MUST send the response message back on the return path specified in the Return Path Sub-TLV. The Reserved field MUST be set to 0 and MUST be ignored on the receive side.
</t>
      

        </section>
      </section>
      <section anchor="sect-7.2" numbered="true" toc="default">
        <name>Block Number TLV Extension</name>

    <t>
<xref target="RFC6374" format="default"/> defines query and response messages that can include one or more optional TLVs. A new TLV Type (value TBA2) is defined in this document to carry the Block Number (8-bit) of the traffic counters in the LM query and response messages. The format of the Block Number TLV is shown in Figure 6:
</t>

        <figure anchor="ure-block-number-tlv">
          <name>Block Number TLV</name>
          <artwork name="" type="" align="left" alt=""><![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 = TBA2  |    Length     | Reserved    |R| Block Number  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>


<t>
The Length is a one-byte field and is equal to 2 bytes.
</t>

<t>
    The Block Number TLV is defined in the Mandatory TLV Type registry space <xref target="RFC6374" format="default"/>. 
    The querier MUST only insert one Block Number TLV in the query message to identify the Block Number for 
    the traffic counters in the forward direction. The responder that supports this TLV MUST only insert one 
    Block Number TLV in the response message to identify the Block Number for the traffic counters in the reverse direction. 
    The responder also MUST return the first Block Number TLV from the query message and ignore the other Block Number TLVs if present.
    The Block Number TLV is specific to a measurement session.
    The R flag is used to indicate the query and response message direction associated with the Block Number. 
    The R flag MUST be clear in the query message for the Block Number associated with Counter 1 and Counter 2, 
    and set in the response message for the Block Number associated with Counter 3 and Counter 4. 
    The Reserved field MUST be set to 0 and MUST be ignored on the receive side.
</t>

      </section>
    </section>

    <section anchor="sect-9" numbered="true" toc="default">
      <name>ECMP for SR-MPLS Policies</name>

      <t>
The SLs of an SR-MPLS Policy can have ECMPs between the source and transit nodes, between transit nodes, and between transit and destination nodes. Usage of node SID <xref target="RFC8402" format="default"/> by the SLs of an SR-MPLS Policy can result in ECMP paths. In addition, usage of Anycast SID <xref target="RFC8402" format="default"/> by the SLs of an SR-MPLS Policy can result in ECMP paths via transit nodes that are part of that Anycast group. The query and response messages SHOULD be sent to traverse different ECMP paths to measure the delay of each ECMP path of an SL.
</t>

<t>
The forwarding plane has various hashing functions available to forward packets on specific ECMP paths. For end-to-end SR-MPLS Policy delay measurement, different entropy label <xref target="RFC6790" format="default"/> values can be used in query and response messages to take advantage of the hashing function in the forwarding plane to influence the ECMP path taken by them.
</t>

<t>
The considerations for loss measurement for different ECMP paths of an SR-MPLS Policy are outside the scope of this document.
</t>

    </section>
    <section anchor="sect-10" numbered="true" toc="default">
      <name>Extended TE Link Metrics Advertisements</name>

      <t>
The extended TE metrics for link delay (namely, average delay, minimum delay, maximum delay and delay-variance) and packet loss can be computed using the performance measurement procedures described in this document and advertised in the routing domain as follows:
</t>

<ul spacing="normal">
    <li>For OSPF, ISIS, and BGP-LS, protocol extensions defined in <xref target="RFC7471" format="default"/>, <xref target="RFC8570" format="default"/>, and <xref target="RFC8571" format="default"/>, respectively, are used for advertising the extended TE link delay and loss metrics in the network.</li>
    <li>The extended TE link delay and loss metrics are advertised for Layer-2 LAG bundle member links in OSPF <xref target="RFC9356" format="default"/> and ISIS <xref target="RFC8668" format="default"/> using the same protocol extensions defined in <xref target="RFC7471" format="default"/> and <xref target="RFC8570" format="default"/>, respectively.</li>
    <li>The advertised delay-variance metric is computed as Packet Delay Variation (PDV), as described in Section 4.2 of <xref target="RFC5481" format="default"/>.</li>
</ul>

    </section>

    <section anchor="sect-11" numbered="true" toc="default">
      <name>Backwards Compatibility</name>

      <t>
The procedures defined in this document are backwards compatible with the procedures defined in <xref target="RFC6374" format="default"/> at both the querier and responder. If the responder does not support the new Mandatory TLV Types defined in this document; it MUST return Error 0x17: Unsupported Mandatory TLV Object as per <xref target="RFC6374" format="default"/>.
</t>

    </section>

    <section anchor="sect-12" numbered="true" toc="default">
      <name>Manageability Considerations</name>

      <t>
The manageability considerations described in Section 7 of <xref target="RFC6374" format="default"/> and Section 6 of <xref target="RFC7876" format="default"/> are applicable to this specification.
</t>

    </section>

    <section anchor="sect-13" numbered="true" toc="default">
      <name>Security Considerations</name>

      <t>
The security considerations specified in <xref target="RFC6374" format="default"/>, <xref target="RFC7471" format="default"/>, <xref target="RFC8570" format="default"/>, <xref target="RFC8571" format="default"/>, <xref target="RFC7876" format="default"/>, and <xref target="RFC9341" format="default"/> also apply to the procedures described in this document.
</t>

<t>
The procedure defined in this document is intended for deployment in a single operator administrative domain. As such, the querier node, responder node, forward, and return paths are provisioned by the operator for the probe session. It is assumed that the operator has verified the integrity of the forward and return paths of the probe packets.
</t>

<t>
The "Return Path" TLV extensions defined in this document may be used for potential address spoofing. For example, a query message may carry a return path that has a destination that is not local at the querier. To prevent such possible attacks, the responder may drop the query messages when it cannot determine whether the return path has the destination local at the querier. The querier may send a proper source address in the "Source Address" TLV that the responder can use to make that determination, for example, by checking the access control list provisioned by the operator.
</t>

    </section>

    <section anchor="sect-14" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>IANA is requested to allocate values for the following Mandatory
   TLV Types for <xref target="RFC6374" format="default"/> from the "MPLS Loss/Delay Measurement TLV Object" 
   registry contained within the "Generic Associated Channel (G-ACh) Parameters" registry set:</t>
      <table anchor="iana-tlv-type-tbl" align="center">
        <name>MPLS Loss/Delay Measurement TLV Types</name>
        <thead>
          <tr>
            <th align="left">Value</th>
            <th align="center">Description</th>
            <th align="left">Reference</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">TBA1</td>
            <td align="center">Return Path TLV</td>
            <td align="left">This document</td>
          </tr>
          <tr>
            <td align="left">TBA2</td>
            <td align="center">Block Number TLV</td>
            <td align="left">This document</td>
          </tr>
        </tbody>
      </table>

      <t>
The Block Number TLV is carried in the query and response messages, and the Return Path TLV is carried in the query messages.
</t>

<t>
IANA is requested to create a registry for "Return Path Sub-TLV Type." All code points in the range 0 through 175 in this registry shall be allocated according to the "IETF Review" procedure as specified in <xref target="RFC8126" format="default"/>. Code points in the range 176 through 239 in this registry shall be allocated according to the "First Come, First Served" procedure as specified in <xref target="RFC8126" format="default"/>. Remaining code points are allocated according to <xref target="iana-return-path-tbl" format="default"/>:
</t>

      <table anchor="iana-return-path-tbl" align="center">
        <name>Return Path Sub-TLV Type Registry</name>
        <thead>
          <tr>
            <th align="left">Value</th>
            <th align="center">Description</th>
            <th align="left">Reference</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">1 - 175</td>
            <td align="center">IETF Review</td>
            <td align="left">This document</td>
          </tr>
          <tr>
            <td align="left">176 - 239</td>
            <td align="center">First Come First Served</td>
            <td align="left">This document</td>
          </tr>
          <tr>
            <td align="left">240 - 251</td>
            <td align="center">Experimental Use</td>
            <td align="left">This document</td>
          </tr>
          <tr>
            <td align="left">252 - 254</td>
            <td align="center">Private Use</td>
            <td align="left">This document</td>
          </tr>
        </tbody>
      </table>
      <t>This document defines the following values in the Return Path Sub-TLV Type registry:</t>
      <table anchor="iana-return-path-type-tbl" align="center">
        <name>Return Path Sub-TLV Types</name>
        <thead>
          <tr>
            <th align="left">Value</th>
            <th align="center">Description</th>
            <th align="left">Reference</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">0</td>
            <td align="center">Reserved</td>
            <td align="left">This document</td>
          </tr>
          <tr>
            <td align="left">1</td>
            <td align="center">MPLS Label Stack of the Return Path</td>
            <td align="left">This document</td>
          </tr>
          <tr>
            <td align="left">255</td>
            <td align="center">Reserved</td>
            <td align="left">This document</td>
          </tr>
        </tbody>
      </table>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
    &RFC2119;
    &RFC6374;
    &RFC7876;
    &RFC8174;
    &RFC9341;
      </references>

      <references>
       <name>Informative References</name>
    &RFC3031;
    &RFC3032;
    &RFC5082;
    &RFC5481;
    &RFC5586;
    &RFC6790;
    &RFC7471;
    &RFC8126;
    &RFC8402;
    &RFC8570;
    &RFC8571;
    &RFC8668;
    &RFC9256;
    &RFC9356;
    &RFC9545;

      &I-D.ietf-mpls-inband-pm-encapsulation;

        <reference anchor="IEEE802.1AX">
          <front>
            <title>IEEE Standard for Local and metropolitan area networks - Link Aggregation</title>
            <author>
              <organization>
                   IEEE Std. 802.1AX
              </organization>
            </author>
            <date month="November" year="2008"/>
          </front>
        </reference>

      </references>
    </references>

    <section numbered="false" anchor="acknowledgments" toc="default">
      <name>Acknowledgments</name>

<t>
The authors would like to thank Thierry Couture and Ianik Semco for the discussions on the use cases for performance measurement in segment routing networks. The authors would like to thank Patrick Khordoc, Ruby Lin, and Haowei Shi for implementing the mechanisms defined in this document. The authors would like to thank Greg Mirsky and Xiao Min for providing many useful comments and suggestions. The authors would also like to thank Stewart Bryant, Sam Aldrin, Tarek Saad, and Rajiv Asati for their review comments. Thanks to Huaimo Chen, Yimin Shen, and Xufeng Liu for MPLS-RT expert review, Zhaohui Zhang for RTGDIR early review, Tony Li for shepherd's review, Ned Smith for SECDIR review, Roni Even for Gen-ART review, Marcus Ihlar for TSV-ART review, Dhruv Dhody for OPSDIR review, Gunter Van de Velde, Paul Wouters, and Roman Danyliw for IESG review.
</t>
      
    </section>
    <section numbered="false" anchor="contributors" toc="default">
      <name>Contributors</name>
      <artwork name="" type="" align="left" alt=""><![CDATA[
Sagar Soni
Cisco Systems, Inc.
Email: sagsoni@cisco.com

Zafar Ali
Cisco Systems, Inc.
Email: zali@cisco.com

Pier Luigi Ventre
CNIT
Italy
Email: pierluigi.ventre@cnit.it
]]></artwork>
    </section>
  </back>
</rfc>
