<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
<!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 RFC6936 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6936.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 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 RFC8174 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC8200 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8200.xml">
<!ENTITY RFC8250 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8250.xml">
<!ENTITY RFC8754 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8754.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 RFC9197 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9197.xml">
<!ENTITY RFC9486 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9486.xml">
<!ENTITY RFC9268 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9268.xml">
<!ENTITY RFC9326 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9326.xml">
<!ENTITY RFC9343 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9343.xml">
<!ENTITY RFC9673 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9673.xml">
<!ENTITY I-D.ietf-ippm-asymmetrical-pkts SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-ippm-asymmetrical-pkts.xml">
<!ENTITY I-D.ietf-ippm-on-path-active-measurements SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-ippm-on-path-active-measurements.xml">
]>
<rfc submissionType="IETF" docName="draft-ietf-ippm-stamp-ext-hdr-13" category="std" ipr="trust200902" consensus="true">
    <!-- 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="no"?>
    <?rfc symrefs="yes"?>
    <?rfc strict="yes"?>
    <?rfc toc="yes"?>
    <front>
    <title abbrev="STAMP for Reflecting IP Headers">Simple Two-Way Active Measurement Protocol (STAMP) Extensions for Reflecting STAMP Packet IP Headers</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-ippm-stamp-ext-hdr-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="Tianran Zhou" initials="T." surname="Zhou">
      <organization showOnFrontPage="true">Huawei</organization>
      <address>
        <postal>
          <country>China</country>
        </postal>
        <email>zhoutianran@huawei.com</email>
      </address>
    </author>

    <author fullname="Zhenqiang Li" initials="Z." surname="Li">
      <organization showOnFrontPage="true">China Mobile</organization>
      <address>
        <postal>
          <country>China</country>
        </postal>
        <email>lizhenqiang@chinamobile.com</email>
      </address>
    </author>

    <author fullname="William Hawkins" initials="W." surname="Hawkins">
      <organization showOnFrontPage="true">University of Cincinnati</organization>
      <address>
        <postal>
          <country>USA</country>
        </postal>
        <email>hawkinsw@obs.cr</email>
      </address>
    </author>

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

    <abstract>
        <t>
The Simple Two-Way Active Measurement Protocol (STAMP) and its optional extensions can be used for Edge-to-Edge (E2E) active measurements. In Situ Operations, Administration, and Maintenance (IOAM) data fields can be used for recording and collecting Hop-by-Hop (HBH) and E2E operational and telemetry information. This document extends STAMP to reflect IP headers as well as IPv6 extension headers for HBH and E2E active measurements, for example, using the IOAM data fields.
</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 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. STAMP test packets are transmitted along a path between a Session-Sender and a Session-Reflector to measure Edge-to-Edge performance metrics, like delay, delay variation, and packet loss along that path.
</t>

<t>
In Situ Operations, Administration, and Maintenance (IOAM) is used for recording and collecting operational and telemetry information while the packet traverses a path between two points in the network. The IOAM data fields are defined in <xref target="RFC9197" format="default"/>. The information from the collected IOAM data fields can be used to support Hop-by-Hop (HBH) and Edge-to-Edge (E2E) measurement use cases.
</t>

<t>
IPv6 packets may carry IPv6 extension headers, including Hop-by-Hop options headers and Destination options headers, as defined in <xref target="RFC8200" format="default"/>. The HBH options processing procedures are further specified in <xref target="RFC9673" format="default"/>. 
</t>

<t>
<xref target="RFC9486" format="default"/> specifies IPv6 option types for HBH and destination options headers to carry the IOAM Option-Types defined in <xref target="RFC9197" format="default"/> and <xref target="RFC9326" format="default"/> for the IPv6 data plane. 
</t>

<t>
It may be desirable to record and collect HBH and E2E operational and telemetry information using active measurement packets between two nodes in a network. This is achieved by augmenting STAMP <xref target="RFC8762" format="default"/> using optional STAMP extensions defined in <xref target="RFC8972" format="default"/> to reflect IP headers as well as IPv6 extension headers as specified in this document. The procedure defined in this document leverages existing implementations at midpoint nodes with an IPv6 data plane that supports the IPv6 extension headers used, without any additional requirements.
</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" format="default"/>.
</t>

   </section>

   <section title="Conventions Used in This Document" anchor="sect-2">
       
   <section title="Requirements Language" anchor="sect-2.1">

               <t>
   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
   NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "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 title="Abbreviations" anchor="sect-2.2">

    <texttable anchor="abbreviations" title="Abbreviations">
      <ttcol align="left">Abbreviation</ttcol>
      <ttcol align="left">Meaning</ttcol>
      <ttcol align="left">Reference</ttcol>
      <c>CRC</c>
      <c>Cyclic Redundancy Check</c>
      <c><xref target="RFC6936"/></c>
      <c>CSPRNG</c>
      <c>Cryptographically Secure Pseudorandom Number Generator</c>
      <c><xref target="NIST-CSPRNG"/></c>
      <c>DEX</c>
      <c>Direct Export</c>
      <c><xref target="RFC9326"/></c>
      <c>E2E</c>
      <c>Edge-to-Edge</c>
      <c><xref target="RFC9197"/></c>
      <c>HBH</c>
      <c>Hop-by-Hop</c>
      <c><xref target="RFC8200"/></c>
      <c>HL</c>
      <c>Hop Limit</c>
      <c><xref target="RFC8200"/></c>
      <c>IOAM</c>
      <c>In Situ Operations, Administration, and Maintenance</c>
      <c><xref target="RFC9197"/></c>
      <c>MTU</c>
      <c>Maximum Transmission Unit</c>
      <c><xref target="RFC8200"/></c>
      <c>STAMP</c>
      <c>Simple Two-Way Active Measurement Protocol</c>
      <c><xref target="RFC8762"/></c>
      <c>TLV</c>
      <c>Type-Length-Value</c>
      <c><xref target="RFC8972"/></c>
      <c>TTL</c>
      <c>Time to Live</c>
      <c><xref target="RFC8200"/></c>
      <c>UDP</c>
      <c>User Datagram Protocol</c>
      <c><xref target="RFC768"/></c>
    </texttable>

    </section>

    <section title="STAMP Reference Topology" anchor="sect-2.3">

