<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
<!ENTITY nbsp   "&#160;">
<!ENTITY zwsp   "&#8203;">
<!ENTITY nbhy   "&#8209;">
<!ENTITY wj     "&#8288;">
<!ENTITY RFC768 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.768.xml">
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC3032 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3032.xml">
<!ENTITY RFC3443 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3443.xml">
<!ENTITY RFC4026 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4026.xml">
<!ENTITY RFC4448 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4448.xml">
<!ENTITY RFC5462 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5462.xml">
<!ENTITY RFC8174 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC8762 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8762.xml">
<!ENTITY RFC8972 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8972.xml">
<!ENTITY RFC4385 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4385.xml">
<!ENTITY RFC5085 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5085.xml">
<!ENTITY RFC5087 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5087.xml">
<!ENTITY RFC5921 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5921.xml">
<!ENTITY RFC5960 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5960.xml">
<!ENTITY RFC6056 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6056.xml">
<!ENTITY RFC6335 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6335.xml">
<!ENTITY RFC6374 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6374.xml">
<!ENTITY RFC6398 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6398.xml">
<!ENTITY RFC4928 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4928.xml">
<!ENTITY RFC7325 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7325.xml">
<!ENTITY RFC6658 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6658.xml">
<!ENTITY RFC6790 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6790.xml">
<!ENTITY RFC5586 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5586.xml">
<!ENTITY RFC6936 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6936.xml">
<!ENTITY RFC7708 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7708.xml">
<!ENTITY RFC7820 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7820.xml">
<!ENTITY RFC8085 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8085.xml">
<!ENTITY RFC8200 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8200.xml">
<!ENTITY RFC9780 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9780.xml">
<!ENTITY RFC9790 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9790.xml">
<!ENTITY RFC9801 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9801.xml">
<!ENTITY RFC9503 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9503.xml">
<!ENTITY RFC9570 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9570.xml">
<!ENTITY I-D.ietf-spring-stamp-srpm-mpls SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-spring-stamp-srpm-mpls.xml">
]>

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" docName="draft-ietf-mpls-stamp-pw-18" category="std" consensus="true" updates="8762, 8972" ipr="trust200902">
<!-- xml2rfc v2v3 conversion 3.12.0 -->
<!-- Generated by id2xml 1.5.0 on 2020-02-06T01:41:26Z -->
    <?rfc compact="yes"?>
    <?rfc text-list-symbols="oo*+-"?>
    <?rfc subcompact="no"?>
    <?rfc sortrefs="false"?>
    <?rfc symrefs="true"?>
    <?rfc strict="yes"?>
    <?rfc toc="yes"?>

    <front>
    <title abbrev="STAMP in MPLS Networks">Encapsulation of Simple Two-Way Active Measurement Protocol for LSPs and Pseudowires in MPLS Networks</title>

    <author fullname="Rakesh Gandhi" initials="R." role="editor" surname="Gandhi">
    <organization>Cisco Systems, Inc.</organization>
    <address>
    <postal><country>Canada</country>
    </postal>
        <email>rgandhi@cisco.com</email>
    </address>
    </author>

    <author fullname="Patrice Brissette" initials="P." surname="Brissette">
    <organization>Cisco Systems, Inc.</organization>
        <address>
    <postal><country>Canada</country>
    </postal>
        <email>pbrisset@cisco.com</email>
    </address>
    </author>

    <author fullname="Edward Leyton" initials="E." surname="Leyton">
     <organization>Verizon Wireless</organization>
     <address>
     <email>edward.leyton@verizonwireless.com</email>
     </address>
    </author>

    <author fullname="Xiao Min" initials="X." surname="Min">
      <organization>ZTE Corp.</organization>
     <address>
       <postal>
         <street/>
         <city>Nanjing</city>
         <region/>
         <code/>
         <country>China</country>
       </postal>
       <email>xiao.min2@zte.com.cn</email>
     </address>
    </author>

    <date year="2026"/>
    <workgroup>MPLS Working Group</workgroup>

    <abstract>
   <t>
    This document specifies encapsulations for the Simple Two-Way Active Measurement Protocol
    (STAMP), defined in RFC 8762, and its optional extensions, defined in RFC 8972, in MPLS
    networks. It specifies the encapsulation of STAMP test packets for point-to-point Label
    Switched Paths (LSPs) and point-to-point single-segment Pseudowires (PWs), with or without an
    IP/UDP header, so that the test packets experience the same forwarding and Equal-Cost
    Multi-Path (ECMP) behavior as the data traffic being measured. In addition, two new MPLS
    Generic Associated Channel (G-ACh) types are defined.
   </t>

   <t>
  This document updates RFC 8762 and RFC 8972 to allow STAMP to operate without an IP/UDP header when STAMP test packets are carried over MPLS LSPs and PWs, and specifies the resulting changes to the processing of the STAMP session identifier, the TTL and IPv6 Hop Limit, and the STAMP TLV extensions.
   </t>

   <t>
   This document specifies the requirements for IPv6 STAMP in unauthenticated mode using UDP zero-checksum, which deviates from the integrity requirement in RFC 6936.
   </t>

    </abstract>
    </front>

    <middle>
    <section title="Introduction" anchor="sect-1">
  
   <t>The Simple Two-Way Active Measurement Protocol (STAMP) provides
   capabilities for measuring various metrics in IP networks
   <xref target="RFC8762"/> without the use of a control channel to
   pre-signal session parameters. <xref target="RFC8972"/> defines optional extensions to STAMP.
   </t>

   <t>Label Switched Paths (LSPs) are used in MPLS networks for various services, 
   including forwarding Layer 2 and Layer 3 data packets.
   LSPs can be point-to-point or point-to-multipoint. 
   STAMP encapsulations for point-to-multipoint LSPs are outside the scope of this document.
   This document specifies STAMP encapsulations for point-to-point LSPs.
   </t>

   <t>Pseudowires (PWs) are used in MPLS networks for various services,
   including forwarding Layer 2 and Layer 3 data packets <xref target="RFC6658"/>.
   PWs are bidirectional in nature.
   PWs may use the Control Word (CW) as defined in <xref target="RFC4385" section="3"/>.
   This document covers STAMP encapsulations for point-to-point PWs; point-to-multipoint PWs are outside the scope of this document.
   PWs can be single-segment PWs or multi-segment PWs.
   This document specifies STAMP encapsulations for single-segment PWs; multi-segment PWs are outside the scope of this document.
   </t>

   <t>
   MPLS Transport Profile (MPLS-TP) <xref target="RFC5960"/> is designed to use the MPLS data plane without any changes.
   Therefore, when STAMP is specified over the MPLS data plane, it is equally
   applicable to MPLS-TP networks. 
   As specified in <xref target="RFC5921" section="2"/>,
   "OAM and protection mechanisms, and forwarding of data packets, must
   be able to operate without IP forwarding support."
   As described in <xref target="RFC5921" section="3.4.5"/>, MPLS-TP LSPs and PWs may carry traffic from the attachment circuits
   that may be heterogeneous (e.g., any combination of SDH, PPP, Frame Relay, etc.).
   </t>

   <t>
   A Generic Associated Channel (G-ACh), as defined in <xref target="RFC5586"/>, provides a mechanism
   for carrying Operations, Administration, and Maintenance (OAM) and other control messages over the MPLS data plane.
   The G-ACh type identifies the specific OAM message carried over the channel.
   Virtual Circuit Connectivity Verification (VCCV) is used as a control channel for PWs as specified in <xref target="RFC5085"/>.
   A G-ACh label (GAL) can be used as a VCCV Control Channel as specified in <xref target="RFC7708"/>.
   </t>

   <t>
   This document specifies the encapsulation and termination procedures for STAMP and its
   optional extensions for LSPs and PWs in MPLS networks.
   This document also specifies the encapsulation and termination procedures for STAMP test packets with or without the CW and/or an IP/UDP header
   for LSPs and PWs.
   </t>

   <t>
   When STAMP is used for MPLS and MPLS-TP on both LSPs and PWs,
   there are unique aspects, such as test packet encapsulation, test packet termination, and ECMP behavior, that need to be considered with respect to the use of the CW,
   and these aspects are addressed in this document.
   </t>

   <t>
   This document uses the mechanisms defined in <xref target="RFC5085"/> and <xref target="RFC7708"/> to terminate STAMP
   test packets on the Session-Sender and the Session-Reflector for control-plane processing for both LSPs and PWs.
   </t>

   <ul>
   <li>
   <t>The mechanism applied to terminate the STAMP test packet for an LSP or a PW is locally provisioned on both ends of the STAMP session for the LSP or PW.</t>
   </li>
   <li>
   <t>The signaling extensions for the VCCV Control Channel for STAMP on PWs are outside the scope of this document.</t>
   </li>
   <li>
   <t>The VCCV Control Channel signaling has only been specified for PWs, not for LSPs; therefore, local provisioning of the mechanism for an LSP is the only viable option at present.</t>
   </li>
   </ul>

   <t>
   This document uses the existing G-ACh types "Associated Channel carries an IPv4 packet" 
   and "Associated Channel carries an IPv6 packet" when STAMP test packets are transmitted with an IP/UDP header for LSPs and PWs.
   In addition, this document defines two new G-ACh types when STAMP test packets are transmitted without an IP/UDP header.
   </t>

   <t>
   Additional considerations for encapsulating STAMP for performance measurement of Segment Routing 
   LSPs over the MPLS data plane are described in <xref target="I-D.ietf-spring-stamp-srpm-mpls"/>, and
   are outside the scope of this document.
   </t>

   <t>
  This document updates <xref target="RFC8762"/> and <xref target="RFC8972"/> to allow STAMP to operate without an IP/UDP header when STAMP test packets are carried over MPLS LSPs and PWs, and specifies the resulting changes to the processing of the STAMP session identifier, the TTL and IPv6 Hop Limit, and the STAMP TLV extensions.
   </t>

   <t>
  This document specifies the requirements for IPv6 STAMP in unauthenticated mode using UDP zero-checksum, which deviates from the integrity requirement in <xref target="RFC6936"/>.
   </t>

   <section title="Requirements" anchor="sect-1.1">

   <t>
   STAMP test packets need to be transmitted with the same
   label stack as the LSP and PW data traffic to ensure proper validation
   of the underlay path taken by the actual data traffic. In addition, STAMP test packets need
   to consider the underlay path taken by the LSP and PW data traffic in the network.
   PW data traffic may be encapsulated with the CW, as defined in <xref target="RFC4385" section="3"/>, and an IP header.
   As such, STAMP test packets need to be transmitted over these PWs using a G-ACh and an IP/UDP header.
   </t>

   <t>
   When a STAMP test packet is transmitted to the target IP address of a STAMP Session-Reflector, it is
   encapsulated for an MPLS LSP by the data plane based on the reachability of that IP address over the LSP.
   Hence, STAMP test packets are treated the same as the data traffic forwarded over the LSP by the transit nodes along the path.
   </t>

   <t>
   Private Line Emulation (PLE) <xref target="RFC9801"/>
   traffic is sent over a Packet Switched Network (PSN) as a Virtual Private Wire Service (VPWS) using PWs.
   The data packets are encapsulated with the PLE CW, but they do not carry any IP header.
   As such, STAMP test packets need to be transmitted using the same label stack,
   including the VPWS PW label as the PLE traffic <xref target="RFC9801"/>,
   and encapsulated using a G-ACh but without an IP/UDP header.
   This allows STAMP test packets to experience the same forwarding
   behavior, follow the same underlay path as the PLE traffic.</t>

   <t>
   The G-ACh provides support for the OAM control channel associated
   with MPLS-TP <xref target="RFC5960"/> LSPs and PWs.
   The OAM control channel for MPLS-TP needs to be extended to encapsulate STAMP test packets using the G-ACh types.
   This extension is similar to the G-ACh types defined for delay and loss measurement packets in <xref target="RFC6374"/>.
   </t>
   
   <t>
   The encapsulation requirements for STAMP test packets transmitted on the LSPs and PWs in MPLS networks can be summarized as follows:
   </t>

  <ul>
  <li>
  <t>The G-ACh needs to support STAMP test packets with an IP/UDP header.</t>
  </li>
  <li>
  <t>The G-ACh needs to support STAMP test packets without an IP/UDP header.</t>
  </li>
  <li>
  <t>The G-ACh types need to support demultiplexing of the control channel for STAMP test packets.</t>
  </li>
  <li>
  <t>Session-Sender test packets need to follow the underlay path taken by the data traffic that uses the CW.</t>
  </li>
  <li>
  <t>Session-Sender test packets need to follow the same underlay path as the data traffic that uses the CW and an Entropy Label defined in <xref target="RFC6790"/>.</t>
  </li>
  <li>
  <t>Session-Sender test packets need to follow the same underlay path as the data traffic that uses the CW but does not use an Entropy Label defined in <xref target="RFC6790"/>.</t>
  </li>
  <li>
  <t>Session-Reflector test packets can follow the reverse underlay path taken by Session-Sender test packets.</t>
  </li>
  <li>
  <t>Session-Reflector test packets can follow the same reverse underlay path as the Session-Sender test packets.</t>
  </li>
  </ul>

   </section>

   <section title="Examples of MPLS Data Traffic Use Cases" anchor="sect-1.2">

    <t>Examples of MPLS data traffic use cases for STAMP test packets with IP/UDP headers are:</t>
    <ol>
     <li>
      <t>MPLS PW Data Traffic (with CW and IP header)</t>
     </li>
     <li>
      <t>MPLS-TP PW Data Traffic (with CW and IP header)</t>
     </li>
     <li>
      <t>MPLS LSP Data Traffic (with IP header)</t>
     </li>
    </ol>
    
    <t>Examples of MPLS data traffic use cases for STAMP test packets without IP/UDP headers are:</t>
    <ol>
     <li>
      <t>MPLS Ethernet PW Data Traffic <xref target="RFC4448"/></t>
     </li>
     <li>
      <t>PLE <xref target="RFC9801"/> PW Data Traffic</t>
     </li>
     <li>
      <t>TDM over IP <xref target="RFC5087"/> PW Data Traffic (with no IP header)</t>
     </li>
     <li>
      <t>MPLS-TP LSP Data Traffic</t>
     </li>
    </ol>

    </section>

   </section>

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

   <section title="Abbreviations" anchor="sect-2.2">

   <table anchor="abbreviations">
   <name>Abbreviations</name>
   <thead>
   <tr>
   <th align="left">Abbreviation</th>
   <th align="left">Meaning</th>
   <th align="left">Reference</th>
   </tr>
   </thead>
   <tbody>
   <tr>
   <td>CE</td>
   <td>Customer Edge</td>
   <td><xref target="RFC4026"/></td>
   </tr>
   <tr>
  <td>CW</td>
  <td>Control Word</td>
  <td><xref target="RFC4385"/></td>
  </tr>
  <tr>
   <td>ECMP</td>
   <td>Equal-Cost Multi-Path</td>
   <td><xref target="RFC6790"/></td>
   </tr>
   <tr>
   <td>ACH</td>
   <td>Associated Channel</td>
   <td><xref target="RFC5586"/></td>
   </tr>
  <tr>
   <td>G-ACh</td>
   <td>Generic Associated Channel</td>
   <td><xref target="RFC5586"/></td>
   </tr>
   <tr>
   <td>GAL</td>
  <td>Generic Associated Channel Label</td>
   <td><xref target="RFC5586"/></td>
   </tr>
   <tr>
   <td>HMAC</td>
   <td>Hashed Message Authentication Code</td>
   <td><xref target="RFC8762"/></td>
   </tr>
    <tr>
    <td>HL</td>
    <td>Hop Limit</td>
    <td><xref target="RFC8200"/></td>
    </tr>
  <tr>
  <td>L2VPN</td>
  <td>Layer 2 Virtual Private Network</td>
  <td><xref target="RFC4026"/></td>
  </tr>
  <tr>
  <td>L3VPN</td>
  <td>Layer 3 Virtual Private Network</td>
  <td><xref target="RFC4026"/></td>
  </tr>
   <tr>
   <td>LSP</td>
   <td>Label Switched Path</td>
   <td><xref target="RFC3032"/></td>
   </tr>
   <tr>
   <td>MPLS</td>
   <td>Multiprotocol Label Switching</td>
   <td><xref target="RFC3032"/></td>
   </tr>
   <tr>
   <td>MPLS-TP</td>
   <td>MPLS Transport Profile</td>
   <td><xref target="RFC5960"/></td>
   </tr>
   <tr>
   <td>OAM</td>
   <td>Operations, Administration, and Maintenance</td>
   <td><xref target="RFC5586"/></td>
   </tr>
   <tr>
   <td>PE</td>
  <td>Provider Edge</td>
   <td><xref target="RFC4026"/></td>
   </tr>
  <tr>
  <td>PFN</td>
  <td>Post-Stack First Nibble</td>
  <td><xref target="RFC9790"/></td>
  </tr>
   <tr>
   <td>PLE</td>
   <td>Private Line Emulation</td>
   <td><xref target="RFC9801"/></td>
   </tr>
  <tr>
  <td>PSN</td>
  <td>Packet Switched Network</td>
  <td><xref target="RFC9801"/></td>
  </tr>
  <tr>
  <td>RA</td>
  <td>Router Alert</td>
  <td><xref target="RFC5085"/></td>
  </tr>
   <tr>
   <td>PW</td>
   <td>Pseudowire</td>
   <td><xref target="RFC6658"/></td>
   </tr>
   <tr>
   <td>S bit</td>
   <td>Bottom of Stack bit</td>
   <td><xref target="RFC3032"/></td>
   </tr>
   <tr>
   <td>SSID</td>
   <td>STAMP Session Identifier</td>
   <td><xref target="RFC8972"/></td>
   </tr>
   <tr>
   <td>STAMP</td>
   <td>Simple Two-Way Active Measurement Protocol</td>
   <td><xref target="RFC8762"/></td>
   </tr>
   <tr>
   <td>TC</td>
   <td>Traffic Class</td>
   <td><xref target="RFC5462"/></td>
   </tr>
   <tr>
  <td>TDM</td>
  <td>Time-Division Multiplexing</td>
  <td><xref target="RFC5087"/></td>
  </tr>
   <tr>
   <td>TTL</td>
  <td>Time to Live</td>
   <td><xref target="RFC3032"/></td>
   </tr>
  <tr>
  <td>VCCV</td>
  <td>Virtual Circuit Connectivity Verification</td>
  <td><xref target="RFC5085"/></td>
  </tr>
  <tr>
  <td>VPWS</td>
  <td>Virtual Private Wire Service</td>
  <td><xref target="RFC9801"/></td>
  </tr>
   </tbody>
   </table>

   </section>

   <section title="STAMP Reference Topology" anchor="sect-2.3">
   <t>
   In the STAMP reference topology shown in <xref target="ure-stamp-reference-top"/>,
   there is an LSP or a PW to transport data between Provider Edge (PE) endpoints S1 and R1.
   The STAMP Session-Sender on PE node S1 initiates a
   Session-Sender test packet, and the STAMP Session-Reflector on PE node R1
   transmits a reply Session-Reflector test packet. The Session-Reflector test packet may be transmitted
   to the STAMP Session-Sender node S1 on the same path (that is, the same set
   of links and nodes) in the reverse direction of the path taken toward the Session-Reflector node R1.
   </t>

   <figure title="STAMP Reference Topology using LSP and PW" anchor="ure-stamp-reference-top"><artwork><![CDATA[

                 |<-------- Pseudowire ------->|
                 |<-------- LSP -------------->|
                 |                             |
                 |     T1                T2    |
                 |    /                   \    |
             +-------+      Test Packet    +-------+
             |       | - - - - - - - - - ->|       |
             |   S1  |=====================|   R1  |
             |       |<- - - - - - - - - - |       |
             +-------+  Reply Test Packet  +-------+
                      \                   /
                       T4                T3

         STAMP Session-Sender        STAMP Session-Reflector
         Provider Edge Endpoint      Provider Edge Endpoint
]]></artwork>
    </figure>

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

   <t>
   The STAMP test packets are used for one-way and round-trip performance metrics, such as delay, delay
   variation, and packet loss <xref target="RFC8972"/>.
   </t> 

    </section>

   </section>
   
    <section title="Overview" anchor="sect-3">
    <t>
    The STAMP Session-Sender and Session-Reflector test packet payloads defined 
    in <xref target="RFC8972"/> are encapsulated and transmitted over the LSPs and PWs in MPLS networks.
    </t>

    <t>
    The STAMP Session Identifier (SSID) defined in <xref target="RFC8972"/> is used to identify the STAMP session and MUST be set to a nonzero value.
    The SSID MUST be carried in STAMP test packets in both directions so that the STAMP sessions for LSPs and PWs can be identified.
    </t>

    <section title="IP/UDP Header" anchor="sect-3.1">
    <t>
    The IP/UDP header specified in this section is applicable to all STAMP sessions using an IP/UDP header and is not limited to STAMP sessions for LSPs and PWs.
    </t>

    <t>
    The STAMP Session-Sender and Session-Reflector addresses for a STAMP session are provisioned on both ends of the LSP or PW.
    </t>

    <t>
    The base STAMP test packet payloads can be transported using a UDP
    header and destination UDP port number 862 as the default destination port,
    as specified in <xref target="RFC8762" section="4.1"/>.
    </t>

    <t>
    The source port number is chosen as follows:
    </t>

    <ul>
    <li>
    The source UDP port number SHOULD be chosen using a randomized allocation method
    as specified in <xref target="RFC6056"/> to provide protection against off-path attacks,
    as recommended in <xref target="RFC8085"/>.
    </li>
    <li>
    The source UDP port number SHOULD be chosen from the Dynamic Ports range (49152-65535)
    <xref target="RFC6335"/> to avoid conflicts with well-known and registered service ports.
    </li>
    <li>
    The source UDP port number MUST distinguish between the received Session-Reflector test packets and
    the Session-Sender test packets from the reverse direction.
    </li>
    </ul>
    </section>

      <section title="Formats and G-ACh Types for STAMP" anchor="sect-3.2">

    <t>
    STAMP test packet payloads are encapsulated over a G-ACh in two formats:
    Format-1 (with an IP/UDP header) and Format-2 (without an IP/UDP header).
    </t>

    <ul>

    <li>
    Format-1 (with IP/UDP Header):
    <ul>
    <li>
    For encapsulating the STAMP test packet payloads over a G-ACh with IP/UDP headers, the channel types
    "Associated Channel carries an IPv4 packet" and "Associated Channel carries an IPv6 packet" <xref target="RFC4385"/> are used for both Session-Sender
    and Session-Reflector test packets.
    </li>
    <li>
    The destination UDP port number in the Session-Sender and Session-Reflector test packets distinguishes
    the test packets.
    </li>
    </ul>
    </li>

    <li>
    Format-2 (without IP/UDP Header):
    <ul>
    <li>
    For encapsulating the STAMP test packet payloads over a G-ACh without adding IP/UDP headers,
    two new channel types are defined in this document: one for the Session-Sender test packets (see <xref target="sect-5.2"/>)
    and one for the Session-Reflector test packets (see <xref target="sect-6.2"/>).
    </li>
    <li>
    The different channel types are required for the Session-Sender and Session-Reflector test packets
    because the STAMP test packets do not have a way to discriminate between them.
    </li>
    </ul>
    </li>

    </ul>

    <section title="STAMP Applicability to Format-2 (without IP/UDP Header)" anchor="sect-3.2.1">
    <t>
    This document updates the procedures defined in <xref target="RFC8762"/> and <xref target="RFC8972"/> for Format-2 STAMP test packets because they do not carry IP/UDP headers.
    </t>

    <t>
      The base STAMP test packet defined in <xref target="RFC8762"/> and the STAMP Session Identifier defined in <xref target="RFC8972"/> carry no dependency on the IP or UDP header, and the integrity protection of <xref target="RFC8762" section="4.4"/> and the HMAC TLV of <xref target="RFC8972" section="4.8"/> are computed over the STAMP packet alone. These apply to Format-2 unchanged.
    </t>

    <t>
    A TLV that reports or sets a field of the IP or UDP header cannot be used with Format-2 test packets. A Session-Sender MUST NOT include such a TLV in a Format-2 test packet, and a Session-Reflector that receives one MUST set the U flag as specified in <xref target="RFC8972" section="4"/> and MUST NOT attempt to populate it. This applies to the Location TLV (<xref target="RFC8972" section="4.2"/>), the Class of Service TLV (<xref target="RFC8972" section="4.4"/>), the Destination Node Address TLV (<xref target="RFC9503" section="3"/>), and the Return Address Sub-TLVs of the Return Path TLV (<xref target="RFC9503" section="4"/>).
    </t>

    <t>
    Requirements in <xref target="RFC8762"/> and <xref target="RFC8972"/> that operate on the IP or UDP header likewise have no effect for Format-2 test packets, including the UDP header Length comparison required by <xref target="RFC8972" section="4"/> and the UDP port considerations in <xref target="RFC8762" section="7"/>.
    </t>
    </section>

    </section>

    <section title="STAMP Session Identifier for LSPs and PWs" anchor="sect-3.3">

    <t>
    <xref target="RFC8972" section="3"/> defines the STAMP session identifier that is also applicable to <xref target="RFC8762"/> as follows:
    </t>

    <ul>
    <li>
    "A STAMP Session is identified by the 4-tuple (source and destination IP addresses, source and destination UDP port numbers)".
    </li>
    <li>
    "An implementation of the STAMP Session-Reflector that supports this specification MUST identify a STAMP Session
    using the SSID in combination with elements of the usual 4-tuple for the session".
    </li>    

    </ul>

    <t>
    This document updates the definition of the STAMP session identifier in <xref target="RFC8972" section="3"/> for LSPs and PWs for the following reasons:
    </t>

    <ul>
    <li>
    STAMP test packets in Format-1 can carry a non-routable destination IP address (see <xref target="sect-5"/>) and a random or dynamic source port number (see <xref target="sect-3.1"/>).
    </li>
    <li>
    STAMP test packets in Format-2 do not carry an IP/UDP header.  
    </li>
    </ul>

    <t>
    STAMP sessions for LSPs and PWs on the Session-Sender and the Session-Reflector MUST be identified as follows. 
    STAMP test packets that cannot identify the associated STAMP sessions MUST be discarded as specified in <xref target="RFC8972" section="3"/>.
    </t>

    <ul>
    <li>
    Format-1 (with IP/UDP Header):
    <ul>
    <li>
    The Session-Reflector address that is the source address, the destination UDP port, and the SSID in the
    received Session-Reflector test packets, along with the locally provisioned STAMP session parameters are used
    by the Session-Sender to identify a STAMP session.
    </li>
    <li>
    The Session-Sender address that is the source address, the destination UDP port, and the SSID
    in the received Session-Sender test packets, along with the locally provisioned STAMP session parameters are used
    by the Session-Reflector to identify a STAMP session.
    </li>
    </ul>
    </li>

    <li>
    Format-2 (without IP/UDP Header):
    <ul>
    <li>
    The SSID along with the reverse direction LSP and PW context in the received Session-Reflector
    test packets, along with the locally provisioned STAMP session parameters are used
    by the Session-Sender to identify a STAMP session.
    </li>
    <li>
    The SSID along with the LSP and PW context in the received Session-Sender test packets, along with the
    locally provisioned STAMP session parameters are used by the Session-Reflector to identify a STAMP session.
    </li>
    </ul>
    </li>

    </ul>
 
    </section>

    </section>

    <section title="Processing STAMP for LSPs and PWs" anchor="sect-4">

    <section title="Encapsulation Use Cases" anchor="sect-4.1">

    <t>
    The following encapsulations are defined for STAMP test packets for the data traffic being measured for LSPs and PWs:
    </t>

    <ul>
    <li>
    <t>Use Case 1: STAMP for LSP data traffic with an IP header:</t>
    <ul>
    <li>
    <t>
    The STAMP test packet payloads are transported with an IP/UDP header and an MPLS
    header using the same label stack as the LSP.
    </t>
    </li>
    <li>
    <t>
    The label stack may include the L2 or L3 VPN label for the service when carried over the LSP.
    </t>
    </li>
    </ul>
    </li>

    <li>
    <t>Use Case 2: STAMP for LSP data traffic with an IP header and the CW:</t>
    <ul>
    <li>
    <t>
    The STAMP test packet payloads are transported with an IP/UDP header, a G-ACh header and an MPLS
    header using the same label stack as the LSP.
    </t>
    </li>
    <li>
    <t>
    The label stack may include the L2 or L3 VPN label for the service when carried over the LSP.
    </t>
    </li>
    </ul>
    </li>

    <li>
    <t>Use Case 3: STAMP for PW data traffic with the CW:</t>
    <ul>
    <li>
    <t>
    The STAMP test packet payloads are encapsulated with an MPLS
    header using the same label stack as the PW, including the PW label, and a G-ACh header.
    </t>
    </li>
    </ul>
    </li>

    <li>
    <t>Additional IP-version considerations:</t>
    <ul>
    <li>
    <t>
    When using an IP header, the IP version (IPv4 or IPv6) in the STAMP test packets MUST match the IP version of
    the data traffic carried by the LSPs and PWs being measured.  When an LSP carries both IPv4 and IPv6
    data traffic, the IP version used in the STAMP test packet MUST match the IP
    version of the specific data traffic flow being measured.
    </t>
    </li>
    </ul>
    </li>

    </ul>

    </section>

    <section title="Control Channel Types for PWs" anchor="sect-4.2">

    <t>
    The OAM Control Channel traffic between two PE endpoints is not forwarded beyond the PE
    endpoints toward Customer Edge (CE) devices; instead, the OAM 
    messages are intercepted at the PE endpoints for exception processing in the control plane.
    <xref target="RFC5085"/> and <xref target="RFC7708"/> define mechanisms for the Control Channel to terminate OAM messages for PWs.
     </t>

    <ol>
    <li>
    <t>
    Type 1: "PWE3 Control Word with 0001b as first nibble (PW-ACH)", defined in <xref target="RFC5085" section="5.1.1"/>
    MUST be added when measuring PWs with the CW.</t>
    </li>

    <li>
    <t>
    Type 2: "MPLS Router Alert Label" defined in <xref target="RFC5085" section="5.1.2"/> allows the termination of OAM messages on the remote PE endpoint nodes by adding the 
    Router Alert (RA) Label <xref target="RFC3032"/> immediately above the PW label.</t>
    </li>

    <li>
    <t>
    Type 3: "MPLS PW Label with TTL == 1" defined in <xref target="RFC5085" section="5.1.3"/>
    allows the termination of OAM messages on the remote PE endpoint nodes by forcing them to be terminated on the remote PE endpoints.</t>
    </li>

    <li>
    <t>
    Type 4: "GAL" defined in <xref target="RFC7708"/> allows the termination of OAM messages on the remote PE endpoint nodes by adding the 
    GAL at the bottom of the label stack.</t>
    <t>As specified in <xref target="RFC7708" section="3"/>, when the PW CW is not used, the Type 4 MAY be used.
    </t>
    <t>As specified in <xref target="RFC7708" section="6"/>, Type 1 and Type 4 are mutually exclusive for PWs.
    </t>
    <t>As specified in <xref target="RFC5586" section="4.2"/>, the GAL MUST NOT be used with PWs in MPLS-TP networks. Therefore, the GAL encapsulation for STAMP does not apply to MPLS-TP PWs.</t>
    </li>
    </ol>

    <section title="STAMP Test Packet Exception and Identification" anchor="sect-4.2.1">

    <t>
    <xref target="RFC5085"/> and <xref target="RFC7708"/> define mechanisms by which an OAM message carried on a PW is excepted from the forwarding path at the PE endpoints and delivered to the control plane for processing. This document applies those mechanisms to STAMP test packets. Exactly one of them is in effect for a given STAMP session, provisioned as described in <xref target="sect-1"/>.
    The ECMP considerations for these mechanisms are specified in <xref target="sect-7.1"/>.
    </t>

    <t>
    Two distinct functions are involved, and this document uses both:
    </t>

    <ul>
    <li>
    <t>Exception: Types 3 and 4 except the test packet from the forwarding path without reference to its payload. Type 3 uses a TTL of 1 in the ultimate label, which <xref target="RFC3032" section="2.1"/> requires not to be forwarded further. Type 4 uses the GAL, which <xref target="RFC5586" section="4.2"/> requires not to be forwarded on. Type 1 is a base MPLS behaviour and apply irrespective of which label carries it.</t>
    </li>
    <li>
    <t>Identification: Once excepted, the test packet is identified by the G-ACh header following the label stack: the Channel Type indicates whether an IP/UDP header and a STAMP payload follow (Format-1) or a STAMP payload alone (Format-2). Where a GAL is present, <xref target="RFC5586" section="4.2"/> requires it to be followed by an G-ACh. For a PW, the PW label supplies the context in which the Post-Stack First Nibble (PFN) is interpreted, as described in <xref target="RFC9790" section="3"/>.</t>
    </li>
    </ul>

   <t>
    As specified in <xref target="RFC9570"/>, use of RA has been retired for MPLS OAM due to security vulnerability reasons specified in <xref target="RFC6398"/> and MUST NOT be used for STAMP. Hence,  Type 2 that uses RA is not considered by the procedure specified for STAMP in this document.
    </t>

    <t>
    Type 1 is the exception to that separation: there the PFN is itself the means by which the egress PE excepts the packet from the forwarding path, so it must be unambiguous with respect to user traffic. Type 1 therefore applies only to PWs that use the Control Word, in whose encapsulation the PFN of user packets is 0x0. This is the requirement in <xref target="RFC5586" section="2.1"/> and <xref target="RFC4385" section="7"/>, and the reason <xref target="RFC5085" section="5.1.1"/> limits Type 1 to PW types that employ the Control Word.
    </t>

    <t>
    For a PW that does not use the Control Word, one of Types 3 or 4 MUST be in effect, because the PFN alone cannot except a test packet from the forwarding path on such a PW. <xref target="RFC5085" section="5.1.2"/> and <xref target="RFC5085" section="5.1.3"/> permit Type 3 whether or not the Control Word is present, and <xref target="RFC7708" section="3"/> permits Type 4.
    </t>

    </section>

    <section title="Applicability of Control Channel Types to STAMP" anchor="sect-4.2.2">

    <t>
    The Control Channel types defined in <xref target="RFC5085"/> and <xref target="RFC7708"/> are applied to terminate STAMP test packets as shown in <xref target="iana-cc-type-tbl"/>. 
    The G-ACh Channel Type is determined by the STAMP header format and is independent of the control channel type in effect. The control channel types 1, 3, and 4 are applicable to both formats, subject to the Control Word condition on Type 1 and to the MPLS-TP PW restriction on Type 4 specified in Section 4.2 above.
    </t>

    <texttable anchor="iana-cc-type-tbl" title="STAMP Header Format and G-ACh Channel Type">

    <ttcol align="left">STAMP Header Format</ttcol>
    <ttcol align="left">G-ACh Channel</ttcol>
    <ttcol align="left">Control Channel</ttcol>

    <c>Format-1 (IP/UDP headers)</c>
    <c>Associated Channel carries an IPv4 packet (0x0021) and Associated Channel carries an IPv6 packet (0x0057)</c>
    <c>Types 1, 3, 4</c>

    <c>Format-2 (no IP/UDP headers)</c>
    <c>STAMP Session-Sender G-ACh (TBA1) and STAMP Session-Reflector G-ACh (TBA2)</c>
    <c>Types 1, 3, 4</c>

    </texttable>

    </section>

    </section>

    <section title="TTL and IPv6 Hop Limit Processing" anchor="sect-4.3">

    <t>
    The TTL and IPv6 HL processing for the Session-Reflector is specified in <xref target="RFC8762" section="4.3"/> as follows:
    </t>

    <ul>
    <li>
    The Session-Sender TTL field is one octet long, and its value is a copy of the TTL field in IPv4 (or HL in IPv6) from the received STAMP test packet.
    </li>
    </ul>

    <t>
    Both the Session-Sender and the Session-Reflector MUST NOT discard the received Session-Sender STAMP test packets when the TTL or IPv6 HL is not 255.
    </t>

    <t>
    This document updates the TTL and IPv6 HL processing specified in <xref target="RFC8762"/> for received Session-Sender
    STAMP test packets, processed in the following order:
    </t>

    <ol>
    <li>
    When a Session-Sender STAMP test packet is received with an MPLS header at the Session-Reflector (in both Format-1 and Format-2),
    the Session-Sender TTL field on the Session-Reflector STAMP test packet is set to the TTL value in the topmost MPLS label stack entry of the received packet.
    </li>
    <li>
    Follow the TTL and IPv6 HL processing for the Session-Reflector as specified in <xref target="RFC8762" section="4.3"/>.
    </li>
    </ol>

    <t>
    The following rules apply to the TTL and IPv6 HL fields in the STAMP test packets transmitted by both the Session-Sender and the Session-Reflector:
    </t>

    <ul>
    <li>
    The IPv4 TTL and IPv6 HL MUST be set to 255 in both Session-Sender and Session-Reflector test packets as that allows to determine the 
    number of hops that IP-forwarded the test packet (for example, when penultimate hop of an LSP removes the MPLS header).
    The received Session-Sender TTL in the STAMP packet allows Session-Sender to verify it against expected TTL.
    </li>
    <li>
    The non-ultimate MPLS label TTL MUST be set to 255 in both Session-Sender and Session-Reflector test packets.
    The non-ultimate MPLS label TTL MUST be set to 255 in both Session-Sender and Session-Reflector test packets.
    The exception is that the TTL in the ultimate PW label or ultimate LSP label is set to 1 when using 
    "MPLS PW Label with TTL == 1" (Type 3) (see <xref target="sect-4.2"/>) in both Session-Sender and Session-Reflector test packets.
    </li>
    </ul>

    <t>
    The TTL values in the label stack of a STAMP test packet are set as specified above and are not derived from one another. The Uniform Model TTL derivation in Section 3.6 of <xref target="RFC3443"/> does not apply: a test packet is originated by the Session-Sender rather than transiting the LSP or PW, and the header immediately following the label stack is an ACH, which is neither a label stack entry nor an IP packet. Label TTLs are set independently, as in the Pipe and Short Pipe Models of <xref target="RFC3443"/>.
    </t>

    </section>

    <section title="UDP Checksum Handling" anchor="sect-4.5">
    <t>
    The UDP checksum handling specified in this section is applicable to all 
    STAMP sessions using IPv4/UDP and IPv6/UDP and is not limited to STAMP sessions for LSPs and PWs.
    </t>

    <t>
    As specified in <xref target="RFC8085"/>, the UDP checksum provides a statistical guarantee that the payload
    was not corrupted in transit, truncated, or padded.
    </t>

     <t>
    The following example limitations for STAMP timestamping necessitate the exceptions to permit the use of UDP zero-checksum for IPv4 and IPv6.
    </t>

    <ul>
    <li>
    <t>
    When the local processor cannot recompute the UDP checksum after adding the timestamp in the STAMP test packet.
    </t>
    </li>
    <li>
    <t>
    When the local processor cannot add a checksum complement <xref target="RFC7820"
    format="default"/> after adding the timestamp in the STAMP test packet.
    </t>
    </li>
    </ul>

    <section title="IPv4 UDP Zero-Checksum" anchor="sect-4.5.1">
    <t>
    Use of the UDP checksum with IPv4 MUST be the default configuration for all implementations.
    </t>

    <t>
    For IPv4, <xref target="RFC768"/> permits an option to disable UDP checksum processing by setting the checksum value to zero.
    </t>
    <t>
    For IPv4 STAMP test packets, the Session-Sender and Session-Reflector can use
    this exception for the UDP ports specifically used in STAMP sessions to set the UDP checksum value to 0 with additional checks on the source and destination addresses in the STAMP test packets.
    </t>
    </section>

    <section title="IPv6 UDP Zero-Checksum" anchor="sect-4.5.2">

    <t>
    STAMP test packets are the innermost payload and are not a tunnel encapsulation. This document applies the exception in <xref target="RFC8200" section="8.1" format="default"/> to IPv6 STAMP even though STAMP is not a tunnel protocol, because the STAMP payload is the innermost protocol payload and has no inner packet whose integrity would be protected by a UDP checksum. The UDP zero-checksum requirements of <xref target="RFC6936" format="default"/> therefore apply directly to the STAMP payload rather than to a tunnel encapsulation carrying an inner packet.
    </t>

    <t>
    For IPv6, any node that implements UDP zero-checksum mode <bcp14>MUST</bcp14> follow the requirements specified in <xref target="RFC6936" format="default"/> and <xref target="RFC8085" format="default"/> as described below, with one deviation.
    </t>

    <ul>
    <li>
    In this specification, the use of UDP zero-checksum for IPv6 STAMP in unauthenticated mode deviates from requirement 5 in <xref target="RFC6936" section="5" format="default"/>.
    </li>

    <li>
    <t>
    Requirement 5 of <xref target="RFC6936" section="5" format="default"/> cannot be satisfied because STAMP is not a tunnel protocol and does not include an inner packet with a CRC or other mechanism for checking packet integrity in unauthenticated mode.
    </t>
    </li>
    <li>
    <t>
    This deviation from <xref target="RFC6936" format="default"/> requirement is limited to the IPv6 STAMP sessions in unauthenticated mode that MUST operate under the constraints listed below.
    </t>
    </li>
    </ul>

    <t>
    IPv6 UDP zero-checksum can be enabled only when the following requirements, recommendations, and constraints are satisfied and the residual risk due to STAMP test packet corruption is acceptable.
    </t>

    <ol>

    <li>
     <t>
     UDP zero-checksum is enabled only for the specific UDP port or port range used by
     a STAMP session, at both the Session-Sender and Session-Reflector.
     </t>
    <t>This corresponds to requirement 1 in <xref target="RFC6936" section="5" format="default"/>.</t>
    </li>

    <li>
     <t>
     STAMP test packets in authenticated mode, as defined in Figures <xref target="RFC8972" section="3" format="default"/> and <xref target="RFC8972" section="4" format="default"/>, are RECOMMENDED in networks where packet integrity is required.
     </t>
    <t>This corresponds to requirement 2 in <xref target="RFC6936" section="5" format="default"/>.</t>
    </li>

    <li>
    <t>Requirement 3 in <xref target="RFC6936" section="5" format="default"/> does not apply to STAMP because STAMP packets are not tunnel payloads and do not rely on an inner packet integrity check.
     </t>
    </li>

    <li>
     <t>
     UDP zero-checksum is handled in STAMP so that corruption of header
     information is detected in STAMP and does not result in accumulation of incorrect state for the protocol.
     </t>
    <t>This corresponds to requirement 4 in <xref target="RFC6936" section="5" format="default"/>.</t>
    </li>

    <li>
    Requirements 6 and 7 in <xref target="RFC6936" section="5" format="default"/> are not applicable to STAMP as they are related to the keep alive messages.
    </li>

    <li>
    Middleboxes within the controlled domain that process the IPv6 STAMP test packets MUST comply with Requirements 8 through 10 of <xref target="RFC6936" section="5" format="default"/>.
    </li>

    </ol>

    <t>
    Additional specific guidance from <xref target="RFC8085" section="3.4.1" format="default"/> applied to IPv6 STAMP test packets that use UDP zero-checksum is summarized below:
    </t>

    <ol>

    <li>
    <t>
    Use of the UDP checksum with IPv6 MUST be the default configuration for all implementations.
    </t>
    <t>This corresponds to the first requirement in <xref target="RFC8085" section="3.4.1" format="default"/>.</t>
    </li>

    <li>
     <t>
    The receiving endpoint MUST verify a non-zero UDP checksum packet and MUST discard it if checksum verification fails; it MUST NOT treat the packet as a valid measurement result.
     </t>
    <t>This corresponds to the second requirement in <xref target="RFC8085" section="3.4.1" format="default"/> and also applies to <xref target="RFC6936" section="4" format="default"/> and <xref target="RFC6936" section="5" format="default"/>.</t>
    </li>

    <li>
     <t>
    The receiving endpoint MUST only permit the use of UDP zero-checksum for IPv6 on a UDP destination port number that is specifically enabled for STAMP and MUST check that
    the source and destination IPv6 addresses are valid and discard any packet for which this check fails.
     </t>
    <t>This corresponds to the third requirement in <xref target="RFC8085" section="3.4.1" format="default"/>.</t>
    </li>

    <li>
     <t>
    STAMP sessions are restricted to networks under a single administrative domain (see <xref target="sect-7"/>), 
    where the operator is willing to take the risk of STAMP test packet corruption affecting measurements when using UDP zero-checksum.
     </t>
    <t>This corresponds to the fourth requirement in <xref target="RFC8085" section="3.4.1" format="default"/>.</t>
    </li>

    <li>
     <t>
    STAMP sessions that choose to use a UDP zero-checksum MUST NOT make
    assumptions regarding the correctness of received test packets and MUST
    behave correctly when a UDP datagram is corrupted.
     </t>

    <t>This corresponds to the fifth requirement in <xref target="RFC8085" section="3.4.1" format="default"/>.</t>

    </li>

    </ol>
    </section>

    </section>

    </section>

    <section title="Session-Sender Test Packet" anchor="sect-5">

   <t>
   STAMP Session-Sender test packets are transmitted on an LSP or a PW
   using an MPLS header with an IP/UDP header in Format-1 or without an IP/UDP header in Format-2. Additionally:
   </t>

   <ul>
   <li>
   <t>
   For PWs, Session-Sender test packets are transmitted on the PW using the label stack of the PW, including the PW label and the G-ACh.
   </t>
   </li>

   <li>
   <t>
  For LSPs, Session-Sender test packets are transmitted on the LSP using the label stack of the LSP, with a G-ACh where the LSP carries the CW or where a GAL is used. Where neither is present, the test packet is transmitted in Format-1 with an IP/UDP header and no G-ACh, as in Use Case 1 of <xref target="sect-4.1"/>; Format-2 is not applicable in that case.
   </t>
   </li>
   </ul>

    <section title="Session-Sender Test Packet with IP/UDP Header in Format-1" anchor="sect-5.1"><t>
   The content of an example STAMP Session-Sender test packet for an LSP or a PW encapsulated using a
   G-ACh and an IP/UDP header in Format-1 is shown in <xref target="ure-stamp-sender-packet1"/>. 
   </t>

    <figure title="Example Session-Sender Test Packet with G-ACh and IP/UDP Header in Format-1" anchor="ure-stamp-sender-packet1"><artwork><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Label(1)               | TC  |0|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    PW Label or Ultimate LSP Label     | TC  |1|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |0 0 0 1|Version|    Reserved   | Channel Type                  |
 . Associated Channel carries an IPv4 packet (0x0021) or         .
 . Associated Channel carries an IPv6 packet (0x0057)            .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | 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 = As chosen by Session-Sender                    .
 .  Destination Port = User-configured Destination Port or 862   .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | Payload = Test Packet as specified in Section 3 of RFC 8972   |
 .           in Figure 1 and Figure 3                            .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
    </figure>

    <t>
    The TTL of the PW label or ultimate LSP label is 1 only where control channel Type 3 is in effect, as specified in <xref target="sect-4.3"/>; for Types 1 and 4 it is set as it would be for the data traffic being measured. Where a GAL is present, the packet is intercepted by the GAL as specified in <xref target="RFC5586" section="4.2"/>, and the GAL LSE TTL is set to 1.
    </t>

    <t>
    Where Type 4 is in effect with Format-1, a GAL is present immediately above the G-ACh as shown in <xref target="ure-stamp-sender-packet2"/>, and the remainder of the packet is as shown in <xref target="ure-stamp-sender-packet1"/>. Per <xref target="sect-4.2"/> this does not apply to MPLS-TP PWs.
    </t>


   <t>
   The destination address in the IP header of a STAMP test packet can be one of the following when adding an MPLS encapsulation for an LSP or a PW.
   </t>

     <ul>
     <li>
     <t>A routable IPv4 address</t>
     </li>
     <li>
     <t>A routable IPv6 address</t>
     </li>
     <li>
     <t>An IPv4 address from the 127/8 range</t>
     </li>
     <li>
     <t>An IPv6 address from the Dummy IPv6 Prefix 100:0:0:1::/64 <xref target="RFC9780"/> <xref target="IANA-IPv6-REG" format="default"/></t>
     </li>
     </ul>

  <t>For an IPv6 address from the dummy prefix, as specified in <xref target="RFC9780" section="1"/>, this source-only prefix is deliberately used as a destination to generate an exception.</t>

