<?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 RFC9534 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9534.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 I-D.ietf-ippm-asymmetrical-pkts SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-ippm-asymmetrical-pkts.xml">
]>
<rfc submissionType="IETF" docName="draft-gandhi-ippm-stamp-ber-01" 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 Bit Error Rate"> Simple Two-Way Active Measurement Protocol (STAMP) Extensions for Bit Error Detection and Bit Error Rate Measurement</title>
    <seriesInfo name="Internet-Draft" value="draft-gandhi-ippm-stamp-ber-01"/>    

    <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="Peter Schoenmaker" initials="P." surname="Schoenmaker">
    <organization>Meta Platforms, Inc.</organization>
    <address>
    <postal><street>United Kingdom</street>
    </postal>
        <email>psch@meta.com</email>
    </address>
    </author>

    <date year="2025"/>
    <workgroup>IPPM Working Group</workgroup>
    <abstract>
        <t>
The Simple Two-Way Active Measurement Protocol (STAMP), as defined in RFC 8762, along with its optional extensions specified in RFC 8972, can be utilized for active measurement. This document further augments the STAMP extensions specified in RFC 8972 to enable the detection of bit errors and the measurement of the bit error rate within the "Extra Padding" TLV of STAMP packets.
    </t>
    </abstract>
    </front>

    <middle>

   <section title="Introduction" anchor="sect-1">
<t>
The Simple Two-Way Active Measurement Protocol (STAMP) is designed to measure various performance metrics in IP networks without relying on a control channel to pre-signal session parameters, as specified in [RFC8762]. STAMP test packets are sent between a Session-Sender and a Session-Reflector to measure delay and packet loss along the path.
</t>

<t>
<xref target="RFC8972" format="default"/> introduces optional extensions for STAMP in the form of Type-Length-Value (TLV) objects, including the capability to transmit "Extra Padding" TLV within STAMP test packets.
</t>

<t>
Networks may experience transmission bit errors due to various factors, such as poor fiber quality. The bit error can be a single bit error or a burst of bit errors at a time. It is beneficial to detect bit errors and measure the Bit Error Rate (BER) using active measurement packets between two nodes. For accurate bit error detection, transmitting large-sized active measurement packets is preferable, especially on links with low bit error rates. Furthermore, there is a need to transmit test packets at a high rate to detect bit errors on high-capacity links.
</t>

<t>
The STAMP test packets use a UDP header with a checksum field that may be used for checking the integrity of the header and data. The UDP checksum is optional for the IPv4 header and may be set to 0 for the IPv6 header for the STAMP destination UDP port. However, the checksum field does not provide an accurate measurement of bit errors.
</t>

<t>
Authenticated mode provides data integrity protection for the STAMP test packets by adding a Hashed Message Authentication Code (HMAC), such as HMAC-SHA-256 [RFC8762]. However, the authenticated mode does not provide an accurate measurement of bit errors. In addition, the HMAC TLV defined in <xref target="RFC8972" format="default"/> for authenticating STAMP TLVs does not include checking the "Extra Padding" TLV.
</t>

<t>
This document further augments the STAMP extensions defined in <xref target="RFC8972" format="default"/> to enable the detection of bit errors and the measurement of BER within the "Extra Padding" TLV of STAMP packets.
 </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">

    <t> BER:    Bit Error Rate </t>
    <t> MTU:    Maximum Transmission Unit </t>
    <t> STAMP:  Simple Two-way Active Measurement Protocol </t>
    <t> TLV:    Type-Length-Value </t>

    </section>

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

<t>
In the STAMP reference topology shown in Figure 1, the STAMP Session-Sender S1 initiates Session-Sender test packets, and the STAMP Session-Reflector R1 transmits reply Session-Reflector test packets. 
</t>

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

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

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

    </section>
    </section>

    <section title="Overview" anchor="sect-3">
 <t>
