<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-ietf-ippm-stamp-04" ipr="trust200902">

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<front>

	<title abbrev="STAMP">Simple Two-way Active Measurement Protocol</title>

    <author fullname="Greg Mirsky" initials="G." surname="Mirsky">
      <organization>ZTE Corp.</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <country/>
        </postal>

        <email>gregimirsky@gmail.com</email>
      </address>
    </author>
	
		<author fullname="Guo Jun" initials="G." surname="Jun">
      <organization>ZTE Corporation</organization>
      <address>
        <postal>
          <street>68# Zijinghua Road</street>          
          <city>Nanjing</city>          
          <region>Jiangsu</region>  
          <code>210012</code>
          <country>P.R.China</country>
        </postal>
        <phone>+86 18105183663</phone>
        <email>guo.jun2@zte.com.cn</email>
      </address>
    </author>
    
      <author fullname="Henrik Nydell" initials="H." surname="Nydell">
      <organization>Accedian Networks</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <country/>
        </postal>

        <email>hnydell@accedian.com</email>
      </address>
    </author>
    
	
	<author initials="R." surname="Foote" fullname="Richard Foote">
		<organization>Nokia</organization>
		<address>
			<email>footer.foote@nokia.com </email>
		</address> 
	</author>
  
    
    <date year="2018"/>

    <area>Transport</area>

    <workgroup>Network Working Group</workgroup>

    <keyword>Internet-Draft</keyword>

   <keyword>IPPM</keyword>
   
   <keyword>Performance Measurement </keyword>
   
	
	<abstract>
	<t>
	This document describes a Simple Two-way Active Measurement Protocol which enables
	the measurement of both one-way and round-trip performance metrics like delay, delay variation, and packet loss.
	 </t>
	</abstract>
</front>

<middle>
  <section anchor="intro" title="Introduction">
        <t>
Development and deployment of Two-Way Active Measurement Protocol (TWAMP) <xref target="RFC5357"/> and its extensions, e.g., 
<xref target="RFC6038"/> that defined features such as Reflect Octets and Symmetrical Size for TWAMP
provided invaluable experience. Several independent implementations exist, have been deployed and provide
important operational performance measurements. At the same time, there has been noticeable interest in using a simpler
mechanism for active performance monitoring that can provide deterministic behavior and inherit separation of control
(vendor-specific configuration or orchestration) and test functions. One of such is Performance Measurement from
IP Edge to Customer Equipment using TWAMP Light from Broadband Forum (<xref target="BBF.TR-390"/>).
This document defines active performance measurement test protocol, Simple Two-way Active Measurement Protocol (STAMP),
that enables measurement of both one-way and round-trip performance metrics like delay, delay variation, and packet loss.
        </t>
        </section>
         
     <section title="Conventions used in this document">
         <section title="Terminology">
<t>AES       Advanced Encryption Standard</t>
<t>CBC       Cipher Block Chaining</t>
<t>ECB       Electronic Cookbook</t>
<t>KEK       Key-encryption Key</t>
<t>STAMP - Simple Two-way Active Measurement Protocol</t>
 <t>NTP   - Network Time Protocol</t>
 <t>PTP  - Precision Time Protocol</t>
<t>HMAC     Hashed Message Authentication Code</t>
<t>OWAMP   One-Way Active Measurement Protocol</t>
<t>TWAMP    Two-Way Active Measurement Protocol</t>
         </section>    
         
        <section title="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"/> <xref target="RFC8174"/> 
   when, and only when, they appear in all capitals, as shown here.
             </t>
             </section>
             
      </section>
      
<section anchor="simple-pm-section" title="Softwarization of Performance Measurement">
<t>
<xref target="STAMP-ref-model"/> presents Simple Two-way Active Measurement Protocol (STAMP) Session-Sender and Session-Reflector with a measurement session.
The configuration and management of the STAMP Session-Sender, Session-Reflector and management of the STAMP sessions can be achieved through various means.
Command Line Interface, OSS/BSS using SNMP or SDN using Netconf/YANG are but a few examples.
        
</t>

        <figure align="left" anchor="STAMP-ref-model" title="STAMP Reference Model">
          <artwork>
          <![CDATA[   
      o----------------------------------------------------------o
      |                      Configuration and                   |
      |                         Management                       |
      o----------------------------------------------------------o
             ||                                          ||
             ||                                          ||
             ||                                          ||
  +----------------------+                +-------------------------+
  | STAMP Session-Sender | <--- STAMP---> | STAMP Session-Reflector |
  +----------------------+                +-------------------------+
         ]]>
          </artwork>
        </figure>
        
