<?xml version="1.0" encoding="utf-8"?>
<!--
     draft-rfcxml-general-template-standard-00
     Documentation is at https://authors.ietf.org/en/templates-and-schemas
-->
<?xml-model href="rfc7991bis.rnc"?>  <!-- Required for schema validation and schema-aware editing -->
<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> -->
<!-- This third-party XSLT can be enabled for direct transformations in XML processors, including most browsers -->


<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="std"
  docName="draft-ietf-ippm-stamp-cos-ecn-00"
  ipr="trust200902"
  obsoletes=""
  updates="8972"
  submissionType="IETF"
  xml:lang="en"
  version="3">

  <front>
    <title abbrev="STAMP CoS ECN Update">Update of the Simple Two-way Active Measurement Protocol Class-of-Service Extension - ECN</title>

    <seriesInfo name="Internet-Draft" value="draft-ietf-ippm-stamp-cos-ecn-00"/>


    <author fullname="Greg White" initials="G" surname="White">
      <organization>CableLabs</organization>
      <address>
        <postal>
          <street>858 Coal Creek Circle</street>
          <city>Louisville</city>
          <region>Colorado</region>
          <code>80027</code>
          <country>US</country>
        </postal>
        <email>g.white@cablelabs.com</email>
        <!-- Can have more than one <email> element -->
        <uri>http://www.cablelabs.com</uri>
      </address>
    </author>

    <author fullname="Greg Mirsky" initials="G" surname="Mirsky">
      <organization>Ericsson</organization>
      <address>
        <email>gregimirsky@gmail.com</email>
      </address>
    </author>

    <author fullname="Xiao Min" initials="X" surname="Min">
      <organization>ZTE Corp.</organization>
      <address>
        <postal>
          <city>Nanjing</city>
          <country>CN</country>
        </postal>
        <email>xiao.min2@zte.com.cn</email>
      </address>
    </author>


    <date/>

    <area>Operations and Management</area>
    <workgroup>IP Performance Measurement</workgroup>

    <keyword>stamp</keyword>
    <keyword>DSCP</keyword>
    <keyword>ECN</keyword>
    <keyword>Congestion</keyword>

    <abstract>
      <t>The Simple Two-Way Active Measurement Protocol (STAMP) enables
    one-way and round-trip measurement of network metrics between IP hosts, and has a facility for defining
    optional extensions. This document updates the definition of the Class of Service TLV (originally defined
    in RFC 8972) to enable the measurement of manipulation of the value of the Explicit Congestion
    Notification (ECN) field of the IP header by middleboxes between two STAMP hosts, and to
    enable discovery and measurement of paths that provide differential treatment of packets depending
    on the value of their ECN field.</t>
    </abstract>

  </front>

  <middle>

    <section>
      <name>Introduction</name>
      <t>   <xref target="RFC8972"/> defined several extensions to the Simple Two-way Active
   Measurement Protocol (STAMP).  Among those is a Class of Service (CoS)
   TLV that enables measurements that utilize the Differentiated Services Code Point
   (DSCP) marking in both directions.  Also, the CoS TLV
   supports outbound measurements that utilize the Explicit Congestion
   Notification (ECN) field, but it lacked support for such measurements on the return path.
   Experience deploying STAMP and its extensions
   demonstrated that it is helpful to an operator to monitor ECN's
   consistency in both directions.  This specification updates
   the definition of the CoS TLV in a backward compatible manner to
   support monitoring of ECN in the return path of the STAMP test
   session.
      </t>
      <t>Another STAMP extension header <xref target="I-D.ietf-ippm-stamp-ext-hdr"/> defines a mechanism that can
      be used by a Session-Sender to request that the Session-Reflector copy the entire IP header from the received test
      packet into the reflected test packet.
      That capability could be used in place of the CoS TLV to observe the DSCP and ECN values in the forward direction in situations
      where there is no need to control the return path DSCP or ECN value. </t>
    </section>

    <section>
      <name>Conventions Used in This Document</name>
      <section>
        <name>Acronyms</name>
        <dl>
        <dt>CoS:</dt>
        <dd>Class of Service</dd>
        <dt>DSCP:</dt>
        <dd>Differentiated Services Code Point</dd>
        <dt>ECN:</dt>
        <dd>Explicit Congestion Notification</dd>
        <dt>STAMP:</dt>
        <dd>Simple Two-way Active Measurement Protocol</dd>
        </dl>
      </section>

      <section>
        <name>Requirements Language</name>
        <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>
      <name>Class of Service TLV</name>

      <section>
        <name>TLV Definition</name>
      <t>The STAMP Session-Sender <bcp14>MAY</bcp14> include a CoS TLV in the STAMP test packet.
        The format of the CoS TLV is presented in <xref target="TLV"/>.</t>


    <figure anchor="TLV">
      <name>Class of Service TLV</name>
      <artset>
        <artwork type="ascii-art" name="TLV.txt">
        <![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|    CoS Type   |           Length              |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   DSCP1   |   DSCP2   |EC2|RPD|EC1|RPE|     Reserved          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            ]]>
        </artwork>
        </artset>
      </figure>

      <t>Where the fields are defined as follows.</t>
      <ul spacing="normal">
        <li>STAMP TLV Flags: eight-bit field; format presented in <xref target="RFC8972" section="4"/>.</li>
        <li>CoS (Class of Service) Type: one-octet field; the value <bcp14>MUST</bcp14> be set to 4.</li>
        <li>Length: two-octet field; set equal to the value 4 (octets).</li>
        <li>DSCP1: DSCP value intended by the Session-Sender to be used as the DSCP value of the reflected test packet.</li>
        <li>DSCP2: received value in the DSCP field at the ingress of the Session-Reflector.</li>
        <li>EC2: received value in the ECN field at the ingress of the Session-Reflector.</li>
        <li>RPD (reverse path DSCP): two-bit field indicating whether the Session-Reflector used DSCP1 or DSCP2 as the DSCP value of the reflected test packet; a Session-Sender <bcp14>MUST</bcp14> set the value of the RPD field to 0b00 on transmission.</li>
        <li>EC1: ECN value intended by the Session-Sender to be used as the ECN value of the reflected test packet.</li>
        <li>RPE (reverse path ECN): two-bit field indicating whether the Session-Reflector used EC1 as the ECN value of the reflected test packet; a Session-Sender <bcp14>MUST</bcp14> set the value of the RPE field to 0b00 on transmission.</li>
        <li>Reserved: twelve-bit field; <bcp14>MUST</bcp14> be zeroed on transmission and ignored on receipt.</li>
      </ul>

    </section>

    <section>
      <name>Session-Reflector Behavior</name>
      <t>A STAMP Session-Reflector that receives a test packet with the CoS
      TLV <bcp14>MUST</bcp14> include the CoS TLV in the reflected test packet.
      The Session-Reflector <bcp14>MUST</bcp14> copy the value of the DSCP and ECN fields of
      the IP header of the received STAMP test packet into the DSCP2 and EC2
      fields, respectively, in the CoS TLV in the reflected test packet.</t>

      <t>A Session-Reflector might have a local policy configuration that limits the DSCP values
        that it can use for reflected test packets.
        This local policy could be (for example) a system default policy, a global policy for the Session-Reflector, or
        a policy that is configured for specific destination addresses or networks.
        The Session-Reflector <bcp14>MUST</bcp14> verify whether the
      use of the value of the DSCP1 field is permitted in the reflected test packet.
      If it is, the Session-Reflector <bcp14>MUST</bcp14> set the DSCP field's value in the
      IP header of the reflected test packet equal to the value of the DSCP1
      field of the received test packet.
      Otherwise, the Session-Reflector <bcp14>MUST</bcp14> use the DSCP value of the received
      STAMP packet and set the value of the RPD field to 0b01.
      Upon receiving the reflected packet, if the value of the RPD field is 0b00,
      the Session-Sender will save the DSCP value for analysis of the CoS in
      the reverse direction.
      If the value of the RPD field in the received reflected packet is 0b01, only
      CoS in the forward direction can be analyzed.</t>

      <t>A Session-Reflector might have a local policy configuration that limits the ECN values
        that it can use for reflected test packets.
        This local policy could be (for example) a system default policy, a global policy for the Session-Reflector, or
        a policy that is configured for specific destination addresses or networks.
        Additionally, a Session-Reflector could have platform limitations that
        prevent it from setting the ECN value in reflected test packets.
        The Session-Reflector <bcp14>MUST</bcp14> set the ECN value in the IP header of the
      reflected STAMP test packet to the value of the EC1 field, if it is permitted and capable to do so.
      If the Session-Reflector is able to set the ECN value in the IP header of the reflected STAMP
      test packet to the EC1 value, it <bcp14>MUST</bcp14> then set the RPE field in the CoS TLV in the
      reflected test packet to the value 0b11.
      If the Session-Reflector is unable to set the ECN value in the IP header of the
      reflected STAMP test packet to the EC1 value,
      it <bcp14>MUST</bcp14> instead set the RPE field in the CoS TLV in the
      reflected test packet to the value 0b10.
      As a result, the Session-Sender can detect whether the EC1
      value was used by
      inspecting the value of the RPE field in the received
      reflected test packet.</t>

    </section>

    <section>
      <name>Interoperability with RFC 8972</name>

      <t> The extended CoS TLV defined in this draft is backward compatible with
      the specification in <xref target="RFC8972" section="4.4"/>.  The handling of the DSCP1, DSCP2, EC2 and RPD fields defined here is identical to the handling defined for the equivalent fields in <xref target="RFC8972" section="4.4"/>.</t>

      <t>Consider a case when an implementation that supports this specification performs
      as Session-Sender, and the intended Session-Reflector's support of the CoS TLV
      is according to <xref target="RFC8972" section="4.4"/>.
      If the operator requires monitoring ECN in the reverse direction, the value
      of the EC1 field will be set to a non-zero value.
      Because the Session-Reflector would treat the EC1 field as part of the
      Reserved field, it would ignore its value as per <xref target="RFC8972"
      section="4.4"/>.
      Further, the Session-Reflector would treat the RPE field as part of the
      Reserved field and thus it would send the value 0b00 in the reflected STAMP
      packet, rather than sending the value 0b10 or 0b11.
      Consequently, the Session-Sender will determine that the Session-Reflector
      does not implement the current version of the CoS TLV, and that the ECN value in the
      IP header of the reflected test packet was not set as requested.</t>

      <t>Also, this specification supports the case when the Session-Reflector
      supports the extended CoS TLV as defined in this specification and the
      Session-Sender supports the CoS TLV according to <xref target="RFC8972"
      section="4.4"/>.
      In that scenario, the Session-Sender will set its <xref target="RFC8972"/>
      Reserved field to zeros.
      The Session-Reflector will interpret the first two bits of that field as
      the EC1 field, as shown in <xref target="TLV"/> and thus will set the
      value of the ECN field in the IP header of the reflected packet to
      0b00. Further the Session-Reflector will set the RPE field to 0b11.
      The Session-Sender will treat the RPE field as part of the Reserved field
      and will ignore its value.</t>

    </section>

    <section>
      <name>Congestion Response</name>

        <t><xref target="RFC3168"/> and <xref target="RFC9330"/> mandate that applications that send packets marked with the ECT0 or ECT1 codepoints implement a response to congestion notifications from the network.
        While the STAMP protocol doesn't include the concept of a connection between a Session-Sender and a Session-Reflector, there are situations in which the Session-Sender may send multiple STAMP packets to the same Session-Reflector within the round-trip time between them, and there are situations in which the Session-Sender may elicit multiple STAMP packets from a Session-Reflector in response to a single sent STAMP packet.
        As such, the Session-Sender is generally responsible for dictating both its sending rate, and the sending rate of the packets sent in response by an individual Session-Reflector, and so is not exempt from this mandate. </t>

        <t>When using this CoS TLV with either an ECT0 or an ECT1 value in the ECN field of the IP header of the STAMP packet, the Session-Sender gains the ability (via observing a CE reflected value in the EC2 field) to detect that congestion was present on the path from the Session-Sender to the Session-Reflector.
        Similarly, when using this CoS TLV with either an ECT0 or an ECT1 value in the EC1 field, the Session-Sender gains the ability (via observing a CE in the ECN field of the IP header of the reflected packet) to detect that congestion was present on the path from the Session-Reflector to the Session-Sender.  </t>

        <t>If a Session-Sender sends multiple STAMP packets with the CoS TLV to a Session-Reflector within an RTT with either the ECT0 or ECT1 value in the ECN field of the IP header, it <bcp14>MUST</bcp14> observe the reflected EC2 field and reduce its sending rate upon observation of a CE value.
        If a Session-Sender sends multiple STAMP packets with the CoS TLV to a Session-Reflector within an RTT with either the ECT0 or ECT1 value in the EC1 field, it <bcp14>MUST</bcp14> observe the ECN value in the IP header of the reflected packets and reduce its sending rate upon observation of a CE value.
        If a Session-Sender sends a STAMP packet containing both the CoS TLV and the Reflected Test Packet Control TLV (<xref target="I-D.ietf-ippm-asymmetrical-pkts"/>) to a Session-Reflector, and specifies either the ECT0 or ECT1 value in the EC1 field, it <bcp14>MUST</bcp14> observe the ECN value in the IP header of the reflected packets and adjust the Reflected Test Packet Control parameters in any future STAMP packet sent to the same Session-Reflector based on the observation of CE values.</t>

    </section>
  </section>


    <section anchor="IANA">
    <!-- All drafts are required to have an IANA considerations section. See RFC 8126 for a guide.-->
      <name>IANA Considerations</name>
      <t>This document includes no request to IANA.</t>
    </section>

    <section anchor="Security">
      <!-- All drafts are required to have a security considerations section. See RFC 3552 for a guide. -->
      <name>Security Considerations</name>
      <t>This document extends the functionality of the CoS TLV (<xref target="RFC8972"/>)
       and inherits all the security considerations applicable to the base
       STAMP specification <xref target="RFC8762"/> and <xref target="RFC8972"/>.</t>

       <t>As this specification defines a mechanism to set ECN values, this
       document inherits all the security considerations discussed in
       <xref target="RFC3168"/> and <xref target="RFC9330"/>.
       Monitoring and optional control of ECN for a reflected
       STAMP test packet using the extended CoS TLV may be used across the
       Internet such that the Session-Sender and the Session-Reflector are
       located in different domains.
      </t>
    </section>

  </middle>

  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2474.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3168.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8762.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8972.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9330.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-ippm-asymmetrical-pkts-08.xml"/>
      </references>

      <references>
        <name>Informative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8311.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9331.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-ippm-stamp-ext-hdr-07.xml"/>
      </references>
    </references>

    <section anchor="Acknowledgements" numbered="false">
      <!-- [REPLACE/DELETE] an Acknowledgements section is optional -->
      <name>Acknowledgements</name>
      <t>TBD</t>
    </section>

    <section anchor="Contributors" numbered="false">
      <name>Contributors</name>
      <t>Karthik Sundaresan, William Hawkins III, Gorry Fairhurst, Rüdiger Geib</t>
    </section>

 </back>
</rfc>
