<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC3819 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3819.xml">
<!ENTITY RFC8200 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8200.xml">
<!ENTITY RFC8201 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8201.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 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">
<!ENTITY RFC3385 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3385.xml">
]>
<rfc submissionType="IETF" docName="draft-ietf-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 Residual Bit Error Rate"> Simple Two-Way Active Measurement Protocol (STAMP) Extensions for Residual Bit Error Rate Measurement</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-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>

    <author fullname="Richard Foote" initials="R." surname="Foote">
      <organization>Nokia</organization>
      <address>
        <email>footer.foote@nokia.com</email>
      </address>
    </author>
    <author fullname="Li Zhang" initials="L." surname="Zhang">
      <organization>Huawei Technologies</organization>
      <address>
        <postal>
          <country>China</country>
        </postal>
        <email>zhangli344@huawei.com</email>
      </address>
    </author>


    <date year="2026"/>
    <workgroup>IPPM Working Group</workgroup>
    <abstract>
        <t>
The Simple Two-Way Active Measurement Protocol (STAMP), specified in RFC 8762, along with its optional extensions specified in RFC 8972, supports active measurement.
Networks may experience transmission bit errors due to various factors, including poor fiber quality.
Even with efficient CRC and FEC mechanisms, some bit errors may escape detection and correction; these are referred to as residual bit errors. 
This document further augments the STAMP extensions specified in RFC 8972 to enable the measurement of the residual bit error rate within the "Extra Padding" TLV of STAMP-Test 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 <xref target="RFC8762" format="default"/>. 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 the "Extra Padding" (Type=1) TLV within STAMP-Test packets.
</t>

<t>
Networks may experience transmission bit errors due to various factors, such as poor fiber quality. These errors can corrupt packets.
Bit errors can be single-bit errors or occur in bursts.
Bit errors in the received packets can be detected using a Cyclic Redundancy Check (CRC) <xref target="RFC3819" format="default"/>.
Packets with CRC failures may be dropped, or their errors may be corrected using Forward Error Correction (FEC) <xref target="RFC3819" format="default"/>.
Even with efficient CRC and FEC mechanisms, 
some bit errors may escape detection and correction; these are referred to as residual bit errors <xref target="RFC3819" format="default"/>.
These bit errors can cause checksum failures in upper-layer protocols such as UDP and TCP, resulting in packet drops.
Measuring the residual bit error rate (also called bit error ratio) (BER)  <xref target="RFC3385" format="default"/> using active measurement packets between two nodes is beneficial for detecting service degradation. 
For accurate residual BER measurement, transmitting large active measurement packets is preferable, especially on links with low bit error rates. 
Furthermore, there is a need to transmit active measurement packets at a high rate to measure residual BER on high-capacity links.
</t>

<t>
STAMP-Test packets are transported over UDP. The UDP checksum can be used to check the integrity of the header and payload. 
However, the checksum field does not provide an accurate measurement of bit errors.
</t>

<t>
Authenticated mode provides data integrity protection for STAMP-Test packets by adding a Hashed Message Authentication Code (HMAC), such as HMAC-SHA-256 <xref target="RFC8762" format="default"/>. 
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 verify the integrity of the "Extra Padding" TLV.
</t>

<t>
This document further augments the STAMP extensions defined in <xref target="RFC8972" format="default"/> to enable the measurement of residual bit error rate within the "Extra Padding" TLV of STAMP-Test 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="Terminology" anchor="sect-2.2">
<t>
This document uses terms defined in <xref target="RFC8762" format="default"/>, specifically Session-Sender, Session-Reflector, STAMP-Test packet, and symmetric.
</t>
<t>
This document uses terms defined in <xref target="RFC8972" format="default"/>, specifically STAMP TLV Flags and Sub-TLVs.
</t>
    </section>

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

    <texttable anchor="abbreviations-table" title="Abbreviations">
      <ttcol align="left">Abbreviation</ttcol>
      <ttcol align="left">Meaning</ttcol>
      <ttcol align="left">Reference</ttcol>
      <c>BER</c>
      <c>Bit Error Rate</c>
      <c><xref target="RFC3385" format="default"/></c>
      <c>CRC</c>
      <c>Cyclic Redundancy Check</c>
      <c><xref target="RFC3819" format="default"/></c>
      <c>FEC</c>
      <c>Forward Error Correction</c>
      <c><xref target="RFC3819" format="default"/></c>
      <c>MTU</c>
      <c>Maximum Transmission Unit</c>
      <c><xref target="RFC8200" format="default"/></c>
      <c>STAMP</c>
      <c>Simple Two-Way Active Measurement Protocol</c>
      <c><xref target="RFC8762" format="default"/></c>
      <c>TLV</c>
      <c>Type-Length-Value</c>
      <c><xref target="RFC8972" format="default"/></c>
    </texttable>

    </section>

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

