<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC8174 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC3828 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3828.xml">
<!ENTITY RFC5905 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5905.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 RFC10052 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.10052.xml">
]>
<rfc submissionType="IETF" docName="draft-gandhi-bpm-stamp-signaling-00" category="std" ipr="trust200902" consensus="true">
    <?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 Extensions for Signaling">Simple Two-Way Active Measurement Protocol (STAMP) Extensions for Signaling Parameters</title>
        <seriesInfo name="Internet-Draft" value="draft-gandhi-bpm-stamp-signaling-00"/>

        <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>

        <date year="2026"/>
        <workgroup>BPM Working Group</workgroup>
        <abstract>
            <t>
The Simple Two-Way Active Measurement Protocol (STAMP) specified in RFC 8762 supports active measurement of network performance without a control channel to pre-signal session parameters. RFC 8972 defines optional extensions in the form of Type-Length-Value (TLV) elements for STAMP. This document defines a STAMP Type-Length-Value (TLV) that allows a Session-Sender and a Session-Reflector to exchange measurement capabilities and configuration parameters in STAMP-Test packets. The Session-Sender uses the returned parameters to configure a STAMP session.
            </t>
        </abstract>
    </front>

    <middle>
        <section title="Introduction" anchor="introduction">
            <t>
The Simple Two-Way Active Measurement Protocol (STAMP), specified in <xref target="RFC8762" format="default"/>, provides capabilities for measuring various performance metrics in IP networks without the use of a control channel to pre-signal session parameters. <xref target="RFC8972" format="default"/> defines optional extensions in the form of Type-Length-Value (TLV) elements for STAMP.
            </t>
            <t>
A Session-Sender may not know which measurement capabilities and configuration parameters are supported or required by a particular Session-Reflector. For example, the Session-Sender may not know whether the Session-Reflector supports stateful or stateless operation, a given timestamping method, or the requested packet transmission interval. The Session-Sender may also need to know whether the Session-Reflector's clock is synchronized for one-way delay metrics.
            </t>
            <t>
Without this information, a Session-Sender cannot reliably select a measurement mode or configure the rate and timestamping behavior of a STAMP session. This document defines a signaling procedure using a STAMP TLV carried in STAMP-Test packets. The Session-Sender includes its Profile ID and one or more requested measurement-mode sub-TLVs in a STAMP-Test packet. The Session-Reflector returns the selected Profile ID and parameters for each requested mode in the reflected packet. The Session-Sender uses the returned parameters to configure subsequent STAMP-Test packets. The signaling uses the STAMP measurement path and test packets in-band and does not require a separate control channel.
            </t>
            <t>
This mechanism does not provision the IP endpoints, authentication, or reachability required to exchange STAMP-Test packets. Those items must be configured by other means. The TLV signals capabilities and session parameters after the Session-Sender can transmit an initial STAMP-Test packet to the Session-Reflector.
            </t>
        </section>

        <section title="Conventions Used in This Document" anchor="conventions">
            <section title="Requirements Language" anchor="requirements-language">
                <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="Terminology" anchor="terminology">
                <t>
This document uses the terms Session-Sender, Session-Reflector, and STAMP-Test packet as defined in <xref target="RFC8762" format="default"/> and <xref target="RFC8972" format="default"/>.
                </t>
                <t>
This document uses the terms STAMP TLV and STAMP TLV Flags as defined in <xref target="RFC8972" format="default"/>.
                </t>
                <t>
