<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" docName="draft-ietf-spring-stamp-srpm-13" category="info" ipr="trust200902" obsoletes="" updates="" xml:lang="en" sortRefs="false" consensus="yes" symRefs="true" tocInclude="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.12.0 -->
  <!-- Generated by id2xml 1.5.0 on 2020-02-06T01:41:26Z -->
    <front>
    <title abbrev="Using STAMP for Segment Routing">Performance Measurement Using Simple Two-Way Active Measurement Protocol (STAMP) for Segment Routing Networks</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-spring-stamp-srpm-13"/>
    <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="Mach(Guoyi) Chen" initials="M." surname="Chen">
      <organization>Huawei</organization>
      <address>
        <email>mach.chen@huawei.com</email>
      </address>
    </author>
    <author fullname="Richard Foote" initials="R." surname="Foote">
      <organization>Nokia</organization>
      <address>
        <email>footer.foote@nokia.com</email>
      </address>
    </author>
    <date day="04" month="March" year="2024"/>
    <workgroup>SPRING Working Group</workgroup>
    <abstract>
      <t>
   Segment Routing (SR) leverages the source routing paradigm.  SR is
   applicable to both Multiprotocol Label Switching (SR-MPLS) and IPv6
   (SRv6) data planes.  This document describes procedures  
   for Performance Measurement in SR networks using 
   Simple Two-Way Active Measurement Protocol (STAMP) defined in RFC 8762 
   and its optional extensions defined in RFC 8972 and further augmented in RFC 9503.
   The procedure described is used for links, end-to-end SR paths (including SR Policies 
   and SR Flexible Algorithm IGP paths) as well as Layer-3 and Layer-2 services in SR networks, and is applicable
   to both SR-MPLS and SRv6 data planes.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="sect-1" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
   Segment Routing (SR) leverages the source routing paradigm and
   greatly simplifies network operations for Software Defined Networks
   (SDNs).  SR is applicable to both Multiprotocol Label Switching
   (SR-MPLS) and IPv6 (SRv6) data planes <xref target="RFC8402" format="default"/>.  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="RFC9256" format="default"/> are used
   to steer traffic through a specific, user-defined paths using a stack
   of Segments.  A comprehensive SR Performance Measurement (PM) toolset is one of the
   essential requirements to measure network performance to provide Service Level Agreements (SLAs).</t>

      <t>The Simple Two-Way Active Measurement Protocol (STAMP) provides
   capabilities for the measurement of various performance
   metrics in IP networks <xref target="RFC8762" format="default"/>
   without the use of a control channel to pre-signal session parameters. 
   <xref target="RFC8972" format="default"/> defines optional extensions, in the form of TLVs, for STAMP.
   <xref target="RFC9503" format="default"/> augments that framework 
   to define STAMP extensions for SR networks.</t>

      <t>This document describes procedures for Performance Measurement in SR networks using 
   STAMP defined in <xref target="RFC8762" format="default"/> 
   and its optional extensions defined in <xref target="RFC8972" format="default"/> 
   and further augmented in <xref target="RFC9503" format="default"/>. 
   The procedure described is used for links, end-to-end SR paths <xref target="RFC8402" format="default"/> (including 
   SR Policies <xref target="RFC9256" format="default"/> and SR Flexible Algorithm (Flex-Algo) IGP paths 
   <xref target="RFC9350" format="default"/>) as well as Layer-3 (L3) and Layer-2 (L2) services in SR networks, and is applicable
   to both SR-MPLS and SRv6 data planes.</t>

    <t>STAMP requires protocol support on the Session-Reflector to process
   the received test packets, and hence the received test packets need to be punted 
   from the fast path in data plane and return test packets need to be generated. 
   This limits the scale for number test sessions and the ability to provide faster measurement interval.
   This document enhances the procedure for Performance Measurement using STAMP to improve the 
   scale for number of sessions and the interval for measurement of SR paths,
   for both SR-MPLS and SRv6 data planes by using timestamp and forward network programming function.</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> ECMP: Equal Cost Multi-Path.</t>
        <t> HMAC: Hashed Message Authentication Code.</t>
        <t> I2E: Ingress-To-Egress.</t>
        <t> IHS: Ingress-To-Egress, Hop-By-Hop or Select Scope.</t>
        <t> L2: Layer-2.</t>
        <t> L3: Layer-3.</t>
        <t> MBZ: Must be Zero.</t>
        <t> MNA: MPLS Network Action.</t>    
        <t> MPLS: Multiprotocol Label Switching.</t>
        <t> PSID: Path Segment Identifier.</t>
        <t> SHA: Secure Hash Algorithm.</t>
        <t> SID: Segment ID.</t>
        <t> SR: Segment Routing.</t>
        <t> SRH: Segment Routing Header.</t>
        <t> SR-MPLS: Segment Routing with MPLS data plane.</t>
        <t> SRv6: Segment Routing with IPv6 data plane.</t>
        <t> SSID: STAMP Session Identifier.</t>
        <t> STAMP: Simple Two-Way Active Measurement Protocol.</t>
        <t> TC: Traffic Class.</t>
        <t> TSF: Timestamp and Forward.</t>
        <t> TTL: Time To Live.</t>
        <t> VPN: Virtual Private Network.</t>
      </section>

      <section anchor="sect-2.3" numbered="true" toc="default">
        <name>Reference Topology</name>
   <t>
   As shown in Figure 1, Reference Topology, the STAMP Session-Sender S1 initiates a
   STAMP Session-Sender test packet and the STAMP Session-Reflector R1
   transmits a reply STAMP test packet.  The reply STAMP test packet may be transmitted 
   to the STAMP Session-Sender S1 on the same path (same set of links and nodes) or a different path 
   in the reverse direction from the path taken towards the Session-Reflector R1.</t>

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

   <t>The nodes S1 and R1 may be
   connected via a link or an SR path <xref target="RFC8402" format="default"/>.  
   The link may be a physical interface, virtual link, 
   or Link Aggregation Group (LAG) <xref target="IEEE802.1AX" format="default"/>, or LAG member. 
   The SR path may be an SR Policy <xref target="RFC9256" format="default"/> 
   on node S1 (called "head-end") with destination to node R1 (called "tail-end") 
   or SR Flex-Algo IGP path <xref target="RFC9350" format="default"/>. </t>

          <figure anchor="ure-reference-topology">
          <name>Reference Topology for One-Way and Two-Way Measurement Modes</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
                       T1                T2
                      /                   \
             +-------+     Test Packet     +-------+
             |       | - - - - - - - - - ->|       |
             |   S1  |=====================|   R1  |
             |       |<- - - - - - - - - - |       |
             +-------+  Reply Test Packet  +-------+
                      \                   /
                       T4                T3

         STAMP Session-Sender        STAMP Session-Reflector
]]></artwork>
        </figure>

      </section>
    </section>

    <section anchor="sect-3" numbered="true" toc="default">
      <name>Overview</name>
      <t>
    For performance measurement in SR networks, the STAMP Session-Sender and 
    Session-Reflector can use the base test packets defined <xref target="RFC8762" format="default"/>.
    However, the STAMP test packets defined in <xref target="RFC8972" format="default"/> 
    are preferred in SR environment because of the optional extensions.
    The STAMP test packets are encapsulated using IP/UDP header and 
    use the Destination UDP port 862 <xref target="RFC8762" format="default"/>, by default. In this document,
    the STAMP test packets using IP/UDP header are considered for SR networks, 
    where the STAMP test packets are further encapsulated with an SR-MPLS or SRv6 header.
    The STAMP test packets MUST carry the same IP/SR encapsulation as used by the data packets on the 
    SR path under measurement.
        </t>

    <t>The STAMP test packets are transmitted in measurement mode one-way, two-way, 
    loopback, or loopback with timestamp and forward function in SR networks. 
    Note that one-way and two-way measurement modes are referred to in <xref target="RFC8762" format="default"/> 
    and are further described for SR networks in this document.  
    </t>

    <t>
    The procedure defined in <xref target="RFC8762" format="default"/> is used to measure packet loss based 
    on the transmission and reception of the STAMP test packets.  
    The optional STAMP extensions defined in <xref target="RFC8972" format="default"/> are used for
    direct measurement of packet loss in SR networks.
    The measurement modes defined in this document 
    are also applicable to measure packet loss in SR networks.
    </t>

      <t>The STAMP test packets are transmitted on the same path as the data 
    traffic flow under measurement to measure the delay and packet 
    loss experienced by the data traffic flow.</t>
      <t>Typically, the STAMP test packets are transmitted along an IP path 
    between a Session-Sender and a Session-Reflector to measure delay and 
    packet loss along that IP path.  Matching forward direction and return  
    paths for STAMP test packets, even for directly connected 
    nodes are not guaranteed.</t>
      <t>If it is desired in SR networks that the same path (same set of 
    links and nodes) between the Session-Sender and Session-Reflector 
    be used for the STAMP test packets in both directions,
    it is achieved by using the optional STAMP extensions for SR-MPLS 
    and SRv6 networks specified in <xref target="RFC9503" format="default"/>.  
    The STAMP Session-Reflector uses the return path parameters 
    for the reply test packet from the received Session-Sender test packet,
    as described in <xref target="RFC9503" format="default"/>.
    </t>

      <section anchor="sect-3.1" numbered="true" toc="default">
        <name>Example STAMP Reference Model</name>
        <t>
    An example of a STAMP Reference Model with some of the typical measurement 
    parameters for STAMP test sessions is shown in Figure 2.</t>

        <figure anchor="ure-example-reference-model">
          <name>Example STAMP Reference Model</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
                            +------------+
                            | Controller |
                            +------------+
  Performance Measurement Mode  /    \
  Destination UDP Port         /      \      Destination UDP Port
  Authentication Mode         /        \     Authentication Mode
      Keychain               /          \        Keychain
  Timestamp Format          /            \   Timestamp Format 
  Protocol Mode            /              \  Protocol Mode
  Metric Type             /                \  
                         v                  v
                     +-------+          +-------+
                     |       |          |       |
                     |   S1  |==========|   R1  |
                     |       |          |       |
                     +-------+          +-------+

              STAMP Session-Sender  STAMP Session-Reflector
]]></artwork>
        </figure>
        <t>A Destination UDP port number MUST be selected for STAMP function as described in
    <xref target="RFC8762" format="default"/>.  The same Destination UDP 
    port can be used for STAMP test sessions for links, end-to-end SR paths, and L3 and L2 services in SR networks.
    In this case, the Destination UDP port does not distinguish between 
    the link, end-to-end SR path, or L3 and L2 service STAMP test sessions.
    The Source UDP port is chosen by the Session-Sender.
    The same or different UDP Source port can be used for different STAMP test 
    sessions and for STAMP test sessions for links, 
    end-to-end SR paths, and L3 and L2 services in SR networks.</t>

        <t>Examples of the Timestamp Format is Precision Time Protocol 64-bit truncated 
    (PTPv2) <xref target="IEEE1588" format="default"/> and Network Time Protocol (NTP).
    By default, the Session-Reflector replies in kind to the timestamp 
    format received in the received Session-Sender test packet, 
    as indicated by the "Z" flag in the Error Estimate field 
    as described in <xref target="RFC8762" format="default"/> and it can be based on the Session-Reflector capability.</t>

        <t>Examples of Performance Measurement Mode are one-way, two-way, 
    loopback, and loopback with timestamp and forward function as described in this document for SR networks.</t>

        <t>Examples of Delay Metric Type are one-way delay, round-trip delay, near-end (forward direction) and far-end 
    (backward direction) delay as defined in <xref target="RFC8762" format="default"/>, and loopback delay as defined in this document.</t>

        <t>Examples of Packet Loss Metric Type are round-trip, near-end (forward direction) and far-end 
    (backward direction) packet loss as defined in <xref target="RFC8762" format="default"/>.</t>

        <t>When using the authentication mode for the STAMP test sessions, the matching
    Authentication Type (e.g., HMAC-SHA-256) and Keychain MUST be configured
    on STAMP Session-Sender and STAMP Session-Reflector <xref target="RFC8762" format="default"/>.</t>

        <t>In case of One-Way Protocol Mode (default protocol mode is Two-Way), Session-Reflector does not transmit reply test packet. </t>

        <t>The controller shown in Figure 2 is used for provisioning STAMP test sessions on Session-Sender and Session-Reflector.
    Note that the YANG data model defined for STAMP in <xref target="I-D.ietf-ippm-stamp-yang" format="default"/> 
    can be used to provision the Session-Sender and Session-Reflector and also for streaming telemetry of the operational data.</t>

      </section>
    </section>
    <section anchor="sect-4" numbered="true" toc="default">
      <name>Delay Measurement in SR Networks</name>
      <section anchor="sect-4.1" numbered="true" toc="default">
        <name>Session-Sender Test Packet</name>
        <t>
   The content of an example Session-Sender test packet using an IP and  
   UDP header <xref target="RFC0768" format="default"/> is shown in Figure 3. 
   The payload contains the Session-Sender test 
   packet defined in Section 3 of <xref target="RFC8972" format="default"/>
   as transmitted in an IP network. 
   Note that <xref target="RFC8972" format="default"/> updates the Session-Sender 
   test packet defined in <xref target="RFC8762" format="default"/> 
   with optional STAMP Session Identifier (SSID).
   The SR encapsulation of the STAMP test packet is further described later in this document. 
        </t>
        <figure anchor="ure-dm-sender-test-packet">
          <name>Example Session-Sender Test Packet</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | IP Header                                                     |
 .  Source IP Address = Session-Sender IPv4 or IPv6 Address      .
 .  Destination IP Address=Session-Reflector IPv4 or IPv6 Address.
 .  IPv4 Protocol or IPv6 Next-header = UDP (17)                 .
 .                                                               .
 +---------------------------------------------------------------+
 | UDP Header                                                    |
 .  Source Port = Chosen by Session-Sender                       .
 .  Destination Port = User-configured Destination Port | 862    .
 .                                                               .
 +---------------------------------------------------------------+
 | Payload = Test Packet as specified in Section 3 of RFC 8972   |
 .           in Figure 1 and Figure 3                            .
 .                                                               .
 +---------------------------------------------------------------+
]]></artwork>
        </figure>
        <section anchor="sect-4.1.1" numbered="true" toc="default">
          <name>Session-Sender Test Packet for Links</name>
   <t>
   The Session-Sender test packet as shown in Figure 3 is 
   transmitted over the link for delay measurement.
   The local and remote IP addresses of the link MUST be used 
   as Source and Destination Addresses in the IP header of the Session-Sender test packets, respectively. 
   For IPv6 links, the link local addresses <xref target="RFC7404" format="default"/> can be used in the IPv6 header.
   An SR encapsulation (e.g., containing local adjacency SID of the link) can also be added for transmitting the Session-Sender test packets for links.
   </t>

   <t>
   The Session-Sender can use the local Address Resolution Protocol (ARP) table 
   or any other similar method to obtain the IP and MAC addresses for the links for transmitting STAMP packets.
   </t>

   <t>
   Note that the Session-Sender test packet is further encapsulated with a Layer-2 header containing 
   Session-Reflector MAC address as the Destination MAC address and Session-Sender MAC address as the Source MAC address for Ethernet links.
   </t>

   <t>
   For LAG member links, the STAMP extension for the Micro-Session ID TLV defined 
   in <xref target="RFC9534" format="default"/> is used to identify the member link.
   </t>
        </section>

          <section anchor="sect-4.1.2" numbered="true" toc="default">
            <name>Session-Sender Test Packet for SR-MPLS Policies</name>
   <t>
   An SR-MPLS Policy Candidate-Path can contain one or more Segment Lists.
   Each SR-MPLS Segment List contains a list of 32-bit Label Stack Entry
   (LSE) that includes a 20-bit label value, 8-bit Time-To-Live (TTL) value, 3-bit Traffic-Class (TC) 
   value and 1-bit End-Of-Stack (S) field.
   A Session-Sender test packet MUST be transmitted using each Segment List of the SR-MPLS Policy Candidate-Path for delay measurement.
   </t>

   <t>
   The content of an example Session-Sender test packet for an
   SR-MPLS Policy using the same SR-MPLS encapsulation as the data traffic is shown in Figure 4.</t>

            <figure anchor="ure-test-packet-for-sr-mpls-policy">
              <name>Example Session-Sender Test Packet for SR-MPLS Path</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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Segment(1)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Segment(n)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                PSID (optional)        | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Test Packet as shown in Figure 3               |
 .                                                               .
 +---------------------------------------------------------------+
]]></artwork>
            </figure>

          <t>The head-end node address of the SR-MPLS Policy 
   MUST be used as the Source Address in the IP header of the Session-Sender test packet. 
   The endpoint address of the SR-MPLS Policy MUST be
   used as the Destination Address in the IP header of the Session-Sender test packet.</t>

   <t>The Segment List can be empty in the case of a single-hop SR path with Implicit NULL label. 
   The Session-Reflector may need to receive Session-Sender test packets with no MPLS header, for example, when using Penultimate Hop Popping (PHP).
   In both these cases, the Destination Address in IP header ensures the test packet reaches the Session-Reflector.</t>

   <t>In the case of SR-MPLS Policy with Color-Only Destination Steering, with endpoint as unspecified address 
   (the null endpoint is 0.0.0.0 for IPv4 or :: for IPv6 (all bits set to the 0 value)) as 
   defined in Section 8.8.1 of <xref target="RFC9256" format="default"/>,
   the loopback address from the range 127/8 for IPv4, or the loopback address ::1/128 
   for IPv6 <xref target="RFC4291" format="default"/> can be used as the Destination 
   Address in the IP header of the Session-Sender test packets, respectively.
   In this case, the SR-MPLS encapsulation MUST ensure the Session-Sender test packets reach the endpoint of the SR Policy
   (for example, by adding the Prefix SID of the SR-MPLS Policy endpoint in the Segment List if required).</t>
        
   <t>The Path Segment Identifier (PSID) <xref target="RFC9545" format="default"/> of
   an SR-MPLS Policy (either for Segment List or for Candidate-Path) can be added in the Segment List of the STAMP test packets as shown in Figure 4,
   and can be used for direct measurement as described in Section 8, "Direct Measurement in SR Networks".</t>
    </section>

    <section anchor="sect-4.1.3" numbered="true" toc="default">
            <name>Session-Sender Test Packet for SRv6 Policies</name>
            <t>
   An SRv6 Policy Candidate-Path can contain one or more Segment Lists.
   Each Segment List can contain a number of SRv6 SIDs as defined in <xref target="RFC8986" format="default"/>.
   A Session-Sender test packet MUST be transmitted using each Segment List of the SRv6 Policy Candidate-Path for delay measurement.
   A packet can contain an outer IPv6 header and SRv6 Segment Routing Header (SRH) carrying 
   a Segment List as described in <xref target="RFC8754" format="default"/>. 
   </t>

   <t>
   The content of an example Session-Sender test packet for an  
   SRv6 Policy using the same IPv6/SRH encapsulation as the data traffic is shown in Figure 5.</t>
            <figure anchor="ure-test-packet-for-srv6-policy">
              <name>Example Session-Sender Test Packet for SRv6 Path</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | IP Header                                                     |
 .  Source IP Address = Session-Sender IPv6 Address              .
 .  Destination IP Address = Segment List[Segments Left]         . 
 .  Next-Header = 43, Routing Type = SRH (4)                     .
 .                                                               .
 +---------------------------------------------------------------+
 | SRH as specified in RFC 8754                                  |
 .  <PSID (optional), Segment List>                              .
 .  Next-Header = UDP (17)                                       .
 .                                                               .
 +---------------------------------------------------------------+
 | UDP Header                                                    |
 .  Source Port = Chosen by Session-Sender                       .
 .  Destination Port = User-configured Destination Port | 862    .
 .                                                               .
 +---------------------------------------------------------------+
 | Payload = Test Packet as specified in Section 3 of RFC 8972   |
 .           in Figure 1 and Figure 3                            .
 .                                                               .
 +---------------------------------------------------------------+

     Example 1: Without Using Inner IPv6 Header

 +---------------------------------------------------------------+
 | IP Header                                                     |
 .  Source IP Address = Session-Sender IPv6 Address              .
 .  Destination IP Address = Session-Reflector IPv6 Address |    .
 .                           Segment List[Segments Left]         . 
 .  Next-Header = 43, Routing Type = SRH (4)                     .
 .                                                               .
 +---------------------------------------------------------------+
 | SRH as specified in RFC 8754                                  |
 .  <PSID (optional), Segment List>                              .
 .  Next-Header = 43 (IPv6)                                      .
 .                                                               .
 +---------------------------------------------------------------+
 |                Test Packet as shown in Figure 3               |
 +---------------------------------------------------------------+

     Example 2: Using Inner IPv6 Header
]]></artwork>
            </figure>

   <t>The head-end node address of the SRv6 Policy 
   MUST be used as the Source Address in the IPv6 header of the Session-Sender test packet.
   </t>

   <t>The Segment List of the SRv6 Policy Candidate-Path can be empty. In this case, the endpoint address
   of the SRv6 Policy is used as the Destination Address in the IPv6 header of the Session-Sender test packet.
   </t>

   <t>
   Note that the Session-Sender test packets can be transmitted with or without adding the inner IP header with Source Address 
   of the Session-Sender and Destination Address of the Session-Reflector after the IPv6/SRH.
   In case of Penultimate Segment Popping (PSP), where IPv6/SRH encapsulation is removed on the penultimate node,
   Inner IP header MUST be added for the test packets to reach the Session-Reflector node.
   When inner IP header is not added, the Session-Sender MUST ensure that 
   the Session-Sender test packets using the Segment List reach the Session-Reflector (for example, by adding the Prefix 
   SID or IPv6 address of the SR Policy endpoint in the Segment List if required).</t>
        
   <t>The SRv6 network programming is described in <xref target="RFC8986" format="default"/>. 
   The procedure defined for Upper-Layer (UL) Header processing for SRv6 End SIDs 
   in Section 4.1.1 of <xref target="RFC8986" format="default"/>
   MUST be used to process the IPv6/UDP header in the received Session-Sender test packets
   on the Session-Reflector.</t>

   <t>The Path Segment Identifier (PSID) <xref target="I-D.ietf-spring-srv6-path-segment" format="default"/> of
   the SRv6 Policy (either for Segment List or for Candidate-Path) can be added in the Segment List of the STAMP test packets as shown in Figure 5 
   and can be used for direct measurement as described in 
   Section 8, "Direct Measurement in SR Networks".</t>

          </section>


     <section anchor="sect-4.1.4." numbered="true" toc="default">
         <name>Session-Sender Test Packet for SR Flexible Algorithm IGP Path</name>

     <t>The delay measurement procedure for end-to-end SR paths is also 
     applicable to SR-MPLS and SRv6 Flex-Algo IGP paths.</t>

     <t>Flex-Algo in IGP in SR networks <xref target="RFC9350" format="default"/> 
     has Prefix SIDs advertised by the nodes for each Flex-Algo.
     The STAMP test packets for delay measurement MUST be transmitted on the Flex-Algo path 
     using the same SR encapsulation as the data traffic under measurement.
     </t>

     <t>For delay measurement of an SR-MPLS Flex-Algo IGP path, the Session-Sender test packets MUST carry the 
     Flex-Algo Prefix SID of the Session-Reflector for that Flex-Algo IGP path in the MPLS header.</t>

     <t>For delay measurement of an SRv6 Flex-Algo IGP path, the Session-Sender test packets MUST carry the 
     Flex-Algo Prefix SIDs of the Session-Sender and Session-Reflector for that Flex-Algo IGP path as the Source Address  
     and Destination Address in the IPv6 header, respectively.</t>

      </section>


      <section anchor="sect-4.1.5" numbered="true" toc="default">
        <name>Session-Sender Test Packet for P2MP SR Policies</name>
      <t>
      The delay measurement procedure 
      for end-to-end SR-MPLS and SRv6 Policies is equally applicable to the P2MP SR-MPLS and SRv6 Policies.</t> 

      <t>The Point-to-Multipoint (P2MP) SR path
      that originates from a root node terminates on multiple destinations called leaf nodes 
      (e.g., P2MP SR Policy <xref target="I-D.ietf-pim-sr-p2mp-policy" format="default"/> Candidate-Path).
      The Session-Sender root node MUST transmit the Session-Sender test packets using the
      Segment Lists and that may contain replication SIDs
      <xref target="RFC9524" format="default"/> for delay measurement.</t>

      <t>
      The Source Address in the Session-Sender test packets MUST be set to the address of the 
      root-node of the P2MP SR-MPLS and SRv6 Policy.
      </t>

      <t>
      For P2MP SR-MPLS path, the Destination Address in the Session-Sender test packets MUST be set to a loopback 
      address from the range 127/8 for IPv4, or the loopback address ::1/128 for IPv6.
      The SR encapsulation MUST ensure the Session-Sender test packets reach the leaf nodes of the P2MP SR Policy.
      </t>

      <t>
      The Session-Reflector on the leaf node MUST add its address as Source Address in the Session-Reflector test packet.
      The P2MP root node measures the delay and packet loss for each leaf node independently using the 
      Source Address of the leaf node from the received Session-Reflector reply test packets.
      </t>

      <t>The <xref target="I-D.mirsky-ippm-asymmetrical-pkts" format="default"/> defines extensions for using STAMP for performance measurement in multicast environment. 
      Those extensions also apply to the performance measurement for P2MP SR Policies.
      </t>

      </section>


     <section anchor="sect-4.1.6" numbered="true" toc="default">
        <name>Session-Sender Test Packet for Layer-3 Service over SR Path</name>

     <t>The delay measurement procedure defined in this document for end-to-end SR path is also applicable to 
     L3 services in an SR network for both SR-MPLS and SRv6 data planes.</t>

     <section anchor="sect-4.1.6.1" numbered="true" toc="default">
          <name>Session-Sender Test Packet for Layer-3 Service over SR-MPLS Path</name>
     <t>
     For delay measurement of end-to-end L3 service over SR-MPLS path, the same SR-MPLS label stack as the 
     data packets of the L3 service including the L3VPN SR-MPLS label (advertised by the 
     Session-Reflector) is used to transmit Session-Sender test packets as shown in Figure 6.</t>


            <figure anchor="ure-test-packet-for-sr-l3-mpls">
              <name>Example Session-Sender Test Packet for L3 Service over SR-MPLS Path</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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Segment(1)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                L3VPN Segment          | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Test Packet as shown in Figure 3               |
 .                   Destination IP Address in L3VPN table       .
 .                                                               .
 +---------------------------------------------------------------+
]]></artwork>
            </figure>


     <t>
     An IP header (as shown in Figure 3) MUST be added in the Session-Sender test packets after the SR-MPLS encapsulation. 
     The Destination Address of the Session-Reflector added in the IP header MUST be 
     reachable via the IP table lookup associated with the L3VPN SR-MPLS label added. 
     </t>
      </section>

    <section anchor="sect-4.1.6.2" numbered="true" toc="default">
          <name>Session-Sender Test Packet for Layer-3 Service over SRv6 Path</name>
    <t>
    For delay measurement of end-to-end L3 service over SRv6 path, the same IPv6/SRH encapsulation as the 
    data packets of the L3 service including the L3VPN SRv6 SID instantiated on the 
    Session-Reflector (for example, End.DT6 SID instance, End.DT4 SID instance, End.DT46 instance, 
    defined in <xref target="RFC8986" format="default"/>) is used to transmit Session-Sender test packets as shown in Figure 7. </t>


            <figure anchor="ure-test-packet-for-srv6-l3">
              <name>Example Session-Sender Test Packet for L3 Service over SRv6 Path</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | IP Header                                                     |
 .  Source IP Address = Session-Sender IPv6 Address              .
 .  Destination IP Address = Segment List[Segments Left]         . 
 .  Next-Header = 43, Routing Type = SRH (4)                     .
 .                                                               .
 +---------------------------------------------------------------+
 | SRH as specified in RFC 8754                                  |
 .  <Segment List including End.DT4/DT6/DT46 SID>                .
 .  Next-Header = UDP (17)                                       .
 .                                                               .
 +---------------------------------------------------------------+
 | UDP Header                                                    |
 .  Source Port = Chosen by Session-Sender                       .
 .  Destination Port = User-configured Destination Port | 862    .
 .                                                               .
 +---------------------------------------------------------------+
 | Payload = Test Packet as specified in Section 3 of RFC 8972   |
 .           in Figure 1 and Figure 3                            .
 .                                                               .
 +---------------------------------------------------------------+

     Example 1: Without Using Inner IP Header
 
 +---------------------------------------------------------------+
 | IP Header                                                     |
 .  Source IP Address = Session-Sender IPv6 Address              .
 .  Destination IP Address = Segment List[Segments Left]         . 
 .  Next-Header = 43, Routing Type = SRH (4)                     .
 .                                                               .
 +---------------------------------------------------------------+
 | SRH as specified in RFC 8754                                  |
 .  <Segment List including End.DT4/DT6/DT46 SID>                .
 .  Next-Header = 43 (IPv6)                                      .
 .                                                               .
 +---------------------------------------------------------------+
 | IP Header                                                     |
 .  Source IP Address = Session-Sender IPv4 or IPv6 Address      .
 .  Destination IP Address=Session-Reflector IPv4 or IPv6 Address.
 .                         in L3VPN table                        .
 .  IPv4 Protocol or IPv6 Next-header = UDP (17)                 .
 .                                                               .
 +---------------------------------------------------------------+
 | UDP Header                                                    |
 .  Source Port = Chosen by Session-Sender                       .
 .  Destination Port = User-configured Destination Port | 862    .
 .                                                               .
 +---------------------------------------------------------------+
 | Payload = Test Packet as specified in Section 3 of RFC 8972   |
 .           in Figure 1 and Figure 3                            .
 .                                                               .
 +---------------------------------------------------------------+

     Example 2: Using Inner IP Header
]]></artwork>
            </figure>

    <t>
    An optional inner IP header MAY be added in the Session-Sender test packets after the IPv6/SRH encapsulation. 
    The Destination Address of the Session-Reflector added 
    in the inner IP header MUST be reachable via the IPv4 or IPv6 table lookup associated with the L3VPN SRv6 SID added. 
    </t>
          </section>

      </section>

    <section anchor="sect-4.1.7" numbered="true" toc="default">
        <name>Session-Sender Test Packet for Layer-2 Service over SR Path</name>

     <t>The delay measurement procedure defined in this document for end-to-end SR path is also applicable to 
     L2 services in an SR network for both SR-MPLS and SRv6 data planes.</t>

    <section anchor="sect-4.1.7.1" numbered="true" toc="default">
          <name>Session-Sender Test Packet for Layer-2 Service over SR-MPLS Path</name>
     <t>
     For delay measurement of end-to-end L2 service over SR-MPLS path, the same SR-MPLS label stack as the 
     data packets of the L2 service including the L2VPN SR-MPLS label (advertised by the Session-Reflector) 
     is used to transmit Session-Sender test packets as shown in Figure 8. </t> 

     <t>
     The L2VPN SR-MPLS label is added with a TTL value of 1 in order to punt the Session-Sender test packet from data plane to 
     CPU or slow path on Session-Reflector for STAMP processing. 
     </t>


            <figure anchor="ure-test-packet-for-sr-l2-mpls">
              <name>Example Session-Sender Test Packet for L2 Service over SR-MPLS Path</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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Segment(1)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                L2VPN Segment          | TC  |1|    TTL=1      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Test Packet as shown in Figure 3               |
 .                                                               .
 +---------------------------------------------------------------+
]]></artwork>
            </figure>

     <t>
     An IP header as shown in Figure 3 MUST be added in the Session-Sender test packets after the MPLS header. 
     It contains the Source Address of the Session-Sender and Destination Address of the Session-Reflector. 
     </t>
      </section>

          <section anchor="sect-4.1.7.2" numbered="true" toc="default">
          <name>Session-Sender Test Packet for Layer-2 Service over SRv6 Path</name>
     <t>
     For delay measurement of end-to-end L2 service over SRv6 path, the same IPv6/SRH encapsulation as the 
     data packets of the L2 service including the L2VPN SRv6 SID instantiated on the Session-Reflector (for example, End.DT2U SID instance  
     defined in <xref target="RFC8986" format="default"/>) is used to transmit Session-Sender test packets as shown in Figure 9. </t> 


            <figure anchor="ure-test-packet-for-srv6-l2">
              <name>Example Session-Sender Test Packet for L2 Service over SRv6 Path</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | IP Header                                                     |
 .  Source IP Address = Session-Sender IPv6 Address              .
 .  Destination IP Address = Segment List[Segments Left]         . 
 .  Next-Header = 43, Routing Type = SRH (4)                     .
 .                                                               .
 +---------------------------------------------------------------+
 | SRH as specified in RFC 8754                                  |
 .  <Segment List including End.DT2U SID>                        .
 .  Next-Header = UDP (17)                                       .
 .                                                               .
 +---------------------------------------------------------------+
 | UDP Header                                                    |
 .  Source Port = Chosen by Session-Sender                       .
 .  Destination Port = User-configured Destination Port | 862    .
 .                                                               .
 +---------------------------------------------------------------+
 | Payload = Test Packet as specified in Section 3 of RFC 8972   |
 .           in Figure 1 and Figure 3                            .
 .                                                               .
 +---------------------------------------------------------------+
]]></artwork>
            </figure>

       </section>

      </section>
   </section>

      <section anchor="sect-4.2" numbered="true" toc="default">
        <name>Session-Reflector Test Packet</name>
        <t>
   The Session-Reflector decapsulates the outer IP header (if present) and the SR 
   header (SR-MPLS header or IPv6/SRH if present) from the received Session-Sender test packets.
   The Session-Reflector reply test packet is generated using the information from the IP/UDP
   header of the received Session-Sender test packet as shown in Figure 10.
   </t>

        <figure anchor="ure-test-reply-packet">
          <name>Example Session-Reflector Test Packet</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | IP Header                                                     |
 .  Source IP Address                                            .
 .     = Destination IP Address from Session-Sender Test Packet  . 
 .  Destination IP Address                                       .
 .     = Source IP Address from Session-Sender Test Packet       .
 .  IPv4 Protocol or IPv6 Next-header = UDP (17)                 .
 .                                                               .
 +---------------------------------------------------------------+
 | UDP Header                                                    |
 .  Source Port                                                  . 
 .     = Destination Port from Session-Sender Test Packet        .
 .  Destination Port                                             . 
 .     = Source Port from Session-Sender Test Packet             .
 .                                                               .
 +---------------------------------------------------------------+
 | Payload = Test Packet as specified in Section 3 of RFC 8972   |
 .           in Figure 2 and Figure 4                            .
 .                                                               .
 +---------------------------------------------------------------+
]]></artwork>
        </figure>

    <t>
   The payload contains the Session-Reflector test 
   packet defined in Section 3 of <xref target="RFC8972" format="default"/>.</t>

        <section anchor="sect-4.2.1" numbered="true" toc="default">
          <name>One-Way Measurement Mode</name>
          <t>
   In one-way measurement mode, a reply test packet
   with the contents as shown in Figure 10 is transmitted by the Session-Reflector,
   for links, end-to-end SR paths and L3 and L2 services in SR networks. The Session-Reflector reply test packet can be 
   transmitted in the reverse direction on the same path as the forward direction or a 
   different path than the forward direction to the Session-Sender.</t>

          <t>In this mode, as per Reference Topology, 
   all timestamps T1, T2, T3, and T4 are collected by the STAMP test packets.
   However, only timestamps T1 and T2 are used to measure one-way delay as (T2 - T1).
   Note that the delay value (T2 - T1) is referred to as near-end (forward direction) one-way delay
   and the delay value (T4 - T3) is referred to as far-end (backward direction) one-way delay.
   The one-way measurement mode requires the clocks on the Session-Sender 
   and Session-Reflector to be synchronized.</t>

        <section anchor="sect-4.2.1.1" numbered="true" toc="default">
          <name>One-Way Protocol Mode</name>
      <t>In one-way protocol mode, Session-Reflector does not generate and transmit reply test packet upon
   receiving Session-Sender test packet.

   The Session-Sender can request in the test packet to the 
   Session-Reflector to not transmit the reply test packet using 
   the "No Reply Requested" flag in the Control Code Sub-TLV in the Return 
   Path TLV defined in <xref target="RFC9503" format="default"/>.

   Alternatively, Session-Reflector can be provisioned with protocol mode as one-way 
   or using a different destination UDP port.
   In this case, only timestamps T1 and T2 are collected by the STAMP Session-Sender test packets and 
   one-way delay value (T2 - T1) is measured by the Session-Reflector.
          </t>
        </section>

        </section>
        <section anchor="sect-4.2.2" numbered="true" toc="default">
          <name>Two-Way Measurement Mode</name>
          <t>
   In two-way measurement mode, a reply test packet as shown in 
   Figure 10 SHOULD be transmitted by the Session-Reflector 
   on the same path in the reverse direction as the forward direction, 
   e.g., on the same link in the reverse direction or on the reverse SR path associated with the forward SR path 
   <xref target="I-D.ietf-pce-sr-bidir-path" format="default"/>, or reverse SR Flex-Algo IGP path associated with the forward SR Flex-Algo IGP path, 
   or over same L3 and L2 service in the reverse direction.</t>

          <t>In two-way measurement mode for links, the Session-Sender may request in the test packet to the 
   Session-Reflector to transmit the reply test packet back on the same link in the reverse direction, for example, in an ECMP environment.
   It can use the "Reply Requested on the Same Link" flag in the Control Code Sub-TLV 
   in the Return Path TLV defined in <xref target="RFC9503" format="default"/> for this request.
          </t>

          <t>In two-way measurement mode for end-to-end SR paths, the Session-Sender
   may request in the test packet to the Session-Reflector to
   transmit the reply test packet back on a specific return SR path, for example, in an ECMP environment.
   It can use a Segment List sub-TLV in the Return Path TLV defined in <xref target="RFC9503" format="default"/> for this request.
          </t>

          <t>In two-way measurement mode for SR Flex-Algo IGP paths, the Session-Sender
   may request in the test packet to the Session-Reflector to
   transmit the reply test packet back on the same SR Flex-Algo IGP paths in the reverse direction using
   Segment List sub-TLV in the Return Path TLV defined in <xref target="RFC9503" format="default"/>.
          </t>

   <t>In two-way measurement mode for L3 services, the Session-Reflector
   can derive the L3 service in the reverse direction using the L3VPN SID
   received in the Session-Sender test packets to transmit the Session-Reflector test packets.
   The Source Address added in the IP header of the Session-Sender test packets MUST be reachable 
   via the IP table lookup associated with the L3 service in the reverse direction. 
          </t>

     <t>In two-way measurement mode for L2 services, the Session-Reflector
   can derive the L2 service in the reverse direction using the L2VPN SID
   received in the Session-Sender test packets to transmit the Session-Reflector test packets.
          </t>

          <t>In this mode, as per Reference Topology, all timestamps T1, T2, T3, and T4 are collected by the STAMP test packets.
   All four timestamps are used to measure round-trip delay as ((T4 - T1) - (T3 - T2)).
          </t>

        </section>

     </section>
     </section>

        <section anchor="sect-5" numbered="true" toc="default">
          <name>Loopback Measurement Mode in SR Networks</name>
          <t>
   The Session-Sender test packets are transmitted in loopback measurement mode to 
   measure loopback delay of a bidirectional circular path. In this mode,  
   the received Session-Sender test packets MUST NOT be punted out of the fast path in data plane  
   (i.e., to slow path or control-plane) at the Session-Reflector. In other words, 
   the Session-Reflector does not process them and generate Session-Reflector test packets.
   This is a new measurement mode, not defined by the STAMP process in   
   <xref target="RFC8762" format="default"/>.
       </t>

          <figure anchor="ure-reference-topology-for-loopback">
          <name>Reference Topology for Loopback Measurement Mode</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
                       T1 
                      /  
             +-------+     Test Packet     +-------+
             |       | - - - - - - - - - - |       |
             |   S1  |====================||   R1  |
             |       |<- - - - - - - - - - |       |
             +-------+  Return Test Packet +-------+
                      \                    Loopback 
                       T4

         STAMP Session-Sender 
]]></artwork>
            </figure>

          <t>In this mode, as shown in Figure 11, Reference Topology for Loopback Measurement Mode, the Session-Sender test packet received back 
   at the Session-Sender retrieves the timestamp T1 from the test packet and collects the receive timestamp T4 locally. 
   Both these timestamps are used to measure the loopback delay as (T4 - T1).  
   The loopback delay includes the STAMP test packet processing delay on the Session-Reflector component.
   The Session-Reflector processing delay component includes only the time
   required to loop the STAMP test packet from the incoming interface to the
   outgoing interface in the data plane. The Session-Reflector does not timestamp 
   the test packets and hence does not need timestamping capability.
          </t>

   <section anchor="sect-5.1" numbered="true" toc="default">
            <name>Loopback Measurement Mode STAMP Packet Processing</name>
   <t>The Session-Sender MUST set the Destination UDP port to 
   the UDP port it uses to receive the return Session-Reflector test packets (other than the UDP Destination port 862 which is used by the STAMP Session-Reflector).
   The same UDP port can be used as the Source UDP port in the Session-Sender test packet.
   </t>

   <t>
   The Session-Reflector does not support the STAMP process, hence the loopback function simply 
   processes the encapsulation including IP and SR headers (but does not process the UDP header)  
   to forward the received Session-Sender test packet to the Session-Sender 
   without STAMP modifications defined in <xref target="RFC8762" format="default"/>.
   </t>
   <t>The Session-Sender can use the STAMP Session ID (SSID) field in the received STAMP test packet 
   or local configuration to identify its STAMP test session that uses the loopback measurement mode.
   In this mode, at the Session-Sender, the 'Session-Sender Sequence Number', 'Session-Sender Timestamp', 
   'Session-Sender Error Estimate', and 'Session-Sender TTL' fields MUST be set to zero in the transmitted Session-Sender test packets and
   MUST be ignored in the received test packets.
    </t>
    </section>

   <section anchor="sect-5.2" numbered="true" toc="default">
       <name>Loopback Measurement Mode for Links</name>
   <t>
   In loopback measurement mode for links, an inner IP header for the return path is added in the Session-Sender test packets as shown in Figure 12 
   and it MUST set the Destination Address equal to the Session-Sender address.
   </t>

        <figure anchor="ure-dm-sender-test-packet-lb-return">
          <name>Example Session-Sender Return Test Packet in Loopback Measurement Mode</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | IP Header (Return Path)                                       |
 .  Source IP Address = Session-Sender IP Address                .
 .  Destination IP Address = Session-Sender IP Address           .
 .  IPv4 Protocol or IPv6 Next-header = UDP (17)                 .
 .                                                               .
 +---------------------------------------------------------------+
 | UDP Header                                                    |
 .  Source Port = Chosen by Session-Sender                       .
 .  Destination Port = Source Port                               .
 .                                                               .
 +---------------------------------------------------------------+
 | Payload = Test Packet as specified in Section 3 of RFC 8972   |
 .           in Figure 1 and Figure 3                            .
 .                                                               .
 +---------------------------------------------------------------+
]]></artwork>
        </figure>

   <t>
   The Session-Sender test packets in loopback measurement mode may be transmitted with a Layer-2 header for the forward path as shown in Figure 13, 
   containing Session-Reflector MAC address as the Destination Address and Session-Sender MAC address as the Source MAC address of Ethernet links. 
   An SR encapsulation (e.g., containing adjacency SID of the link) can also be added for the forward path after the Layer-2 header.
   </t>

        <figure anchor="ure-dm-sender-test-packet-lb">
          <name>Example Session-Sender Test Packet in Loopback Measurement Mode for Ethernet Link</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | L2 MAC Header (Forward Path)                                  |
 .  Source Address = Session-Sender MAC Address                  .
 .  Destination Address = Session-Reflector MAC Address          .
 .  Ether-Type = 0x0800 (IPv4) Or 0x86DD (IPv6)                  . 
 .                                                               .
 +---------------------------------------------------------------+
 | Test Packet as shown in Figure 12 (Return Path)               |
 .                                                               .
 +---------------------------------------------------------------+
]]></artwork>
        </figure>

   </section>

   <section anchor="sect-5.3" numbered="true" toc="default">
       <name>Loopback Measurement Mode for SR-MPLS Paths</name>
   <t>An SR-MPLS path uses an MPLS header for carrying a Segment List in MPLS label stack.
   In the case of loopback measurement mode for SR-MPLS paths, the Session-Sender test packet can either carry the Segment List 
   of the forward SR-MPLS path only or both the forward and the return SR-MPLS paths in MPLS header as shown in Figure 14. 
   </t>

         <figure anchor="ure-dm-sender-test-packet-lb-mpls">
          <name>Example Session-Sender Test Packet in Loopback Measurement Mode for SR-MPLS Path</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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Segment(1)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Segment(n)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                PSID (optional)        | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Test Packet as shown in Figure 12 (Return Path)|
 .                                                               .
 +---------------------------------------------------------------+
]]></artwork>
        </figure>

   <t>
   In the case of SR-MPLS Policy using Penultimate Hop Popping (PHP), the Session-Sender MUST ensure that 
   the STAMP test packets reach the SR-MPLS Policy endpoint (for example, by adding the Prefix 
   SID of the SR-MPLS Policy endpoint in the Segment List of the forward path if required).
   </t>

   <section anchor="sect-5.3.1" numbered="true" toc="default">
       <name>Return SR-MPLS Path</name>
   <t>
   To receive the return Session-Sender test packet on a specific
   SR-MPLS path in an ECMP environment, the SR-MPLS label stack needs to carry the specific 
   return SR-MPLS path, in addition to the forward direction SR-MPLS path. 
   For example, it can carry the corresponding SR-MPLS label stack of the Segment List of the  
   reverse SR-MPLS Policy Candidate-Path <xref target="I-D.ietf-pce-sr-bidir-path" format="default"/>
   or the Binding SID of the reverse SR-MPLS Policy or the SR-MPLS Prefix Segment Identifier of the Session-Sender.
   For SR-MPLS Flex-Algo IGP paths, it MUST carry the matching SR-MPLS Flex-Algo Prefix SID label of the Session-Sender.
   </t> 

   <t>
   The IP header of the Session-Sender test packets
   MUST set the Destination Address equal to the Session-Sender address as shown in Figure 12.
   </t>

   <t>In this case, the optional PSID added in the Session-Sender test packet is allocated by the Session-Sender.</t>

   </section>

   <section anchor="sect-5.3.2" numbered="true" toc="default">
       <name>Return IP/UDP Path</name>
   <t>
   In the case of loopback measurement mode for SR-MPLS paths, the MPLS header can carry the SR-MPLS label stack of 
   the forward SR path only.
   </t>

   <t>
   The IP header for the return path of the Session-Sender test packets
   MUST set the Destination Address equal to the Session-Sender address as shown in Figure 12 to forward the packet to the Session-Sender.
   </t>

   <t>
   The Session-Reflector decapsulates the MPLS header and forwards the packet using the IP header for the return path.
   </t>

   <t>In this case, the optional PSID added in the Session-Sender test packet is allocated by the Session-Reflector.</t>
   

   </section>
   </section>

   <section anchor="sect-5.4" numbered="true" toc="default">
        <name>Loopback Measurement Mode for SRv6 Paths</name>

   <t>An SRv6 path uses an IPv6 header and SRv6 Segment Routing Header (SRH) for carrying 
   a Segment List as described in <xref target="RFC8754" format="default"/>.
   In the case of loopback measurement mode for SRv6 paths, the Session-Sender test packet can either carry the Segment List 
   of the forward SRv6 path only or both the forward and the return SRv6 paths in IPv6/SRH as shown in Figure 15. 
   </t>

      <figure anchor="ure-test-packet-for-srv6-policy-lb">
          <name>Example Session-Sender Test Packet in Loopback Measurement Mode for SRv6 Path</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | IP Header                                                     |
 .  Source IP Address = Session-Sender IPv6 Address              .
 .  Destination IP Address = Segment List[Segments Left]         . 
 .  Next-Header = 43, Routing Type = SRH (4)                     .
 .                                                               .
 +---------------------------------------------------------------+
 | SRH as specified in RFC 8754                                  |
 .  <PSID (optional), Segment List>                              .
 .  <Segment List for Return Path>                               .
 .  Next-Header = UDP (17)                                       .
 .                                                               .
 +---------------------------------------------------------------+
 | UDP Header                                                    |
 .  Source Port = Chosen by Session-Sender                       .
 .  Destination Port = Source Port                               .
 .                                                               .
 +---------------------------------------------------------------+
 | Payload = Test Packet as specified in Section 3 of RFC 8972   |
 .           in Figure 1 and Figure 3                            .
 .                                                               .
 +---------------------------------------------------------------+

     Example 1: Using SRv6 Return Path

 +---------------------------------------------------------------+
 | IP Header                                                     |
 .  Source IP Address = Session-Sender IPv6 Address              .
 .  Destination IP Address = Session-Reflector IPv6 Address |    .
 .                Segment List[Segments Left]                    . 
 .  Next-Header = 43, Routing Type = SRH (4)                     .
 .                                                               .
 +---------------------------------------------------------------+
 | SRH as specified in RFC 8754                                  |
 .  <PSID (optional), Segment List>                              .
 .  Next-Header = 43 (IPv6)                                      .
 .                                                               .
 +---------------------------------------------------------------+
 | Test Packet as shown in Figure 12 (Return Path)               |
 .                                                               .
 +---------------------------------------------------------------+

     Example 2: Using IP/UDP Return Path 
]]></artwork>
            </figure>

   <t>The Session-Sender MUST ensure that 
   the Session-Sender test packets using the Segment List reach the SRv6 Policy endpoint (for example, by adding the Prefix 
   SID or IPv6 address of the SRv6 Policy endpoint in the Segment List if required).</t>

       <section anchor="sect-5.4.1" numbered="true" toc="default">
        <name>Return SRv6 Path</name>

   <t>To receive the return Session-Sender test packet on a specific
   SRv6 path in an ECMP environment, the SRv6 Segment List needs to carry the specific return 
   SRv6 path, in addition to the forward direction SRv6 path. 
   For example, it can carry the corresponding Segment List of the 
   reverse SRv6 Policy Candidate-Path <xref target="I-D.ietf-pce-sr-bidir-path" format="default"/>
   or the Binding SID of the reverse SRv6 Policy or the SRv6 Prefix Segment Identifier of the Session-Sender.  
   For SRv6 Flex-Algo IGP paths, it MUST carry the matching SRv6 Flex-Algo Prefix SID of the Session-Sender.
   </t>

   <t>An inner IP header MAY be added in the Session-Sender test packet and that has the Destination Address equal
   to the Session-Sender address as shown in Figure 12.</t>

   <t>In this case, the optional PSID added in the Session-Sender test packet is allocated by the Session-Sender.</t>


   </section>

   <section anchor="sect-5.4.2" numbered="true" toc="default">
    <name>Return IP/UDP Path</name>
   <t>In the case of loopback measurement mode for SRv6 paths, the Session-Sender test packet can contain the Segment List of the forward SRv6 path only. 
   </t>

   <t>An inner IP header for return path MUST be added in the Session-Sender test packets that has the Destination Address equal
   to the Session-Sender address as shown in Figure 12 to forward the packet to the Session-Sender.</t>

   <t>
   The Session-Reflector decapsulates the outer IPv6/SRH headers and forwards the packet using the inner IP header for the return path.
   </t>

   <t>In this case, the optional PSID added in the Session-Sender test packet is allocated by the Session-Reflector.</t>
   
    </section>
    </section>


   <section anchor="sect-5.5." numbered="true" toc="default">
        <name> Loopback Measurement Mode for Layer-3 Service over SR Path </name>

   <t>The loopback measurement mode is also applicable to L3 services in SR networks for
   both SR-MPLS and SRv6 data planes.
   </t>

   <t>It is desired that the STAMP test packets traverse
   the same path in the forward and reverse direction of the L3 service in loopback measurement mode.</t>

   <section anchor="sect-5.5.1." numbered="true" toc="default">
        <name> Loopback Measurement Mode for Layer-3 Service over SR-MPLS Path </name>

   <t>
   In loopback measurement mode for L3 service over SR-MPLS path, the same SR-MPLS label stack as the 
   data packets of the L3 service including the L3VPN SR-MPLS label (advertised by the 
   Session-Reflector) is used to transmit Session-Sender test packets as shown in Figure 16.</t>

         <figure anchor="ure-dm-sender-test-packet-lb-l3-mpls">
          <name>Example Session-Sender Test Packet in Loopback Measurement Mode for L3 Service over SR-MPLS Path</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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Segment(1)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                L3VPN Segment          | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | Test Packet as shown in Figure 12 (Return Path)               |
 .           Destination IP Address in L3VPN table               .
 .                                                               .
 +---------------------------------------------------------------+
]]></artwork>
        </figure>


   <t>An IP header for return path MUST be added in the Session-Sender test packets that has the Destination Address equal
   to the Session-Sender address as shown in Figure 12 to forward the packet to the Session-Sender.
   In this case, the Destination Address added in the IP header for the return path MUST be reachable via the IP table 
   lookup associated with the L3VPN SR-MPLS label added. 
   </t>

   <t>The Session-Reflector decapsulates the MPLS header and 
   forwards the packet using the IP header for the return path (after adding SR-MPLS encapsulation for the reverse direction L3 service).
   </t>

   </section>

   <section anchor="sect-5.5.2." numbered="true" toc="default">
        <name> Loopback Measurement Mode for Layer-3 Service over SRv6 Path </name>

    <t>
   In loopback measurement mode for L3 service over SRv6 path, the same IPv6/SRH encapsulation as the 
   data packets of the L3 service including the L3VPN SRv6 SID instantiated on the 
   Session-Reflector (for example, End.DT6 SID instance, End.DT4 SID instance, etc. 
   defined in <xref target="RFC8986" format="default"/>) is used to transmit Session-Sender test packets as shown in Figure 17. </t>

      <figure anchor="ure-test-packet-for-srv6-l3-lb">
          <name>Example Session-Sender Test Packet in Loopback Measurement Mode for L3 Service over SRv6 Path</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | IP Header                                                     |
 .  Source IP Address = Session-Sender IPv6 Address              .
 .  Destination IP Address = Segment List[Segments Left]         . 
 .  Next-Header = 43, Routing Type = SRH (4)                     .
 .                                                               .
 +---------------------------------------------------------------+
 | SRH as specified in RFC 8754                                  |
 .  <Segment List including End.DT4/DT6/DT46 SID>                .
 .  Next-Header = 43 (IPv6)                                      .
 .                                                               .
 +---------------------------------------------------------------+
 | Test Packet as shown in Figure 12 (Return Path)               |
 .           Destination IP Address in L3VPN table               .
 .                                                               .
 +---------------------------------------------------------------+
]]></artwork>
            </figure>


   <t>An inner IP header for return path MUST be added in the Session-Sender test packets that has the Destination Address equal
   to the Session-Sender address as shown in Figure 12 to forward the packet to the Session-Sender.
   In this case, the Destination Address added in the inner IP header for the return path MUST be reachable via the IPv4 or IPv6 table 
   lookup associated with the L3VPN SRv6 SID added. 
   </t>

   <t>The Session-Reflector decapsulates the outer IPv6/SRH and 
   forwards the packet using the inner IP header for the return path (after adding IPv6/SRv6 encapsulation for the reverse direction L3 service).
   </t>

   </section>
   </section>


   <section anchor="sect-5.6." numbered="true" toc="default">
        <name> Loopback Measurement Mode for Layer-2 Service over SR Path </name>

   <t>
   The loopback measurement mode is also applicable to L2 services in an SR network for
   both SR-MPLS and SRv6 data planes.
   </t>

   <t>As L2 service uses co-routed bidirectional connection, it is desired that the STAMP test packets traverse
   the same path in the forward and reverse direction of the L2 service in loopback measurement mode.</t>

   <section anchor="sect-5.6.1." numbered="true" toc="default">
        <name> Loopback Measurement Mode for Layer-2 Service over SR-MPLS Path </name>
    <t>
   In loopback measurement mode for L2 service over SR-MPLS path, the same SR-MPLS label stack (except the L2VPN SR-MPLS label advertised by the Session-Reflector) as the 
   data packets of the L2 service in the forward path and the same SR-MPLS label stack and the L2VPN SR-MPLS label (advertised by the Session-Sender) 
   for the return path of the L2 service is used to transmit Session-Sender test packets as shown in Figure 18. </t> 

    <t>
   The L2VPN SR-MPLS label is added with a TTL value of 1 in order to punt the Session-Sender test packet from data plane to 
   CPU or slow path on Session-Sender for STAMP processing. 
     </t>

         <figure anchor="ure-dm-sender-test-packet-lb-l2-mpls">
          <name>Example Session-Sender Test Packet in Loopback Measurement Mode for L2 Service over SR-MPLS Path</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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Segment(1)             | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   L2VPN Segment (Reverse Direction)   | TC  |1|    TTL=1      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | Test Packet as shown in Figure 12 (Return Path)               |
 .                                                               .
 +---------------------------------------------------------------+
]]></artwork>
        </figure>

    <t>An IP header for return path MUST be added in the Session-Sender test packets that has the Destination Address equal
   to the Session-Sender address as shown in Figure 12.
    </t>

   </section>

   <section anchor="sect-5.6.2." numbered="true" toc="default">
        <name> Loopback Measurement Mode for Layer-2 Service over SRv6 Path </name>
    <t>
   In loopback measurement mode for L2 service over SRv6 path, the same IPv6/SRH encapsulation (except the L2VPN SRv6 SID instantiated by the Session-Reflector) as the 
   data packets of the L2 service in the forward path and the same IPv6/SRH encapsulation and the L2VPN SRv6 SID instantiated on the Session-Sender 
   (for example, End.DT2U SID instance defined in <xref target="RFC8986" format="default"/>) 
   for the return path of the L2 service is used to transmit the Session-Sender test packets as shown in Figure 19. </t> 


            <figure anchor="ure-test-packet-for-lb-srv6-l2">
              <name>Example Session-Sender Test Packet in Loopback Mode for L2 Service over SRv6 Path</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | IP Header                                                     |
 .  Source IP Address = Session-Sender IPv6 Address              .
 .  Destination IP Address = Segment List[Segments Left]         . 
 .  Next-Header = 43, Routing Type = SRH (4)                     .
 .                                                               .
 +---------------------------------------------------------------+
 | SRH as specified in RFC 8754                                  |
 .  <Segment List including End.DT2U SID (Reverse Direction)>    .
 .  Next-Header = UDP (17)                                       .
 .                                                               .
 +---------------------------------------------------------------+
 | UDP Header                                                    |
 .  Source Port = Chosen by Session-Sender                       .
 .  Destination Port = Source Port                               .
 .                                                               .
 +---------------------------------------------------------------+
 | Payload = Test Packet as specified in Section 3 of RFC 8972   |
 .           in Figure 1 and Figure 3                            .
 .                                                               .
 +---------------------------------------------------------------+
]]></artwork>
            </figure>


   </section>
   </section>


    </section>

    <section anchor="sect-6" numbered="true" toc="default">
      <name>Loopback Measurement Mode with Timestamp and Forward Function in SR Networks</name>

         <t>This document defines a new STAMP measurement mode, called "loopback measurement mode with timestamp and forward"  
    that uses network programming function.
    In this mode, the timestamps T1, T2, and T4, all in data plane, are collected
    by the Session-Sender test packet as shown in Figure 20.
    The network programming function is used to optimize the "operations of punt 
    test packet and generate return test packet" on the Session-Reflector, 
    as timestamping is implemented in fast path in data plane. This helps to achieve 
    higher number of STAMP test session scale and faster measurement interval.</t>
        <t>The Session-Sender adds transmit 
    timestamp (T1) in the payload of the Session-Sender test packet. 
    The Session-Reflector adds the receive timestamp (T2) in the 
    payload of the received test packet in fast path in 
    data plane without punting the test packet (e.g., to slow path or control-plane).
    The network programming function carried by the test packet enables the Session-Reflector to 
    add the receive timestamp (T2) at the specific offset in the 
    payload of the test packet.</t>

              <figure anchor="ure-loopback-mode-with-tsf">
          <name>Reference Topology for Loopback Measurement Mode with Timestamp and Forward Function</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
                         T1                  T2
                        /                     \
               +-------+      Test Packet      +-------+
               |       | - - - - - - - - - - - |       |
               |   S1  |======================||  R1   |
               |       |<- - - - - - - - - - - |       |
               +-------+   Return Test Packet  +-------+
                        \                      Loopback 
                         T4 

             STAMP Session-Sender     STAMP Session-Reflector
                                             (Timestamp, 
                                              and Forward)
      ]]></artwork>
        </figure>

    <t>For an end-to-end SR path including SR Policy, 
    STAMP Session-Sender test packets are transmitted in loopback measurement mode with timestamp and forward function 
    as described in the following sub-sections.</t>

    <section anchor="sect-6.1" toc="default" numbered="true">
        <name>Loopback Measurement Mode with Timestamp and Forward Function for SR-MPLS Paths</name>

    <t>The MPLS Network Action (MNA) Sub-Stack defined in <xref target="I-D.ietf-mpls-mna-hdr" format="default"/>
    is used for SR-MPLS data plane for 
    "timestamp and forward" network programming function for the STAMP test packets.
    The MNA Sub-Stack carries the MNA Label (bSPL value TBA1) as defined in <xref target="I-D.ietf-mpls-mna-hdr" format="default"/>.
    A new MNA Opcode (value MNA.TSF) is defined for the Timestamp and Forward network action.
    </t>

    <t>In the Session-Sender test packets for SR-MPLS paths,
    the MNA Sub-Stack with Opcode MNA.TSF is added in the MPLS header as shown in Figure 21, to
    collect "Receive Timestamp" field in the payload of the test packet. 
    The Ingress-to-Egress (I2E), Hop-By-Hop (HBH), Select scope (IHS) is set to "I2E" when 
    return path is IP/UDP.
    The Network Action Sub-Stack Length (NASL) is set to 0 when there is no Label Stack Entry (LSE) after the MNA.TSF Opcode in the MNA Sub-Stack.
    The U flag is set to skip the network action and forward the packet (and not drop the packet).
    </t>

    <t>
    The Label Stack for the return SR-MPLS path can be added after the MNA Sub-Stack
    to receive the return test packet on a specific path.
    The Ingress-to-Egress (I2E), Hop-By-Hop (HBH), Select scope (IHS) is set to  
    "Select" in this case.
    </t>

        <figure anchor="ure-test-packet-header-for-sr-mpls-with-timestamp-label">
          <name>Example Session-Sender Test Packet in Loopback Measurement Mode with TSF for SR-MPLS Paths</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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |            Segment(1)                 | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |            Segment(n)                 | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |            MNA Label (value TBA1)     | TC  |S|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |7-bit MNA.TSF|  0x0                    |R|IHS|S| RES |U|NASL=0 |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | Test Packet as shown in Figure 12 (Return Path)               |
 .                                                               .
 +---------------------------------------------------------------+
  ]]></artwork>
        </figure>

    <t>When a Session-Reflector receives a packet with MNA Sub-Stack with Opcode MNA.TSF,   
    after timestamping the packet in STAMP payload at the specific offset, 
    the Session-Reflector pops the MNA Sub-Stack (after completing any other network actions) and forwards the
    packet as defined in the loopback measurement mode for SR-MPLS paths.</t>

        <section anchor="sect-6.1.1" toc="default" numbered="true">
          <name>Timestamp and Forward Network Action Assignment</name>
    <t>
    New MPLS Network Action Opcode is defined called "Timestamp and Forward Network Action, MNA.TSF".
    The MNA.TSF Opcode is statically configured on the STAMP Session-Reflector node with a value from "Private Use from Range 111-126". 
    The timestamp format for 64-bit PTPv2 and NTP to be added in the STAMP payload is statically configured for MNA.TSF.
    The offset in the STAMP payload (e.g., for unauthenticated mode with offset 16 bytes) is also statically configured for MNA.TSF.
    </t>
          
        </section>

        <section anchor="sect-6.1.2" toc="default" numbered="true">
          <name>Node Capability for MNA Sub-Stack with Opcode MNA.TSF</name>
         <t>The STAMP Session-Sender needs 
    to know if the Session-Reflector can process the MNA Sub-Stack with Opcode MNA.TSF to avoid dropping the test packets. 
    The signaling extension for this capability exchange or local configuration are outside the scope of this document.</t>
        </section>
      </section>

      <section anchor="sect-6.2" numbered="true" toc="default">
        <name>Loopback Measurement Mode with Timestamp and Forward Function for SRv6 Paths</name>

    <t>The <xref target="RFC8986" format="default"/> defines 
    SRv6 Endpoint Behaviours for SRv6 nodes.
    A new SRv6 Endpoint Behaviour is  
    defined for "Timestamp and Forward (TSF)" network programming function for the STAMP test packets.
    </t>

       <t>In the Session-Sender test packets for SRv6 paths,
    Timestamp and Forward Endpoint Function (End.TSF) is carried with the target Segment 
    Identifier (SID) in SRH <xref target="RFC8754" format="default"/> as shown in Figure 22,
    to collect "Receive Timestamp" field in the payload of the test packet. </t>
 
        <figure anchor="ure-test-packet-header-for-srv6-with-endpoint-function">
          <name>Example Session-Sender Test Packet in Loopback Measurement Mode with TSF for SRv6 Paths</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | IP Header                                                     |
 .  Source IP Address = Session-Sender IPv6 Address              .
 .  Destination IP Address = Segment List[Segments Left]         . 
 .  Next-Header = 43, Routing Type = SRH (4)                     .
 .                                                               .
 +---------------------------------------------------------------+
 | SRH as specified in RFC 8754                                  |
 .  <Segment List including End.TSF SID>                         .
 .  <Segment List for Return Path>                               .
 .  Next-Header = UDP (17)                                       .
 .                                                               .
 +---------------------------------------------------------------+
 | UDP Header                                                    |
 .  Source Port = Chosen by Session-Sender                       .
 .  Destination Port = Source Port                               .
 .                                                               .
 +---------------------------------------------------------------+
 | Payload = Test Packet as specified in Section 3 of RFC 8972   |
 .           in Figure 1 and Figure 3                            .
 .                                                               .
 +---------------------------------------------------------------+

     Example 1: Using SRv6 Return Path

 +---------------------------------------------------------------+
 | IP Header                                                     |
 .  Source IP Address = Session-Sender IPv6 Address              .
 .  Destination IP Address = Session-Reflector IPv6 Address |    .
 .                Segment List[Segments Left]                    . 
 .  Next-Header = 43, Routing Type = SRH (4)                     .
 .                                                               .
 +---------------------------------------------------------------+
 | SRH as specified in RFC 8754                                  |
 .  <Segment List including End.TSF SID>                         .
 .  Next-Header = 43 (IPv6)                                      .
 .                                                               .
 +---------------------------------------------------------------+
 | Test Packet as shown in Figure 12 (Return Path)               |
 .                                                               .
 +---------------------------------------------------------------+

     Example 2: Using IP/UDP Return Path
  ]]></artwork>
        </figure>

   <t>
    When a Session-Reflector receives a packet with
    Timestamp and Forward Endpoint (End.TSF) for the target SID, which is local, 
    after timestamping the test packet at the specific offset,
    the Session-Reflector forwards the packet as 
    defined in the loopback measurement mode for SRv6 paths.</t>

    <section anchor="sect-6.2.1" toc="default" numbered="true">
          <name>Timestamp and Forward Endpoint Function Assignment</name>
    <t>
    New SRv6 Endpoint Behavior is defined called "Endpoint Behavior bound to SID with 
    Timestamp and Forward (End.TSF)". 
    The End.TSF is a node SID instantiated at STAMP Session-Reflector node. 
    The End.TSF is statically configured on the STAMP Session-Reflector node and not advertised into the routing protocols. 
    The timestamp format for 64-bit PTPv2 and NTP to be added in the STAMP payload is statically configured for End.TSF.
    The offset in the STAMP payload (e.g., for unauthenticated mode with offset 16 bytes) is also statically configured for End.TSF.
    </t>
           
        </section>

    <section anchor="sect-6.2.2" toc="default" numbered="true">
          <name>Node Capability for Timestamp and Forward Endpoint Function</name>
       <t>The STAMP Session-Sender needs to know if the Session-Reflector can process 
    the Timestamp and Forward Endpoint Function to avoid dropping test packets.
    The signaling extension for this capability exchange or local configuration are outside the scope of this document.</t>
        </section>

      </section>
    </section>

    <section anchor="sect-7" numbered="true" toc="default">
      <name>Packet Loss Measurement in SR Networks</name>
      <t>
   The procedure described in Section 4 and Section 5 for delay measurement in SR networks using STAMP test packets 
   is used similarly for round-trip, near-end (forward direction) and far-end 
   (backward direction) inferred packet loss measurement in SR networks.
   This provides only an approximate view of the data packet loss.</t>

   <t>In case of loopback measurement mode, and loopback measurement mode with timestamp and forward function, 
   only the round-trip packet loss measurement is applicable.</t>

    </section>

    <section anchor="sect-8" numbered="true" toc="default">
      <name>Direct Measurement in SR Networks</name>
      <t>
   The STAMP "Direct Measurement" TLV (Type 5) defined in <xref target="RFC8972" format="default"/> 
   can be used in SR networks for data packet loss measurement.
   The STAMP test packets with this TLV are transmitted using the
   procedures described in Section 4 for delay measurement using STAMP test packets to collect the 
   Session-Sender transmit counters and Session-Reflector receive and transmit counters 
   of the data packet flows for direct measurement.</t>

      <t>The PSID carried in the received data packet for the traffic
   flow under measurement can be used to measure receive data packets 
   (for receive traffic counter) for an end-to-end SR path  
   on the Session-Reflector.  The PSID in the received Session-Sender test packet
   header can be used to associate the receive traffic counter to the end-to-end SR path on the Session-Reflector.
   In the case of L3 and L2 services in SR networks, the associated 
   SR-MPLS service labels or SRv6 service SIDs, can be used for receive traffic counters. </t>

   <t>In case of loopback measurement mode, and loopback measurement mode with timestamp and forward function, 
   the direct measurement is not applicable.</t>

    </section>

    <section anchor="sect-9" numbered="true" toc="default">
      <name>ECMP Measurement in SR Networks</name>
      <t>
   An SR 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" format="default"/> by an SR Policy can result in ECMP
   paths via transit nodes part of that Anycast group.  The STAMP test
   packets need to be transmitted to traverse different ECMP paths to measure
   end-to-end delay of an SR Policy.</t>
      <t>Forwarding plane has various hashing functions available to forward
   packets on specific ECMP paths.  The mechanisms described in
   <xref target="RFC8029" format="default"/> and <xref target="RFC5884" format="default"/> for 
   handling ECMPs are also applicable to delay measurement.</t>
      <t>For SR-MPLS Policy, sweeping of MPLS entropy label <xref target="RFC6790" format="default"/> values can 
   be used in Session-Sender test packets and Session-Reflector reply test 
   packets to take advantage of the hashing function in data  
   plane to influence the ECMP path taken by them.</t>
      <t>In IPv4 header of the Session-Sender test packets and Session-Reflector reply test packets 
   sweeping of Destination Address from the range 127/8 can be 
   used to exercise ECMP paths taken by them when using MPLS header.</t>
      <t>As specified in <xref target="RFC6437" format="default"/>, Flow Label field in
   the outer IPv6 header can also be used for sweeping to exercise different IPv6 ECMP paths.</t>
    </section>

    <section anchor="sect-10" numbered="true" toc="default">
      <name>STAMP Session State</name>
    <t>
    The threshold-based notification for delay and packet loss metrics may not be generated if the delay and packet loss 
    metrics are not changing significantly. For an unambiguous monitoring, the controller may need to distinguish 
    the cases whether the session is active, but delay and packet loss metrics are not changing significantly crossing the threshold
    or the session has failed.</t>

    <t>
    The STAMP test session state monitoring allows to know if the performance measurement test is active, idle or failed. 
    The STAMP test session state is notified as idle when Session-Sender is not transmitting test packets.
    The STAMP test session state is initially notified as active when Session-Sender is transmitting test 
    packets and as soon as one or more reply test packets are received at the Session-Sender. 
    The STAMP test session state is notified as 
    failed when consecutive N number of reply test packets are not received at the Session-Sender 
    after the session state is notified as active, where N (consecutive packet loss count) is a locally provisioned value. 
    In this case, the failed state of the STAMP test session on the Session-Sender also indicates 
    the connectivity (i.e., liveness) failure of the link, SR path or the L3/L2 service where the STAMP session was active.</t>     

    </section>


     <section anchor="sect-11" numbered="true" toc="default">
        <name>Additional STAMP Test Packet Processing Rules</name>
        <t>
    The processing rules described in this section are applicable to the
    STAMP test packets for links, end-to-end SR paths, and L3 and L2 services in SR networks.</t>
        <section anchor="sect-10.1" numbered="true" toc="default">
          <name>TTL</name>
          <t>
    The TTL field in the IPv4 and MPLS headers of the Session-Sender and Session-Reflector test packets 
    MUST be set to 255 as per Generalized TTL Security Mechanism (GTSM) <xref target="RFC5082" format="default"/>.</t>
        </section>
        <section anchor="sect-11.2" numbered="true" toc="default">
          <name>IPv6 Hop Limit</name>
          <t>
    The Hop Limit (HL) field in all IPv6 headers of the Session-Sender and Session-Reflector test packets
    MUST be set to 255 as per Generalized TTL Security Mechanism (GTSM) <xref target="RFC5082" format="default"/>.</t>
        </section>

        <section anchor="sect-11.3" numbered="true" toc="default">
          <name>Router Alert Option</name>
          <t>
    The Router Alert IP option (RAO) <xref target="RFC2113" format="default"/> MUST NOT 
    be set in the STAMP test packets to be able to punt the test packets using the UDP ports for STAMP.</t>
        </section>

        <section anchor="sect-11.4" numbered="true" toc="default">
          <name>IPv6 Flow Label</name>
    <t>
    The Flow Label field in the IPv6 header of the STAMP test packet is set to the value that is used by the 
    data packets for the traffic flow on the SR path being measured by the Session-Sender. 
    </t>
    <t>
    The Session-Reflector SHOULD use the Flow Label value it received in the STAMP test packet 
    IPv6 header in the STAMP reply test packet, 
    and it can be based on the local configuration on the Session-Reflector.
    </t>
        </section>

    <section anchor="sect-11.5" numbered="true" toc="default">
          <name>UDP Checksum</name>
          <t>For IPv4 test packets, where the local processor is not capable
    of re-computing the UDP checksum or adding checksum complement
    <xref target="RFC7820" format="default"/>, the Session-Sender and Session-Reflector 
    can set the UDP checksum value to 0 <xref target="RFC8085" format="default"/>.</t>

          <t>For IPv6 test packets, where the local processor is not capable
    of re-computing the UDP checksum or adding checksum complement
    <xref target="RFC7820" format="default"/>, the Session-Sender and Session-Reflector
    can use the procedure defined in <xref target="RFC6936" format="default"/>
    for the UDP checksum (with value set to 0) for the UDP ports used for the STAMP sessions, 
    and it can be based on the local policy.</t>
        </section>
  
    </section>


    <section anchor="sect-12" numbered="true" toc="default">
      <name>Implementation Status </name>
    <t>
    Editorial note: Please remove this section prior to publication.
    </t>
    <t>
    The following Cisco routing platforms running IOS-XR operating system have participated in an interop testing for one-way, two-way and loopback measurement modes for SR-MPLS and SRv6:
    </t>

    <t>
    *  Cisco 8802 (based Cisco Silicon One Q200)
      </t>

    <t>
    *  Cisco ASR9904 with Lightspeed linecard and Tomahawk linecard
      </t>

    <t>
    *  Cisco NCS5500 (based on Broadcom Jericho1 platform)
      </t>

    <t>
    *  Cisco NCS5700 (based on Broadcom Jericho2 platform)
      </t>

    </section>


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

      <t>The security considerations specified in <xref target="RFC8762" format="default"/>, 
      <xref target="RFC8972" format="default"/>, and <xref target="RFC9503" format="default"/> 
      also apply to the procedures described in this document. </t>

      <t>Use of HMAC-SHA-256 in the authenticated mode protects the data
   integrity of the STAMP test packets. The message integrity protection using HMAC 
   defined in Section 4.4 of <xref target="RFC8762" format="default"/> 
   can be used with the procedure described in this document.</t>

      <t>STAMP uses the well-known UDP port number that could become 
   a target of denial of service (DoS) or could
   be used to aid on-path attacks.
   Thus, the security considerations and measures to mitigate the 
   risk of the attack documented in Section 6 of <xref target="RFC8545" format="default"/>
   equally apply to the procedures described in this document.</t>

      <t>The procedures defined in this document is intended for deployment in a single network administrative domain.
   As such, the Session-Sender address, Session-Reflector address, and forward and return paths are provisioned by the operator for the STAMP session.
   It is assumed that the operator has verified the integrity of the forward and return paths of the STAMP test packets.</t>

      <t>When using the procedures defined in <xref target="RFC6936" format="default"/>, the 
   security considerations specified in <xref target="RFC6936" format="default"/> also apply.</t>

      <t>The security considerations specified in <xref target="I-D.ietf-mpls-mna-hdr" format="default"/> 
    are also applicable to the procedures for the SR-MPLS data plane defined in this document.</t>     

   <t>SRv6 STAMP test packets can use the HMAC protection
   authentication defined for SRH in <xref target="RFC8754" format="default"/>. </t>

      <t>The security considerations specified in <xref target="RFC8986" format="default"/> 
    are also applicable to the procedures for the SRv6 data plane defined in this document.</t>     

    </section>
    <section anchor="sect-14" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>
   This document does not require any IANA action.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <reference anchor="RFC0768" target="https://www.rfc-editor.org/info/rfc768" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.0768.xml">
          <front>
            <title>User Datagram Protocol</title>
            <author initials="J." surname="Postel" fullname="J. Postel">
              <organization/>
            </author>
            <date year="1980" month="August"/>
          </front>
          <seriesInfo name="STD" value="6"/>
          <seriesInfo name="RFC" value="768"/>
          <seriesInfo name="DOI" value="10.17487/RFC0768"/>
        </reference>

        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author initials="S." surname="Bradner" fullname="S. Bradner">
              <organization/>
            </author>
            <date year="1997" month="March"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>

        <reference anchor="RFC6790" target="https://www.rfc-editor.org/info/rfc6790" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6790.xml">
          <front>
            <title>The Use of Entropy Labels in MPLS Forwarding</title>
            <author initials="K." surname="Kompella" fullname="K. Kompella">
              <organization/>
            </author>
            <author initials="J." surname="Drake" fullname="J. Drake">
              <organization/>
            </author>
            <author initials="S." surname="Amante" fullname="S. Amante">
              <organization/>
            </author>
            <author initials="W." surname="Henderickx" fullname="W. Henderickx">
              <organization/>
            </author>
            <author initials="L." surname="Yong" fullname="L. Yong">
              <organization/>
            </author>
            <date year="2012" month="November"/>
          </front>
          <seriesInfo name="RFC" value="6790"/>
          <seriesInfo name="DOI" value="10.17487/RFC6790"/>
        </reference>

        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author initials="B." surname="Leiba" fullname="B. Leiba">
              <organization/>
            </author>
            <date year="2017" month="May"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>

        <reference anchor="RFC8762" target="https://www.rfc-editor.org/info/rfc8762" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8762.xml">
          <front>
            <title>Simple Two-Way Active Measurement Protocol</title>
            <author initials="G." surname="Mirsky" fullname="G. Mirsky">
              <organization/>
            </author>
            <author initials="G." surname="Jun" fullname="G. Jun">
              <organization/>
            </author>
            <author initials="H." surname="Nydell" fullname="H. Nydell">
              <organization/>
            </author>
            <author initials="R." surname="Foote" fullname="R. Foote">
              <organization/>
            </author>
            <date year="2020" month="March"/>
          </front>
          <seriesInfo name="RFC" value="8762"/>
          <seriesInfo name="DOI" value="10.17487/RFC8762"/>
        </reference>

        <reference anchor="RFC8972" target="https://www.rfc-editor.org/info/rfc8972" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8972.xml">
          <front>
            <title>Simple Two-Way Active Measurement Protocol Optional Extensions</title>
            <author initials="G." surname="Mirsky" fullname="G. Mirsky">
              <organization/>
            </author>
            <author initials="X." surname="Min" fullname="X. Min">
              <organization/>
            </author>
            <author initials="H." surname="Nydell" fullname="H. Nydell">
              <organization/>
            </author>
            <author initials="R." surname="Foote" fullname="R. Foote">
              <organization/>
            </author>
            <author initials="A." surname="Masputra" fullname="A. Masputra">
              <organization/>
            </author>
            <author initials="E." surname="Ruffini" fullname="E. Ruffini">
              <organization/>
            </author>
            <date year="2021" month="January"/>
          </front>
          <seriesInfo name="RFC" value="8972"/>
          <seriesInfo name="DOI" value="10.17487/RFC8972"/>
        </reference>

        <reference anchor="RFC8986" target="https://www.rfc-editor.org/info/rfc8986" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8986.xml">
          <front>
            <title>Segment Routing over IPv6 (SRv6) Network Programming</title>
            <author initials="C." surname="Filsfils" fullname="C. Filsfils" role="editor">
              <organization/>
            </author>
            <author initials="P." surname="Camarillo" fullname="P. Camarillo" role="editor">
              <organization/>
            </author>
            <author initials="J." surname="Leddy" fullname="J. Leddy">
              <organization/>
            </author>
            <author initials="D." surname="Voyer" fullname="D. Voyer">
              <organization/>
            </author>
            <author initials="S." surname="Matsushima" fullname="S. Matsushima">
              <organization/>
            </author>
            <author initials="Z." surname="Li" fullname="Z. Li">
              <organization/>
            </author>
            <date year="2021" month="February"/>
          </front>
          <seriesInfo name="RFC" value="8986"/>
          <seriesInfo name="DOI" value="10.17487/RFC8986"/>
        </reference>

        <reference anchor="RFC9503" target="https://www.rfc-editor.org/info/rfc9503" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9503.xml">
          <front>
            <title>Simple Two-Way Active Measurement Protocol (STAMP) Extensions for Segment Routing Networks</title>
            <author fullname="Rakesh Gandhi">
              <organization>Cisco Systems, Inc.</organization>
            </author>
            <author fullname="Clarence Filsfils">
              <organization>Cisco Systems, Inc.</organization>
            </author>
            <author fullname="Mach(Guoyi) Chen">
              <organization>Huawei</organization>
            </author>
            <author fullname="Bart Janssens">
              <organization>Colt</organization>
            </author>
            <author fullname="Richard Foote">
              <organization>Nokia</organization>
            </author>
            <date year="2023" month="October"/>
          </front>
          <seriesInfo name="RFC" value="9503"/>
        </reference>

        <reference anchor="RFC9534" target="https://www.rfc-editor.org/info/rfc9534" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9534.xml">
          <front>
            <title>Simple Two-Way Active Measurement Protocol Extensions for Performance Measurement on a Link Aggregation Group</title>
            <author fullname="Zhenqiang Li">
              <organization>China Mobile</organization>
            </author>
            <author fullname="Tianran Zhou">
              <organization>Huawei</organization>
            </author>
            <author fullname="Jun Guo">
              <organization>ZTE Corp.</organization>
            </author>
            <author fullname="Greg Mirsky">
              <organization>Ericsson</organization>
            </author>
            <author fullname="Rakesh Gandhi">
              <organization>Cisco Systems, Inc.</organization>
            </author>
            <date year="2024" month="January"/>
          </front>
          <seriesInfo name="RFC" value="9534"/>
        </reference>

      <reference anchor="I-D.ietf-mpls-mna-hdr" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-mpls-mna-hdr.xml" target="https://www.ietf.org/archive/id/draft-ietf-mpls-mna-hdr-04.txt">
          <front>
            <title>MPLS Network Action Sub-Stack Solution</title>
            <author fullname="Jaganbabu Rajamanickam" role="editor" >
              <organization>Cisco Systems, Inc.</organization>
            </author>
            <author fullname="Rakesh Gandhi" role="editor">
              <organization>Cisco Systems, Inc.</organization>
            </author>
            <author fullname="Royi Zigler" >
              <organization>Broadcom</organization>
            </author>
            <author fullname="Haoyu Song">
              <organization>Futurewei Technologies</organization>
            </author>
           <author fullname="Kireeti Kompella">
             <organization>Juniper Networks</organization>
           </author>
            <date month="October" year="2023"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-mpls-mna-hdr-04"/>
      </reference>

      </references>

      <references>
        <name>Informative References</name>
        <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>

        <reference anchor="RFC2113" target="https://www.rfc-editor.org/info/rfc2113" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2113.xml">
          <front>
            <title>IP Router Alert Option</title>
            <author initials="D." surname="Katz" fullname="D. Katz">
              <organization/>
            </author>
            <date year="1997" month="February"/>
          </front>
          <seriesInfo name="RFC" value="2113"/>
          <seriesInfo name="DOI" value="10.17487/RFC2113"/>
        </reference>

        <reference anchor="RFC4291" target="https://www.rfc-editor.org/info/rfc4291" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4291.xml">
          <front>
            <title>IP Version 6 Addressing Architecture</title>
            <author initials="R." surname="Hinden" fullname="R. Hinden">
              <organization/>
            </author>
            <author initials="S." surname="Deering" fullname="S. Deering">
              <organization/>
            </author>
            <date year="2006" month="February"/>
          </front>
          <seriesInfo name="RFC" value="4291"/>
          <seriesInfo name="DOI" value="10.17487/RFC4291"/>
        </reference>

        <reference anchor="RFC5082" target="https://www.rfc-editor.org/info/rfc5082" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5082.xml">
          <front>
            <title>The Generalized TTL Security Mechanism (GTSM)</title>
            <author initials="V." surname="Gill" fullname="V. Gill">
              <organization/>
            </author>
            <author initials="J." surname="Heasley" fullname="J. Heasley">
              <organization/>
            </author>
            <author initials="D." surname="Meyer" fullname="D. Meyer">
              <organization/>
            </author>
            <author initials="P." surname="Savola" fullname="P. Savola" role="editor">
              <organization/>
            </author>
            <author initials="C." surname="Pignataro" fullname="C. Pignataro">
              <organization/>
            </author>
            <date year="2007" month="October"/>
          </front>
          <seriesInfo name="RFC" value="5082"/>
          <seriesInfo name="DOI" value="10.17487/RFC5082"/>
        </reference>

        <reference anchor="RFC5884" target="https://www.rfc-editor.org/info/rfc5884" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5884.xml">
          <front>
            <title>Bidirectional Forwarding Detection (BFD) for MPLS Label Switched Paths (LSPs)</title>
            <author initials="R." surname="Aggarwal" fullname="R. Aggarwal">
              <organization/>
            </author>
            <author initials="K." surname="Kompella" fullname="K. Kompella">
              <organization/>
            </author>
            <author initials="T." surname="Nadeau" fullname="T. Nadeau">
              <organization/>
            </author>
            <author initials="G." surname="Swallow" fullname="G. Swallow">
              <organization/>
            </author>
            <date year="2010" month="June"/>
          </front>
          <seriesInfo name="RFC" value="5884"/>
          <seriesInfo name="DOI" value="10.17487/RFC5884"/>
        </reference>

        <reference anchor="RFC6437" target="https://www.rfc-editor.org/info/rfc6437" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6437.xml">
          <front>
            <title>IPv6 Flow Label Specification</title>
            <author initials="S." surname="Amante" fullname="S. Amante">
              <organization/>
            </author>
            <author initials="B." surname="Carpenter" fullname="B. Carpenter">
              <organization/>
            </author>
            <author initials="S." surname="Jiang" fullname="S. Jiang">
              <organization/>
            </author>
            <author initials="J." surname="Rajahalme" fullname="J. Rajahalme">
              <organization/>
            </author>
            <date year="2011" month="November"/>
          </front>
          <seriesInfo name="RFC" value="6437"/>
          <seriesInfo name="DOI" value="10.17487/RFC6437"/>
        </reference>

        <reference anchor="RFC6936" target="https://www.rfc-editor.org/info/rfc6936" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6936.xml">
          <front>
            <title>Applicability Statement for the Use of IPv6 UDP Datagrams with Zero Checksums</title>
            <author initials="G." surname="Fairhurst" fullname="G. Fairhurst">
              <organization/>
            </author>
            <author initials="M." surname="Westerlund" fullname="M. Westerlund">
              <organization/>
            </author>
            <date year="2013" month="April"/>
          </front>
          <seriesInfo name="RFC" value="6936"/>
          <seriesInfo name="DOI" value="10.17487/RFC6936"/>
        </reference>

        <reference anchor="RFC7404" target="https://www.rfc-editor.org/info/rfc7404" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7404.xml">
          <front>
            <title>Using Only Link-Local Addressing inside an IPv6 Network</title>
            <author initials="M." surname="Behringer" fullname="M. Behringer">
              <organization/>
            </author>
            <author initials="E." surname="Vyncke" fullname="E. Vyncke">
              <organization/>
            </author>
            <date year="2014" month="November"/>
          </front>
          <seriesInfo name="RFC" value="7404"/>
          <seriesInfo name="DOI" value="10.17487/RFC7404"/>
        </reference>

        <reference anchor="RFC7820" target="https://www.rfc-editor.org/info/rfc7820" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7820.xml">
          <front>
            <title>UDP Checksum Complement in the One-Way Active Measurement Protocol (OWAMP) and Two-Way Active Measurement Protocol (TWAMP)</title>
            <author initials="T." surname="Mizrahi" fullname="T. Mizrahi">
              <organization/>
            </author>
            <date year="2016" month="March"/>
          </front>
          <seriesInfo name="RFC" value="7820"/>
          <seriesInfo name="DOI" value="10.17487/RFC7820"/>
        </reference>

        <reference anchor="RFC8029" target="https://www.rfc-editor.org/info/rfc8029" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8029.xml">
          <front>
            <title>Detecting Multiprotocol Label Switched (MPLS) Data-Plane Failures</title>
            <author initials="K." surname="Kompella" fullname="K. Kompella">
              <organization/>
            </author>
            <author initials="G." surname="Swallow" fullname="G. Swallow">
              <organization/>
            </author>
            <author initials="C." surname="Pignataro" fullname="C. Pignataro" role="editor">
              <organization/>
            </author>
            <author initials="N." surname="Kumar" fullname="N. Kumar">
              <organization/>
            </author>
            <author initials="S." surname="Aldrin" fullname="S. Aldrin">
              <organization/>
            </author>
            <author initials="M." surname="Chen" fullname="M. Chen">
              <organization/>
            </author>
            <date year="2017" month="March"/>
          </front>
          <seriesInfo name="RFC" value="8029"/>
          <seriesInfo name="DOI" value="10.17487/RFC8029"/>
        </reference>

        <reference anchor="RFC8085" target="https://www.rfc-editor.org/info/rfc8085" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8085.xml">
          <front>
            <title>UDP Usage Guidelines</title>
            <author initials="L." surname="Eggert" fullname="L. Eggert">
              <organization/>
            </author>
            <author initials="G." surname="Fairhurst" fullname="G. Fairhurst">
              <organization/>
            </author>
            <author initials="G." surname="Shepherd" fullname="G. Shepherd">
              <organization/>
            </author>
            <date year="2017" month="March"/>
          </front>
          <seriesInfo name="BCP" value="145"/>
          <seriesInfo name="RFC" value="8085"/>
          <seriesInfo name="DOI" value="10.17487/RFC8085"/>
        </reference>

         <reference anchor="RFC8402" target="https://www.rfc-editor.org/info/rfc8402" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8402.xml">
          <front>
            <title>Segment Routing Architecture</title>
            <author initials="C." surname="Filsfils" fullname="C. Filsfils" role="editor">
              <organization/>
            </author>
            <author initials="S." surname="Previdi" fullname="S. Previdi" role="editor">
              <organization/>
            </author>
            <author initials="L." surname="Ginsberg" fullname="L. Ginsberg">
              <organization/>
            </author>
            <author initials="B." surname="Decraene" fullname="B. Decraene">
              <organization/>
            </author>
            <author initials="S." surname="Litkowski" fullname="S. Litkowski">
              <organization/>
            </author>
            <author initials="R." surname="Shakir" fullname="R. Shakir">
              <organization/>
            </author>
            <date year="2018" month="July"/>
          </front>
          <seriesInfo name="RFC" value="8402"/>
          <seriesInfo name="DOI" value="10.17487/RFC8402"/>
        </reference>

        <reference anchor="RFC8545" target="https://www.rfc-editor.org/info/rfc8545" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8545.xml">
          <front>
            <title>Well-Known Port Assignments for the One-Way Active Measurement Protocol (OWAMP) and the Two-Way Active Measurement Protocol (TWAMP)</title>
            <author initials="A." surname="Morton" fullname="A. Morton" role="editor">
              <organization/>
            </author>
            <author initials="G." surname="Mirsky" fullname="G. Mirsky" role="editor">
              <organization/>
            </author>
            <date year="2019" month="March"/>
          </front>
          <seriesInfo name="RFC" value="8545"/>
          <seriesInfo name="DOI" value="10.17487/RFC8545"/>
        </reference>

        <reference anchor="RFC8754" target="https://www.rfc-editor.org/info/rfc8754" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8754.xml">
          <front>
            <title>IPv6 Segment Routing Header (SRH)</title>
            <author initials="C." surname="Filsfils" fullname="C. Filsfils" role="editor">
              <organization/>
            </author>
            <author initials="D." surname="Dukes" fullname="D. Dukes" role="editor">
              <organization/>
            </author>
            <author initials="S." surname="Previdi" fullname="S. Previdi">
              <organization/>
            </author>
            <author initials="J." surname="Leddy" fullname="J. Leddy">
              <organization/>
            </author>
            <author initials="S." surname="Matsushima" fullname="S. Matsushima">
              <organization/>
            </author>
            <author initials="D." surname="Voyer" fullname="D. Voyer">
              <organization/>
            </author>
            <date year="2020" month="March"/>
          </front>
          <seriesInfo name="RFC" value="8754"/>
          <seriesInfo name="DOI" value="10.17487/RFC8754"/>
        </reference>

         <reference anchor="RFC9256" target="https://www.rfc-editor.org/info/rfc9256" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9256.xml">
          <front>
            <title>Segment Routing Policy Architecture</title>
            <author fullname="Clarence Filsfils">
              <organization>Cisco Systems</organization>
            </author>
            <author fullname="Ketan Talaulikar">
              <organization>Cisco Systems</organization>
            </author>
            <author fullname="Daniel Voyer">
              <organization>Bell Canada</organization>
            </author>
            <author fullname="Alex Bogdanov">
              <organization>British Telecom</organization>
            </author>
            <author fullname="Paul Mattes">
              <organization>Microsoft</organization>
            </author>
            <date month="July" year="2022"/>
          </front>
          <seriesInfo name="RFC" value="9256"/>
        </reference>

     <reference anchor="RFC9350" target="https://www.rfc-editor.org/info/rfc9350" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9350.xml">
          <front>
            <title>IGP Flexible Algorithm</title>
            <author initials="P." surname="Psenak" fullname="Peter Psenak" role="editor">
              <organization/>
            </author>
            <author initials="S." surname="Hegde" fullname="Shraddha Hegde">
              <organization/>
            </author>
            <author initials="C." surname="Filsfils" fullname="Clarence Filsfils">
              <organization/>
            </author>
            <author initials="K." surname="Talaulikar" fullname="Ketan Talaulikar">
              <organization/>
            </author>
            <author initials="A." surname="Gulko" fullname="Arkadiy Gulko">
              <organization/>
            </author>
            <date year="2023" month="February"/>
          </front>
          <seriesInfo name="RFC" value="9350"/>
        </reference>

       <reference anchor="RFC9524" target="https://www.rfc-editor.org/info/rfc9524" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9524.xml">
          <front>
            <title>Segment Routing Replication for Multipoint Service Delivery</title>
            <author fullname="Daniel Voyer" role="editor">
              <organization>Bell Canada</organization>
            </author>
            <author fullname="Clarence Filsfils">
              <organization>Cisco Systems, Inc.</organization>
            </author>
            <author fullname="Rishabh Parekh">
              <organization>Cisco Systems, Inc.</organization>
            </author>
            <author fullname="Hooman Bidgoli">
              <organization>Nokia</organization>
            </author>
            <author fullname="Zhaohui Zhang">
              <organization>Juniper Networks</organization>
            </author>
            <date month="February" year="2024"/>
          </front>
          <seriesInfo name="RFC" value="9524"/>
        </reference>

       <reference anchor="RFC9545" target="https://www.rfc-editor.org/info/rfc9545" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9545.xml">
          <front>
            <title>Path Segment in MPLS-Based Segment Routing Network</title>
            <author fullname="Weiqiang Cheng">
              <organization>China Mobile</organization>
            </author>
            <author fullname="Han Li">
              <organization>China Mobile</organization>
            </author>
            <author fullname="Cheng Li">
              <organization>Huawei</organization>
            </author>
            <author fullname="Rakesh Gandhi">
              <organization>Cisco Systems, Inc.</organization>
            </author>
            <author fullname="Royi Zigler">
              <organization>Broadcom</organization>
            </author>
            <date month="February" year="2024"/>
          </front>
          <seriesInfo name="RFC" value="9545"/>
        </reference>

      <reference anchor="I-D.ietf-pim-sr-p2mp-policy" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-pim-sr-p2mp-policy.xml" target="https://www.ietf.org/archive/id/draft-ietf-pim-sr-p2mp-policy-07.txt">
          <front>
            <title>Segment Routing Point-to-Multipoint Policy</title>
            <author fullname="Daniel Voyer" role="editor">
              <organization>Bell Canada</organization>
            </author>
            <author fullname="Clarence Filsfils">
              <organization>Cisco Systems, Inc.</organization>
            </author>
            <author fullname="Rishabh Parekh">
              <organization>Cisco Systems, Inc.</organization>
            </author>
            <author fullname="Hooman Bidgoli">
              <organization>Nokia</organization>
            </author>
            <author fullname="Zhaohui Zhang">
              <organization>Juniper Networks</organization>
            </author>
            <date month="October" day="11" year="2023"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-pim-sr-p2mp-policy-07"/>
        </reference>

        <reference anchor="I-D.ietf-spring-srv6-path-segment" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-spring-srv6-path-segment.xml" target="https://www.ietf.org/archive/id/draft-ietf-spring-srv6-path-segment-07.txt">
          <front>
            <title>Path Segment for SRv6 (Segment Routing in IPv6)</title>
            <author fullname="Cheng Li">
              <organization>Huawei Technologies</organization>
            </author>
            <author fullname="Weiqiang Cheng">
              <organization>China Mobile</organization>
            </author>
            <author fullname="Mach(Guoyi) Chen">
              <organization>Huawei Technologies</organization>
            </author>
            <author fullname="Dhruv Dhody">
              <organization>Huawei Technologies</organization>
            </author>
            <author fullname="Yongqing Zhu">
              <organization>China Telecom</organization>
            </author>
            <date month="October" day="19" year="2023"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-spring-srv6-path-segment-07"/>
        </reference>

        <reference anchor="I-D.ietf-pce-sr-bidir-path" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-pce-sr-bidir-path.xml" target="https://www.ietf.org/archive/id/draft-ietf-pce-sr-bidir-path-13.txt">
          <front>
            <title>Path Computation Element Communication Protocol (PCEP) Extensions for Associated Bidirectional Segment Routing (SR) Paths</title>
            <author fullname="Cheng Li">
              <organization>Huawei Technologies</organization>
            </author>
            <author fullname="Mach(Guoyi) Chen">
              <organization>Huawei Technologies</organization>
            </author>
            <author fullname="Weiqiang Cheng">
              <organization>China Mobile</organization>
            </author>
            <author fullname="Rakesh Gandhi">
              <organization>Cisco Systems, Inc.</organization>
            </author>
            <author fullname="Quan Xiong">
              <organization>ZTE Corporation</organization>
            </author>
            <date month="February" day="13" year="2024"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-pce-sr-bidir-path-13"/>
        </reference>

        <reference anchor="I-D.ietf-ippm-stamp-yang" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-ippm-stamp-yang.xml" target="https://www.ietf.org/archive/id/draft-ietf-ippm-stamp-yang-12.txt">
          <front>
            <title>Simple Two-way Active Measurement Protocol (STAMP) Data Model</title>
            <author fullname="Greg Mirsky">
              <organization>Ericsson</organization>
            </author>
            <author fullname="Xiao Min">
              <organization>ZTE Corp.</organization>
            </author>
            <author fullname="Wei S Luo">
              <organization>Ericsson</organization>
            </author>
            <author fullname="Rakesh Gandhi">
              <organization>Cisco Systems, Inc.</organization>
            </author>
            <date month="November" day="05" year="2023"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-ippm-stamp-yang-12"/>
        </reference>

        <reference anchor="I-D.mirsky-ippm-asymmetrical-pkts" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.mirsky-ippm-asymmetrical-pkts.xml" target="https://www.ietf.org/archive/id/draft-mirsky-ippm-asymmetrical-pkts-04.txt">
          <front>
            <title>Performance Measurement with Asymmetrical Packets in STAMP</title>
            <author fullname="Greg Mirsky">
              <organization>Ericsson</organization>
            </author>
            <author fullname="Ernesto Ruffini">
              <organization>OutSys</organization>
            </author>
            <author fullname="Henrik Nydell">
              <organization>Accedian Networks</organization>
            </author>
            <author initials="R." surname="Foote" fullname="R. Foote">
              <organization/>
            </author>
            <date month="February" day="20" year="2024"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-mirsky-ippm-asymmetrical-pkts-04"/>
        </reference>

        <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.  The authors
   would also like to thank Greg Mirsky, Gyan Mishra, Xie Jingrong, 
   and Mike Koldychev for reviewing this document and
   providing useful comments and suggestions. Patrick Khordoc, Haowei Shi, Amila Tharaperiya Gamage, Pengyan Zhang, Ruby Lin and Radu
   Valceanu have helped improve the mechanisms described in this document.</t>
    </section>


   <section numbered="false" title="Contributors">
   <t>The following people have substantially contributed to this document:</t>

   <artwork><![CDATA[Bart Janssens
Colt
Email: Bart.Janssens@colt.net

]]></artwork>

   <artwork><![CDATA[Navin Vaghamshi
Reliance
Email: Navin.Vaghamshi@ril.com

]]></artwork>

   <artwork><![CDATA[Moses Nagarajah
Telstra
Email: Moses.Nagarajah@team.telstra.com

]]></artwork>

   <artwork><![CDATA[Amit Dhamija
Arrcus
India
Email: amitd@arrcus.com

]]></artwork>

    </section>

  </back>
</rfc>