</section>

<section anchor="stamp-section" title="Theory of Operation">
<t>
STAMP Session-Sender transmits test packets toward STAMP Session-Reflector. STAMP Session-Reflector
receives Session-Sender's packet and acts according to the configuration and optional control information
communicated in the Session-Sender's test packet. STAMP defines two different test packet formats, one for
   packets transmitted by the STAMP-Session-Sender and one for packets
   transmitted by the STAMP-Session-Reflector.  STAMP supports two modes:
   unauthenticated and authenticated. Unauthenticated STAMP test packets
   are compatible on the wire with unauthenticated TWAMP-Test <xref target="RFC5357"/>
   packet formats.
</t>
<t>
By default, STAMP uses symmetrical packets, i.e., size of the packet transmitted by Session-Reflector equals the size of
the packet received by the Session-Reflector.
</t>

           <section anchor="stamp-session-sender" title="Session-Sender Behavior and Packet Format">
             <t>
             </t>
             
             <section anchor="session-sender-packet-unauthenticated-section" title="Session-Sender Packet Format in Unauthenticated Mode">
              <t>
             Because STAMP supports symmetrical test packets, STAMP Session-Sender packet has a minimum 
             size of 44 octets in unauthenticated mode, see <xref target="session-sender-unauthenticated-format"/>,
             and 48 octets in the authenticated mode, see <xref target="session-sender-authenticated-format"/>.
              </t>
 
               <t>
                For unauthenticated mode:
         <figure align="left" anchor="session-sender-unauthenticated-format" title=" STAMP Session-Sender test packet format in unauthenticated mode">
          <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                        Sequence Number                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                          Timestamp                            |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |         Error Estimate        |                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
   |                                                               |
   |                                                               |
   |                         MBZ (27 octets)                       |
   |                                                               |
   |                                                               |
   |                                                               |
   +               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               |          Server Octets        |               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+               +
   |           Remaining Packet Padding (to be reflected)          |
   ~          (length in octets specified in Server Octets)        ~
   +                                               +-+-+-+-+-+-+-+-+
   |                                               |    Comp.MBZ   |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
   |             Type              |           Length              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   ~                            Value                              ~
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
        where fields are defined as the following:
        <list style="symbols">
        <t>
        Sequence Number is four octets long field. For each new session its value starts at zero and is incremented with each transmitted packet.
        </t>
        <t>
        Timestamp is eight octets long field. STAMP node MUST support Network Time Protocol (NTP) version 4 64-bit timestamp format <xref target="RFC5905"/>.
STAMP node MAY support IEEE 1588v2 Precision Time Protocol truncated 64-bit timestamp format <xref target="IEEE.1588.2008"/>.
        </t>
        <t>
        Error Estimate is two octets long field with format displayed in <xref target="error-estimate-format"/>
         <figure align="left" anchor="error-estimate-format" title=" Error Estimate Format">
          <artwork><![CDATA[
         0                   1
         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        |S|Z|   Scale   |   Multiplier  |
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
          ]]></artwork>
        </figure>
        where S, Scale, and Multiplier fields are interpreted as they have been defined in section 4.1.2 <xref target="RFC4656"/>;
        and Z field - as has been defined in section 2.3 <xref target="RFC8186"/>:
             <list style="symbols">
             <t>0 - NTP 64 bit format of a timestamp;</t>
             <t>1 - PTPv2 truncated format of a timestamp.</t>
             </list>
             The STAMP Session-Sender and Session-Reflector MAY use, not use, or set value of the Z field
             in accordance with the timestamp format in use. This optional field is to enhance operations,
             but local configuration or defaults could be used in its place.
        </t>
        <t>
        Must-be-Zero (MBZ) field in the session-sender unauthenticated packet is 27 octets long. It MUST be all zeroed on the transmission and ignored on receipt.
        </t>
        <t>