"Signaling request" refers to a STAMP-Test packet carrying the TLV from the Session-Sender. "Signaling response" refers to the corresponding reflected STAMP-Test packet.
                </t>
            </section>
            <section title="Abbreviations" anchor="abbreviations">
                <table anchor="abbreviations-table">
                    <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>NTP</td><td>Network Time Protocol</td><td><xref target="RFC5905" format="default"/></td></tr>
                        <tr><td>PTP</td><td>Precision Time Protocol</td><td><xref target="IEEE1588" format="default"/></td></tr>
                        <tr><td>STAMP</td><td>Simple Two-Way Active Measurement Protocol</td><td><xref target="RFC8762" format="default"/></td></tr>
                        <tr><td>TLV</td><td>Type-Length-Value</td><td><xref target="RFC8972" format="default"/></td></tr>
                    </tbody>
                </table>
            </section>
        </section>

        <section title="Overview" anchor="overview">
            <t>
    The signaling exchange is carried in STAMP-Test packets as an optional TLV, following the general extension processing procedures in <xref target="RFC8972" format="default"/>. The Session-Sender sends an initial signaling request with its desired Profile ID and one or more mode-specific sub-TLVs, with no more than one sub-TLV for each measurement mode. Each sub-TLV identifies a mode and requests the parameters applicable to that mode. If the Session-Sender does not know which mode or modes are configured for a Profile ID, it MAY include one sub-TLV for each mode it wants to query; to query all modes defined in this document, it includes one sub-TLV for each defined mode. The two-way, one-way, and loopback measurement modes are described in <xref target="two-way-measurement-mode" format="default"/>, <xref target="one-way-measurement-mode" format="default"/>, and <xref target="loopback-measurement-mode" format="default"/>, respectively. Note that the two-way measurement mode is specified as part of the STAMP process in <xref target="RFC8762" format="default"/> and <xref target="RFC8972" format="default"/>. The other measurement modes are defined in this document. This document defines signaling parameters for those modes. The Session-Reflector returns the selected Profile ID and one corresponding sub-TLV for each requested mode. A response sub-TLV with its U flag clear indicates that the mode is configured and available for the selected Profile ID; a sub-TLV with its U flag set indicates that the mode is not configured for that profile, unsupported, or disallowed for the request's source node.
            </t>

            <t>
    A response may provide parameters for multiple available modes as alternatives for one session. A STAMP-Test session MUST operate in exactly one measurement mode. After receiving and validating a response, the Session-Sender MUST select exactly one available mode that meets its requirements for the session and MUST NOT use more than one measurement mode in that session. If no returned mode meets its requirements, it MUST NOT start the session. For one-way and two-way modes, each corresponding sub-TLV carries the minimum receive interval and UDP port; capabilities are reported in the parent TLV. Loopback mode uses a separate sub-TLV because those parameters do not apply to it.
        </t>

            <t>
The exchange is initiated by the Session-Sender and requires no Session-Reflector-initiated discovery packet. A Session-Reflector can process the signaling request without retaining per-session state. The parent TLV Capability Flags report stateful operation support for one-way or two-way mode and stateless operation support for two-way mode. The initial request is sent using a locally configured interval. If the response is absent, malformed, or indicates that a Session-Sender requirement is not supported, the Session-Sender does not treat the requested configuration as negotiated.
        </t>


            <t>
    The Profile ID is an opaque identifier for a profile known at both endpoints. A single Profile ID can be associated with more than one measurement mode. The identifier allows the endpoints to select corresponding local configuration.
            </t>

            <section title="Two-Way Measurement Mode" anchor="two-way-measurement-mode">
                <t>
As shown in <xref target="modes-reference-topology-two-way" format="default"/>, in two-way measurement mode, the STAMP Session-Sender S1 initiates a Session-Sender test packet, and the STAMP Session-Reflector R1 generates and transmits a Session-Reflector test packet. The Session-Reflector test packet is sent to the Session-Sender S1 on either the same path (i.e., the same set of links and nodes) or a different path in the reverse direction from the path taken toward the Session-Reflector R1.
                </t>
                <figure anchor="modes-reference-topology-two-way">
                    <name>Reference Topology for Two-Way Measurement Mode</name>
                    <artwork><![CDATA[
                   T1                           T2
                  /                               \
         +-------+  Session-Sender Test Packet     +-------+
         |       | - - - - - - - - - - - - - - - ->|       |
         |   S1  |=================================|   R1  |
         |       |<- - - - - - - - - - - - - - - - |       |
         +-------+   Session-Reflector test packet +-------+
                  \                               /
                   T4                           T3

     STAMP Session-Sender                 STAMP Session-Reflector
                    ]]></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. All four timestamps are used by the Session-Sender to measure the two-way delay metric, defined as ((T4 - T1) - (T3 - T2)). Timestamps T1 and T2 are used by the Session-Sender to measure the forward one-way delay metric, defined as (T2 - T1). Note that the delay value (T4 - T3), measured by the Session-Sender, is the reverse one-way delay metric. The "two-way delay" is the sum of the one-way delays in each direction and reflects the delay of the bidirectional path, irrespective of processing delays within the Session-Reflector.
                </t>

<t>In two-way measurement mode, the round-trip delay interval (T4 - T1) includes the Session-Reflector processing time, including handling the UDP header in the exception path, generating the Session-Reflector test packet, and reflecting optional TLVs. The two-way delay metric subtracts the Session-Reflector interval (T3 - T2) from the round-trip delay interval.</t>



                <t>