<t>
    In the "STAMP Reference Topology" shown in <xref target="stamp-reference-topology"/>, the STAMP Session-Sender S1 initiates a Session-Sender test packet, and the STAMP Session-Reflector R1 transmits a reply Session-Reflector test packet. Node M1 is a midpoint node that does not perform any STAMP processing.
</t>

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

   <figure anchor="stamp-reference-topology">
        <name>STAMP Reference Topology</name>
  <artwork name="" type="" align="left" alt=""><![CDATA[
           T1                                       T2   
          /                                           \   
 +-------+    Test Packet  +-------+                   +-------+
 |       | - - - - - - - - |       | - - - - - - - - ->|       |
 |   S1  |=================|   M1  |===================|   R1  |
 |       |<- - - - - - - - |       | - - - - - - - - - |       |
 +-------+                 +-------+ Reply Test Packet +-------+
          \                                           /
           T4                                       T3

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

    </section>
    </section>

    <section title="Overview" anchor="sect-3">

<t>
<xref target="RFC8972" format="default"/> defines optional extensions for STAMP. The optional extensions are added to the base STAMP test packet defined in <xref target="RFC8762" format="default"/> in the form of TLVs. As specified in <xref target="RFC8972" format="default"/>, both Session-Sender and Session-Reflector test packets are symmetric in size when including all optional TLVs (but excluding headers). The Session-Reflector reflects all received STAMP TLVs from the Session-Sender test packet.
</t>

<t>
As specified in <xref target="RFC8762" format="default"/>, STAMP test packets are transmitted with IP/UDP headers. Since midpoint nodes do not process the UDP headers in the packets, they are agnostic to the STAMP test packets in the payload.
</t>

<t>
STAMP test packets may carry IP headers and IPv6 extension headers. This document defines procedures and STAMP extensions for a Session-Reflector to reflect the received IP headers and IPv6 extension headers back to the Session-Sender for both one-way and two-way measurement types.
</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 using the extensions defined in this document.
</t>

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

<t>
The base STAMP test packet payloads can be transported using a UDP
header with destination UDP port number 862 as the default destination
port, as specified in <xref target="RFC8762" section="4.1"/> or from 
the User Ports (aka Registered Ports) and Dynamic Ports (aka Private or Ephemeral Ports) ranges defined in <xref target="RFC6335"/>. 
</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>

<t>
The IPv4 TTL and IPv6 HL MUST be set to 255 in both Session-Sender
and Session-Reflector test packets, which allows determination of the
number of hops that forwarded the test packet.
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>



</section>

<section title="Procedure for Reflecting IPv6 Extension Headers" anchor="sect-3.2">

<t>
This document defines a new TLV option for STAMP, called "Reflected IPv6 Extension Header Data" (value TBA1). When a STAMP Session-Sender adds an IPv6 extension header, such as an IPv6 Hop-by-Hop options header or a Destination options header <xref target="RFC8200" format="default"/>, in the Session-Sender test packet, the Session-Sender MUST add a corresponding "Reflected IPv6 Extension Header Data" TLV in the Session-Sender test packet to receive a copy of that IPv6 extension header back in the STAMP TLV. The Length of the TLV is set to the total size of the IPv6 extension header, starting from its Next Header field, and includes the first 8 octets of the IPv6 extension header carried in the Requested IPv6 Extension Header Data field. The format of this TLV is specified in <xref target="sect-5.1"/>.
</t>

<t>
An example STAMP test packet for carrying an IPv6 header, IPv6 extension headers, and reflected data in the "Reflected IPv6 Extension Header Data" TLVs is shown in <xref target="stamp-generic-reflected-ipv6-data"/>.
</t>

        <figure anchor="stamp-generic-reflected-ipv6-data">
        <name>Example Session-Sender and Session-Reflector Test Packet with Reflected IPv6 Extension Header Data TLVs</name>
    <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | IPv6 Header                                                   |
 +---------------------------------------------------------------+
 | IPv6 Extension Header-1 RFC 8200                              |
 +---------------------------------------------------------------+
 ~ ...                                                           ~
 +---------------------------------------------------------------+
 | IPv6 Extension Header-N RFC 8200                              |
 +---------------------------------------------------------------+
 | UDP Header                                                    |
 +---------------------------------------------------------------+
 | STAMP Packet RFC 8972                                         |
 +---------------------------------------------------------------+
 | Reflected IPv6 Extension Header-1 Data STAMP TLV (TBA1)       |
 +---------------------------------------------------------------+
 ~ ...                                                           ~
 +---------------------------------------------------------------+
 | Reflected IPv6 Extension Header-M Data STAMP TLV (TBA1)       |
 +---------------------------------------------------------------+

   Note: Value of M <= N
]]></artwork>
    </figure>