Server Octets field is two octets long field. It MUST follow the 27 octets long MBZ field. The Reflect Octets capability
defined in <xref target="RFC6038"/>.
The value in the Server Octets field equals the number of octets the Session-Reflector is expected to copy 
back to the Session-Sender starting with the Server Octets field. Thus the minimal non-zero value for the Server Octets field is two. Therefore, the value of one is invalid.
If none of Payload to be copied, the value of the Server Octets field MUST be set to zero on transmit.
        </t>
        <t>
        Remaining Packet Padding is an optional field of variable length. The number of octets in the Remaining Packet Padding field is the value of the Server Octets field
        less the length of the Server Octets field.
        </t>
        <t>
        Comp.MBZ is variable length field used to achieve alignment on a word boundary. Thus the length of Comp.MBZ field may be only 0, 1, 2 or 3 octets.
        The value of the field MUST be zeroed on transmission and ignored on receipt.
        </t>
                </list>
            </t>
        <t>
        The unauthenticated STAMP Session-Sender packet MAY include Type-Length-Value encodings that immediately follow the Comp. MBZ field.
        <list style="symbols">
        <t>
        Type field is two octets long. The value of the Type field is the codepoint allocated by IANA
        <xref target="iana-consider"/> that identifies data in the Value field.
        </t>
        <t>
        Length is two octets long field, and its value is the length of the Value field in octets.
        </t>
        <t>
        Value field contains the application specific information. The length of the Value field MUST be four octets aligned.
        </t>
        </list>
        </t>
</section>

<section anchor="session-sender-packet-authenticated-section" title="Session-Sender Packet Format in Authenticated Mode">
            <t>
                     For authenticated mode:
         <figure align="left" anchor="session-sender-authenticated-format" title=" STAMP Session-Sender test packet format in authenticated mode">
          <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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                      Sequence Number                          |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 |                      MBZ (12 octets)                          |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                        Timestamp                              |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |        Error Estimate         |                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
 ~                                                               ~ 
 |                         MBZ (70 octets)                       |
 ~                                                               ~ 
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             Type              |           Length              |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~                            Value                              ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~                           Comp.MBZ                            ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 |                       HMAC (16 octets)                        |
 |                                                               |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  ]]></artwork>
        </figure>
 
  </t>
  
  <t>
  The field definitions are the same as the unauthenticated mode, listed in <xref target="session-sender-packet-unauthenticated-section"/>.
  Also, Comp.MBZ field is variable length field to align the packet on 16 octets boundary.
 Also, the packet includes a key-hashed message authentication code (HMAC) (<xref target="RFC2104"/>) hash at the end of the PDU.
 </t>
<!--
<t>
   The STAMP Session-Sender-packet format (<xref target="session-sender-authenticated-format"/>) is the same in authenticated and
   encrypted modes.  The encryption and authentication operations are,
   however, different and protect the data as follows:
   <list>
   <t>in the authenticated mode the Sequence Number is protected while the
   Timestamp and the Error Estimate are sent in clear text;
   </t>
   <t>
   in encrypted mode all fields, including the timestamp and Error Estimate,
   are protected to provide maximum data confidentiality and integrity protection.
   </t></list>
   Sending the Timestamp in clear text
   in authenticated mode allows more consistent reading of time by a Session-Sender
   on the transmission of the test packet.
   Reading of the time in encrypted mode must be followed by its encryption which introduces
   variable delay thus affecting calculated timing metrics.
</t>
-->
                </section>      
 
           </section>
           
          <section anchor="stamp-session-reflector" title="Session-Reflector Behavior and Packet Format">
             <t>
             The Session-Reflector receives the STAMP test packet, verifies it, prepares and transmits
             the reflected test packet.
             </t>
             <t>
             Two modes of STAMP Session-Reflector characterize the expected behavior and, consequently, performance metrics that can be measured:
             <list style="symbols">
             <t>
             Stateless - STAMP Session-Reflector does not maintain test state and will reflect the received sequence number without modification.
             As a result, only round-trip packet loss can be calculated while the reflector is operating in stateless mode.
             </t>
             <t>
             Stateful - STAMP Session-Reflector maintains test state  thus enabling the ability
             to determine forward loss, gaps recognized in the received sequence number.