<t>
In the STAMP reference topology shown in <xref target="stamp-reference-topology" format="default"/>, the STAMP Session-Sender S1 initiates Session-Sender test packets, and the STAMP Session-Reflector R1 transmits Session-Reflector test packets. 
</t>

   <figure anchor="stamp-reference-topology">
        <name>STAMP Reference Topology</name>
  <artwork name="" type="" align="left" alt=""><![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.
</t>

    </section>

    </section>

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

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

<t>
Residual BER is measured in both directions between the Session-Sender and the Session-Reflector using the procedure and extensions defined in this document. Residual BER is calculated using the number of bit errors detected and the number of bits received, both in the padding data.
</t>

    <section title="UDP Checksum" anchor="sect-3.1">
<t>
The UDP checksum is used to check the integrity of received STAMP-Test packets at the Session-Sender and the Session-Reflector. When STAMP is used to measure residual BER, the UDP checksum MUST be set to zero in IPv4 and IPv6 STAMP-Test packets to disable UDP checksum verification. This prevents the Session-Sender and the Session-Reflector from dropping packets when bit errors cause UDP checksum verification to fail.
</t>

<t>
When the UDP checksum is zero, the UDP layer does not detect corruption of the STAMP-Test payload. Implementations MUST perform the specified STAMP packet and session validation, including checks of packet format, session identification, sequence number field, timestamp fields, and TLV structure and length, and MUST discard packets that fail those checks. These checks detect some invalid packets but do not provide general integrity protection: corruption that leaves a packet valid, including changes to measurement fields or TLV values, may go undetected and affect the measurement. Thus, a session using a zero UDP checksum without authenticated STAMP has no general assurance that its measurement information is intact.	
The integrity of those fields in STAMP-Test packets can be verified using the authentication mode with HMAC mechanism defined in <xref target="RFC8762" format="default"/> and <xref target="RFC8972" format="default"/>.
</t>
  
    </section>

    <section title="Bit Errors Outside the Extra Padding TLV" anchor="sect-3.2">
<t>
The procedure and extensions defined in this document measure residual BER only in the "Extra Padding" TLV; they do not check the rest of the STAMP-Test packet, including its headers and other STAMP TLVs. It is possible that bit errors may affect those fields of STAMP-Test packets, causing packet verification failures.
Such STAMP-Test packets are generally reported using a different measurement metric, such as packet loss. 
</t>

    </section>

    </section>

    <section title="Residual BER in Padding TLV Extension" anchor="sect-4">
<t>
This document defines a "Residual BER in Padding" TLV (Type=TBD1) for STAMP. 
Its Value consists of a four-octet bit error count followed by a sequence of sub-TLVs. Each sub-TLV has the STAMP TLV Flags, Type, Length, and Value fields defined in <xref target="RFC8972" format="default"/>. The format of the "Residual BER in Padding" TLV is shown in <xref target="stamp-padding-stamp-ber" format="default"/>.
</t>

   <figure anchor="stamp-padding-stamp-ber">
        <name>Residual BER in Padding 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=TBD1    |         Length                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Bit error count (4 octets)                   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                         Sub-TLVs                              ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
    </figure>

<t>
The fields of the "Residual BER in Padding" TLV are defined as follows:
</t>
<ul>
<li><t>STAMP TLV Flags: The STAMP TLV Flags follow the procedures specified in <xref target="RFC8972" format="default"/>.</t></li>
<li><t>Type: MUST be set to TBD1.</t></li>
<li><t>Length: A two-octet field equal to the length of the Value field, in octets, including the bit error count and all sub-TLVs.</t></li>
<li><t>Bit error count: A four-octet field containing the number of bit errors in the padding data within the "Extra Padding" TLV.</t></li>
<li><t>Sub-TLVs: A sequence of zero or more sub-TLVs defined in <xref target="sect-4.1" format="default"/> and <xref target="sect-4.2" format="default"/>.</t></li>
</ul>

<t>
The "Residual BER in Padding" TLV contains a bit error count and MAY contain one "Bit Pattern in Padding" sub-TLV (Type=TBA1), and MAY contain one "Maximum Bit Error Burst Size in Padding" sub-TLV (Type=TBA2).
</t>

    <section title="Bit Pattern in Padding Sub-TLV" anchor="sect-4.1">
<t>
The "Bit Pattern in Padding" sub-TLV is optional and is carried within the "Residual BER in Padding" TLV. Its format is shown in <xref target="stamp-padding-stamp-ber-pattern" format="default"/>.
</t>

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

<t>
The fields of the "Bit Pattern in Padding" sub-TLV are defined as follows:
</t>
<ul>
<li><t>STAMP TLV Flags: The STAMP TLV 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 equal to the length of the Value field, in octets. The length of the Value field MUST be a multiple of 4 octets.</t></li>
<li><t>Bit pattern: The repeated bit pattern that MUST be used in the "Extra Padding" TLV.</t></li>
</ul>

    </section>

    <section title="Maximum Bit Error Burst Size in Padding Sub-TLV" anchor="sect-4.2">
<t>
The "Maximum Bit Error Burst Size in Padding" sub-TLV is optional and is carried within the "Residual BER in Padding" TLV. Its format is shown in <xref target="stamp-padding-stamp-ber-burst" format="default"/>.
</t>

   <figure anchor="stamp-padding-stamp-ber-burst">
        <name>Maximum Bit Error Burst Size in Padding 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|STAMP TLV Flags|  Type=TBA2    |         Length=4              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Maximum bit error burst size                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
    </figure>
<t>
The fields of the "Maximum Bit Error Burst Size in Padding" sub-TLV are defined as follows:
</t>
<ul>
<li><t>STAMP TLV Flags: The STAMP TLV 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 4 octets long.</t></li>
<li><t>Maximum bit error burst size: The maximum number of consecutive bit errors in the padding data within the "Extra Padding" TLV.</t></li>
</ul>
    </section>

    </section>

    <section title="STAMP Procedure for Residual BER Measurement" anchor="sect-5">
<t>
The "Residual BER in Padding" TLV is carried by Session-Sender test packets and Session-Reflector test packets for residual BER measurement.
</t>

<t>
An example of a STAMP-Test packet using the "Extra Padding" TLV and "Residual BER in Padding" TLV for measuring residual BER is shown in <xref target="stamp-stamp-ber" format="default"/>. 
</t>

   <figure anchor="stamp-stamp-ber">
        <name>Example STAMP-Test Packet to Measure Residual BER</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-Test Packet RFC 8972                    |
.                                                               .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|STAMP TLV Flags|   Type=1      |           Length              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                   Extra Padding                               ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--
|STAMP TLV Flags|   Type=TBD1   |           Length=20           | T
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ L
|                   Bit error count                             | V
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--
|STAMP TLV Flags|   Type=TBA1   |           Length=4            | S
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ u
|                   Bit pattern                                 | b
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ T
|STAMP TLV Flags|   Type=TBA2   |           Length=4            | L
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ V
|                   Maximum bit error burst size                | s 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--
      ]]></artwork>
    </figure>

    <section title="STAMP Session-Sender" anchor="sect-5.1">