<t>
When adding multiple IPv6 extension headers in a Session-Sender test packet, the corresponding "Reflected IPv6 Extension Header Data" TLVs MUST be added in the same order to receive copies of those IPv6 extension headers.

When the Session-Sender test packets carry an IPv6 extension header that the Session-Sender does not require the Session-Reflector to reflect in Session-Reflector test packets, the Session-Sender MUST NOT add a corresponding "Reflected IPv6 Extension Header Data" TLV in the Session-Sender test packets. In this case, the number of "Reflected IPv6 Extension Header Data" TLVs (value of M in <xref target="stamp-generic-reflected-ipv6-data"/>) in the Session-Sender test packet would be less than the number of IPv6 extension headers (value of N in <xref target="stamp-generic-reflected-ipv6-data"/>). 
</t>

<t>
The number of "Reflected IPv6 Extension Header Data" TLVs MUST be less than or equal to the number of IPv6 extension headers in a Session-Sender test packet.  
</t>

<t>
When the Session-Reflector receives a STAMP test packet with an IPv6 extension header and a "Reflected IPv6 Extension Header Data" TLV, the following rules apply:
</t>

<t>
1. The Session-Reflector that supports this STAMP TLV MUST copy the portion of the IPv6 extension header after the first 8 octets into the "Reflected IPv6 Extension Header Data" field in the Session-Reflector test packet.
</t>

<t>
2. When there are multiple IPv6 extension headers in the received Session-Sender test packet, each IPv6 extension header MUST be processed in order, starting from the outer header, and copied into the corresponding "Reflected IPv6 Extension Header Data" TLV in the Session-Reflector test packet, if that STAMP TLV exists.
</t>

<t>
3. When the Session-Reflector receives a STAMP test packet with an IPv6 extension header but without a corresponding "Reflected IPv6 Extension Header Data" TLV, the Session-Reflector does not copy the IPv6 extension header into the Session-Reflector test packet.
</t>

<t>
The value field in the "Reflected IPv6 Extension Header Data" TLV in Session-Sender test packets can be initialized to all zeros.

The Session-Sender MUST copy the "Requested IPv6 Extension Header Data" field (shown in <xref target="stamp-reflected-ipv6-option"/>) using the first 8 octets from the IPv6 extension header (starting from the Next Header field of the IPv6 extension header) if there is an ambiguity when there are multiple IPv6 extension headers with the same length present and not all need to be copied and reflected in the STAMP TLVs. This method assumes that the first 8 octets of the IPv6 extension header do not change before being received at the Session-Reflector.

If the Session-Reflector receives Session-Sender test packets with non-zero values in the "Requested IPv6 Extension Header Data" field of the "Reflected IPv6 Extension Header Data" TLV, the Session-Reflector MUST match the first 8 octets in the corresponding IPv6 extension header (starting from the Next Header field of the IPv6 extension header) before copying data into the STAMP TLV.
</t>

<t>
The Session-Sender and Session-Reflector MUST ensure that the resulting test packets do not exceed the IPv6 MTU after adding "Reflected IPv6 Extension Header Data" TLVs. If necessary, one or more "Reflected IPv6 Extension Header Data" TLVs MUST be removed to avoid violating the IPv6 MTU limit.
</t>

<t>
Because this procedure leverages existing IPv6 extension header implementations at midpoint nodes, no additional requirements are imposed when these headers are carried in STAMP test packets. IPv6 extension headers are processed by midpoint nodes using the procedures specified in their defining documents.
</t>

<t>
<xref target="RFC8250" format="default"/> precludes the insertion and deletion of IPv6 extension headers along the path (except by encapsulating the original packet in another IPv6 header); therefore, the use case where the IPv6 extension headers of the Session-Sender test packets are added, removed, or adjusted in length along the path is outside the scope of this document.
</t>

<t>
Examples of IPv6 extension headers include: the IOAM data fields in an IPv6 options header defined in <xref target="RFC9486" format="default"/>, Performance and Diagnostic Metrics IPv6 options header defined in <xref target="RFC8250" format="default"/>, Maximum Path MTU IPv6 options header defined in <xref target="RFC9268" format="default"/>, Alternate Marking Method IPv6 options header defined in <xref target="RFC9343" format="default"/>, Routing Header for IPv6 including Segment Routing Header defined in <xref target="RFC8754" format="default"/>, and any new IPv6 extension header that is defined in the future.
</t>

<section title="One-Way and Two-Way Measurement Types" anchor="sect-3.2.1">

<t>
This document defines two measurement types: one-way and two-way measurements.
These types relate only to whether the Session-Reflector adds new matching IPv6 extension headers for the reverse path.
</t>

<t>
In the two-way measurement type, the Session-Reflector adds new matching IPv6 extension headers in the Session-Reflector test packets in the same order as received in the Session-Sender test packets for the reverse direction measurement. 
The length and content of the new IPv6 extension headers added in the Session-Reflector test packets are local decisions at the Session-Reflector.
The STAMP Session-Sender enables this type by adding the "IPv6 Extension Header Control" Sub-TLV for the "Reflected Test Packet Control" TLV in the Session-Sender test packets.
</t>