As a result, both near-end (forward) and far-end (backward) packet loss can be computed. That implies that the STAMP Session-Reflector MUST
             keep a state for each accepted STAMP-test session, uniquely identifying STAMP-test packets to one such session instance, and enabling 
             adding a sequence number in the test reply that is individually incremented on a per-session basis.
             </t>
             </list>
           
             </t>
             
            <section anchor="session-reflector-packet-unauthenticated-section" title="Session-Reflector Packet Format in Unauthenticated Mode">
              <t>
              </t>
 
               <t>
                For unauthenticated mode:
         <figure align="left" anchor="session-reflector-unauthenticated-format" title=" STAMP Session-Reflector test packet format in unauthenticated mode">
          <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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                        Sequence Number                        |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                          Timestamp                            |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |         Error Estimate        |           MBZ                 |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                          Receive Timestamp                    |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                 Session-Sender Sequence Number                |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Session-Sender Timestamp                     |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | Session-Sender Error Estimate |           MBZ                 |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |Ses-Sender TTL |                                               |
 +-+-+-+-+-+-+-+-+                                               +
 |                                                               | 
 ~                Packet Padding (reflected)                     ~ 
 +                                               +-+-+-+-+-+-+-+-+
 |                                               |    Comp.MBZ   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
 |             Type              |           Length              |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~                            Value                              ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
      where fields are defined as the following:
        <list style="symbols">
          <t>
        Sequence Number is four octets long field. The value of the Sequence Number field is set according to the mode of the STAMP Session-Reflector:
        <list>
        <t>
        in the stateless mode the Session-Reflector copies the value from the received STAMP test packet's Sequence Number field;
        </t>
        <t>
        in the stateful mode the Session-Reflector counts the received STAMP test packets in each
        test session and uses that counter to set the value of the Sequence Number field.
        </t>
        </list>
        </t>
        <t>
        Timestamp and Receiver Timestamp fields are each eight octets long. The format of these fields, NTP or PTPv2, 
        indicated by the Z flag of the Error Estimate field as described in <xref target="stamp-session-sender"/>.
        </t>
        <t>
        Error Estimate has the same size and interpretation as described in <xref target="stamp-session-sender"/>.
        </t>
        <t>
        Session-Sender Sequence Number, Session-Sender Timestamp, and Session-Sender Error Estimate
        are copies of the corresponding fields in the STAMP test packet sent by the Session-Sender.
        </t>
        <t>
        Session-Sender TTL is one octet long field, and its value is the copy of the TTL field from the received STAMP test packet.
        </t>
        <t>
        Packet Padding (reflected) is an optional variable length field. The length of the Packet Padding (reflected) field MUST be equal to the value
        of the Server Octets field (<xref target="session-sender-unauthenticated-format"/>). If the value is non-zero,
        the Session-Reflector MUST copy number of octets equal to the value of Server Octets field starting with
        the Server Octets field.
        </t>
        <t>
        Comp.MBZ is variable length field used to achieve alignment on a word boundary. Thus the length of Comp.MBZ field may be only 0, 1, 2 or 3 octets.
        The value of the field MUST be zeroed on transmission and ignored on receipt.
        </t>
        </list>
            </t>
            </section>
            
<section anchor="session-reflector-packet-authenticated-section" title="Session-Reflector Packet Format in Authenticated Mode">
            <t>
                     For the authenticated mode:
         <figure align="left" anchor="session-reflector-authenticated-format" title=" STAMP Session-Reflector test packet format in authenticated mode">
          <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                        Sequence Number                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                        MBZ (12 octets)                        |
   |                                                               |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                          Timestamp                            |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |         Error Estimate        |                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
   |                        MBZ (6 octets)                         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                        Receive Timestamp                      |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                        MBZ (8 octets)                         |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                 Session-Sender Sequence Number                |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                        MBZ (12 octets)                        |
   |                                                               |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                 Session-Sender Timestamp                      |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | Session-Sender Error Estimate |                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
   |                        MBZ (6 octets)                         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |Ses-Sender TTL |                                               |
   +-+-+-+-+-+-+-+-+                                               +
   |                                                               |
   |                        MBZ (15 octets)                        |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |             Type              |           Length              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   ~                            Value                              ~
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   ~                           Comp.MBZ                            ~
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                        HMAC (16 octets)                       |
   |                                                               |
   |                                                               |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

  ]]></artwork>
        </figure>
                     
                     </t>

  <t>
  The field definitions are the same as the unauthenticated mode, listed in <xref target="session-reflector-packet-unauthenticated-section"/>.
  Additionally, the packet MAY include Comp.MBZ field is variable length field to align the packet on 16 octets boundary.
 Also, STAMP Session-Reflector test packet format in authenticated mode
 includes a key (HMAC) (<xref target="RFC2104"/>) hash at the end of the PDU.
 </t>
 
                </section>      
                
             </section>
             
             <section anchor="encryption-section" title="Integrity and Confidentiality Protection in STAMP">
                <t>
                To provide integrity protection,
                each STAMP message is being authenticated by adding 
                Hashed Message Authentication Code (HMAC). STAMP 
                uses HMAC-SHA-256 truncated to 128 bits (similarly to the use of it in IPSec defined in <xref target="RFC4868"/>); hence
                the length of the HMAC field is 16 octets. HMAC uses own key and the definition of
                the mechanism to distribute the HMAC key is outside the scope of this specification. One example is to
                use an orchestrator to configure HMAC key based on STAMP YANG data model <xref target="I-D.ietf-ippm-stamp-yang"/>.
                HMAC MUST be verified as early as possible to avoid using or propagating corrupted data.
                </t>
                <t>
                If confidentiality protection for STAMP is required, encryption at the higher level MUST be used.
                </t>
             </section>
                
    <section anchor="interoperation-twamp" title="Interoperability with TWAMP Light">
    <t>