<t>
When a STAMP Session-Sender is configured to measure residual BER, it adds an "Extra Padding" (Type=1) TLV and one "Residual BER in Padding" (Type=TBD1) TLV to Session-Sender test packets. The "Residual BER in Padding" TLV contains a bit error count and MAY contain one "Bit Pattern in Padding" sub-TLV (Type=TBA1) and one "Maximum Bit Error Burst Size in Padding" sub-TLV (Type=TBA2). A Session-Sender test packet MUST NOT contain more than one "Extra Padding" TLV or more than one "Residual BER in Padding" TLV.
</t>

<t>
The Session-Sender MUST add an "Extra Padding" TLV <xref target="RFC8972" format="default"/> when it adds a "Residual BER in Padding" TLV to a Session-Sender test packet. 
</t>

<t>
If the "Bit Pattern in Padding" sub-TLV is present, the length of its Value field MUST be a multiple of 4 octets, and its data MUST contain the bit pattern employed in the "Extra Padding" TLV. The length of the padding data MUST be an integer multiple of the length of the bit pattern to ease implementation.
</t>

<t>
The bit error count MUST be set to 0 by the Session-Sender.
</t>

<t>
The maximum bit error burst size in the "Maximum Bit Error Burst Size in Padding" sub-TLV MUST be set to 0 by the Session-Sender.
</t>