The optional extensions for STAMP test packets [RFC8762] are defined in [RFC8762] in the form of TLVs. The Session-Sender transmits optional STAMP TLVs, and the Session-Reflector reflects all received STAMP TLVs from the Session-Sender test packets. <xref target="RFC8972" format="default"/> defines an optional TLV extension specifically for transmitting "Extra Padding" (Type=1) TLV in the STAMP test packets. The "Extra Padding" TLV can be filled using either a predefined fixed pattern or a random pattern of bits <xref target="RFC8972" format="default"/>.
</t>

<t>
This document defines a procedure to detect bit errors within the "Extra Padding" TLV. The process involves the Session-Sender transmitting the extra padding filled with a predefined bit pattern. The Session-Reflector then checks for bit errors by comparing the received padding against the predefined bit pattern. This allows for the detection of a single bit error or a burst of bit errors and the measurement of the BER. The Session-Reflector does not discard the STAMP test packet with bit errors but instead reflects it back to the Session-Sender after correcting the bit errors. The Session-Reflector also returns the bit error count to the Session-Sender.
</t>

<t>
Bit errors are detected in both the forward and reverse directions between the Session-Sender and the Session-Reflector using the procedure and extensions defined in this document. The BER is measured using the number of bit errors detected and the number of bits received in the extra padding.
</t>

<t>
As specified in <xref target="RFC8972" format="default"/>, the Session-Sender and Session-Reflector test packets are symmetric in size. The Session-Sender and Session-Reflector MUST ensure that the resulting test packets do not exceed the path MTU after adding the STAMP TLVs.
</t>
  
    <section title="Bit Errors in Non-measurement Fields of STAMP" anchor="sect-3.1">
<t>
Note that the procedure and extensions defined in this document are not used to detect bit errors in the base STAMP packets, packet headers, or STAMP TLVs other than the "Extra Padding" TLV. It is possible that the bit errors impact those non-measurement fields of the STAMP test packets, resulting in verification failures. Such STAMP test packets are reported using a different measurement metric, and not included in the BER measurement. 
The integrity of those fields can be verified using the HMAC mechanisms defined in <xref target="RFC8762" format="default"/> and <xref target="RFC8972" format="default"/>. 
</t>
    </section>
    </section>

    <section title="STAMP Procedure" anchor="sect-4">
<t>
This document defines two TLV options for STAMP: "Bit Pattern in Padding" TLV (Type=TBA1) and "Bit Error Count in Padding" TLV (Type=TBA2). 
</t>
<t>
An example of STAMP test packet used for detecting bit errors is shown in Figure 2 using "Extra Padding" TLV, 
optional "Bit Pattern in Padding" TLV, and "Bit Error Count in Padding" TLV. </t>

   <figure anchor="stamp-stamp-ber">
        <name>Example STAMP Packet to Detect Bit Errors</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 Packet RFC 8972                              |
.                                                               .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|STAMP TLV Flags|     Type=1    |           Length              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                     Extra Padding                             ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|STAMP TLV Flags|     Type=TBA1 |           Length              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~            Optional Bit Pattern in Padding                    ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|STAMP TLV Flags|     Type=TBA2 |           Length=4            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Bit Error Count in Padding                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
    </figure>


    <section title="STAMP Session-Sender" anchor="sect-4.1">
<t>
When a STAMP Session-Sender is set up to detect bit errors, it adds an "Extra Padding" (Type=1) TLV, a "Bit Error Count in Padding" (Type=TBA2) TLV, and optionally, a "Bit Pattern in Padding" (Type=TBA1) TLV in Session-Sender test packets. The Session-Sender test packets carry only one "Bit Error Count in Padding" TLV, only one "Extra Padding" TLV <xref target="RFC8972" format="default"/> and 
optionally carry only one "Bit Pattern in Padding" TLV.
</t>