<t>
In the one-way measurement type, the Session-Reflector MAY omit adding new matching IPv6 extension headers in the Session-Reflector test packets in response to the received IPv6 extension headers in the Session-Sender test packets, based on its local policy. This does not preclude the Session-Reflector from adding IPv6 extension headers independently.
However, the Session-Reflector still copies received IPv6 extension headers into the "Reflected IPv6 Extension Header Data" TLVs as specified in <xref target="sect-3.2"/>. This type is the default if the "IPv6 Extension Header Control" Sub-TLV is absent in the Session-Sender test packet.
</t>

<t>
The measurement type for a STAMP session is locally provisioned on the STAMP Session-Sender.
</t>

    </section>
    </section>

<section title="Procedure for Reflecting Fixed Headers" anchor="sect-3.3">

<t>
This document defines a new TLV option for STAMP, called "Reflected Fixed Header Data" (value TBA2). The STAMP TLV can be used to reflect any fixed-size header received in a Session-Sender test packet, including IPv4 and IPv6 headers. When a STAMP Session-Sender adds an IP header, the Session-Sender also adds a "Reflected Fixed Header Data" TLV in the Session-Sender test packet to receive a copy of that IP header back in the STAMP TLV. The Length of the TLV is set to the total size of the IP header, and includes the first 4 octets of the IP header carried in the Requested Fixed Header Data field. The format of this TLV is specified in <xref target="sect-5.2.1"/>.
</t>

<t>
An example STAMP test packet carrying an IP header and reflected data in the "Reflected Fixed Header Data" TLV is shown in <xref target="stamp-generic-reflected-ip-hdr"/>.
</t>
    
        <figure anchor="stamp-generic-reflected-ip-hdr">
        <name>Example Session-Sender and Session-Reflector Test Packet with "Reflected Fixed Header Data" TLV</name>
    <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | IP Header                                                     |
 +---------------------------------------------------------------+
 | UDP Header                                                    |
 +---------------------------------------------------------------+
 | STAMP Packet RFC 8972                                         |
 +---------------------------------------------------------------+
 | Reflected Fixed Header Data STAMP TLV (TBA2)                  |
 +---------------------------------------------------------------+
]]></artwork>
    </figure>

<t>
When adding multiple IP headers in a Session-Sender test packet, the corresponding "Reflected Fixed Header Data" TLVs MUST also be added in the same order to receive copies of those IP headers.

When the Session-Sender test packets carry an IP header that the Session-Sender does not require the Session-Reflector to reflect in Session-Reflector test packets, the Session-Sender MUST NOT add a corresponding "Reflected Fixed Header Data" TLV in the Session-Sender test packets. In this case, the number of "Reflected Fixed Header Data" TLVs in the Session-Sender test packet would be less than the number of IP headers in the packet. 
</t>

<t>
The number of "Reflected Fixed Header Data" TLVs MUST be less than or equal to the number of IP headers in the Session-Sender test packet.  
</t>

<t>
When the Session-Reflector receives a STAMP test packet with an IP header and a "Reflected Fixed Header Data" TLV, the following rules apply:
</t>

<t>
1. The Session-Reflector that supports this TLV MUST copy the portion of the IP header after the first 4 octets into the "Reflected Fixed Header Data" field in the Session-Reflector test packet.
</t>

<t>
2. When there are multiple IP headers in the received Session-Sender test packet, each IP header MUST be processed in order, starting from the outer header, and copied into the corresponding "Reflected Fixed Header Data" TLV in the Session-Reflector test packet, if that STAMP TLV exists.
</t>

<t>
3. When the Session-Reflector receives a STAMP test packet with an IP header but without a corresponding "Reflected Fixed Header Data" TLV, the Session-Reflector does not copy the IP header into the Session-Reflector test packet.
</t>

<t>
The value field in the "Reflected Fixed Header Data" TLV in Session-Sender test packets can be initialized to all zeros.
The Session-Sender MUST copy the "Requested Fixed Header Data" field (shown in <xref target="stamp-reflected-fixed-hdr-data"/>) using the first 4 octets from the IP header if there is an ambiguity when there are multiple IP headers with the same length present and not all need to be copied and reflected in the STAMP TLVs. This method assumes that the first 4 octets in the IP header do not change before being received at the Session-Reflector.
If the Session-Reflector receives Session-Sender test packets with non-zero values in the "Requested Fixed Header Data" field of the "Reflected Fixed Header Data" TLV, it MUST match the first 4 octets in the corresponding IP header before copying data into the STAMP TLV.
</t>

<t>
The Session-Sender and Session-Reflector MUST ensure that the resulting test packets do not exceed the IP MTU after adding "Reflected Fixed Header Data" TLVs. If necessary, one or more "Reflected Fixed Header Data" TLVs MUST be removed to avoid violating the IP MTU limit.
</t>

     </section>

    <section title="Reflecting Fixed Headers and IPv6 Extension Headers" anchor="sect-3.4">