<t>
The integrity of the "Residual BER in Padding" TLV, including its sub-TLVs, can be protected using the HMAC mechanisms defined in <xref target="RFC8972" format="default"/>.
</t>

<t>
If the Session-Sender receives the "Residual BER in Padding" TLV or any of its sub-TLVs with the U flag (Unrecognized) set to 1 in the corresponding STAMP TLV Flags, it assumes that the Session-Reflector does not support residual BER measurement. The Session-Sender therefore disables residual BER measurement but continues with the other STAMP measurements such as delay and loss.
</t>

    <section title="MTU Considerations" anchor="sect-5.1.1">
<t>
As specified in <xref target="RFC8972" format="default"/>, the Session-Sender test packets and Session-Reflector test packets are symmetric in size. The Session-Sender and Session-Reflector MUST adjust the size of the padding data after adding the STAMP TLVs to ensure that the resulting packets do not exceed the path MTU.
Information about the path MTU of the nodes may be configured, collected through management protocols, or distributed by control protocols, such as Path MTU Discovery for IPv6 <xref target="RFC8201" format="default"/>. The mechanisms to learn the path MTU of nodes in the path are out of scope for this document.
</t>
    </section>

    <section title="Bit Pattern Considerations" anchor="sect-5.1.2">
<t>
The bit pattern in the "Bit Pattern in Padding" sub-TLV may itself contain bit errors. This can result in a measurement error due to a mismatch between the bit pattern and the padding data.
One way to avoid this issue is for the Session-Sender and Session-Reflector to use the locally configured bit pattern or the default bit pattern of "0xFF00FF00", which is repeated in the padding data.
In this case, the "Bit Pattern in Padding" sub-TLV is not transmitted in STAMP-Test packets.
</t>

    </section>

    </section>

    <section title="STAMP Session-Reflector" anchor="sect-5.2">
<t>
When the Session-Reflector receives a Session-Sender test packet with a "Residual BER in Padding" TLV, it MUST check the padding data in the "Extra Padding" TLV against the expected bit pattern, counting each mismatching bit as a bit error. If the "Bit Pattern in Padding" sub-TLV is absent, the Session-Reflector uses the locally configured or default bit pattern.
</t>

<t>
The Session-Reflector MUST set the bit error count to the number of detected bit errors and reflect the "Residual BER in Padding" TLV back to the Session-Sender in a Session-Reflector test packet. If no bit errors are detected, the value remains 0.
</t>

<t>
If the "Maximum Bit Error Burst Size in Padding" sub-TLV is present, the Session-Reflector MUST update it with the maximum number of consecutive bits that do not match the expected bit pattern. If no bit errors are detected, the value remains 0.
</t>

<t>
The Session-Reflector corrects the padding data in the "Extra Padding" TLV to match the expected bit pattern and reflects the corrected "Extra Padding" TLV and the updated "Residual BER in Padding" TLV to the Session-Sender in a Session-Reflector test packet. The corrected padding data is used to measure residual BER in the reverse direction.
</t>

<t>
If the Session-Reflector does not recognize the "Residual BER in Padding" TLV, it MUST return that TLV with the U flag (Unrecognized) set to 1 in its STAMP TLV Flags. If it recognizes the "Residual BER in Padding" TLV but does not recognize one of its sub-TLVs, it MUST return that sub-TLV with the U flag set to 1 in the sub-TLV's STAMP TLV Flags, as specified in <xref target="RFC8972" format="default"/>.
</t>

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

<t>
Following the procedure specified in <xref target="RFC10052" format="default"/>, the Session-Reflector MUST set the Conformant Reflected Packet STAMP TLV flag to 1 in the STAMP TLV Flags of the reflected "Residual BER in Padding" TLV in the following cases:
</t>