The computation of the one-way delay metric requires the clocks on the Session-Sender and the Session-Reflector to be synchronized, e.g., using either PTPv2 <xref target="IEEE1588" format="default"/> or NTPv4 <xref target="RFC5905" format="default"/>.
                </t>
                <t>
In two-way measurement mode, round-trip packet loss, near-end packet loss (forward direction), and far-end packet loss (backward direction) can be measured. Note that packet loss measurement does not require the clocks on the Session-Sender and the Session-Reflector to be synchronized using either PTPv2 or NTPv4.
                </t>
            </section>

            <section title="One-Way Measurement Mode" anchor="one-way-measurement-mode">
                <t>
As shown in <xref target="modes-reference-topology-one-way" format="default"/>, in one-way measurement mode, the STAMP Session-Sender S1 initiates a Session-Sender test packet. Upon receiving a Session-Sender test packet, the STAMP Session-Reflector does not transmit a Session-Reflector test packet.
                </t>
                <figure anchor="modes-reference-topology-one-way">
                    <name>Reference Topology for One-Way Measurement Mode</name>
                    <artwork><![CDATA[
                   T1                           T2
                  /                               \
         +-------+  Session-Sender Test Packet     +-------+
         |       | - - - - - - - - - - - - - - - ->|       |
         |   S1  |=================================|   R1  |
         |       |                                 |       |
         +-------+                                 +-------+

     STAMP Session-Sender                 STAMP Session-Reflector
                    ]]></artwork>
                </figure>
                <t>
T1 is a transmit timestamp added by node S1 and T2 is a receive timestamp added by node R1. Timestamps T1 and T2 are used by the Session-Reflector to measure the one-way delay metric, defined as (T2 - T1).
                </t>

                <t>
The computation of the one-way delay metric requires the clocks on the Session-Sender and the Session-Reflector to be synchronized using either PTPv2 or NTPv4.
                </t>
                <t>
In one-way measurement mode, forward-direction packet loss can be measured. The Session-Reflector compares the Session-Sender Sequence Number in each received Session-Sender test packet with the sequence number in the previously received packet. An increase of k indicates that k-1 test packets were not received, accounting for sequence-number wraparound. This measurement is available at the Session-Reflector. Note that packet loss measurement does not require the clocks on the Session-Sender and the Session-Reflector to be synchronized using either PTPv2 or NTPv4.
                </t>
            </section>

            <section title="Loopback Measurement Mode" anchor="loopback-measurement-mode">
                <t>
As shown in <xref target="modes-reference-topology-for-loopback" format="default"/>, in loopback measurement mode, the STAMP Session-Sender S1 initiates a Session-Sender test packet to measure the round-trip delay using source routing. The node R1 at the end of the configured forward path forwards the received STAMP-Test packet along the configured return path using its MPLS and service forwarding state in the data plane. The node R1 does not need to support STAMP or maintain a STAMP session.
                </t>
                <figure anchor="modes-reference-topology-for-loopback">
                    <name>Reference Topology for Loopback Measurement Mode</name>
                    <artwork><![CDATA[
                   T1
                  /
         +-------+  Session-Sender Test Packet     +-------+
         |       | - - - - - - - - - - - - - - - - |       |
         |   S1  |================================||   R1  |
         |       |<- - - - - - - - - - - - - - - - |       |
         +-------+     Session-Sender test packet  +-------+
                  \    (Return)
                   T4

    STAMP Session-Sender                 STAMP Session-Reflector
                                         (Loopback, Forward)
                    ]]></artwork>
                </figure>
                <t>
T1 is a transmit timestamp and T4 is a receive timestamp added by node S1. The Session-Sender uses them to measure the round-trip delay metric, defined as (T4 - T1). This delay includes test packet processing on the node R1 in the data plane. The processing delay includes only the time required to forward the test packet from the incoming interface to the outgoing interface in the data plane. The node R1 does not timestamp the test packets and therefore does not require a timestamping capability.
                </t>
                <t>