<t>
The Session-Sender MUST add an "Extra Padding" TLV <xref target="RFC8972" format="default"/> when it adds a "Bit Pattern in Padding" TLV to the Session-Sender test packets. The variable-length data in the "Bit Pattern in Padding" TLV MUST contain the bit pattern employed in the "Extra Padding" TLV. It is RECOMMENDED to have the length of the extra padding as an integer multiple of the length of the Bit Pattern to ease implementation.
</t>

<t>
The Session-Sender MUST also add an "Extra Padding" TLV <xref target="RFC8972" format="default"/> when it adds a "Bit Error Count in Padding" TLV in the Session-Sender test packets. The bit error count in padding MUST be set to 0.
</t>

<t>
Note that the integrity of the "Bit Pattern in Padding" and "Bit Error Count in Padding" TLVs can be protected using the HMAC mechanisms defined in <xref target="RFC8972" format="default"/>. 
</t>

    <section title="Considerations for Bit Pattern" anchor="sect-4.1.1">
<t>
It is possible that the bit pattern in the "Bit Pattern in Padding" TLV itself may contain bit errors. This can result in a measurement error due to a mismatch between the bit pattern and the extra padding. 
One way to avoid this issue is for the Session-Sender and Session-Reflector to use the local configuration or the default value of 0xFF00 as the bit pattern.
In this case, the "Bit Pattern in Padding" TLV is not transmitted in the STAMP test packets. However, the "Bit Error Count in Padding" TLV MUST be transmitted to reflect the detected bit error count.
</t>

    </section>

    </section>

    <section title="STAMP Session-Reflector" anchor="sect-4.2">
<t>
When the Session-Reflector receives a STAMP test packet with a "Bit Pattern in Padding" TLV, the Session-Reflector that supports this TLV MUST check the extra padding in the "Extra Padding" TLV against the bit pattern to detect any bits that do not match the bit pattern and count them as bit errors.
</t>

<t>
When the Session-Reflector receives a STAMP test packet with a "Bit Error Count in Padding" TLV, the Session-Reflector that supports this TLV MUST check the "Extra Padding" TLV against the expected bit pattern to detect if there are any bits not matching the bit pattern and count them as bit errors. The Session-Reflector updates the count of bit errors in the received "Bit Error Count in Padding" TLV and reflects the TLV back to the Session-Sender. If no bit errors are detected, the bit error count remains as 0 in the reflected "Bit Error Count in Padding" TLV.
</t>

<t>
The Session-Reflector corrects the bit errors in the "Extra Padding" TLV by matching the bit pattern and reflects the corrected "Extra Padding" TLV to the Session-Sender. The corrected "Extra Padding" TLV is used to detect bit errors in the reverse direction.
</t>

    <section title="STAMP TLV Conformant Check" anchor="sect-4.2.1">

<t>
If the Session-Reflector receives a STAMP test packet with a "Bit Pattern in Padding" TLV or a "Bit Error Count in Padding" TLV without an "Extra Padding" TLV or with more than one "Extra Padding" TLV, it MUST set the C flag (Conformant) defined in <xref target="I-D.ietf-ippm-asymmetrical-pkts" format="default"/> to 1 in the STAMP TLV Flags in the reflected STAMP test packet for those STAMP TLVs.
</t>

<t>
If the Session-Reflector receives a STAMP test packet that contains more than one "Bit Pattern in Padding" TLV or more than one "Bit Error Count in Padding" TLV, 
it MUST set the C flag (Conformant) defined in <xref target="I-D.ietf-ippm-asymmetrical-pkts" format="default"/> to 1 in the STAMP TLV Flags in the reflected STAMP test packet for those STAMP TLVs. 
</t>

    </section>

    </section>

    <section title="Considerations for Link Aggregation Group" anchor="sect-4.3">
<t>
Networks may experience transmission bit errors differently for different link members in a Link Aggregation Group (LAG). The STAMP extensions for LAG are defined in <xref target="RFC9534" format="default"/>. The procedure and extensions defined in this document are equally applicable for detecting bit errors in each individual LAG member link by creating a separate micro-session for each link, as defined in <xref target="RFC9534" format="default"/>. Note that in order to get a good approximation of the bit errors, it is desired to transmit the STAMP test packets that match the link MTU size.
</t>
    </section>

    </section>

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

    <section title="Bit Pattern in Padding STAMP TLV" anchor="sect-5.1">