<t>
STAMP test packets can be used to reflect both IP headers and IPv6 extension headers by carrying the corresponding "Reflected Fixed Header Data" and "Reflected IPv6 Extension Header Data" TLVs.
A STAMP test packet carrying an IPv6 header and an IPv6 extension header along with their corresponding "Reflected Fixed Header Data" and "Reflected IPv6 Extension Header Data" TLVs is shown in <xref target="stamp-reflected-ipv6-ext-data-ip-data"/>.  
</t>

        <figure anchor="stamp-reflected-ipv6-ext-data-ip-data">
        <name>Example Session-Sender and Session-Reflector Test Packet with "Reflected Fixed Header Data" and "Reflected IPv6 Extension Header Data" TLVs</name>
    <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | IPv6 Header                                                   |
 +---------------------------------------------------------------+
 | IPv6 Extension Header RFC 8200                                |
 +---------------------------------------------------------------+
 | UDP Header                                                    |
 +---------------------------------------------------------------+
 | STAMP Packet RFC 8972                                         |
 +---------------------------------------------------------------+
 | Reflected Fixed Header Data STAMP TLV (TBA2)                  |
 +---------------------------------------------------------------+
 | Reflected IPv6 Extension Header Data STAMP TLV (TBA1)         |
 +---------------------------------------------------------------+
]]></artwork>
    </figure>

<t>
The "Reflected Fixed Header Data" TLVs MUST be added before adding the "Reflected IPv6 Extension Header Data" TLVs to maintain the same order as the IP headers and IPv6 extension headers in the Session-Sender test packets. If the "Reflected Fixed Header Data" TLVs and the "Reflected IPv6 Extension Header Data" TLVs are not received in this order, the Session-Reflector MUST return these TLVs with the C flag (Conformance) set to 1 in the STAMP TLV Flags using the procedure defined in <xref target="I-D.ietf-ippm-asymmetrical-pkts" format="default"/>, but without copying any data in these STAMP TLVs.
 </t>

     </section>

    </section>

    <section title="Use Case of Reflecting IOAM Data Fields" anchor="sect-4">
<t>
In Situ Operations, Administration, and Maintenance (IOAM) is used for recording and collecting operational and telemetry information while the packet traverses a path between two points in the network. The IOAM data fields are defined in <xref target="RFC9197" format="default"/>. Examples of data recorded by IOAM Trace Options include per-hop information, such as node ID, timestamp, queue depth, interface ID, and interface load. The information collected can be used for monitoring paths, proof-of-transit, and troubleshooting failures in the network. IOAM can be used with STAMP test packets for active measurements. The procedure and STAMP extensions defined in this document can be used to reflect the collected IOAM data fields back to the Session-Sender, where the Session-Sender can use this information to support HBH and E2E measurement use cases.
</t>

<t>
<xref target="RFC9486" format="default"/> defines types for HBH and destination options headers and is used to carry the IOAM option types defined in <xref target="RFC9197" format="default"/> for the IPv6 data plane. The STAMP Session-Sender and Session-Reflector test packets carry the IPv6 options headers with IOAM option types for recording and collecting HBH and E2E operational and telemetry information for active measurements, as shown in <xref target="stamp-reflected-ipv6-option-tlv"/>. The Session-Sender node, midpoint nodes, and the Session-Reflector node process the IOAM data fields, as defined in <xref target="RFC9197" format="default"/>. Note that using the IOAM option type "Incremental Trace Option-Type" is not supported by <xref target="RFC9486" format="default"/>.
</t>

        <figure anchor="stamp-reflected-ipv6-option-tlv">
        <name>Example Session-Sender and Session-Reflector Test Packet for IOAM with Reflected IPv6 Extension Header Data TLV</name>
    <artwork name="" type="" align="left" alt=""><![CDATA[
 +---------------------------------------------------------------+
 | IPv6 Header                                                   |
 +---------------------------------------------------------------+
 | HBH IOAM IPv6 Options Header RFC 9486                         |
 +---------------------------------------------------------------+
 | UDP Header                                                    |
 +---------------------------------------------------------------+
 | STAMP Packet RFC 8972                                         |
 +---------------------------------------------------------------+
 | Reflected IPv6 Extension Header Data STAMP TLV (TBA1)         |
 +---------------------------------------------------------------+
]]></artwork>
    </figure>


<t>
IOAM Direct Exporting (DEX) <xref target="RFC9326" format="default"/> is applicable with STAMP test packets for on-path telemetry use cases as described in <xref target="I-D.ietf-ippm-on-path-active-measurements" format="default"/>. 
In this case, the Session-Reflector is not required to reflect the IOAM option type, since no IOAM data fields would be recorded in the STAMP test packets.
Hence, the Session-Sender MAY omit a corresponding "Reflected IPv6 Extension Header Data" TLV in Session-Sender test packets for the IOAM DEX option type.
</t>


    </section>

    <section title="STAMP Extensions" anchor="sect-5">

    <section title="Reflected IPv6 Extension Header Data TLV" anchor="sect-5.1">

<t>
The "Reflected IPv6 Extension Header Data" TLV is carried by Session-Sender and Session-Reflector test packets. STAMP test packets MAY carry one or more STAMP TLVs of this type. The same "Reflected IPv6 Extension Header Data" TLV Type is used for reflecting different IPv6 extension headers, including HBH and Destination IPv6 options headers. The format of the "Reflected IPv6 Extension Header Data" TLV is shown in <xref target="stamp-reflected-ipv6-option"/>.
</t>
        
        <figure anchor="stamp-reflected-ipv6-option">
        <name>Reflected IPv6 Extension Header Data TLV</name>
    <artwork name="" type="" align="left" alt=""><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |STAMP TLV Flags|  Type=TBA1    |         Length                |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Requested IPv6 Extension Header Data         |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Reflected IPv6 Extension Header Data         |
 ~                     (Length - 8 octets)                       ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
    </figure>

<t>
The STAMP TLV fields are defined as follows:
</t>

<t>
Type: STAMP TLV Type (value TBA1).
</t>