In loopback measurement mode, only round-trip packet loss can be measured.
                </t>
            </section>

        </section>

        <section title="STAMP Parameters TLV" anchor="capability-tlv">
            <t>
    This document defines the "STAMP Parameters" TLV (Type=TBD). Its Value contains, in order, a 16-bit Maximum Padding Size field, an 8-bit Reserved field, a one-octet Profile ID, a 16-bit Reserved field, eight one-bit R flags, a Capability Flags octet, and one or more measurement mode sub-TLVs associated with that Profile ID. Each request and response MUST contain at least one measurement mode sub-TLV and MUST NOT contain more than one sub-TLV for any one measurement mode. A STAMP-Test packet MUST NOT contain more than one STAMP Parameters TLV. The STAMP TLV Flags, Type, and Length fields use the format specified in <xref target="RFC8972" format="default"/>.
            </t>
            <figure anchor="capability-configuration-tlv">
                <name>STAMP Parameters TLV</name>
                <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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |STAMP TLV Flags|  Type=TBD     |          Length               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |Maximum Padding Size (16 bits) | Reserved      | Profile ID 8b |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |Reserved             (16 bits) |R|R|R|R|R|R|R|R|U|Y|S|H|N|P|L|F|
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 ~                 Measurement Mode Sub-TLVs                     ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                ]]></artwork>
            </figure>
            <t>