<ul>
<li>
<t>
If a Session-Reflector receives a Session-Sender test packet with a "Residual BER in Padding" TLV but without an "Extra Padding" TLV, with more than one "Extra Padding" TLV or "Residual BER in Padding" TLV, or with a "Residual BER in Padding" TLV whose Length field is less than 4 octets.
</t>
</li>
<li>
<t>
If the "Residual BER in Padding" TLV contains more than one "Bit Pattern in Padding" sub-TLV or more than one "Maximum Bit Error Burst Size in Padding" sub-TLV.
</t>
</li>
<li>
<t>
If the length of the extra padding data is not an integer multiple of the length of the bit pattern.
</t>
</li>
<li>
<t>
If the "Bit Pattern in Padding" sub-TLV is present and its value length is not a multiple of 4 octets.
</t>
</li>
</ul>

    </section>

    </section>

    <section title="Considerations for a Link Aggregation Group" anchor="sect-5.3">
<t>
Networks may experience transmission bit errors differently for different link members of a Link Aggregation Group (LAG). 
The procedure and extensions defined in this document are equally applicable to measuring residual BER in both directions of each individual member of the LAG.
</t>

<t>
To measure delay on LAG member links, a separate STAMP micro-session is created for each member of the LAG. The STAMP extension for the "Micro-Session ID" TLV, as defined in <xref target="RFC9534" format="default"/>, is used to identify each member link of the LAG associated with the STAMP micro-session at the Session-Sender and the Session-Reflector. The Session-Reflector replies on the same member of the LAG in the reverse direction based on the information in the received STAMP-Test packet and on either the local configuration for the micro-session or the information from the data plane where the STAMP-Test packet was received.
</t> 

<t>
Note that in order to obtain a good approximation of the residual BER measurement, it is RECOMMENDED to transmit STAMP-Test packets with padding data so that the packet size matches, but does not exceed, the link MTU.
</t>
    </section>

    </section>

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

<t>
    The operational considerations specified in <xref target="RFC8762" format="default"/> apply to the procedure and extensions defined in this document.
    Additional operational considerations are specified in the following subsections.
</t>

    <section title="Configuration Data Model Parameters" anchor="sect-6.1">
<t>
    The configuration data model for the residual BER measurement using STAMP MUST allow the setting of the following parameters:
</t>

<ul>
    <li><t>Padding size (number of octets, which is an integer multiple of the padding bit pattern size in octets)</t></li>
    <li><t>Padding bit pattern (of variable length, in 4-octet units)</t></li>
    <li><t>Transmit interval for STAMP-Test packets</t></li>
    <li><t>Computation interval as a multiple of the transmit interval for reporting residual BER measurements</t></li>
</ul>

    </section>
    <section title="Operational Data Model Parameters" anchor="sect-6.2">
<t>
    The operational data model for the residual BER measurement using STAMP MUST allow the reporting of the following parameters:
</t>

<t>
    Forward direction (near-end) residual BER measurement: 
</t>
<ul>
    <li><t>Total number of STAMP-Test packets received in the computation interval.</t></li>
    <li><t>Total number of STAMP-Test packets received with a non-zero bit error count in the "Residual BER in Padding" TLVs in the computation interval.</t></li>
    <li><t>Sum of the number of bits in the padding data of all received STAMP-Test packets in the computation interval.</t></li>
    <li><t>Sum of the bit error counts reported in the "Residual BER in Padding" TLVs of all received STAMP-Test packets in the computation interval.</t></li>
    <li><t>Maximum and average bit error burst sizes in the "Maximum Bit Error Burst Size in Padding" sub-TLVs of all received STAMP-Test packets in the computation interval.</t></li>
</ul>


<t>
    Reverse direction (far-end) residual BER measurement: 
</t>

<ul>
    <li><t>Total number of STAMP-Test packets received in the computation interval.</t></li>
    <li><t>Total number of STAMP-Test packets received with bit errors in the computation interval.</t></li>
    <li><t>Sum of the number of bits in the padding data of all received STAMP-Test packets in the computation interval.</t></li>
    <li><t>Sum of the number of bit errors in all received STAMP-Test packets in the computation interval.</t></li>
    <li><t>Maximum and average bit error burst sizes in all received STAMP-Test packets in the computation interval.</t></li>
</ul>

<t>
    Thresholds may be configured for the following forward- and reverse-direction residual BER metrics, measured over the computation interval:
</t>
<ul>
    <li><t>Number of bit errors per million bits received</t></li>
    <li><t>Number of STAMP-Test packets with bit errors per million packets received</t></li>