<t>
STAMP TLV Flags: The STAMP TLV Flags follow the procedures described in <xref target="RFC8972" format="default"/>.
</t>

<t>
Length: A two-octet field equal to the total size of the IPv6 extension header to be reflected, starting from its Next Header field, in octets.
</t>

<t>
Requested IPv6 Extension Header Data: A fixed 8-octet field containing the first 8 octets of the target IPv6 extension header to be reflected, starting from its Next Header field. This field is used to disambiguate which IPv6 extension header in the received Session-Sender test packet MUST be copied into the Reflected field when multiple IPv6 extension headers of the same length are present. When this field is set to all zeros, the Session-Reflector MUST match the first IPv6 extension header in the Session-Sender test packet with the matching length.
</t>

<t>
Reflected IPv6 Extension Header Data: A variable-length field of (Length - 8) octets containing the portion of the reflected IPv6 extension header after the first 8 octets, copied from the received Session-Sender test packet by the Session-Reflector. In Session-Sender test packets, this field MUST be initialized to zero. 
</t>

<t>
When the Session-Reflector recognizes the received "Reflected IPv6 Extension Header Data" TLV but could not use it for reflecting any IPv6 extension header received, the Session-Reflector MUST return the "Reflected IPv6 Extension Header Data" TLV with the C flag (Conformance TLV) set to 1 in the STAMP TLV Flags using the procedure defined in <xref target="I-D.ietf-ippm-asymmetrical-pkts" format="default"/>.

This can occur, for example if: (a) there is a mismatch between the expected length in "Reflected IPv6 Extension Header Data" TLVs and the received IPv6 extension headers,
(b) the Session-Reflector cannot access the received IPv6 extension headers from the data plane,
(c) no IPv6 extension header matches the "Requested IPv6 Extension Header Data" field, etc.
</t>

    </section>
    
<section title="Reflected Fixed Header Data TLV" anchor="sect-5.2.1">

<t>
The "Reflected Fixed Header Data" TLV is carried by Session-Sender and Session-Reflector test packets. STAMP test packets MAY carry one or more STAMP TLVs of this type. The format of the "Reflected Fixed Header Data" TLV is shown in <xref target="stamp-reflected-fixed-hdr-data"/>.
</t>

        <figure anchor="stamp-reflected-fixed-hdr-data">
        <name>Reflected Fixed Header Data TLV</name>
    <artwork name="" type="" align="left" alt=""><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |STAMP TLV Flags|  Type=TBA2    |         Length                |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Requested Fixed Header Data                  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Reflected Fixed Header Data                  |
 ~                     (Length - 4 octets)                       ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
    </figure>

<t>
The STAMP TLV fields are defined as follows:
</t>

<t>
Type: STAMP TLV Type (value TBA2).
</t>

<t>
STAMP TLV Flags: The STAMP TLV Flags follow the procedures described in <xref target="RFC8972" format="default"/>.
</t>

<t>
Length: A two-octet field equal to the total size of the IP header to be reflected, in octets. For a 20-octet IPv4 header, it is 20, and for a 40-octet IPv6 header, it is 40.
</t>

<t>
Requested Fixed Header Data: A fixed 4-octet field containing the first 4 octets of the target IP header to be reflected. This field is used to disambiguate which IP header in the received Session-Sender test packet MUST be copied into the Reflected field when multiple IP headers of the same length are present in the Session-Sender test packet. When this field is set to all zeros, the Session-Reflector MUST match the first IP header in the Session-Sender test packet with the matching length.
</t>

<t>
Reflected Fixed Header Data: A variable-length field of (Length - 4) octets containing the portion of the reflected IP header after the first 4 octets, copied from the received Session-Sender test packet by the Session-Reflector. In Session-Sender test packets, this field MUST be initialized to zero. 
</t>

<t>
When the Session-Reflector recognizes the received "Reflected Fixed Header Data" TLV but could not use it for reflecting any IP header received, the Session-Reflector MUST return the "Reflected Fixed Header Data" TLV with the C flag (Conformance TLV) set to 1 in the STAMP TLV Flags using the procedure defined in <xref target="I-D.ietf-ippm-asymmetrical-pkts" format="default"/>.

This can occur, for example if: (a) there is a mismatch between the expected length in "Reflected Fixed Header Data" TLVs and the received IP headers,
(b) the Session-Reflector cannot access the received IP headers from the data plane,
(c) no IP header matches the "Requested Fixed Header Data" field, etc.
</t>

    </section>

    <section title="IPv6 Extension Header Control Sub-TLV" anchor="sect-5.3">

<t>
This document defines the "IPv6 Extension Header Control" Sub-TLV (Type TBA3) for the "Reflected Test Packet Control" TLV (Type 12) introduced in <xref target="I-D.ietf-ippm-asymmetrical-pkts" format="default"/>.
The format of "IPv6 Extension Header Control" Sub-TLV is shown in <xref target="stamp-ipv6-header-control-sub-tlv"/>.
</t>

   <figure anchor="stamp-ipv6-header-control-sub-tlv">
        <name>IPv6 Extension Header Control Sub-TLV</name>
    <artwork name="" type="" align="left" alt=""><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | Sub-TLV Flags |  Type = TBA3  |         Sub-TLV Length = 0    |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
    </figure>

<t>
The Sub-TLV fields are defined as follows:
</t>

<t>
Type: Sub-TLV Type (value TBA3).
</t>

