<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC6374 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6374.xml">
<!ENTITY RFC7876 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7876.xml">
<!ENTITY RFC8174 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC5481 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5481.xml">
<!ENTITY RFC6790 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6790.xml">
<!ENTITY RFC7679 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7679.xml">
<!ENTITY RFC7471 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7471.xml">
<!ENTITY RFC8126 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml">
<!ENTITY RFC8321 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8321.xml">
<!ENTITY RFC8402 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8402.xml">
<!ENTITY RFC8570 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8570.xml">
<!ENTITY RFC8571 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8571.xml">
<!ENTITY RFC8668 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8668.xml">
<!ENTITY RFC8799 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8799.xml">
<!ENTITY I-D.ietf-spring-segment-routing-policy SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-spring-segment-routing-policy.xml">
<!ENTITY I-D.ietf-pim-sr-p2mp-policy SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-pim-sr-p2mp-policy.xml">
<!ENTITY I-D.ietf-spring-sr-replication-segment SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-spring-sr-replication-segment.xml">
<!ENTITY I-D.shen-spring-p2mp-transport-chain SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.shen-spring-p2mp-transport-chain.xml">
<!ENTITY I-D.ietf-pce-binding-label-sid SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-pce-binding-label-sid.xml">
<!ENTITY I-D.ietf-spring-mpls-path-segment SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-spring-mpls-path-segment.xml">
<!ENTITY I-D.gandhi-mpls-ioam SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.gandhi-mpls-ioam.xml">
<!ENTITY I-D.ietf-lsr-ospf-l2bundles SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-lsr-ospf-l2bundles.xml">
<!ENTITY I-D.ietf-pce-sr-bidir-path SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-pce-sr-bidir-path.xml">
]>
<rfc submissionType="IETF" docName="draft-ietf-mpls-rfc6374-sr-03" category="std" ipr="trust200902">
    <!-- Generated by id2xml 1.5.0 on 2020-03-06T17:47:05Z -->
    <?rfc compact="yes"?>
    <?rfc text-list-symbols="o*+-"?>
    <?rfc subcompact="no"?>
    <?rfc sortrefs="no"?>
    <?rfc symrefs="yes"?>
    <?rfc strict="yes"?>
    <?rfc toc="yes"?>
    <front>
    <title abbrev="Using RFC 6374 for SR-MPLS Networks">Performance Measurement Using RFC 6374 for Segment Routing Networks with MPLS Data Plane</title>
    <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="25" month="July" year="2021"/>
    <workgroup>MPLS Working Group</workgroup>
    <abstract><t>
   Segment Routing (SR) leverages the source routing paradigm.  RFC 6374
   specifies protocol mechanisms to enable the 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.  
   This document utilizes these mechanisms for Performance
   Delay and Loss Measurements in SR networks with
   MPLS data plane (SR-MPLS), for both SR-MPLS links and end-to-end 
   SR-MPLS paths including Policies.  In addition, this document defines 
   Return Path TLV and Block Number TLV extensions for RFC 6374.</t>

    </abstract>
    </front>

    <middle>
    <section title="Introduction" anchor="sect-1"><t>
   Segment Routing (SR) leverages the source routing paradigm for Software Defined Networks
   (SDNs).  SR is applicable to both Multiprotocol Label Switching
   (SR-MPLS) and IPv6 (SRv6) data planes.  SR takes advantage of the
   Equal-Cost Multipaths (ECMPs) between source and transit nodes,
   between transit nodes and between transit and destination nodes.  SR
   Policies as defined in <xref target="I-D.ietf-spring-segment-routing-policy"/> are used
   to steer traffic through a specific, user-defined paths using a stack
   of Segments.  Built-in SR Performance Measurement (PM) is one of the
   essential requirements to provide Service Level Agreements (SLAs).</t>

    <t>
   <xref target="RFC6374"/> specifies protocol mechanisms to enable 
   the efficient and accurate measurement of performance metrics 
   in MPLS networks using query and response messages. 
   <xref target="RFC7876"/> specifies mechanisms for sending and
   processing out-of-band responses over an UDP return path when 
   receiving RFC 6374 based query messages. 
   These mechanisms are also well-suited in SR-MPLS networks.</t>

    <t>
   This document utilizes the mechanisms defined in <xref target="RFC6374"/> 
   for Performance Delay and Loss Measurements in SR-MPLS networks,
   for both SR-MPLS links and end-to-end SR-MPLS paths including Policies.
   In addition, this document defines Return Path TLV and Block Number TLV
   extensions for <xref target="RFC6374"/>.</t>


    </section>

    <section title="Conventions Used in This Document" anchor="sect-2"><section title="Requirements Language" anchor="sect-2.1"><t>
   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in <xref target="RFC2119"/> <xref target="RFC8174"/>
   when, and only when, they appear in all capitals, as shown here.</t>

    </section>

    <section title="Abbreviations" anchor="sect-2.2"><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>
   MPLS: Multiprotocol Label Switching.</t>

    <t>
   NTP: Network Time Protocol.</t>

    <t>
   PM: Performance Measurement.</t>

    <t>
   PSID: Path Segment Identifier.</t>

    <t>
   PTP: Precision Time Protocol.</t>

    <t>
   SID: Segment ID.</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>
   URO: UDP Return Object.</t>

    </section>

    <section title="Reference Topology" anchor="sect-2.3"><t>
   In the reference topology shown in Figure 1, the querier node Q1
   initiates a query message and the responder node R1 sends 
   a response message for the query message received.  The
   response message is sent back to the querier node Q1 in-band 
   on the same path (same set of links and nodes) or a different 
   path in the reverse direction.</t> 

   <t>SR is enabled with MPLS data plane on nodes Q1 and R1.
   The nodes Q1 and R1 may be directly connected via a link enabled with MPLS 
   (Section 2.9.1 of <xref target="RFC6374"/>) or a Point-to-Point (P2P) 
   SR-MPLS path <xref target="RFC8402"/>.
   The link may be a physical interface, virtual link,    
   or Link Aggregation Group (LAG) <xref target="IEEE802.1AX"/>, or 
   LAG member link.  The SR-MPLS path may be an SR-MPLS Policy  
   <xref target="I-D.ietf-spring-segment-routing-policy"/> on node Q1 
   (called head-end) with destination to node R1 (called tail-end).</t>  
 
    <figure title="Reference Topology" anchor="ure-reference-topology"><artwork><![CDATA[

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

    </section>

    <section title="Overview" anchor="sect-3">
    <t>For delay and loss measurement in SR-MPLS networks, the procedures 
    defined in <xref target="RFC6374"/> are used in this document. Note that 
    the one-way, two-way and round-trip delay measurements are 
    defined in Section 2.4 of <xref target="RFC6374"/> and are further 
    described in this document for SR-MPLS networks. Similarly,
    the packet loss measurement is defined in Section 2.2 of <xref target="RFC6374"/> 
    and is further described in this document for SR-MPLS networks.</t>

    <t>In SR-MPLS networks, the query and response messages 
    defined in <xref target="RFC6374"/> are sent as following:</t>

    <t><list style="symbols"><t>For delay measurement, the query 
    messages are sent in-band (on the same path as data traffic) 
    for SR-MPLS links and end-to-end SR-MPLS paths 
    to collect transmit and receive timestamps.</t>

    <t>For loss measurement, the query messages are 
    sent in-band (on the same path as data traffic) 
    for SR-MPLS links and end-to-end SR-MPLS paths 
    to collect transmit and receive traffic counters 
    (e.g. for traffic received on the incoming link for the 
    link packet loss and for the incoming Path Segment Identifier (PSID) <xref target="I-D.ietf-spring-mpls-path-segment"/> for 
    the end-to-end SR-MPLS path packet loss).</t>

    </list>
    </t>

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

    <t>The packet loss measurement using Alternate-Marking Method 
    defined in <xref target="RFC8321"/> requires collecting 
    Block Number of the traffic counters. This is achieved by 
    using the Block Number TLV extension defined in this document.</t>
    
    <t>The performance measurement procedure for SR-MPLS links can be used to compute
    extended Traffic Engineering (TE) metrics for delay and loss as described in
    this document. The metrics are advertised in the network using the routing protocol extensions
    defined in <xref target="RFC7471"/>, <xref target="RFC8570"/>, and <xref target="RFC8571"/>.</t>

    </section>

    <section title="Query and Response Messages" anchor="sect-4">
    <t>As described in Section 2.9.1 of <xref target="RFC6374"/>, the query and
    response messages flow over an MPLS Generic Associated Channel
    (G-ACh).  These query and response messages contain G-ACh Label (GAL)
    (value 13, with S=1).  The GAL is followed by an Associated Channel Header
    (ACH), where Channel Type identifies the measurement 
    message type, and the message payload
    following the ACH as shown in Figure 2.</t>

    <figure title="RFC 6374 Query and Response Message Header" anchor="ure-header-for-an-sr-mpls-link"><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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             GAL (value 13)            | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |0 0 0 1|Version| Reserved      |       Channel Type            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
    </figure>


    <section title="Query Message for SR-MPLS Links and Policies" anchor="sect-4.1">
       <section title="Query Message for SR-MPLS Links" anchor="sect-4.1.1"><t>
   A query message as shown in Figure 2 is sent over the SR-MPLS links
   for both delay and loss measurement using the procedures described 
   in <xref target="RFC6374"/>.  For SR-MPLS links, the TTL value is set to 255 
   in the SR-MPLS header.
   SR-MPLS encapsulation (e.g. using adjacency SID of the link)
   can be added for transmitting the query messages for SR-MPLS links.</t>

    </section>

        <section title="Query Message for SR-MPLS Policies" anchor="sect-4.1.2"><t>
   An SR-MPLS Policy may contain a number of Segment Lists (SLs) (i.e. stack of MPLS labels)
   <xref target="I-D.ietf-spring-segment-routing-policy"/>.  The 
   query messages MUST be transmitted for each SL of the SR-MPLS Policy.  
   A query message for an end-to-end SR-MPLS Policy, for both delay and loss measurement,
   contains an SR-MPLS label stack,
   with the G-ACh Label (GAL) at the bottom of the stack (with S=1) as shown in Figure 3.
   For SR-MPLS Policies, the TTL value is set to 255 in the SR-MPLS header.</t>

    <figure title="Example Query Message Header for an End-to-end SR-MPLS Policy" anchor="ure-header-for-an-end-to-end-sr-mpls-policy"><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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Label(1)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Label(n)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  GAL (value 13)       | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |0 0 0 1|Version| Reserved      |       Channel Type            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
    </figure>
    <t>
   The SR-MPLS label stack can be empty (format as shown in Figure 2) to
   indicate the Implicit NULL label case.</t>

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

    </section>
    </section>

    <section title="Response Message for SR-MPLS Links and Policies" anchor="sect-4.2">
        <section title="One-way Measurement Mode" anchor="sect-4.2.1"><t>
   In one-way measurement mode defined in 
   Section 2.4 of <xref target="RFC6374"/>, the querier
   can receive "out-of-band" response messages with 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"/> and includes the
   UDP-Destination-Port and IP Address.  When the querier
   sets an IP address and an UDP port in the URO TLV, the response message is 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 is set to "out-of-band response requested" <xref target="RFC6374"/>.</t>

   <t>In one-way delay measurement mode, as per Reference Topology in Figure 1, the timestamps 
   T1 and T2 are collected by the query and response messages. Both these timestamps 
   are used to measure one-way delay as (T2 - T1).</t>

    </section>

    <section title="Two-way Measurement Mode" anchor="sect-4.2.2"><t>
   In two-way measurement mode defined in Section 2.4 of <xref target="RFC6374"/>, 
   the response messages are sent back to the querier 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.</t>

   <t>For SR-MPLS links, the response message (format as shown in Figure 2) 
   is sent back on the same incoming link where the query 
   message is received.  In this case, the "Control Code" 
   in the query message is set to "in-band response requested" <xref target="RFC6374"/>.</t>

   <t>For end-to-end SR-MPLS paths, the responder transmits
   the response message (example as shown in Figure 3) 
   on a specific return SR-MPLS path 
   <xref target="I-D.ietf-pce-sr-bidir-path"/>.  The querier 
   can request in the query message to the responder to
   send the response message back on a given return path using the 
   SR-MPLS Segment List sub-TLV in the Return Path TLV defined in this document.</t>

   <t>In two-way delay measurement mode, as per Reference Topology in Figure 1, 
   all four timestamps T1, T2, T3, and T4 are collected by the query and 
   response messages.  All four timestamps are used to measure two-way 
   delay as ((T4 - T1) - (T3 - T2)).</t>

    </section>

    <section title="Loopback Measurement Mode" anchor="sect-4.2.3"><t>
   The Loopback measurement mode defined in Section 2.8 of <xref target="RFC6374"/> is
   used to measure round-trip delay for a bidirectional circular SR-MPLS path
   <xref target="I-D.ietf-pce-sr-bidir-path"/>.  
   In this mode, the received query messages are not punted
   out of the fast path in forwarding (i.e. to slow path or control-
   plane) at the responder.  In other words, the responder
   does not process them and generate response messages. 
   The loopback function simply returns the received
   query message to the querier without responder 
   modifications <xref target="RFC6374"/>.</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"/>.
   The label stack in query messages in this case carry 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 3).</t>

   <t>In loopback delay measurement mode, as per Reference Topology in Figure 1, 
   the timestamps T1 and T4 are collected by the query messages.  Both these 
   timestamps are used to measure round-trip delay as (T4 - T1).
   In this mode, the round-trip delay includes the processing delay on
   the responder.  The responder processing delay
   component includes only the time required to loop the test packet
   from the incoming interface to the outgoing interface in forwarding plane.
   </t>

    </section>

    </section>

    </section>

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

    <t>
   The DM message payload as defined in Section 3.2 of <xref target="RFC6374"/> is used
   for delay measurement, for both SR-MPLS links and end-to-end SR-MPLS Policies.</t>

    </section>

    <section title="Timestamps" anchor="sect-5.2"><t>
   The Section 3.4 of <xref target="RFC6374"/> defines timestamp format that can be
   used for delay measurement.  The IEEE 1588 Precision Time Protocol
   (PTP) timestamp format <xref target="IEEE1588"/> is used by default as described in
   Appendix A of <xref target="RFC6374"/>.</t> 

    </section>

    </section>

    <section title="Loss Measurement" anchor="sect-6"><t>
   The LM protocol can perform two distinct kinds of loss measurement as
   described in Section 2.9.8 of <xref target="RFC6374"/>.</t>

    <t><list style="symbols"><t>In inferred mode, LM will measure the loss of specially generated
      test messages in order to infer the approximate data plane loss
      level.  Inferred mode LM provides only approximate loss
      accounting.</t>

    <t>In direct mode, LM will directly measure data plane packet loss.
      Direct mode LM provides perfect loss accounting, but may require
      hardware support.</t>

    </list>
    </t>

   <section title="Loss Measurement Message Format" anchor="sect-6.1"><t>
   As defined in <xref target="RFC6374"/>, MPLS LM query and response messages
   use 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 following the
   ACH.  For both SR-MPLS links and end-to-end 
   SR-MPLS Policies, the same MPLS LM ACH value is used.</t>

   <t>The LM message payload as defined in Section 3.1 of <xref target="RFC6374"/> 
   is used for loss measurement, for both SR-MPLS links and end-to-end 
   SR-MPLS Policies.</t>

    </section>


    <section title="Combined Loss/Delay Measurement Message Format" anchor="sect-6.3"><t>
   As defined in <xref target="RFC6374"/>, Combined DM+LM query and response messages
   use 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 following the
   ACH.  For both SR-MPLS links and end-to-end 
   SR-MPLS Policies, the same MPLS DM+LM ACH value is used.</t>

    <t>
   The message payload as defined in Section 3.3 of <xref target="RFC6374"/> is used
   for combined delay and loss measurement, for both SR-MPLS links and end-to-end 
   SR-MPLS Policies.</t>
        </section>

    <section title="Counters" anchor="sect-6.4"><t>
   The Path Segment Identifier (PSID) <xref target="I-D.ietf-spring-mpls-path-segment"/> 
   carried in the received data packet for the traffic flow    
   under measurement can be used 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 4 can be used to associate the receive 
   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 4 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 title="Example With Path Segment Identifier for SR-MPLS Policy" anchor="ure-with-path-segment-identifier-for-sr-mpls-policy"><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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  PSID                 | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  GAL (value 13)       | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |0 0 0 1|Version| Reserved      |       Channel Type            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
    </figure>

   <t>Different values of PSID can be used to measure packet loss per
   SR-MPLS Policy, per Candidate Path or per Segment List of the 
   SR-MPLS Policy <xref target="I-D.ietf-spring-segment-routing-policy"/>.</t>
        </section>

    </section>

   <section title="TLV Extensions" anchor="sect-7">

        <section title="Return Path TLV Extension" anchor="sect-7.1"><t>
   In two-way measurement mode, the responder sends
   the response message on a specific return path.  The querier
   can request in the query message to the responder to
   send a response message back on a given return path (e.g. co-routed
   SR-MPLS path for two-way measurement). This way the responder 
   avoids creating and maintaining extra dynamic SR states for the return paths
   for two-way measurement.</t>

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

   <t><xref target="RFC6374"/> defines query and response messages those can include
   or more optional TLVs.  New TLV Type (TBA2) is defined in this
   document for Return Path TLV to carry return path information in query
   messages.  The format of the Return Path TLV is shown in Figure 5:</t>

    <figure title="Return Path TLV" anchor="ure-return-path-tlv"><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 = TBA2  |    Length     |      Reserved                 |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                    Return Path Sub-TLV                        |
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
    </figure>

    <t>
   The Return Path TLV is a Mandatory TLV Type.  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 response message back on 
   the return path specified in the Return Path TLV.  The responder
   also MUST NOT add 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 title="Return Path Sub-TLV Extension" anchor="sect-7.1.1">
   <t>The Return Path TLV contains a Sub-TLV to carry the return path. 
   The format of the SR-MPLS Segment List Sub-TLV is shown in Figure 6. 
   The SR-MPLS Segment List Sub-TLV contains SR-MPLS Label Stack. 
   The Label entries in the Segment List MUST be in network order. The SR-MPLS Segment List Sub-TLV 
   in the Return Path TLV is of the following Type:</t>

    <t><list style="symbols"><t>Type (value 1): SR-MPLS Segment List of the Return Path</t>

    </list>
    </t>

    <figure title="SR-MPLS Segment List Sub-TLV in Return Path TLV" anchor="ure-segment-list-sub-tlv-in-return-path-tlv"><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      |    Length     |      Reserved                 |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                    Label(1)                                   |
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                    Label(n) (bottom of stack)                 |
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
    </figure>


   <t>An SR-MPLS Segment List Sub-TLV may carry only Binding SID 
   <xref target="I-D.ietf-pce-binding-label-sid"/> of the Return SR-MPLS Policy.</t>
 
    <t>
   The Return Path TLV MUST carry only one Return Path Sub-TLV. 
   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, also MUST send 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>

   <t>Note that in addition to the P2P SR-MPLS paths, the SR-MPLS Segment List	
   Sub-TLV is also applicable to the P2MP SR-MPLS paths.  For example, for	
   P2MP SR-MPLS paths, it may only carry the Node Segment Identifier of the	
   querier in order for the response to follow an SR-MPLS 	
   path back to the querier.</t>

    </section>
    </section>

    <section title="Block Number TLV Extension" anchor="sect-7.2"><t>
   The direct mode loss measurement using Alternate-Marking Method 
   defined in <xref target="RFC8321"/> requires collecting Block 
   Number of the counters for the data traffic flow under measurement.
   To be able to correlate the transmit and receive traffic counters 
   of the matching Block Number, the Block Number of the traffic 
   counters is carried in the LM query and response messages.</t>

    <t>
   <xref target="RFC6374"/> defines query and response messages those can include
   one or more optional TLVs.  New TLV Type (value TBA1) 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 7:</t>

    <figure title="Block Number TLV" anchor="ure-block-number-tlv"><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 = TBA1  |    Length     | Reserved    |R| Block Number  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
    </figure>

    <t>
   The Block Number TLV is a Mandatory TLV Type. 
   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 inert 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 R Flag MUST be clear in the query message and set in the response message.
   The Reserved field MUST be set to 0 and MUST be ignored on the receive side.
    </t>

    </section>

    </section>


    <section title="Performance Measurement for P2MP SR-MPLS Policies" anchor="sect-8"><t>
   The Point-to-Multipoint (P2MP) SR-MPLS path that originates from a 
   root node terminates on multiple destinations called leaf nodes 
   (e.g. P2MP SR-MPLS Policy <xref target="I-D.ietf-pim-sr-p2mp-policy"/>).</t>

   <t>The procedures for delay and loss measurement described in this
   document for end-to-end P2P SR-MPLS Policies  
   are also equally applicable to the P2MP SR-MPLS Policies. 
   The procedure for one-way measurement is defined as following:</t>

    <t><list style="symbols"><t>The querier root node sends query messages using the
    Tree-SID defined in <xref target="I-D.ietf-pim-sr-p2mp-policy"/> for 
    the P2MP SR-MPLS Policy as shown in Figure 8.  The query messages 
    may contain the replication SID as defined in <xref target="I-D.ietf-spring-sr-replication-segment"/>.</t>

    <t>Destination Address TLV (Type 129) <xref target="RFC6374"/> is not applicable to the P2MP SR-MPLS Policy.</t>

    <t>Each responder leaf node MUST send its node address in the "Source Address" TLV (Type 130)
    <xref target="RFC6374"/> in the response messages.
    This TLV allows the querier root node to identify the responder
    leaf nodes of the P2MP SR-MPLS Policy.</t>

    <t>The P2MP root node measures the delay and loss
    performance for each P2MP leaf node individually.</t>

    </list>
    </t>

    <figure title="Example Query with Tree-SID for SR-MPLS Policy" anchor="ure-with-replication-segment-for-sr-mpls-policy"><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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |              Tree-SID                 | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |              GAL (value 13)           | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |0 0 0 1|Version| Reserved      |       Channel Type            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
    </figure>


   <t>The considerations for two-way measurement mode (e.g. for co-routed bidirectional SR-MPLS path)
   and loopback measurement mode for P2MP SR-MPLS Policy
   are outside the scope of this document.</t>

    </section>

    <section title="ECMP for SR-MPLS Policies" anchor="sect-9"><t>
   An SR-MPLS Policy can have ECMPs between the source and transit nodes,
   between transit nodes and between transit and destination nodes.
   Usage of Anycast SID <xref target="RFC8402"/> by an SR-MPLS Policy can result in ECMP
   paths via transit nodes part of that Anycast group.  The query and response 
   messages SHOULD be sent to traverse different ECMP paths to measure
   delay of each of the ECMP path of an SR-MPLS Policy.</t>

    <t>
   Forwarding plane has various hashing functions available to forward
   packets on specific ECMP paths.  For SR-MPLS Policy, sweeping of
   entropy label <xref target="RFC6790"/> values can be used in query 
   and response messages to take advantage of the hashing function in 
   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 title="SR-MPLS Link Extended TE Metrics Advertisements" anchor="sect-10"><t>
    The extended TE metrics for SR-MPLS link delay and loss can be 
    computed using the performance measurement procedures described
    in this document to advertise in the routing domain as follows:</t>

    <t><list style="symbols">
    <t>For OSPF, ISIS, and BGP-LS, protocol extensions 
    defined in <xref target="RFC7471"/>, <xref target="RFC8570"/>, 
    and <xref target="RFC8571"/>, respectively, are used for
    advertising the extended TE link delay and loss metrics in the network.</t>

    <t>The extended TE link delay and loss metrics are advertised for
    Layer-2 LAG bundle member links in OSPF <xref target="I-D.ietf-lsr-ospf-l2bundles"/> 
    and ISIS <xref target="RFC8668"/> using the same protocol extensions defined in
    <xref target="RFC7471"/> and <xref target="RFC8570"/>, respectively.</t>

    <t>The advertised delay-variance metric, Packet Delay Variation (PDV)
    is computed as described in Section 4.2 of <xref target="RFC5481"/>.</t>

    <t>In the absence of one-way delay measurement,
    the extended TE link one-way delay metrics can be computed using
    the two-way and round-trip delay values by dividing the values by 2.</t>

    </list>
    </t>

    </section>

    <section title="Backwards Compatibility" anchor="sect-11"><t>
   The procedures defined in this document are backwards compatible with 
   the procedures defined in <xref target="RFC6374"/> at both 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"/>.
   </t>

    </section>

    <section title="Security Considerations" anchor="sect-13"><t>
   This document describes the procedures for performance delay and loss
   measurement for SR-MPLS networks, for both SR-MPLS links and end-to-end 
   SR-MPLS Policies using the mechanisms defined in <xref target="RFC6374"/> and <xref target="RFC7876"/>.
   The security considerations covered in <xref target="RFC6374"/>, <xref target="RFC7471"/>,
   <xref target="RFC8570"/>, <xref target="RFC8571"/>, and <xref target="RFC7876"/>
   also apply to the procedures in this document.</t>

   <t>
   The procedure defined in this document is intended for deployment in limited
   domains <xref target="RFC8799"/>.  As such, it assumes that a querier node involved in the
   measurement operation has previously verified the integrity of the path
   and the identity of the far-end responder.</t>

   <t>
   If desired, attacks can be mitigated by performing basic validation
   and sanity checks, at the querier, of the timestamp and counter 
   fields in received response messages.  The minimal state associated
   with these protocols also limits the extent of measurement disruption
   that can be caused by a corrupt or invalid message to a single
   test cycle.</t>

   <t>
   The extensions defined in this document may be used for
   potential "proxying" attacks.  For example, a querier may
   specify a return path that has a destination different from that of
   the responder.  But normally, such attacks will not happen in an
   SR-MPLS domain where the queriers and responders belong to
   the same domain <xref target="RFC8799"/>.  In order to prevent using the extension defined in
   this document for proxying any possible attacks, the return path has
   destination to the same node where the forward path is from.  The
   responder may drop the query messages when it
   cannot determine whether the Return Path has the destination to the
   querier.</t>


    </section>

    <section title="IANA Considerations" anchor="sect-14">
    <t>IANA is requested to allocate a value for the following Mandatory
   Block Number TLV Type for  <xref target="RFC6374"/> to be carried in the 
   query and response messages from the "MPLS Loss/Delay Measurement TLV Object" 
   registry contained within the "Generic Associated Channel (G-ACh) Parameters" registry set:</t>

    <t><list style="symbols"><t>Type TBA1: Block Number TLV</t>

    </list>
    </t>
        
   <t>IANA is also requested to allocate a value for the following Mandatory
   Return Path TLV Type for <xref target="RFC6374"/> to be carried in the query
   messages from the "MPLS Loss/Delay Measurement TLV Object" registry 
   contained within the "Generic Associated Channel (G-ACh) Parameters" registry set:</t>

    <t><list style="symbols"><t>Type TBA2: Return Path TLV</t>

    </list>
    </t>

   <t>IANA is requested to create the “Return Path Sub-TLV” sub-registry as part of
   the Return Path TLV registry.  All code points in the range 1 through
   127 in this registry shall be allocated according to the "IETF
   Review" procedure as specified in <xref target="RFC8126"/>. Code points in the
   range 128 through 239 in this registry shall be allocated according
   to the "First Come First Served" procedure as specified in <xref target="RFC8126"/>.
   Remaining code points are allocated according to <xref target="iana-return-path-tbl"/>:</t>

     <texttable anchor="iana-return-path-tbl" title="Return Path Sub-TLV Type Sub-Registry">
    <ttcol align="left">Value</ttcol>
    <ttcol align="center">Description</ttcol>
    <ttcol align="left">Reference</ttcol>
     <c>0</c>
    <c>Reserved</c>
    <c>This document</c>
     <c>1 - 127</c>
    <c>Unassigned</c>
    <c>This document</c>
     <c>128 - 239</c>
    <c>Unassigned</c>
    <c>This document</c>
     <c>240 - 249</c>
    <c>Experimental</c>
    <c>This document</c>

     <c>250 - 254</c>
    <c>Private Use</c>
    <c>This document</c>
         <c>255</c>
    <c>Reserved</c>
    <c>This document</c>
   </texttable>
 

   <t>This document defines the following new values in the Return Path Sub-TLV sub-registry:</t>

     <texttable anchor="iana-return-path-type-tbl" title="Return Path Sub-TLV Types ">
    <ttcol align="left">Value</ttcol>
    <ttcol align="center">Description</ttcol>
    <ttcol align="left">Reference</ttcol>
     <c>1</c>
     <c>SR-MPLS Segment List of the Return Path</c>
     <c>This document</c>
   </texttable>

    </section>

    </middle>

    <back>
    <references title="Normative References">
    &RFC2119;
    &RFC6374;
    &RFC7876;
    &RFC8174;
    </references>
    <references title="Informative References">
    <reference anchor="IEEE1588"><front>
    <title>1588-2008 IEEE Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems</title>
    <author>
    <organization>IEEE</organization>
    </author>

    <date month="March" year="2008"/>
    </front>

    </reference>
    &RFC5481;
    &RFC6790;
    &RFC7471;
    &RFC8126;
    &RFC8321;
    &RFC8402;
    &RFC8570;
    &RFC8571;
    &RFC8668;
    &RFC8799;
    &I-D.ietf-spring-segment-routing-policy;
    &I-D.ietf-pim-sr-p2mp-policy;
    &I-D.ietf-spring-sr-replication-segment;
    &I-D.ietf-pce-binding-label-sid;
    &I-D.ietf-spring-mpls-path-segment;
    &I-D.ietf-lsr-ospf-l2bundles;
    &I-D.ietf-pce-sr-bidir-path;

    <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>
    <section title="Acknowledgments" numbered="no" anchor="acknowledgments"><t>
   The authors would like to thank Thierry Couture for the discussions
   on the use-cases for the performance measurement in segment routing
   networks.  Authors would like to thank Patrick Khordoc for 
   implementing the mechanisms defined in this document.
   The authors would like to thank Greg Mirsky 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.</t>

    </section>

    <section title="Contributors" numbered="no" anchor="contributors"><figure><artwork><![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>
    </figure>
    </section>

    </back>

    </rfc>