<t>
The "Bit Pattern in Padding" TLV is optional and is carried by Session-Sender and Session-Reflector test packets. The format of the TLV is shown in Figure 3.
</t>

   <figure anchor="stamp-padding-stamp-ber">
        <name>Bit Pattern in Padding STAMP 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                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                  Bit Pattern in Padding                       ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
    </figure>

<t>
The TLV fields are defined as follows:
</t>
<t>
Type: 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 length of the Data in octets.
</t>

    </section>

    <section title="Bit Error Count in Padding STAMP TLV" anchor="sect-5.2">
<t>
The "Bit Error Count in Padding" TLV is optional and is carried by Session-Sender and Session-Reflector test packets. The format of the TLV is shown in Figure 4.
</t>

   <figure anchor="stamp-padding-stamp-ber-count">
        <name>Bit Error Count in Padding STAMP 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=4              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Bit Error Count in Padding                   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
    </figure>

<t>
The TLV fields are defined as follows:
</t>
<t>
Type: 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 set to 4 for the Data.
</t>
        
    </section>
    </section>

    <section title="Data Model Parameters" anchor="sect-6">

    <section title="Configuration Data Model Parameters" anchor="sect-6.1">
<t>
    The configuration data model for bit error detection and BER measurement using STAMP MUST allow to set the following parameters:
</t>

<list>
<t>
    - Padding size (number of bytes) 
</t>
<t>
    - Padding bit pattern (with variable length of bytes)
</t>
<t>
    - Transmit interval for STAMP test packets
</t>
<t>
    - Computation interval as a multiple of transmit interval for reporting bit error rate 
</t>
</list>

    </section>
    <section title="Operational Data Model Parameters" anchor="sect-6.2">
<t>
    The operational data model for bit error detection and BER measurement using STAMP MUST allow to telemetry the following parameters:
</t>

<list>
<t>
    - Number of total packets received in the computation interval
</t>
<t>
    - Number of total packets received with bit errors in the computation interval
</t>
<t>
    - Number of total bits in the padding TLV of all received packets in the computation interval
</t>
<t>
    - Number of total bit error count in the padding TLV of all received packets in the computation interval
</t>
</list>

    </section>

    </section>

    <section title="Security Considerations" anchor="sect-7">
<t>
The security considerations specified in <xref target="RFC8762" format="default"/> and <xref target="RFC8972" format="default"/> apply to the procedure and extensions defined in this document.
</t>

    </section>

    <section title="IANA Considerations" anchor="sect-8">
<t>
IANA has created the "STAMP TLV Types" registry for <xref target="RFC8972" format="default"/>. IANA is requested to allocate a value for the "Bit Pattern in Padding" TLV Type and a value for the "Bit Error Count in Padding" 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">Bit Pattern in Padding</td>
            <td align="left">This document</td>
          </tr>
          <tr>
            <td align="left">TBA2 </td>
            <td align="center">Bit Error Count in Padding</td>
            <td align="left">This document</td>
          </tr>
        </tbody>
    </table>

    </section>

    </middle>

    <back>
    <references title="Normative References">
    &RFC2119; 
    &RFC8174; 
    &RFC8762;
    &RFC8972;
    &I-D.ietf-ippm-asymmetrical-pkts;

    </references>
    <references title="Informative References">
    &RFC9534;

    </references>
    <section title="Acknowledgments" numbered="no" anchor="acknowledgments">
<t>
The authors would like to thank Ianik Semco and Miloslav Kopka for the discussions on the bit error rate measurements. The authors would also like to thank Ruediger Geib and William Hawkins for reviewing this document and providing many useful comments and suggestions.
</t>
    </section>

    </back>

    </rfc>