The fields of the STAMP Parameters TLV are defined as follows:
            </t>
            <ul>
                <li><t>STAMP TLV Flags: The flags are used as specified in <xref target="RFC8972" format="default"/>. In a request, the Session-Sender sets the U (Unrecognized) flag to 1 and the M (Malformed) flag to 0. In a response, the Session-Reflector processes the flags according to <xref target="RFC8972" format="default"/>. The Session-Sender treats U set on the returned parent TLV as indicating that the STAMP Parameters TLV is unrecognized; U set on a returned measurement mode sub-TLV indicates that the corresponding mode is not configured for the selected Profile ID, unsupported, or disallowed.</t></li>
                <li><t>Type: MUST be set to TBD.</t></li>
                <li><t>Length: A two-octet field equal to the length of the complete Value field, in octets. The minimum Length is 12 octets for the fixed fields and one empty loopback sub-TLV. A one-way or two-way sub-TLV adds eight octets, including its four-octet header and four-octet Value. Each additional sub-TLV contributes its complete header and Value to the Length.</t></li>
                <li><t>Maximum Padding Size: An unsigned 16-bit integer in octets that indicates the maximum amount of additional padding supported by the Session-Reflector for the signaling session. The Session-Sender MUST set this field to 0 in a request. In a response, the Session-Reflector MUST set this field to the maximum additional padding size it supports. A value of 0 means that no extra padding is supported.</t></li>
                <li><t>Reserved (8-bit): An 8-bit field that <bcp14>MUST</bcp14> be set to 0 on transmit and <bcp14>MUST</bcp14> be ignored on receipt.</t></li>
                <li><t>Profile ID: An unsigned 8-bit opaque identifier. The Session-Sender places its desired profile identifier in a request. If the Session-Reflector finds the requested profile, it returns the identifier it selected. If a non-zero Profile ID is not found, the Session-Reflector MUST set the Conformant Reflected Packet STAMP TLV flag to 1, following the procedure specified in <xref target="RFC10052" format="default"/>.  A value of zero means that no profile was requested or selected.</t></li>
                <li><t>Reserved (16-bit): A 16-bit field that <bcp14>MUST</bcp14> be set to 0 on transmit and <bcp14>MUST</bcp14> be ignored on receipt.</t></li>
                <li><t>Reserved Flags: This one-octet field contains eight one-bit R flags, each reserved for future use. Each R flag <bcp14>MUST</bcp14> be set to 0 on transmit and <bcp14>MUST</bcp14> be ignored on receipt.</t></li>
                <li><t anchor="capability-flags">Capability Flags: The Capability Flags octet contains F, L, P, N, H, S, Y, and U in bits 0 through 7, respectively, from least significant to most significant. In a request, these flags MUST be set to zero. In a response, the Capability Flags report capabilities for successfully returned one-way and two-way modes associated with the selected Profile ID. The octet is shared by all mode sub-TLVs; a capability bit applies only to the modes for which it is defined and MUST be set only if the capability is available for every successfully returned mode to which the bit applies. Loopback mode does not use these flags. If loopback is the only successfully returned mode, all Capability Flags MUST be set to zero.</t>
                    <ul>
                        <li><t>F (Stateful Reflector): The Session-Reflector supports stateful STAMP operation.</t></li>
                        <li><t>L (Stateless Reflector): The Session-Reflector supports stateless STAMP operation for two-way mode. This flag is not applicable to one-way mode.</t></li>
                        <li><t>P (PTPv2 timestamp format): The Session-Reflector supports adding timestamp in PTPv2 format in packet capability, as specified in <xref target="IEEE1588" format="default"/>.</t></li>
                        <li><t>N (NTPv4 timestamp format): The Session-Reflector supports adding timestamp in NTPv4 format in packet capability, as specified in <xref target="RFC5905" format="default"/>.</t></li>
                        <li><t>H (Hardware timestamp): The Session-Reflector supports adding timestamp in hardware.</t></li>
                        <li><t>S (Software timestamp): The Session-Reflector supports adding timestamp in software.</t></li>
                        <li><t>Y (Clock Sync Enabled): Indicates that clock synchronization is enabled. It does not indicate clock sync status.</t></li>
                        <li><t>U (UDP-Lite Enabled): Indicates that the Session-Reflector is enabled to receive STAMP-Test packets using the Lightweight User Datagram Protocol (UDP-Lite), as specified in <xref target="RFC3828" format="default"/>.</t></li>
                    </ul>
                </li>
                <li><t>Measurement Mode Sub-TLV: Each sub-TLV identifies one requested mode and carries only parameters applicable to that mode. The sub-TLV formats and types are defined in <xref target="one-way-sub-tlv" format="default"/>, <xref target="two-way-sub-tlv" format="default"/>, and <xref target="loopback-sub-tlv" format="default"/>.</t></li>
            </ul>
        <section title="Two-Way Measurement Mode Parameters Sub-TLV" anchor="two-way-sub-tlv">
            <t>
    The "Two-Way Measurement Mode Parameters" sub-TLV (Type=TBA1) identifies the two-way measurement mode described in <xref target="two-way-measurement-mode" format="default"/> and carries the configuration parameters for that mode.
            </t>
            <figure anchor="two-way-sub-tlv-format">
                <name>Two-Way Measurement Mode Parameters Sub-TLV</name>
                <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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |STAMP TLV Flags|  Type=TBA1    |          Length=4             |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |  Session-Reflector UDP Port   |   Minimum Receive Interval    |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                ]]></artwork>
            </figure>
            <t>
    The fields of the "Two-Way Measurement Mode Parameters" sub-TLV are defined as follows:
            </t>
            <ul>
                <li><t>STAMP TLV Flags: The flags follow the procedures specified in <xref target="RFC8972" format="default"/>.</t></li>
                <li><t>Type: MUST be set to TBA1.</t></li>
                <li><t>Length: A two-octet field set to 4, indicating that the Value field is four octets long.</t></li>
                <li><t>Session-Reflector UDP Port: An unsigned 16-bit integer in network byte order that identifies the UDP port on the Session-Reflector for STAMP-Test packets in this mode. In a request, it MUST be set to 0. In a response, the value MUST be non-zero and indicates the Session-Reflector's configured port for this mode.</t></li>
                <li><t>Minimum Receive Interval: An unsigned 16-bit integer in network byte order, expressed in milliseconds. In a request, it MUST be set to 0. In a response, the value MUST be non-zero and indicates the Session-Reflector's shortest configured receive interval for this mode.</t></li>
            </ul>
        </section>

        <section title="One-Way Measurement Mode Parameters Sub-TLV" anchor="one-way-sub-tlv">
            <t>
    The "One-Way Measurement Mode Parameters" sub-TLV (Type=TBA2) identifies the one-way measurement mode described in <xref target="one-way-measurement-mode" format="default"/> and carries the configuration parameters for that mode.
            </t>
            <figure anchor="one-way-sub-tlv-format">
                <name>One-Way Measurement Mode Parameters Sub-TLV</name>
                <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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |STAMP TLV Flags|  Type=TBA2    |          Length=4             |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |  Session-Reflector UDP Port   |   Minimum Receive Interval    |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                ]]></artwork>
            </figure>
            <t>
    The fields of the "One-Way Measurement Mode Parameters" sub-TLV are defined as follows:
            </t>
            <ul>
                <li><t>STAMP TLV Flags: The flags follow the procedures specified in <xref target="RFC8972" format="default"/>.</t></li>
                <li><t>Type: MUST be set to TBA2.</t></li>
                <li><t>Length: A two-octet field set to 4, indicating that the Value field is four octets long.</t></li>
                <li><t>Session-Reflector UDP Port: An unsigned 16-bit integer in network byte order that identifies the UDP port on the Session-Reflector for STAMP-Test packets in this mode. In a request, it MUST be set to 0. In a response, the value MUST be non-zero and indicates the Session-Reflector's configured port for this mode.</t></li>
                <li><t>Minimum Receive Interval: An unsigned 16-bit integer in network byte order, expressed in milliseconds. In a request, it MUST be set to 0. In a response, it is the shortest interval at which the Session-Reflector is configured to receive and process STAMP-Test packets for this mode. A response value of zero is invalid.</t></li>
            </ul>
        </section>

        <section title="Loopback Measurement Mode Parameters Sub-TLV" anchor="loopback-sub-tlv">
            <t>
    The "Loopback Measurement Mode Parameters" sub-TLV (Type=TBA3) identifies the loopback measurement mode described in <xref target="loopback-measurement-mode" format="default"/>. Presence of this sub-TLV in a request indicates that the Session-Sender requests loopback mode; its presence in a response indicates that the Session-Reflector supports loopback mode. Capability Flags are carried in the parent TLV and do not report capabilities for loopback mode.
            </t>
            <figure anchor="loopback-sub-tlv-format">
                <name>Loopback Measurement Mode Parameters Sub-TLV</name>
                <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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |STAMP TLV Flags|  Type=TBA3    |          Length=0             |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                ]]></artwork>
            </figure>
            <t>
    The fields of the "Loopback Measurement Mode Parameters" sub-TLV are defined as follows:
            </t>
            <ul>
                <li><t>STAMP TLV Flags: The flags follow the procedures specified in <xref target="RFC8972" format="default"/>.</t></li>
                <li><t>Type: MUST be set to TBA3.</t></li>
                <li><t>Length: A two-octet field set to zero, indicating that the Value field is empty. The Session-Reflector MUST reject a loopback mode sub-TLV with a non-zero Length as malformed by setting the M (Malformed) flag to 1 as specified in <xref target="RFC8972" format="default"/>.</t></li>
                <li><t>Value: This sub-TLV has no Value field. It carries no capability flags or configuration parameters.</t></li>
            </ul>
        </section>


        </section>

        <section title="STAMP Signaling Procedures" anchor="procedures">
            <section title="Session-Sender Procedures" anchor="sender-procedures">
                <t>