<t>
Sub-TLV Flags: The Sub-TLV Flags follow the procedure for STAMP TLV Flags described in <xref target="RFC8972" format="default"/>.
</t>

<t>
Sub-TLV Length: A two-octet field equal to the length of the Data in octets. It is set to 0.
</t>

<t>
The following rules apply to the Session-Reflector's handling of IPv6 extension headers:
</t>

<t>
1. The Session-Reflector MUST add new matching IPv6 extension headers in the Session-Reflector STAMP test packet in the same order corresponding to the received IPv6 extension headers (except the routing extension headers specific to the Session-Sender test packet).
</t>

<t>
2. In the absence of the "IPv6 Extension Header Control" Sub-TLV in the received Session-Sender test packet, the Session-Reflector MAY omit adding new matching IPv6 extension headers corresponding to the received IPv6 extension headers in the Session-Reflector test packet, based on its local policy. This does not preclude the Session-Reflector from adding IPv6 extension headers independently of the received IPv6 extension headers.
</t>

<t>
3. The IPv6 extension headers received in the Session-Sender test packets MUST be copied and reflected in the corresponding "Reflected IPv6 Extension Header Data" TLVs to the Session-Sender regardless of whether "IPv6 Extension Header Control" Sub-TLV is present or not.
</t>

<t>
4. If the Session-Reflector cannot add a new matching IPv6 extension header in the Session-Reflector test packet, the Session-Reflector MUST return the "Reflected Test Packet Control" TLV with the C flag (Conformance) set to 1 in the Sub-TLV Flags of the "IPv6 Extension Header Control" Sub-TLV using the procedure defined in <xref target="I-D.ietf-ippm-asymmetrical-pkts" format="default"/>. This can occur, for example, when the Session-Reflector does not support the IPv6 extension header, or when the Session-Reflector cannot access the received IPv6 extension headers from the data plane.
</t>

<t>
STAMP test packets MUST NOT carry more than one "IPv6 Extension Header Control" Sub-TLV in a "Reflected Test Packet Control" TLV.
If the "Reflected Test Packet Control" TLV in the Session-Sender test packet contains more than one "IPv6 Extension Header Control" Sub-TLV, 
the Session-Reflector MUST return the "Reflected Test Packet Control" TLV with 
the C flag (Conformance TLV) set to 1 in the Sub-TLV Flags of each "IPv6 Extension Header Control" Sub-TLV, using the procedure defined in <xref target="I-D.ietf-ippm-asymmetrical-pkts" format="default"/>.
</t>

    </section>

    </section>

    <section title="UDP Checksum Handling" anchor="sect-6">
    <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 using the extensions defined in this document.</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-6.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-6.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-8"/>), 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 title="Operational Considerations" anchor="sect-7">

    <t>
    The operational considerations specified in <xref target="RFC8762" format="default"/> and 
    <xref target="I-D.ietf-ippm-asymmetrical-pkts" format="default"/> apply to the procedure and extensions defined in this document.
    </t>

    <t>
    In addition, the Management and Deployment Considerations specified in <xref target="RFC9197" format="default"/> 
    also apply when using the IOAM data fields defined in that document.
    </t>

    <t>
    An operator MAY provision a local policy on a Session-Reflector to not copy and reflect the received IPv6 extension headers 
    and IP headers in the Session-Reflector test packets to avoid exposing the collected network information to the Session-Sender.
    </t>

    <section title="STAMP Session State Notification" anchor="sect-7.1">
    <t>
    The STAMP session state change notifications specified in this section are applicable to all
    STAMP sessions and are not limited to STAMP sessions using the extensions defined in this document.
    </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 path being measured, a connectivity failure
    of that path 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.2">
    <t>
    The rate limiting considerations specified in this section are applicable to all STAMP sessions and are not limited to STAMP sessions using the extensions defined in this document.
    </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),
    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 transmit rate of the STAMP test packets to prevent invalid measurement results.
    </t>

    </section>

    </section>

    <section title="Security Considerations" anchor="sect-8">

    <t>
    The security considerations specified in <xref target="RFC8762" format="default"/>, <xref target="RFC8972" format="default"/>, 
    <xref target="RFC8200" format="default"/>, and <xref target="I-D.ietf-ippm-asymmetrical-pkts" format="default"/> 
    apply to the procedure and extensions defined in this document.
    In addition, the security considerations specified in <xref target="RFC9197" format="default"/> and 
    <xref target="RFC9486" format="default"/> also apply when using IPv6 options for IOAM data fields.
    </t>

    <t>
    The procedures defined in this document are intended for deployment in a single network administrative domain.  
    It is assumed that the operator has verified the integrity of the forward 
    and return paths used to transmit STAMP test packets so that collected network information is not exposed on an undesired node.
    </t>

    <t>
    If desired, attacks can be mitigated by performing basic validation
    checks of the timestamp fields in received reply test packets at the Session-Sender. For example, verifying that T2 is later than T1 in the STAMP Reference Topology shown in <xref target="stamp-reference-topology"/> requires clock synchronization between the Session-Sender and Session-Reflector. In contrast, checking that T3 is greater than or equal to T2, or that T4 is later than T1, compares timestamps generated at the same node and does not require clock synchronization. The minimal state associated with these protocols 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>
    Furthermore, implementations SHOULD NOT assign STAMP Session-IDs <xref target="RFC8972"/> in a predictable
    manner.  In order to avoid predictability, implementations can
    leverage a Cryptographically Secure Pseudorandom Number Generator
    <xref target="NIST-CSPRNG" format="default"/>.
    </t>

    </section>

  <section title="Implementation Status" anchor="sect-9">
    <t>
    Editorial note: Please remove this section prior to publication.
    </t>

    <t>
      An open-source implementation of the Simple Two-Way Active Measurement Protocol <xref target="RFC8762" format="default"/> is available in Teaparty.
    </t>
    <t>
    https://github.com/cerfcast/teaparty
    </t>

    <t>
    An implementation of the solution in this document is available at the following location:
    </t>
    <t>
    https://github.com/cerfcast/teaparty/commit/393abf9357a6c2439877d9bcf2dc426dd89c7158
    </t>

    <t>
    The implemented features are as follows:
    </t>
    <t>
    1. Extraction of the extension headers from the IPv6 headers of the received STAMP test packet.
    </t>
    <t>
    2. Reflection of the extension headers in the reflected STAMP TLV data (with checks for matching length).
    </t>
    <t>
    3. Adding the extension headers to the IP header of the reflected STAMP test packet.
    </t>
    <t>
    4. Support for multiple IPv6 extension headers.
    </t>
    <t>
    5. Reflection of the fixed IPv6 header in the reflected STAMP TLV data. 
    </t>

    <t>
    There is also support for the reflected IPv6 extension header TLV data in the Wireshark dissector:
    </t>
    <t>
    https://github.com/cerfcast/teaparty/commit/fb74e2e02396e9bb3ead017e8d9a0c187e3573e2
    </t>

    <t>
    There is also support for tools to test the reflected IPv6 extension header TLV data:
    </t>
    <t>
    https://github.com/cerfcast/teaparty/tree/main/testing_data#testing-reflected-ipv6-extension-header-data
    </t>

    <t>
    Contact: 
    </t>
    <t>
    William Hawkins 
    </t>
    <t>
    University of Cincinnati
    </t>
    <t>
    Email: hawkinsw@obs.cr
    </t>

    </section>

    <section title="IANA Considerations" anchor="sect-10">

