<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
     please see http://xml.resource.org/authoring/README.html. -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="3"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-song-ippm-inband-e2e-rtt-measurement-05" ipr="trust200902">
  <front>
    <title abbrev="In-band RTT Measurement">
         In-band Edge-to-Edge Round Trip Time Measurement</title>

    <author fullname="Haoyu Song" initials="H." surname="Song">
      <organization>Futurewei Technologies</organization>
      <address>
        <postal>
          <street></street>
          <city>Santa Clara</city>
          <country>USA</country>
        </postal>
        <email>haoyu.song@futurewei.com</email>
      </address>
    </author>
	
	<author fullname="Linda Dunbar" initials="D." surname="Linda">
      <organization>Futurewei Technologies</organization>
      <address>
        <postal>
          <street></street>
          <city>Plano</city>
          <country>USA</country>
        </postal>
        <email>linda.dunbar@futurewei.com</email>
      </address>
    </author>

    <area>OPS</area>
    <workgroup>IPPM</workgroup>
    
    <!---->

    <keyword>IOAM, E2E, RTT</keyword>

    <abstract>
	    <t>This draft describes a lightweight in-band in-network edge-to-edge flow-based network round trip time measurement architecture and 
           proposes the implementation over IOAM E2E option. By augmenting the IOAM E2E option header, the process can 
		   be fully done in data plane without needing to involve the control plane to maintain any states.		   
	    </t>    
    </abstract>

    <note 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><xref target="RFC8174"></xref> when, and only when, they appear in all
   capitals, as shown here.</t>
    </note>
  </front>

  <middle>

    <section title="Introduction">
	    
		<t>In-network service-based traffic engineering or load balancing needs to monitor a particular flow's edge-to-edge performance (i.e., from some ingress node of the flow forwarding path to some egress node),
		   such as round trip time (RTT), in the operator's network domain. 
		   The host-based ping using <xref target="RFC4443">ICMPv6</xref> is usually beyond the access of network operators.
		   The router-based ping, as an active measurement approach, cannot reflect the real performance of the specific flows under scrutiny. 
		   This is also true for the other active measurement approaches such as <xref target="RFC5357">TWAMP</xref>.
        </t> 
		   
		<t><xref target="RFC9197">In-situ OAM (IOAM)</xref> supports in-band flow-based performance measurement. 
		   However, on the one hand, the IOAM trace option can be  
		   too heavy for applications which do not care about the per-hop performance; on the other hand, the IOAM E2E option 
		   only supports the one-way measurement.
        </t>		   
		   
		<t><xref target="RFC9341">Alternate Marking(AM)</xref>, mainly designed for one-way measurement, 
		   can be used to measure the two-way edge-to-edge delay 
           if both edges initiate a one-way measurement session. However, AM's measurement interval needs to be large
		   enough to avoid the measurement ambiguity, and it requires both edges to conduct the measurements and export results to a controller.	   
		</t> 
		
		<t>We need a lightweight in-band flow RTT measurement method for in-network use cases. "Lightweight" means the extra header overhead is low, and the extra 
		   network processing overhead is also low. A network operator should be able to pick a target flow to monitor and get find-grained 
           per-packet RTT measurement for edge to edge in its domain. Moreover, the method should be stateless and does not need a control plane to maintain sessions. Depending on the application scenario and the network domain scope, 
		   the edge can extend to the host, the network interface card (NIC), or the network switch or router.  		   
		   To this end, we propose an in-band edge-to-edge flow RTT measurement method and the implementation approaches. 
        </t>	

	    <t>Such measurement only reflects the network delay for a flow but excludes the application layer delay incurred by server or client, which is useful for isolating the network's contribution to the performance. 
		</t>

    </section>


    <section title="In-band E2E RTT Measurement Architecture">

	    <t>The measurement architecture is shown in Figure 1. The controller, either on a remote machine or on the edge node's control plane,    configures the ingress edge node to measure some flow's RTT 
		   between the ingress edge and the egress edge.
           The ingress edge node uses ACL to filter the flow packets and, at given interval or probability, add the timestamp and the other
           metadata to the selected packets. 
		   The egress edge, after capturing the data, either piggyback the data on a reverse flow packet, or generate a feedback packet carrying 
		   the data back to the ingress edge node. 
		   Once the ingress edge node receives the feedback data, it sends the data along with the current timestamp to the controller. 
		   The controller can then calculate the flow RTT and react with followup actions. 
		</t>

		<t>The RTT calculation can be done in the slow path (e.g., in the controller), the metadata incurs only small and fix header overhead, and the nodes in the domain 
		does not do any processing. All these make the measurement lightweight, accurate, and have little impact to the network forwarding performance. 
		</t> 

        <t><figure anchor="figure_1" title="In-band E2E RTT Measurement">
           <artwork><![CDATA[

                +------+
                |      |
                |Ctrl. |
                |      |
                +-+----+
                  |  ^
          Config. |  | Export                
                  V  | 
  +------+      +----+-+    Forwarding    +------+      +------+
  |      | pkt. |      +-----......------>|      | pkt. |      |
  |Client+----->| Edge |                  | Edge +----->|Server|
  |      |      |      |<----......-------+      |      |      |
  +------+      +------+    Feedback      +------+      +------+
                
                |<--  Operator Network Domain -->|

          ]]></artwork>
	   </figure></t>
	   
	   <t>To differentiate a feedback packet from an original packet, a flag needs to be raised in the feedback. 
	      Optionally, to correlate a feedback with its original packet, the original packet can also include an identifier (e.g., a sequence number) which 
		  the feedback packet will carry back as well. The ingress edge node can use the reverse flow ID plus the identifier to pair an original packet with its feedback.
	   </t>
	   
	   <t>The feedback can also include some other local data at the egress edge (e.g., the egress edge node ID or the egress flow 
	      statistics) other than simply reflecting the original data back. 
	   </t>

    </section>

    <section title="Implementation with Updated IOAM E2E Option">
	
	   <t> One approach to implement the in-band E2E RTT measurement is to use the IOAM E2E option <xref target="RFC9197"/> augmented with the feedback mechanism. 
	       Current IOAM E2E option only sends one-way data from one edge to the other edge. 
		   The data fields can include the ingress edge timestamp which is exactly what is needed. 
           Moreover, the data fields can also include a packet sequence number used for correlating the feedback packet with the 
           original packet. 
		   However, current IOAM E2E option lacks a feedback mechanism. It has no flag field reserved in its current option header specification, 
		   so it is not easy to indicate the feedback packets. </t>
		   
	   <t> To enable the two-way measurement behavior, we need to add some indicator to the IOAM E2E option header to indicate the request for 
	       a feedback. We also need another indicator to tell if the current packet is a feedback. </t>
		   
	   <t> To support this, we can either introduce another IOAM two-way E2E option while keeping the current IOAM E2E option unchanged, 
	       or modify the current IOAM E2E option header specification to extend its usage.
           The simplest modification is to reserve a few (e.g., 4) flag bits and among them, two bits are used for the two-way measurement. 
           One possible layout is shown in Figure 2. Alternatively, the flags can take several bits from the Namespace-ID field. </t>	
		
        <t> The current specification uses 16 bits for IOAM E2E data types and only the first 4 bits are specified. The remaining 12 bits are undefined, so it is possible to redefine their usage as proposed without violating the standard. </t> 		

		<t><figure anchor="figure_2" title="Modified IOAM E2E Option Header">
		 <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |        Namespace-ID           |     IOAM-E2E-Type     | flags |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   |       E2E Option data field determined by IOAM-E2E-Type       |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

		]]></artwork>
	   </figure></t>

	   <t> The data field can carry the timestamp, the sequence number, of a unique packet identifier number. Other data types can also be carried 
           to enrich the feedback information. </t>

       <t> A packet can serve as both a forward packet and a feedback packet when both flags are set. In this case, there are two records for each 
           data type in the data field. The forward packet's data are located in front of the feedback packet's data.</t>
  

    </section>

    <section anchor="Security" title="Security Considerations">
	    <t>To prevent the timestamp to be maliciously altered during the packet forwarding, the ingress edge can instead keep the timestamp locally 
		   and only send a packet identifier (e.g., a random data). When a reverse flow packet carrying the same identifier is received, 
		   the current timestamp along with the saved timestamp are forwarded to the controller. </t>
		<t>The ingress edge node can limit the frequency of measurement to the flow packets. The egress edge node can also rate limit the feedback.
           So the potential DoS attack can be mitigated. </t>		
    </section>

    <section anchor="IANA" title="IANA Considerations">
	    <t>Depending on the discussion output, either a registry for a new IOAM option is required or a modification to the current IOAM E2E option 
           specification is needed. </t>
    </section>
    
    <section anchor="Contributors" title="Contributors">
      <t>TBD.</t>
    </section>

    <section anchor="Acknowledgments" title="Acknowledgments">
      <t>TBD.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include='reference.RFC.2119'?>
      <?rfc include='reference.RFC.8174'?>
	  <?rfc include='reference.RFC.9197'?>
    </references>

    <references title="Informative References">
		<?rfc include='reference.RFC.4443'?>
		<?rfc include='reference.RFC.5357'?>
		<?rfc include='reference.RFC.9341'?>
    </references>
  </back>
</rfc>