</ul>

<t>
When a computed metric crosses a user-configured threshold, an alarm may be generated and event-driven telemetry may be triggered. 
</t>

    </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="Implementation Status" anchor="sect-8">
    <t>
    Editorial note: Please remove this section prior to publication.
    </t>

    <section title="Open Source Implementation" anchor="sect-8.1">
    <t>
    An open-source implementation of the Simple Two-Way Active Measurement Protocol (<xref target="RFC8762" format="default"/>) is available in Teaparty.
    </t>
    <ul>
    <li><t>https://github.com/cerfcast/teaparty</t></li>
    </ul>
    <t>
    An implementation of the solution specified in this document is available at the following location:
    </t>
    <ul>
    <li><t>https://github.com/cerfcast/teaparty/commit/592558a38dbcf9b273acb2a2fe8ab0d8f16d0709</t></li>
    </ul>

    <t>
    Additionally, there is support for residual BER in the Wireshark dissector:
    </t>
    <ul>
    <li><t>https://github.com/cerfcast/teaparty/commit/608b9e89fce2f25ed88eaa367d0bacc693845da2</t></li>
    </ul>
    <t>
    Contact: 
    </t>
    <t>
    William Hawkins
    </t>
    <t>
    University of Cincinnati
    </t>
    <t>
    Email: hawkinsw@obs.cr
    </t>

    </section>

    <section title="Cisco Implementation" anchor="sect-8.2">

    <t> An implementation of the solution defined in this document is available in IOS XR Software Release 26.1.1 for the Cisco 8000 Series.
    </t>

    <t>
     - https://www.cisco.com/c/en/us/td/docs/iosxr/cisco8000/segment-routing/26xx/configuration/guide/b-segment-routing-cg-cisco8000-26xx/configuring-performance-measurement.html#link-residual-bit-error-rate-measurement-using-stamp
    </t>

    </section>

    </section>


    <section title="IANA Considerations" anchor="sect-9">
<t>
    IANA is requested to assign a value to the "Residual BER in Padding" TLV from the IETF Review range of the "STAMP TLV Types" registry under the "Simple Two-way Active Measurement Protocol (STAMP) TLV Types" registry group, as shown in <xref target="iana-tlv-type-tbl" format="default"/>.
</t>

    <table anchor="iana-tlv-type-tbl" align="center">
       <name>STAMP TLV Type</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">TBD1</td>
            <td align="center">Residual BER in Padding</td>
            <td align="left">This document</td>
          </tr>
        </tbody>
    </table>

<t>
IANA is requested to assign values to the "Bit Pattern in Padding" and "Maximum Bit Error Burst Size in Padding" sub-TLVs from the IETF Review range of the "STAMP Sub-TLV Types" registry under the "Simple Two-way Active Measurement Protocol (STAMP) TLV Types" registry group, as shown in <xref target="iana-stamp-sub-tlv-type-tbl" format="default"/>.
</t>

    <table anchor="iana-stamp-sub-tlv-type-tbl" align="center">
       <name>STAMP Sub-TLV Types</name>
        <thead>
          <tr>
            <th align="left">Value</th>
            <th align="center">Description</th>
            <th align="center">Used in</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="center">Residual BER in Padding</td>
            <td align="left">This document</td>
          </tr>
          <tr>
            <td align="left">TBA2</td>
            <td align="center">Maximum Bit Error Burst Size in Padding</td>
            <td align="center">Residual BER in Padding</td>
            <td align="left">This document</td>
          </tr>
        </tbody>
    </table>

    </section>

    </middle>

    <back>
    <references title="Normative References">
    &RFC2119;
    &RFC3819;
    &RFC8174;
    &RFC8200;
    &RFC8762;
    &RFC8972;
    &RFC10052;

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

    </references>
    <section title="Acknowledgments" numbered="no" anchor="acknowledgments">
<t>
The authors would like to thank Ianik Semco and Miloslav Kopka for discussions about bit error rate measurement. The authors would also like to thank Ruediger Geib, Zhenqiang Li, Carsten Rossenhoevel, Ernesto Ruffini, and Xiao Min for reviewing this document and providing many useful comments and suggestions. The authors would also like to thank William Hawkins for implementing the solution defined in this document and providing many useful suggestions.
</t>
    </section>

    </back>

    </rfc>