<t>
IANA has created the "STAMP TLV Types" registry for <xref target="RFC8972" format="default"/>. IANA is requested to allocate a value for the "Reflected IPv6 Extension Header Data" TLV Type  and a value for the "Reflected Fixed Header Data" TLV Type from the IETF Review TLV range of the same registry.
</t>

    <table anchor="iana-tlv-type-tbl" align="center">
       <name>STAMP TLV Types</name>
        <thead>
          <tr>
            <th align="left">Value</th>
            <th align="center">Description</th>
            <th align="left">Reference</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">TBA1 </td>
            <td align="center">Reflected IPv6 Extension Header Data</td>
            <td align="left">This document</td>
          </tr>
          <tr>
            <td align="left">TBA2 </td>
            <td align="center">Reflected Fixed Header Data</td>
            <td align="left">This document</td>
          </tr>
        </tbody>
    </table>

<t>
IANA is requested to allocate a value for the Sub-TLV Type "IPv6 Extension Header Control" (Type TBA3) for the STAMP TLV Type "Reflected Test Packet Control" (Type 12) defined in <xref target="I-D.ietf-ippm-asymmetrical-pkts" format="default"/>, from the "STAMP Sub-TLV Types" registry.
</t>

   <table anchor="iana-tlv-type-tbl2" align="center">
       <name>Sub-TLV Type for Reflected Test Packet Control TLV</name>
        <thead>
          <tr>
            <th align="left">Value</th>
            <th align="center">Description</th>
            <th align="center">TLV Used</th>
            <th align="left">Reference</th>
          </tr>
        </thead>
    
        <tbody>
          <tr>
            <td align="left">TBA3 </td>
            <td align="center">IPv6 Extension Header Control</td>
            <td align="center">Reflected Test Packet Control</td>
            <td align="left">This document</td>
        </tr>

 
        </tbody>
    
    </table>

    </section>

    </middle>

    <back>
    <references title="Normative References">
    &RFC2119; 
    &RFC8174; 
    &RFC8200;
    &RFC8762;
    &RFC8972;
    &RFC768;
    &RFC6056;
    &RFC6335;
    &RFC6936;
    &RFC8085;
    &RFC9673;
    &I-D.ietf-ippm-asymmetrical-pkts;
    </references>
    <references title="Informative References">
    &RFC8250;
    &RFC8754;
    &RFC9197;
    &RFC9268;
    &RFC9326;
    &RFC9343;
    &RFC9486;
    &RFC7820;
    &I-D.ietf-ippm-on-path-active-measurements;

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


    </references>

    <section title="Acknowledgments" numbered="no" anchor="acknowledgments">
<t>
The authors would like to thank Greg Mirsky, Xiao Min, Tal Mizrahi, Cheng Li, Giuseppe Fioccola, Richard "Footer" Foote, and Jie Dong for reviewing this document and providing many useful comments and suggestions. 
The authors also thank William Hawkins for implementing the solution defined in this document in Teaparty.
Thank you to Xiao Min for the PerfMetrdir review which helped improve this document.
The authors would like to thank  Vidhi Goel for the telechat TSVART review originally for draft-ietf-mpls-stamp-pw that resulted in the addition of the specifications for the IP/UDP header, UDP Checksum Handling, STAMP Session State, and Rate Limiting in this document.
</t>

    </section>

    </back>

    </rfc>