Before sending the first STAMP-Test packet with STAMP Parameters TLV, the Session-Sender MUST be configured with the Session-Reflector's IP address and STAMP UDP port number, and with an initial transmission interval that is acceptable under local policy. Each signaling request MUST include exactly one STAMP Parameters TLV. The Session-Sender MUST set all Capability Flags to 0, set the Profile ID to the desired profile or zero, set the Maximum Padding Size field to 0, and include one or more measurement mode sub-TLVs for the intended STAMP session, with no more than one sub-TLV for each mode. If the Session-Sender knows which mode or modes are configured for the Profile ID, it MAY include a sub-TLV for one or more of those modes. If it does not know which mode or modes are configured, it MAY include one sub-TLV for each mode whose parameters it wants for the session. In each one-way or two-way mode sub-TLV, it MUST set the Session-Reflector UDP Port and Minimum Receive Interval fields to 0. Other STAMP TLVs MAY be included subject to the procedures in <xref target="RFC8972" format="default"/>.
                </t>
                <t>
The Session-Sender MUST wait for the corresponding reflected packet and validate its STAMP session identity and the returned TLV. If the Conformant Reflected Packet STAMP TLV flag is set to 1, the Session-Sender MUST treat the response as indicating that the requested Profile ID was not found. The Session-Sender MUST NOT start a measurement session using that Profile ID. If the STAMP Parameters TLV is returned with its parent U flag set, the Session-Sender MUST treat the TLV as unrecognized, MUST NOT use it to configure a session, and MUST continue with the existing STAMP procedure as specified in [RFC8762] and [RFC8972]. Otherwise, the returned parent TLV is valid only if its M flag is clear, its Length is at least 12 octets, its sub-TLV sequence is well-formed, it contains exactly one corresponding sub-TLV for each requested mode and no unrequested or duplicate mode sub-TLVs, and each sub-TLV has a valid length and value. The Session-Sender MUST treat a parent TLV with the M flag set or invalid fields as malformed. The U flag in a returned mode sub-TLV applies only to the corresponding measurement mode, as specified below.
                </t>
                <t>
        When the parent TLV is recognized and valid, the Session-Sender MUST verify that the returned Profile ID matches its non-zero requested Profile ID. For each requested mode, it MUST inspect the U flag in the corresponding response sub-TLV. If that flag is set, the Session-Sender MUST treat the mode as unavailable for the selected Profile ID and MUST NOT use that sub-TLV to configure a session. If the flag is clear, it MUST verify that every capability bit required for that mode is set in the returned parent TLV's Capability Flags. For one-way and two-way modes, it MUST also verify that the returned Session-Reflector UDP Port and Minimum Receive Interval are non-zero. The Session-Sender MUST select a single available mode that meets its requirements for the STAMP session. If multiple returned modes meet its requirements, it MUST choose one according to local policy. If no returned mode meets its requirements, it MUST NOT start a measurement session and MAY terminate the signaling attempt.
                </t>
                <t>