<t>
Example implementations include:
</t>
<ul>
<li>
<t>An implementation using a routable IP address as the destination address during the initial forwarding step, before the STAMP test packet gets forwarded into the MPLS LSP or PW.</t>
</li>
<li>
<t>An implementation using a non-routable IP address as the destination address while adding both an IP header and an MPLS encapsulation in the same forwarding step.</t>
</li>
</ul>

   <t>
  When adding the G-ACh header <xref target="RFC5586"/> with the channel type "Associated Channel carries an IPv4 packet" or "Associated Channel carries an IPv6 packet", it MUST immediately follow the bottom of the label stack.
   The payload contains the STAMP Session-Sender test packet defined in <xref target="RFC8972"/>.</t>

   <t>The STAMP Session-Sender test packet G-ACh header contains the following fields:</t>

   <ul>
   <li>
  <t>PFN: The PFN is set to 0x1 <xref target="RFC9790"/>.</t>
   </li>
   <li>
   <t>Version: The Version field is set to 0, as defined in <xref target="RFC4385"/>.</t>
   </li>
   <li>
   <t>Reserved: Reserved bits MUST be set to zero upon transmission and ignored upon receipt.</t>
   </li>
   <li>
  <t>Channel Type: Associated Channel carries an IPv4 packet (0x0021) or Associated Channel carries an IPv6 packet (0x0057) <xref target="RFC4385"/>.</t>
   </li>
   </ul>

    </section>

    <section title="Session-Sender Test Packet without IP/UDP Header in Format-2" anchor="sect-5.2"><t>
   The content of an example STAMP Session-Sender test packet for an LSP or a PW encapsulated using the GAL and a
   G-ACh without an IP/UDP header in Format-2 is shown in <xref target="ure-stamp-sender-packet2"/>. 
        </t>

    <figure title="Example Session-Sender Test Packet with GAL and G-ACh without IP/UDP Header in Format-2" anchor="ure-stamp-sender-packet2"><artwork><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Label(1)               | TC  |0|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    PW Label or Ultimate LSP Label     | TC  |0|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    GAL                                | TC  |1|      1        |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |0 0 0 1|Version|    Reserved   | STAMP Sender G-ACh (TBA1)     |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | Payload = Test Packet as specified in Section 3 of RFC 8972   |
 .           in Figure 1 and Figure 3                            .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
    </figure>

    <t>
    The TTL of the PW label or ultimate LSP label is 1 only where control channel Type 3 is in effect, as specified in <xref target="sect-4.3"/>; for Types 1 and 4 it is set as it would be for the data traffic being measured. Where a GAL is present, the packet is intercepted by the GAL as specified in <xref target="RFC5586" section="4.2"/>, and the GAL LSE TTL is set to 1.
    </t>

   <t>
    When adding the G-ACh header <xref target="RFC5586"/> with the new STAMP Session-Sender channel type (value TBA1), it MUST immediately follow the bottom of the label stack. The payload contains the STAMP Session-Sender test packet defined in <xref target="RFC8972"/>.</t>
   <t>The STAMP channel type allows the encapsulated STAMP payload to be identified.
   </t>

    <t>The STAMP Session-Sender test packet G-ACh header contains the following fields:</t>

    <ul>
    <li>
    <t>PFN: The PFN is set to 0x1 <xref target="RFC9790"/>.</t>
    </li>
    <li>
    <t>Version: The Version field is set to 0, as defined in <xref target="RFC4385"/>.</t>
    </li>
    <li>
    <t>Reserved: Reserved bits MUST be set to zero upon transmission and ignored upon receipt.</t>
    </li>
    <li>
    <t>Channel Type: G-ACh type for STAMP Session-Sender packet (value TBA1).</t>
    </li>
    </ul>

    </section>

    </section>

    <section title="Session-Reflector Test Packet" anchor="sect-6">

    <t>
    STAMP Session-Reflector test packets are transmitted with an IP/UDP header in Format-1 or without an IP/UDP header in Format-2.
    The Session-Reflector processes and returns a received STAMP test packet in both cases as follows:
    </t>

    <ul>
    <li>
    <t>When a Session-Sender test packet is received with a G-ACh, the Session-Reflector MUST reflect the test packet to the Session-Sender using the same G-ACh in the reverse direction of the bidirectional LSP or PW.</t>

    <ul>
    <li>
    <t>The Session-Reflector MUST transmit the reflected test packet on the same path in the reverse direction of the bidirectional LSP or PW.</t>
    </li>

    <li>
    <t>The Session-Reflector uses the PW label or the ultimate LSP label in the received packet to determine the reverse-direction LSP or PW context.</t>
    </li>

    <li>
    <t>If the received packet context is a PW, the Session-Reflector MUST use the reverse-direction PW label stack and G-ACh to transmit the Session-Reflector test packet. 
     The reverse-direction PW label stack can be determined through static configuration or the signaling protocol used to establish the PW.</t>
    </li>

    <li>
    <t>If the received packet context is a bidirectional LSP, the Session-Reflector MUST use the reverse-direction LSP label stack and G-ACh to transmit the Session-Reflector test packet.
     The reverse-direction LSP label stack can be determined through static configuration or the signaling protocol used to establish the bidirectional LSP.
    </t>
    </li>

    <li>
    <t>If the Session-Reflector cannot find a reverse-direction LSP or PW context for the received test packet, it MUST discard the received packet and MUST NOT transmit a reply.</t>
    </li>

    <li>
    <t>The reflected test packet MUST include an IP/UDP header (Format-1) if the received Session-Sender test packet includes one (see Section 6.1); otherwise, it MUST be sent without an IP/UDP header (Format-2) (see Section 6.2).</t>
    </li>

    </ul>

    </li>

    <li>
    <t>In all other cases for STAMP test packets using an IP/UDP header (Format-1), the Session-Reflector MUST reflect the test packet using an IP/UDP header based on the information in the IP/UDP header of the Session-Sender test packet as specified in Section 6.1 and is subject to the Return Path TLV applicability (<xref target="RFC9503" section="4"/>).</t>
    </li>
    </ul>


  <section title="Session-Reflector Test Packet with IP/UDP Header in Format-1" anchor="sect-6.1"><t>
   The content of an example STAMP Session-Reflector test packet for an LSP or a PW encapsulated using a
   G-ACh and an IP/UDP header in Format-1 is shown in <xref target="ure-test-reply-packet1"/>. 
   </t>

   <figure title="Example Session-Reflector Test Packet with G-ACh and IP/UDP Header in Format-1" anchor="ure-test-reply-packet1"><artwork><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Label(1)               | TC  |0|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    PW Label or Ultimate LSP Label     | TC  |1|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |0 0 0 1|Version|    Reserved   | Channel Type                  |
 . Associated Channel carries an IPv4 packet (0x0021) or         .
 . Associated Channel carries an IPv6 packet (0x0057)            .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | IP Header                                                     |
 .  Source IP Address                                            .
 .     = Configured on Session-Reflector                         .
 .  Destination IP Address                                       .
 .     = Source IP Address from Session-Sender Test Packet       .
 .  IPv4 Protocol or IPv6 Next Header = UDP (17)                 .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | UDP Header                                                    |
 .  Source Port = As chosen by Session-Reflector                 .
 .  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 TTL of the PW label or ultimate LSP label is 1 only where control channel Type 3 is in effect, as specified in <xref target="sect-4.3"/>; for Types 1 and 4 it is set as it would be for the data traffic being measured. Where a GAL is present, the packet is intercepted by the GAL as specified in <xref target="RFC5586" section="4.2"/>, and the GAL LSE TTL is set to 1.
    </t>

   <t>
   When adding the G-ACh header <xref target="RFC5586"/> 
   with the channel type "Associated Channel carries an IPv4 packet" or "Associated Channel carries an IPv6 packet", it MUST immediately follow the bottom of the label stack.
   The payload contains the STAMP Session-Reflector test packet defined in <xref target="RFC8972"/>.
   </t>

   <t>
   The STAMP Session-Reflector test packet MUST use the source address and the source UDP port
   from the received test packet as the destination address and the destination UDP port when an IP/UDP header
   is present in the received test packet.
   </t>

    <t>The STAMP Session-Reflector test packet G-ACh header contains the following fields:</t>

     <ul>
     <li>
    <t>PFN: The PFN is set to 0x1 <xref target="RFC9790"/>.</t>
     </li>
     <li>
     <t>Version: The Version field is set to 0, as defined in <xref target="RFC4385"/>.</t>
     </li>
     <li>
     <t>Reserved: Reserved bits MUST be set to zero upon transmission and ignored upon receipt.</t>
     </li>
     <li>
    <t>Channel Type: Associated Channel carries an IPv4 packet (0x0021) or Associated Channel carries an IPv6 packet (0x0057) <xref target="RFC4385"/>.</t>
     </li>
     </ul>

   </section>

  <section title="Session-Reflector Test Packet without IP/UDP Header in Format-2" anchor="sect-6.2">
   <t>
   The content of an example STAMP Session-Reflector test packet for an LSP or a PW encapsulated using the GAL and a
   G-ACh without an IP/UDP header in Format-2 is shown in <xref target="ure-test-reply-packet2"/>. 
   </t>

  <figure title="Example Session-Reflector Test Packet with GAL and G-ACh without IP/UDP Header in Format-2" anchor="ure-test-reply-packet2"><artwork><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Label(1)               | TC  |0|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 .                                                               .
 .                                                               .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    PW Label or Ultimate LSP Label     | TC  |0|      TTL      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    GAL                                | TC  |1|      1        |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |0 0 0 1|Version|    Reserved   | STAMP Reflector G-ACh (TBA2)  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | Payload = Test Packet as specified in Section 3 of RFC 8972   |
 .           in Figure 2 and Figure 4                            .
 .                                                               .
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
    </figure>

    <t>
    The TTL of the PW label or ultimate LSP label is 1 only where control channel Type 3 is in effect, as specified in <xref target="sect-4.3"/>; for Types 1 and 4 it is set as it would be for the data traffic being measured. Where a GAL is present, the packet is intercepted by the GAL as specified in <xref target="RFC5586" section="4.2"/>, and the GAL LSE TTL is set to 1.
    </t>

   <t>
   When adding the G-ACh header <xref target="RFC5586"/> with the new STAMP Session-Reflector
   channel type (value TBA2), it MUST immediately follow the bottom of 
   the label stack.  The payload contains the STAMP 
   Session-Reflector test packet defined in <xref target="RFC8972"/>.
   </t>

   <t>The STAMP channel type allows the encapsulated STAMP payload to be identified.
   </t>

   <t>The STAMP Session-Reflector test packet G-ACh header contains the following fields:</t>
   <ul>
     <li>
    <t>PFN: The PFN is set to 0x1 <xref target="RFC9790"/>.</t>
     </li>
     <li>
     <t>Version: The Version field is set to 0, as defined in <xref target="RFC4385"/>.</t>
     </li>
     <li>
     <t>Reserved: Reserved bits MUST be set to zero upon transmission and ignored upon receipt.</t>
     </li>
     <li>
    <t>Channel Type: G-ACh type for STAMP Session-Reflector packet (value TBA2).</t>
     </li>
   </ul>

    </section>

    </section>

    <section title="Operational Considerations" anchor="sect-7">

    <t>The operational considerations specified in <xref target="RFC8762" section="5"/> also apply to the procedure specified in this document.
    Further, the operation and management of performance measurement based on STAMP specified in <xref target="RFC8762" section="3"/>
    also apply to the procedure specified in this document.
    </t>

    <t>
    When a destination UDP port number other than the default port 862 is used, the same
    network-impact study and agreement requirements specified in <xref target="sect-3.1"/> apply.
    </t>

    <t>
    Based on local policy, an operator may add the MPLS encapsulation only for STAMP test packets destined
    to addresses within the MPLS administrative domain.
    </t>

    <section title="ECMP Considerations" anchor="sect-7.1">

    <t>
    The following considerations apply when encapsulating STAMP test packets to follow the same ECMP path as the data traffic being measured. 
    </t>

    <ul>
    <li>
    <t>G-ACh encapsulation enables STAMP test packets in Format-1 and Format-2 to follow the ECMP path taken by data packets that use the CW 
    when label-based ECMP is used, as defined in <xref target="RFC4928"/>.</t>
    <t>This assumes that the nodes on the packet path apply the same ECMP selection to STAMP test packets as to data packets with the CW.</t>
    </li>
    <li>
    <t>Because STAMP test packets in Format-1 use IP addresses different from those used by the data packets, IP ECMP
    specified in <xref target="RFC4928"/> may result in different ECMP load-balancing decisions, as specified in <xref target="RFC7325" section="2.4.5.2"/>.
    </t>
    </li>

    <li>
    <t>Special-purpose labels (values 0-15) are not to be used in ECMP decisions. <xref target="RFC9790" section="2.1.1.1"/> recommends that load balancing use the value of a dedicated label and deprecates the practice of deducing the payload type from the PFN; <xref target="RFC7325" section="2.4.5.1"/> states the same requirement for special-purpose labels including the GAL. On conforming equipment, the GAL does not change the ECMP selection, and STAMP test packets follow the same path as data packets with the same label stack. Where an LSP traverses non-conforming equipment, the presence of the GAL can cause STAMP test packets to take a different path from the traffic being measured, as noted in <xref target="RFC7708" section="3"/>; a control channel type that adds no label ought to be provisioned in that case.</t>
    </li>

    <li>
    <t>When using the "MPLS PW Label with TTL == 1" mechanism, the TTL field SHOULD NOT be used to make ECMP decisions as specified in <xref target="RFC7325" section="2.4.5.1"/> in order for the STAMP test packets to follow the same path as data packets with the same label stack.</t>
    </li>
    </ul>

    </section>

    <section title="STAMP Session State Notification" anchor="sect-7.2">
    <t>
    The STAMP session state change notifications specified in this section are applicable to all
    STAMP sessions and are not limited to STAMP sessions for LSPs and PWs.
    </t>

    <t>
    The STAMP session state monitoring allows the Session-Sender to determine whether the STAMP test is idle, active, or failed.
    A STAMP implementation SHOULD generate state-change notifications as follows:
    </t>

    <ul>
    <li>
    STAMP session state is notified as idle when the Session-Sender is not transmitting test packets.
    </li>

    <li>
    The STAMP session state is initially notified as active when the Session-Sender is transmitting test packets and at least one Session-Reflector test packet is received.
    </li>

    <li>
    The STAMP session state is notified as failed when N consecutive Session-Reflector test packets are not received after 
    the STAMP session state is notified as active, where N (the consecutive packet loss count) is a locally provisioned value.
    </li>

    <li>
    The STAMP session state transitions from failed back to active when the Session-Sender is transmitting test packets
    and at least one Session-Reflector test packet is again received.
    </li>
    </ul>

    <t>
    Because STAMP test packets are transmitted over the LSP or PW being measured, a connectivity failure
    of that LSP or PW typically manifests as the continuous packet loss specified above, resulting in the
    STAMP session state being notified as failed.
    </t>

    </section>

    <section title="Rate Limiting" anchor="sect-7.3">
    <t>
    The rate limiting considerations specified in this section are applicable to all STAMP sessions and are not limited to STAMP sessions for LSPs and PWs.
    </t>

    <t>
    On both Session-Sender and Session-Reflector nodes, 
    as each STAMP test packet is processed by the control plane and consumes CPU and memory resources,  
    it is subject to rate limiting as a protection against denial-of-service attacks.
    Such rate limiting on the punt path is indistinguishable from the actual loss in the network and can therefore be reported as packet loss.
    </t>

    <t>
    It is useful for an operator to know that rate limiting was applied to STAMP test packets (for example, 
    based on the UDP ports used for STAMP in Format-1, and LSP or PW context and Channel Type used for STAMP in Format-2),
    so that the alerting system can correlate STAMP packets being rate-limited with failure notifications.
    </t>

    <t>
    This throttling or policing of incoming STAMP test packets SHOULD NOT be more
    stringent than the bandwidth allocated to the STAMP test packets to prevent invalid measurement results.
    </t>

    <t>
    Additional guidance on configuring punt-path rate limiters can also be found in <xref target="RFC5085" section="9"/>.
    </t>

    </section>

    <section title="Congestion Considerations" anchor="sect-7.4">

    <t>
    The rate at which STAMP test packets are transmitted must be configured
    and accounted for when provisioning bandwidth for LSPs and PWs.
    The configured transmit rate must be appropriate for the bandwidth capacity in both directions.
    This applies to both Format-1 and Format-2 STAMP test packets and MUST include the MTU requirements specified in <xref target="sect-7.5"/>.
    </t>

    <t>
    As specified in <xref target="RFC8762" section="7"/>, the load of the STAMP-test packets offered to a network MUST be
    carefully estimated, and the possible impact on the existing
    services MUST be thoroughly analyzed before launching the test session.  
    </t>

    <t>
    <xref target="RFC8085" section="3.1.5"/> provides guidance on handling
    network load for a UDP-based protocol, and applies to the STAMP test packets in Format-1.
    </t>

    <t>
    The congestion considerations in <xref target="RFC5085" section="9"/> apply to the STAMP test packets.
    </t>

    <t>
    As specified in <xref target="RFC5085" section="9"/>, the ICMP and MPLS LSP PING applications should be rate-limited to
    below 5% of the bit-rate of the associated PW.  This rate limit also applies to the STAMP test packets.
    </t>

    <t>
    Because the Session-Reflector responds to each received test packet, the
    following requirements apply when provisioning bandwidth:
    </t>

    <ul>
    <li>
    <t>The reverse direction can generate a comparable test packet transmit rate and MUST be 
    accounted independently when provisioning the reverse direction LSP and PW.</t>
    </li>

    <li>
    <t>The configured transmit rate MUST account for cases where the reverse direction
    has less capacity than the forward direction.</t>
    </li>

    </ul>

    </section>

    <section title="MTU Requirements" anchor="sect-7.5">

    <t>
    The size of a STAMP test packet, including the encapsulation overhead, MUST fit within the LSP or PW MTU independently in both directions. 
    </t>

    <ul>
    <li>
    When using the Extra Padding TLV (value 1) defined in <xref target="RFC8972"/>, its size MUST be included when selecting the test packet size, 
    with the default of symmetric size meaning the reflected test packet matches the size of the received test packet.
    </li>
    <li>
    When the GAL is used, it adds 4 octets of label stack in the case of both Format-1 and Format-2, relative to the data traffic being measured.
    </li>
    <li>
    When a G-ACh is used, it adds 4 octets to the test packet. Relative to the data traffic being measured, where that traffic carries a Control Word, the G-ACh header occupies the position of the Control Word and adds no net overhead; where it does not, the G-ACh adds 4 octets.
    A test packet with G-ACh encapsulation that exceeds the LSP or PW MTU is dropped rather than fragmented and can therefore appear as packet loss.
    </li>
    <li>
    The IPv4/UDP encapsulation adds 28 octets whereas the IPv6/UDP encapsulation adds 48 octets to the Format-1 test packets.
    Format-1 test packets need to be sized to avoid IP fragmentation.
    </li>
    </ul>

    </section>

    <section title="Considerations for Broken LSPs" anchor="sect-7.6">
    <t>
    Forwarding STAMP test packets with an IP/UDP header on a broken LSP would cause the STAMP session to be down when all packets on the LSP are dropped.
    Otherwise, when the test packets are incorrectly forwarded by MPLS or IP to the egress node (hosting the STAMP Session-Reflector), 
    it could lead to an invalid measurement of the LSP, for example, if the packets followed a different path than the LSP.
    </t>

    <t>
    A non-routable IPv4/IPv6 destination address, specified in <xref target="sect-5.1"/>, avoids IP-forwarding 
    Session-Sender test packets to the egress node on a different path than the LSP.
    However, there is a potential risk of receiving Session-Reflector test packets from an unintended
    STAMP Session-Reflector hosted on the node where the broken LSP terminates, since the STAMP
    Session-Reflector may not know that the test packets were received due to a broken LSP.
    In this case, network analytics would detect invalid measurements reported by STAMP over a broken LSP path.
    </t>

    <t>
    Further, the destination IP address-based filtering SHOULD be provisioned on the edges of the MPLS administrative domain
    to prevent the IP-forwarded STAMP test packets for a broken LSP within the domain from leaking outside the domain.
    A non-routable IPv4/IPv6 destination address, specified in <xref target="sect-5.1"/>, MAY be used in STAMP test packets to help avoid this.
    Note that this edge filtering does not protect against the case where the Session-Sender and Session-Reflector both reside within the
    same administrative domain: a natively IP-routed STAMP test packet would still reach the Session-Reflector without ever crossing a domain edge.
    In this case, the non-routable destination address technique specified above remains the primary mitigation.
    </t>

    <t>
    The considerations specified above also apply to the reverse direction. In particular, when the reverse LSP is broken,
    a Session-Reflector test packet with an IP/UDP header may be incorrectly forwarded by MPLS 
    or IP to the ingress node (hosting the STAMP Session-Sender). This is 
    because its destination address is the Session-Sender's source address, which is routable.
    The non-routable destination address technique specified above does not protect the reflected packet.
    Operators SHOULD therefore apply appropriate filtering policies at the edges of the MPLS administrative domain
    to prevent reflected STAMP test packets from leaking outside the domain.
    </t>

    <t>
    As STAMP test packets in Format-2 are not IP-forwarded, the above considerations are not applicable. 
    However, when the test packets are incorrectly MPLS forwarded to the egress node, it could lead to invalid measurements of the LSP.
    </t>

    </section>
    </section>

    <section title="Security Considerations" anchor="sect-8">
   <t>
   The procedures defined in this document are intended for deployment in a single 
   network administrative domain.  As such, the Session-Sender address, the Session-Reflector address, and the IP and
   MPLS 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 IP and MPLS forward 
   and return paths used to transmit STAMP test packets.</t>

   <t>
   The security considerations specified in <xref target="RFC8762"/>
   and <xref target="RFC8972"/> also apply to the procedure
   specified in this document. Specifically,
   the message integrity protection using HMAC, as defined in <xref target="RFC8762" section="4.4"/>,
   also applies to the procedure specified in this document.
   When an IP/UDP header is used, the measures specified in <xref target="RFC8762" section="7"/> to mitigate attacks using the registered UDP port number also apply.
   </t>

   <t>
   Routers that support G-ACh are subject to the same security
   considerations as defined in <xref target="RFC4385"/> and <xref target="RFC5586"/>.</t>

   <t>
   The message throttling mechanisms specified in the security considerations in <xref target="RFC5085" section="10"/>
   to protect against potential (deliberate or unintentional) attacks also apply to the procedure specified in this document.
   </t>

   <t>
   If desired, attacks can be mitigated by performing basic validation
   checks in Session-Reflector test packets received at the Session-Sender, such as verifying that 
   timestamp T2 is later than timestamp T1 (when the Session-Sender and Session-Reflector clocks are synchronized) 
   in the STAMP Reference Topology shown in <xref target="ure-stamp-reference-top"/>.  The minimal state
   associated with this protocol also limits the extent of measurement
   disruption that can be caused by a corrupt or invalid test packet to a
   single test cycle.</t>

   <t>
  An attacker able to inject STAMP test packets into an LSP or PW can
  corrupt the measurement: forged Session-Reflector test packets
  accepted by a Session-Sender produce incorrect delay and loss
  results, and forged Session-Sender test packets cause a
  Session-Reflector to generate replies that consume capacity on the
  return path and on the punt path described in <xref target="sect-7.3"/>.  An
  attacker able to suppress test packets can cause the STAMP session
  state to be reported as failed for an LSP or PW that is in fact
  healthy.  To mitigate these threats, operators SHOULD filter STAMP
  test packets at the edges of the MPLS administrative domain.
   </t>
   
   <t>
  Off-path attack protection differs by format. For Format-1, the source UDP port number is chosen as specified in <xref target="RFC8762"/>, which provides the protection against off-path attacks recommended in <xref target="RFC8085"/>. For Format-2 there is no UDP header and no source port number; the corresponding protection is provided by the LSP or PW context on which the test packet is received, together with the requirement in <xref target="RFC5586" section="5"/> that a node discard associated channel packets on a Channel Type it has not indicated it will process. For both formats, STAMP test packets sent within an MPLS administrative domain benefit from the MPLS encapsulation itself, 
   which makes it extremely difficult for off-path attackers to inject packets that follow the correct 
   label stack and MPLS forwarding path. The requirement that Session-Reflector test packets MUST be 
   transmitted on the reverse LSP or PW (see <xref target="sect-6"/>) further restricts the paths that valid STAMP
   test packets can traverse, providing defense against off-path attacks.
   </t> 

   <t>
   Furthermore, implementations SHOULD NOT assign SSIDs <xref target="RFC8972"/> predictably.
   To avoid predictability, implementations can leverage a Cryptographically Secure Pseudorandom Number Generator
   <xref target="NIST-CSPRNG" format="default"/>.
   </t>

   <t>
   The STAMP test packets received via a PW or an LSP are processed in the context of that PW or
   LSP, and the encapsulations defined in this document do not introduce a mechanism for
   cross-service OAM interactions.
   </t>

    </section>

    <section title="IANA Considerations" anchor="sect-9">
  
    <t>IANA maintains the G-ACh Type Registry 
    (see <eref target="https://www.iana.org/assignments/g-ach-parameters/g-ach-parameters.xhtml"/>).  
    IANA is requested to allocate values for the G-ACh Types for STAMP  
    from the "MPLS Generalized Associated Channel (G-ACh) 
    Types (including Pseudowire Associated Channel Types)" registry.</t>

    <texttable anchor="iana-gach-tbl" title="STAMP G-ACh Types">

    <ttcol align="left">Value</ttcol>
    <ttcol align="left">Description</ttcol>
    <ttcol align="left">Reference</ttcol>
    <c>TBA1</c>
    <c>STAMP Session-Sender G-ACh Type</c>
    <c>This document</c>
    <c>TBA2</c>
    <c>STAMP Session-Reflector G-ACh Type</c>
    <c>This document</c>
    </texttable>

    </section>


    </middle>

    <back>

    <references>
      <name>References</name>

    <references title="Normative References">
    &RFC768;
    &RFC2119; 
    &RFC3032;
    &RFC3443;
    &RFC4385;
    &RFC4928;
    &RFC5085;
    &RFC5586;
    &RFC6056;
    &RFC6335;
    &RFC8085;
    &RFC6936;
    &RFC8174;
    &RFC8200;
    &RFC8762;
    &RFC8972;
    &RFC7708;
    &RFC9780;
    &RFC9790;
    &RFC9801;
    </references>

    <references title="Informative References">
    &RFC4026;
    &RFC4448;
    &RFC5087;
    &RFC5462;
    &RFC5921;
    &RFC5960;
    &RFC6374;
    &RFC6398;
    &RFC6658;
    &RFC7325;
    &RFC7820;
    &RFC6790;
    &RFC9503;
    &RFC9570;
    &I-D.ietf-spring-stamp-srpm-mpls; 
        

    <reference anchor="NIST-CSPRNG">
          <front>
            <title>Recommendation for Random Number Generation Using Deterministic Random Bit Generators, Revision 1</title>
            <author>
              <organization>NIST Special Publication 800-90A Revision 1</organization>
            </author>
            <date month="June" year="2015"/>
          </front>
    </reference>

    <reference anchor="IANA-IPv6-REG" target="https://www.iana.org/assignments/iana-ipv6-special-registry" quoteTitle="true" derivedAnchor="IANA-IPv6-REG">
          <front>
            <title>IANA IPv6 Special-Purpose Address Registry</title>
            <author>
              <organization showOnFrontPage="true">IANA</organization>
            </author>
          </front>
    </reference>

    </references>

    </references>

    <section title="Acknowledgments" numbered="no" anchor="acknowledgments">

    <t>
    The authors would like to thank 
    Bharath Vasudevan, Ali Sianati, and Parag Jain for the discussions regarding the method to punt STAMP test packets to the control plane for processing.
    The authors would also like to thank Greg Mirsky, Loa Andersson, Li Zhang, Richard Foote (Footer), and Stewart Bryant 
    for reviewing this document and providing useful comments and suggestions. 
    Thanks to Carlos Pignataro for the PerfMetrdir review, Russ White for the early Rtgdir review,
    Russ Housley for the Gen-ART review, Vidhi Goel for the telechat TSVART review,
    Giuseppe Fioccola for the Opsdir review, Jen Linkova for the telechat Intdir review, 
    Yaron Sheffer for the early Secdir review, Roman Danyliw, Gorry Fairhurst, Mohamed Boucadair, Eric Vyncke, Gunter Van de Velde, Mike Bishop, and Ketan Talaulikar for IESG review 
    which helped improve this document.
    </t>

    </section>

    </back>

    </rfc>