One of the essential requirements to STAMP is the ability to interwork with TWAMP Light device. There are two possible
combinations for such use case:
<list style="symbols">
<t>STAMP Session-Sender with TWAMP Light Session-Reflector;</t>
<t>TWAMP Light Session-Sender with STAMP Session-Reflector.</t>
</list>
    </t>
    <t>
    In the former case, Session-Sender MAY not be aware that its Session-Reflector does not support STAMP. For example,
    TWAMP Light Session-Reflector may not support the use of UDP port 862 as defined in <xref target="I-D.ietf-ippm-port-twamp-test"/>.
    Thus STAMP Session-Sender MUST be able to send
    test packets to destination UDP port number from the Dynamic and/or Private Ports range 49152-65535, test management
    system should find port number that both devices can use. And if any of TLV-based STAMP extensions are used, the TWAMP Light
    Session-Reflector will view them as Packet Padding field. The Session-Sender SHOULD use the default format for its timestamps - NTP. And
    it MAY use PTPv2 timestamp format.
    </t>
    <t>
    In the latter scenario, the test management system should set STAMP Session-Reflector to use UDP port number from the Dynamic and/or Private Ports range.
    As for Packet Padding field that the TWAMP Light Session-Sender includes in its transmitted packet, the STAMP Session-Reflector
    will process it according to <xref target="RFC6038"/> and return reflected packet of the symmetrical size. The Session-Reflector MUST use the default
    format for its timestamps - NTP.
    </t>
    </section>
    
  </section>
  
           
    <section anchor="iana-consider" title="IANA Considerations">
     
     <t>
     This document doesn't have any IANA action. This section may be removed before the publication.
     </t>
    </section>
     
     <section anchor="security" title="Security Considerations">
     <t>
Use of HMAC-SHA-256 in the authenticated mode protects the data integrity
of the STAMP test packets.
     </t>

     </section>
      
     
      <section title="Acknowledgments">
         <t>
 Authors express their appreciation to Jose Ignacio Alvarez-Hamelin and
Brian Weis for their great insights into the security and identity protection,
and the most helpful and practical suggestions.
         </t>  
      </section>

  </middle>
  
    <back>
    <references title="Normative References">
     
  <?rfc include="reference.RFC.2119"?>
  <?rfc include="reference.RFC.8174"?>
<!--
  <?rfc include="reference.RFC.8126"?>
  -->
  <?rfc include="reference.RFC.5357"?>
  <?rfc include="reference.RFC.5905"?>
  <?rfc include="reference.RFC.4656"?>
  <?rfc include="reference.RFC.8186"?>

  <?rfc include="reference.RFC.6038"?>
  
  <?rfc include="reference.I-D.ietf-ippm-port-twamp-test"?>
    
        <reference anchor="IEEE.1588.2008">
<front>
<title>Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems</title>
<author>
<organization/>
</author>
<date month="March" year="2008"/>
</front>
<seriesInfo name="IEEE" value="Standard 1588"/>
</reference> 

        <reference anchor="BBF.TR-390">
<front>
<title>Performance Measurement from IP Edge to Customer Equipment using TWAMP Light</title>
<author>
<organization/>
</author>
<date month="May" year="2017"/>
</front>
<seriesInfo name="BBF" value="TR-390"/>
</reference> 

    </references>

  <references title="Informative References">
  
  <?rfc include="reference.RFC.2104"?>
    <?rfc include="reference.RFC.4868"?>
   <?rfc include="reference.I-D.ietf-ippm-stamp-yang"?>
  </references>

 </back>
 </rfc>