After selecting a mode, the Session-Sender MAY create a STAMP-Test session using the parameters returned for that mode. For one-way or two-way mode, it MUST set the interval between consecutive STAMP-Test packets to no less than the returned Minimum Receive Interval. The Session-Sender MUST compute one-way metrics only if the returned Y bit is set and its own clock is synchronized; otherwise it MUST use two-way metrics or select another mode.
                </t>
                <t>
If the Session-Sender does not receive a valid signaling response within a locally configured timeout, it MUST NOT assume that the Session-Reflector supports the requested capabilities. It MAY retry the signaling request subject to the rate limits and retry policy configured for the session.
                </t>
            </section>
            <section title="Session-Reflector Procedures" anchor="reflector-procedures">
                <t>
When a Session-Reflector receives a STAMP-Test packet containing the STAMP Parameters TLV, it MUST validate the TLV Length and all sub-TLVs. The Length MUST be at least 12 octets, and each sub-TLV MUST fit completely within the parent TLV Value. A request MUST contain one or more measurement mode sub-TLVs and MUST NOT contain more than one sub-TLV for any one mode. If the TLV or a sub-TLV is malformed, including a duplicate mode sub-TLV, the Session-Reflector MUST process the error using the malformed-TLV procedures in <xref target="RFC8972" section="4" format="default"/> by setting the M (Malformed) flag to 1.
                </t>
                <t>
If a valid request contains a non-zero Profile ID that the Session-Reflector does not find in its local configuration, the Session-Reflector MUST return the received STAMP Parameters TLV with the Conformant Reflected Packet STAMP TLV flag set to 1, following the procedure specified in <xref target="RFC10052" format="default"/>. 
                </t>
                <t>
For a valid request whose Profile ID is zero or is found in the Session-Reflector's local configuration, the Session-Reflector MUST return one STAMP Parameters TLV in the reflected STAMP-Test packet. It MUST set the Profile ID to the profile selected for the session (or zero if none is selected). It MUST set the Maximum Padding Size field to the maximum amount of additional padding it supports for the signaling session, or to 0 if it does not support extra padding. For each requested mode that is configured for the selected Profile ID, supported by the Session-Reflector, and permitted for the source node, it MUST return the corresponding measurement mode sub-TLV with U clear and the parameters it supports for that mode and, for one-way or two-way mode, its configured minimum receive interval in milliseconds. It MUST return exactly one corresponding sub-TLV for every requested mode, including modes that are unavailable as described below. It MUST report supported capabilities for the successfully returned modes in the parent TLV's Capability Flags. It MUST NOT advertise a capability or parameter that it cannot provide for the session. The Session-Reflector MUST return only capabilities and configuration parameters associated with the Profile ID selected for that request.
                </t>
                <t>
For each requested mode that is not configured for the selected Profile ID, not supported by the Session-Reflector, or prohibited by local policy for a session from the request's source node, the Session-Reflector MUST return the corresponding measurement mode sub-TLV with its U (Unrecognized) flag set to 1 and its M (Malformed) flag set to 0. It MUST preserve the sub-TLV's Type, Length, and Value and MUST NOT add negotiated STAMP parameters to that sub-TLV.
                </t>
                <t>
The Session-Reflector MUST enforce a receive-processing limit no more aggressive than the returned minimum interval for the selected one-way or two-way mode, subject to resource protection and local policy. This requirement does not apply to loopback mode. A Session-Reflector MAY change its capabilities or minimum interval as local configuration changes; a Session-Sender that observes a changed response SHOULD re-evaluate the session configuration.
                </t>
                <t>
For one-way and two-way modes, the Session-Reflector MAY support stateful operation and sets F in the parent TLV's Capability Flags to report that support. For two-way mode, the Session-Reflector MAY also support stateless operation and sets L in the parent TLV's Capability Flags to report that support.</t>

                <t>
A Session-Sender MUST use the TLV only with a Session-Reflector that follows <xref target="RFC8972" format="default"/> TLV reflection procedures.
		</t>

                <t>
After initial signaling, the Session-Sender MAY continue to include the TLV to detect changes in Session-Reflector capabilities or parameters. If it does so, it MUST revalidate the response and reconfigure or stop the session when the response no longer meets its requirements. A Session-Reflector MUST return the TLV whenever it receives a valid request TLV, including after the initial exchange.
                </t>

            </section>
        </section>

        <section title="Operational Considerations" anchor="operational-considerations">
            <t>
The operational considerations specified in <xref target="RFC8762" format="default"/> and <xref target="RFC8972" format="default"/> apply. Operators configure the Session-Reflector endpoint and an initial Session-Sender rate before signaling can begin. This mechanism exchanges capabilities and session parameters; it does not discover endpoints or establish routing, security associations, or authorization policy.
            </t>
            <t>
For one-way and two-way modes, the Minimum Receive Interval is an operational limit for the Session-Reflector. Operators should provision intervals that protect Session-Reflector resources and avoid excessive traffic on the measured path. </t>
            <t>
A Session-Sender should choose a timestamp format and measurement metric that match both endpoints and the measurement objective.
            </t>
        </section>

        <section title="Security Considerations" anchor="security-considerations">
            <t>
The security considerations specified in <xref target="RFC8762" format="default"/> and <xref target="RFC8972" format="default"/> apply. Since the TLV is carried in STAMP-Test packets, an on-path attacker able to modify or inject packets could alter advertised capabilities, profile identifiers, or rate parameters. Implementations SHOULD authenticate STAMP packets when the measurement environment requires protection against modification or injection.
            </t>
            <t>
The Session-Reflector's capability information can reveal implementation and operational details. Operators SHOULD restrict access to STAMP Session-Reflectors to authorized measurement endpoints and protect the information according to local policy. A Session-Reflector MUST continue to apply its configured resource limits regardless of values received in a signaling request; the request cannot raise the Session-Reflector's allowed receive rate or enable an unsupported capability.
            </t>
        </section>

        <section title="IANA Considerations" anchor="iana-considerations">
            <t>
IANA is requested to allocate the following TLVs from the IETF Review range of the "STAMP TLV Types" registry (see: <eref target="https://www.iana.org/assignments/stamp-tlv-types"/>) under the Simple Two-way Active Measurement Protocol (STAMP) TLV Types registry group:
            </t>
            <table anchor="iana-stamp-tlv-types" align="center">
                <name>STAMP TLV Type</name>
                <thead>
                    <tr>
                        <th align="left">Value</th>
                        <th align="left">Description</th>
                        <th align="left">Reference</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td align="left">TBD</td>
                        <td align="left">STAMP Parameters</td>
                        <td align="left">This document</td>
                    </tr>
                </tbody>
            </table>
            <t>
IANA is requested to allocate the following sub-TLV from the IETF Review range of the "STAMP Sub-TLV Types" registry (see: <eref target="https://www.iana.org/assignments/stamp-tlv-types"/>) under the Simple Two-way Active Measurement Protocol (STAMP) TLV Types registry group:
            </t>
            <table anchor="iana-stamp-sub-tlv-types" align="center">
                <name>STAMP Sub-TLV Types</name>
                <thead>
                    <tr>
                        <th align="left">Value</th>
                        <th align="left">Description</th>
                        <th align="left">Used In</th>
                        <th align="left">Reference</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td align="left">TBA1</td>
                        <td align="left">Two-Way Measurement Mode Parameters</td>
                        <td align="left">STAMP Parameters TLV</td>
                        <td align="left">This document</td>
                    </tr>
                    <tr>
                        <td align="left">TBA2</td>
                        <td align="left">One-Way Measurement Mode Parameters</td>
                        <td align="left">STAMP Parameters TLV</td>
                        <td align="left">This document</td>
                    </tr>
                    <tr>
                        <td align="left">TBA3</td>
                        <td align="left">Loopback Measurement Mode Parameters</td>
                        <td align="left">STAMP Parameters TLV</td>
                        <td align="left">This document</td>
                    </tr>
                </tbody>
            </table>
        </section>
    </middle>

    <back>
        <references title="Normative References">
            &RFC2119;
            &RFC8174;
            &RFC3828;
            &RFC8762;
            &RFC8972;
            &RFC10052;
        </references>
        <references title="Informative References">
            &RFC5905;
            <reference anchor="IEEE1588">
                <front>
                    <title>IEEE Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems</title>
                    <author><organization>IEEE</organization></author>
                    <date year="2020"/>
                </front>
                <seriesInfo name="IEEE Std" value="1588-2019"/>
            </reference>
        </references>
    </back>
</rfc>
