<?xml version="1.0" encoding="utf-8"?>
<!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" ipr="trust200902" docName="draft-ietf-ippm-hybrid-two-step-06" obsoletes="" updates="" submissionType="IETF" xml:lang="en" tocInclude="true" tocDepth="3" symRefs="true" sortRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.6.0 -->
  <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<front>
    <title abbrev="Hybrid Two-Step">Hybrid Two-Step Performance Measurement Method</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-ippm-hybrid-two-step-06"/>
    <author initials="G." surname="Mirsky" fullname="Greg Mirsky">
      <organization>Ericsson</organization>
      <address>
        <email>gregimirsky@gmail.com</email>
      </address>
    </author>
    <author fullname="Wang Lingqiang" initials="W." surname="Lingqiang">
      <organization>ZTE Corporation</organization>
      <address>
        <postal>
          <street>No 19 ,East Huayuan Road</street>
          <city>Beijing </city>
          <region/>
          <code>100191</code>
          <country>China</country>
        </postal>
        <phone>+86 10 82963945 </phone>
        <email>wang.lingqiang@zte.com.cn </email>
      </address>
    </author>
    <author fullname="Guo Zhui" initials="G." surname="Zhui">
      <organization>ZTE Corporation</organization>
      <address>
        <postal>
          <street>No 19 ,East Huayuan Road</street>
          <city>Beijing </city>
          <region/>
          <code>100191</code>
          <country>China</country>
        </postal>
        <phone>+86 10 82963945 </phone>
        <email>guo.zhui@zte.com.cn </email>
      </address>
    </author>
    <author fullname="Haoyu Song" initials="H." surname="Song">
      <organization>Futurewei Technologies</organization>
      <address>
        <postal>
          <street>2330 Central Expressway</street>
          <city>Santa Clara</city>
          <country>USA</country>
        </postal>
        <email>hsong@futurewei.com</email>
      </address>
    </author>
    
       <author fullname="Pascal Thubert" initials="P." surname="Thubert">
      <organization>Independent</organization>
      <address>
              <postal>
          <street>06330 Roquefort-les-Pins</street>
          <country>France</country>
        </postal>
        <email>pascal.thubert@gmail.com</email>
      </address>
    </author>

    
    <date year="2025"/>
    
    <area>Transport</area>
    <workgroup>IPPM Working Group</workgroup>
    <keyword>Internet-Draft</keyword>
    <keyword>IPPM</keyword>
    <keyword>Hybrid OAM </keyword>
    <abstract>
      <t>
The development and advancements in network operation automation have brought new measurement methodology requirements. 
Among them is the ability to collect instant network operational state as the packet being processed by the networking elements along
its path through the domain. That task can be solved using on-path telemetry, also called hybrid measurement.
An on-path telemetry method allows the collection of essential information that reflects the operational state
and network performance experienced by the packet. This document introduces a method complementary to
on-path telemetry that causes the generation of network telemetry information. This method, referred to as Hybrid Two-Step (HTS),
separates the act of measuring and/or calculating the performance metric from collecting and transporting network operational state.
The HTS packet traverses the same set of nodes and links as the trigger packet, thus simplifying the correlation of
informational elements originating on nodes traversed by the trigger packet.
      </t>
    </abstract>
  </front>
  <middle>
    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
Successful resolution of challenges of automated network operation, as part of, for example, overall service orchestration
or data center operation,
relies on a timely collection of accurate information that reflects the state of network elements on an unprecedented
scale. Because performing the analysis and act upon the collected information requires considerable computing and storage
resources, the network operational state information is unlikely to be processed by the network elements themselves
but will be exported  to big data systems for processing and storing. The process of generating, and collecting network operational state information
also referred to in this document as network telemetry, and transporting it for post-processing
should work equally well with data flows or injected in the network test packets. <xref target="RFC7799" format="default"/> 
describes a combination of elements of passive and active measurement as a hybrid measurement.
</t>
      <t>
     Several technical methods have been proposed to enable the collection of network operational state information
     instantaneous to the packet processing, among them <xref target="P4.INT" format="default"/> and
     <xref target="RFC9197"/>. The instantaneous, i.e., in the data packet itself, collection
     of telemetry information simplifies the process of attribution of telemetry information to the particular monitored flow.
     On the other hand, this collection method impacts the data packets, potentially changing their treatment by the network nodes.
     Also, the amount of information the instantaneous method collects might be incomplete because of the limited space it can be allotted.
     Other proposals defined methods to collect telemetry information in a separate packet from
     each node traversed by the monitored data flow. <xref target="RFC9326"/> is an example of
     this approach to collecting telemetry information.
     These methods allow data collection from any arbitrary path and avoid directly impacting data packets.
     On the other hand, the correlation of data and the monitored flow requires that each packet with telemetry information also includes
     characteristic information about the monitored flow.
      </t>
      <t>
This document introduces Hybrid Two-Step (HTS) as a new method of telemetry collection that improves
accuracy of a measurement by separating the act of
measuring or calculating the performance metric from the collecting and transporting this information while minimizing the overhead
of the generated load in a network.
HTS method extends the two-step mode of Residence Time Measurement (RTM) defined in <xref target="RFC8169" format="default"/> to on-path network operational state
collection and transport. HTS allows the collection of telemetry information from any arbitrary path.
HTS instruments data packets of the monitored flow or specially constructed test packets
that are already equipped with
a shim of on-path telemetry protocol to use as an HTS trigger packet,
making the process of attribution of telemetry to the data flow simple.
</t>
    </section>
    <section numbered="true" toc="default">
      <name>Conventions used in this document</name>
      <section numbered="true" toc="default">
        <name>Acronyms and Terminology</name>
        <t>RTM              Residence Time Measurement <xref target="RFC8169"/></t>
        <t>ECMP            Equal Cost Multipath <xref target="RFC2992"/></t>
        <t>MTU              Maximum Transmission Unit <xref target="RFC1191"/></t>
        <t>HTS               Hybrid Two-Step (<xref target="intro"/>)</t>
        <t>HMAC           Hashed Message Authentication Code <xref target="RFC2104"/></t>
        <t>TLV                Type-Length-Value (<xref target="hts-tlv-fig"/>)</t>
        <t>RTT                Round-Trip Time <xref target="RFC2681"/></t>
        <t>Characteristic information - the interpretation in this document follows the definition of "Characteristic" in Section 3.2 in <xref target="I-D.ietf-nmop-terminology"/>.</t>
        <t>HTS domain is an example of a "limited domain" as defined in <xref target="RFC8799"/>. HTS domain may be identical to an IOAM domain
        (see Section 3 of <xref target="RFC9197"/>) or a controlled domain where the Alternate-Marking Method is used to measure performance metrics
        (see Section 7.1 of <xref target="RFC9341"/>).</t>
        <t>HTS egress node, defined in <xref target="egress-node-section"/>, consumes HTS Trigger packet and terminates an HTS follow-up packet.</t>
        <t>HTS ingress node, defined in <xref target="ingress-node-section"/>, an HTS system that generates an HTS Trigger and HTS follow-up packets.</t>
        <t>HTS intermediate node, defined in <xref target="intermediate-node-section"/>, an HTS system that receives the HTS Trigger and HTS follow-up packets, </t>
        <t>Network telemetry - the interpretation in this document is the same as in <xref target="RFC9232"/></t>
        <t>Network Operational State - the interpretation in this document follows the use of "Operational State" in <xref target="RFC8342"/>.</t>
      </section>
      <section numbered="true" toc="default">
        <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" format="default"/> <xref target="RFC8174" format="default"/> 
   when, and only when, they appear in all capitals, as shown here.
        </t>
      </section>
    </section>
    <section anchor="overview-sec" numbered="true" toc="default">
      <name>Problem Overview</name>
      <t>
     Performance measurements are meant to provide data that characterize conditions experienced by traffic flows in the network
     and possibly trigger operational changes (e.g., re-route of flows, or changes in resource allocations). Modifications to a network 
     are determined based on the performance metric information available when a change is to be made. 
     The correctness of this determination is based on the quality of the collected metrics data. The quality of collected 
     measurement data is defined by: 
      </t>
      <ul spacing="normal">
        <li>the resolution and accuracy of each measurement;</li>
        <li>predictability of both the time at which each measurement is made and the timeliness of measurement collection data delivery for use.</li>
      </ul>
      <t>
    Consider the case of delay measurement that relies on collecting time
     of packet arrival at the ingress interface and time of the packet transmission at the egress interface. 
The method includes recording a local clock value on receiving the first octet of an affected message 
at the device ingress, and again recording the clock value on transmitting the first byte of the same message 
at the device egress. In this ideal case, the difference between the two recorded clock times corresponds 
to the time that the message spent in traversing the device. In practice, the time recorded can differ 
from the ideal case by any fixed amount. A correction can be applied to compute the same time 
difference considering the known fixed time associated with the actual measurement. 
In this way, the resulting time difference reflects any variable delay associated with queuing.
</t>
      <t>
Depending on the implementation, it may be challenging to 
compute the difference between message arrival and departure times and - on the 
fly - add the necessary residence time information to the same message.
     And that task may become even more challenging
     if the packet is encrypted. 
     Recording the departure of a packet time 
     in the same packet may be decremental to the accuracy of the measurement because
    the departure time includes the variable time component (such as that associated with buffering 
    and queuing of the packet). A similar problem may lower the quality of, for example, information
     that characterizes utilization of the egress interface. If unable to obtain the data consistently, without
     variable delays for additional processing, information may not accurately reflect the egress interface state.
     To mitigate this problem <xref target="RFC8169" format="default"/> defined an RTM two-step mode.
      </t>
      <t>
Another challenge associated with methods that collect network operational state information into the actual data packet is the risk to exceed the
Maximum Transmission Unit (MTU) size on the path, especially if the packet traverses overlay domains or VPNs. Since the fragmentation
is not available at the transport network, operators may have to reduce MTU size advertised to the client layer or risk
missing network operational state data for the part, most probably the latter part, of the path. 
      </t>
      <t>
      Performance measurement methods that instrument data flows inherently collect
      one-way performance metrics at the egress of the measurement domain.
      In some networks, for example, wireless that are in the scope
      of <xref target="RFC9450"/>, it is beneficial to collect the telemetry,
      including the calculated performance metrics, that reflects
      conditions experienced by the monitored flow at a network node other than the egress network node.
      For example, a head-end can optimize path selection based on the compounded information that reflects network conditions
      and resource utilization. This mode is referred to as the upstream collection and the other -
      downstream collection to differentiate between two modes of telemetry collection.
      </t>
    </section>
    <section anchor="theory-operation" numbered="true" toc="default">
      <name>Theory of Operation</name>
      <t>
          The HTS method consists of two phases:
      </t>
      <ul spacing="normal">
        <li>Performing a measurement and/or obtaining network operational state information on a network node.
        HTS Trigger is a data or test packet instrumented to trigger the collection of telemetry information on a network node.</li>
        <li>Collecting and transporting the measurement and/or the telemetry information.
        HTS Follow-up is a packet constructed to transport telemetry information that includes operational state
        and performance measurements originated on the nodes along the path traversed by the HTS Trigger.</li>
      </ul>

    <section anchor="hts-trigger-sec" numbered="true" toc="default">
      <name>HTS Packets</name>
      
    <section anchor="ioam-trigger-sec" numbered="true" toc="default">
      <name>HTS Trigger in In-Situ OAM</name>
      
          <figure anchor="ioam-hts-fig">
          <name>Hybrid Two-Step Trace IOAM Header</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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |        Namespace-ID           |     Flags     |Extension-Flags|
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |               IOAM-Trace-Type                 |   Reserved    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                         Flow ID (Optional)                    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                     Sequence Number  (Optional)               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
        </figure>
      <t>
           An HTS Trigger may be carried in a data packet or a specially
           constructed test packet. For example, an HTS Trigger could be a packet that has
           IOAM Option-Type set to the "IOAM Hybrid Two-Step Option-Type"
           value (TBA1) allocated by IANA (see <xref target="ioam-option-type-sec" format="default"/>).
           The HTS Trigger includes HTS IOAM Header (shown in <xref target="ioam-hts-fig"/>)
           consists of:
      </t>
      <ul spacing="normal">
      <li>IOAM Namespace-ID - as defined in Section 5.3 <xref target="RFC9197"/>;</li>
      <li>Flags - as defined in Section 3.2 <xref target="RFC9326"/>;</li>
     <li>Extension-Flags - as defined in Section 3.2 <xref target="RFC9326"/>; </li>
     <li>IOAM-Trace-Type - as defined in Section 5.4 <xref target="RFC9197"/>;</li>
     <li>optional Flow ID - as defined in Section 3.2 <xref target="RFC9326"/>; </li>
     <li>optional Sequence Number - as defined in Section 3.2 <xref target="RFC9326"/>.</li>
      </ul> 
      </section>
      
     <section anchor="amm-trigger-sec" numbered="true" toc="default">
      <name>HTS Trigger in the Alternate-Marking Method</name>
      <t>
      A packet in the flow to which
           the Alternate-Marking method, defined in <xref target="RFC9341"/> and <xref target="RFC9342"/>,
            is applied can be used as an HTS Trigger.
           The nature of the HTS Trigger is a transport network layer-specific, and its description
           is outside the scope of this document. The packet that includes the HTS Trigger
           in this document is also referred to as the trigger packet.
      </t>
</section>

    <section anchor="hts-followup-sec" numbered="true" toc="default">
      <name>HTS Follow-up Packet</name>
      <t>
The HTS method uses the HTS Follow-up packet, referred to
as the follow-up packet, to collect measurement and network operational state data from the nodes.
The node that creates the HTS Trigger also generates the HTS Follow-up packet.
In some use cases, e.g., when HTS is used to collect the telemetry, including performance metrics,
calculated based on a series of measurements,
an HTS follow-up packet can be originated without using the HTS Trigger.
The follow-up packet contains characteristic information
sufficient for participating HTS nodes to associate it with the monitored data flow.
The characteristic information can be obtained using the information of the trigger packet
or constructed by a node that originates the follow-up packet.
As the follow-up packet is expected to traverse the same sequence of nodes, one element
of the characteristic information is the information that determines the path in the data plane. For example,
in a segment routing domain <xref target="RFC8402"/>, a list of segment identifiers of the trigger packet is applied to the follow-up packet.
And in the case of the service function chain based on the Network Service Header <xref target="RFC8300"/>,
the Base Header and Service Path Header of the trigger packet will be applied to the follow-up packet.
Also, when HTS is used to collect the telemetry information in an IOAM domain,
the IOAM trace option header <xref target="RFC9197"/> of the trigger packet is applied in the follow-up packet.
The follow-up packet also uses the same
network information used to load-balance flows in 
equal-cost multipath (ECMP) as the trigger packet, e.g., IPv6 Flow Label <xref target="RFC6437"/>
or an entropy label <xref target="RFC6790"/>.
The exact composition of the
characteristic information is specific for each transport network, and its definition is 
outside the scope of this document.
</t>
<t>
Only one outstanding follow-up packet MUST be on the node for the given path. 
That means that if the node receives an HTS Trigger
for the flow on which it still waits for the follow-up packet to the previous HTS Trigger, the node will
originate the follow-up packet to transport the former set of the
network operational state data and transmit it before it sends the follow-up
packet with the latest collection of network operational state information.
      </t>
      <t>
      The following sections describe the operation of HTS nodes in the downstream mode of collecting the telemetry information.
      In the upstream mode, the behavior of HTS nodes, in general, identical with the exception
      that the HTS Trigger packet does not precede the HTS Follow-up packet.
      </t>
</section>
</section>
      
      <section anchor="ingress-node-section" numbered="true" toc="default">
        <name>Operation of the HTS Ingress Node</name>
        <t>
          A node that originates the HTS Trigger is referred to as the HTS ingress node.
          As stated, the ingress node originates the follow-up packet. The follow-up
          packet has the transport network encapsulation identical with the trigger packet
          followed by the HTS shim and one or more telemetry information elements
          encoded as Type-Length-Value (TLV). <xref target="follow-up-fig" format="default"/> displays an example of the follow-up
          packet format.
          
        </t>
        <figure anchor="follow-up-fig">
          <name>Follow-up Packet Format</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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                                                               |
    ~                      Transport Network                        ~
    |                        Encapsulation                          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |Ver|HTS Shim L |     Flags     |Sequence Number|   Reserved    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                        HTS Max Length                         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    ~                    Telemetry Data Profile                     ~
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                                                               |
    ~                     Telemetry Data TLVs                       ~
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
        <t>
          Fields of the HTS shim are as follows:
        </t>
        <ul empty="true" spacing="normal">
          <li>
          Version (Ver) is the two-bits long field. It specifies the version of the HTS shim format.
          This document defines the format for the 0b00 value of the field.
          </li>
          <li>
          HTS Shim Length is the six bits-long field. It defines the length of
          the HTS shim in octets. The minimal value of the field is eight octets.
          </li>
          <li>
            <figure anchor="flags-field-fig">
              <name>Flags Field Format</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[    
     0               
     0 1 2 3 4 5 6 7 
    +-+-+-+-+-+-+-+-+
    |F|  Reserved   |
    +-+-+-+-+-+-+-+-+
]]></artwork>
            </figure>
          </li>
          <li>
            <t>
          Flags is eight-bits long. The format of the Flags field displayed in <xref target="flags-field-fig" format="default"/>.
            </t>
            <ul spacing="normal">
              <li>
          Full (F) flag MUST be set to zero by the node originating the HTS follow-up packet and MUST be set
          to one by the node that does not add its telemetry data to avoid exceeding MTU size.
          </li>
              <li>
          The node originating the follow-up packet MUST zero the Reserved field and ignore it on the receipt.
          </li>
            </ul>
          </li>
          <li>
          Sequence Number is one octet-long field. The zero-based value of the field reflects the place of
          the HTS follow-up packet in the sequence of the HTS follow-up packets that originated in
          response to the same HTS trigger. The ingress node MUST set the value of the field to
          zero.
          </li>
          <li>
          Reserved is one octet-long field. It MUST be zeroed on transmission and ignored on receipt.
          </li>
          <li>
          HTS Max Length is four octet-long field. The value of the HTS Max Length
          field indicates the maximum length of the HTS Follow-up packet in octets.
          An operator MUST be able to configure the HTS Max Length field's value.
          The value SHOULD be set equal to the path MTU.
          </li>
          <li>
          Telemetry Data Profile is the optional variable-length field of bit-size flags. 
          Each flag indicates the requested type of telemetry data to be collected at each HTS node.
          The increment of the field is four bytes with a minimum length of zero. For example,
          IOAM-Trace-Type information defined in <xref target="RFC9197"/>,
          Sequence Number and/or Flow ID (<xref target="ioam-hts-fig"/>) can be used
          in the Telemetry Data Profile field.
          </li>
          <li>
            <figure anchor="hts-tlv-fig">
              <name>Telemetry Data TLV Format</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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |      Type     |    Reserved   |           Length              |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ~                            Value                              ~
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
            </figure>
          </li>
          <li>
            <t>
          Telemetry Data TLV is a variable-length field. Multiple TLVs MAY be placed
   in an HTS packet. Additional TLVs may be enclosed within a given TLV, subject to the semantics of the (outer) TLV in question.
   <xref target="hts-tlv-fig" format="default"/> presents the format of a Telemetry Data TLV, where fields are defined as the following:
</t>
            <ul spacing="normal">
              <li>
Type - a one-octet-long field that characterizes the interpretation of the Value field.
</li>
              <li>Reserved - one-octet-long field.</li>
              <li>
Length - two-octet-long field equal to the length of the Value field in octets.
</li>
              <li>
Value - a variable-length field. The value of the Type field determines its interpretation and encoding.
IOAM data fields, defined in <xref target="RFC9197"/>, MAY be carried in the Value field.
      </li>
            </ul>
          </li>
        </ul>
        <t>
             All multibyte fields defined in this specification are in network byte order.
</t>
      </section>
      
      <section anchor="intermediate-node-section" numbered="true" toc="default">
        <name>Operation of the HTS Intermediate Node</name>
        <t>
          Upon receiving the trigger packet, the HTS intermediate node MUST:
        </t>
        <ul spacing="normal">
          <li>copy the transport information;</li>
          <li>start the HTS Follow-up Timer for the obtained flow;</li>
          <li>transmit the trigger packet.</li>
        </ul>
        <t>
          Upon receiving the follow-up packet, the HTS intermediate node MUST:
        </t>
        <ol spacing="normal" type="1"><li>
          verify that the matching transport information exists and the Full flag is cleared,
          then stop the associated HTS Follow-up Timer;
          </li>
          <li>otherwise, transmit the received packet. Proceed to Step 8;</li>
          <li>
          collect telemetry data requested in the Telemetry Data
          Profile field or defined by the local HTS policy;
          </li>
          <li>
          if adding the collected telemetry would not exceed HTS Max Length field's value,
          then append data as a new Telemetry Data TLV
          and transmit the follow-up packet. Proceed to Step 8;
          </li>
          <li>
          otherwise, set the value of the Full flag to one,
          copy the transport information from the received
          follow-up packet and transmit it accordingly;
          </li>
          <li>
          originate the new follow-up packet using the transport information copied from the received follow-up packet.
          The value of the Sequence Number field in the HTS shim MUST be set
          to the value of the field in the received follow-up packet incremented by one;
          </li>
          <li>
          copy collected telemetry data into the first Telemetry Data TLV's Value field
          and then transmit the packet;
          </li>
          <li>processing completed.</li>
        </ol>
        <t>
          If the HTS Follow-up Timer expires, the intermediate node MUST:
        </t>
        <ul spacing="normal">
          <li>
          originate the follow-up packet using transport information associated with the expired timer;
          </li>
          <li>
          initialize the HTS shim by setting the Version field's value to 0b00 and Sequence Number field to 0.
          Values of HTS Shim Length and Telemetry Data Profile fields
          MAY be set according to the local policy.
          </li>
          <li>
          copy telemetry information into Telemetry Data TLV's Value field and transmit the packet.
          </li>
        </ul>
        <t>
          If the intermediate node receives a "late" follow-up packet,
          i.e., a packet to which the node has no associated HTS Follow-up timer,
          the node MUST forward the "late" packet.
        </t>
      </section>
      <section anchor="egress-node-section" numbered="true" toc="default">
        <name>Operation of the HTS Egress Node</name>
        <t>
          Upon receiving the trigger packet, the HTS egress node MUST:
        </t>
        <ul spacing="normal">
          <li>
          copy the transport information;
          </li>
          <li>
          start the HTS Collection timer for the obtained flow.
          </li>
        </ul>
        <t>
          When the egress node receives the follow-up packet for the known flow, 
          i.e., the flow to which the Collection timer is running, the node for each of Telemetry Data TLVs MUST:
        </t>
        <ul spacing="normal">
          <li>
          if HTS is used in the authenticated mode, verify the authentication of the Telemetry Data TLV using the Authentication sub-TLV
          (see <xref target="authen-sec" format="default"/>);
          </li>
          <li>
          copy telemetry information from the Value field;
          </li>
          <li>
          restart the corresponding Collection timer.
          </li>
        </ul>
        <t>
          When the Collection timer expires, the egress relays the
          collected telemetry information for processing and analysis
          to a local or remote agent.
        </t>
      </section>
      </section>
      
        <section anchor="ops-cons-section" numbered="true" toc="default">
        <name>Operational Considerations</name>

        <t>
          Correctly attributing information originated by the particular trigger packet to the proper HTS Follow-up packet
          is essential for the HTS protocol. That can be achieved using characteristic information that uniquely identifies the trigger packet
          within a given HTS domain. For example, a combination of the flow identifier and packet's sequence number within that flow,
          as Flow ID and Sequence Number in IOAM Direct Export <xref target="RFC9326"/>,
          can be used to correlate between stored telemetry information
          and the appropriate HTS Follow-up packet. In case the trigger
          packet doesn't include data that distinguish it from other trigger packets in the HTS domain,
          then for the particular flow, there MUST be no more than one HTS Trigger,
          values of HTS timers bounded by the rate of the trigger generation for that flow.
          In practice, the minimal interval between HTS Trigger packets SHOULD be selected from the range
          determined by the round-trip time (RTT) between HTS Ingress and HTS Egress nodes as [RTT/2, RTT].
        </t>

      <section anchor="hts-mcast-section" numbered="true" toc="default">
        <name>Deploying HTS in a Multicast Network</name>
        <t>
          Previous sections discussed the operation of HTS in a unicast network. Multicast services are important,
          and the ability to collect telemetry information is invaluable in delivering a high quality of experience.
          While the replication of data packets is necessary, replication of HTS follow-up packets is not.
          Replication of multicast data packets down a multicast tree may be set based on multicast routing information
          or explicit information included in the special header, as, for example, in Bit-Indexed Explicit Replication
          <xref target="RFC8296" format="default"/>. A replicating node
          processes the HTS packet as defined below:
        </t>
        <ul spacing="normal">
          <li>the first transmitted multicast packet MUST be followed
          by the received corresponding HTS packet as described in <xref target="intermediate-node-section" format="default"/>;</li>
          <li>each consecutively transmitted copy of the original multicast packet MUST be followed by the new HTS packet
          originated by the replicating node that acts as an intermediate HTS node when the HTS Follow-up timer expired.</li>
        </ul>
        <t>
          As a result, there are no duplicate copies of Telemetry Data TLV
          for the same pair of ingress and egress interfaces. At the same time,
          all ingress/egress pairs traversed by the given multicast packet reflected in their respective Telemetry Data TLV.
          Consequently, a centralized controller would reconstruct and analyze the state
          of the particular multicast distribution tree based on HTS packets collected from egress nodes.
        </t>
      </section>
    </section>
    <section anchor="authen-sec" numbered="true" toc="default">
      <name>Authentication in HTS</name>
      <t>
 Telemetry information may be used to drive network operation, closing the control loop for self-driving, self-healing networks.
 Thus, it is critical to provide a mechanism to protect the telemetry information collected using the HTS method. This document
 defines an optional authentication of a Telemetry Data TLV that protects the collected information's integrity.
      </t>
      <t>
 The format of the Authentication sub-TLV is displayed in <xref target="hmac-tlv-fig" format="default"/>.
      </t>
      <figure anchor="hmac-tlv-fig">
        <name>HMAC 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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |Authentic. Type|   HMAC Type   |             Length            |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   |                            Digest                             |
   |                                                               |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
      </figure>
      <t> 
        where fields are defined as follows:
      </t>
      <ul spacing="normal">
        <li>Authentication Type - is a one-octet-long field, value 1 is allocated by IANA <xref target="iana-hts-tlv-registry" format="default"/>.</li>
        <li>Length - two-octet-long field, set equal to the length of the Digest field in octets.</li>
        <li>
        HMAC Type - is a one-octet-long field that identifies the type of the HMAC and the length of the digest 
        and the length of the digest according to the HTS HMAC Type sub-registry (see <xref target="iana-sha-type-reg" format="default"/>).
        </li>
        <li>Digest - is a variable-length field that carries HMAC digest of the text that includes the encompassing TLV.</li>
      </ul>
      <t>
 This specification defines the use of HMAC-SHA-256 truncated to 128 bits (<xref target="RFC4868" format="default"/>) in HTS.
 Future specifications may define the use in HTS of more advanced cryptographic algorithms or the use of digest of a different length.
 HMAC is calculated as defined in <xref target="RFC2104" format="default"/> over text as the concatenation of
 the Sequence Number field of the follow-up packet (see <xref target="follow-up-fig" format="default"/>) and the
 preceding data collected in the Telemetry Data TLV. The digest then MUST be truncated to 128 bits and written into the Digest field.
 Distribution and management of shared keys are outside the scope of this document.
 In the HTS authenticated mode, the Authentication sub-TLV MUST be present
 in each Telemetry Data TLV.
 HMAC MUST be verified before using any data in the included Telemetry Data TLV.
 If HMAC verification fails, the system MUST stop processing corresponding Telemetry Data TLV and notify an operator.
 Specification of the notification mechanism is outside the scope of this document.
      </t>
    </section>
    <section anchor="iana-considerations" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <section anchor="ioam-option-type-sec" numbered="true" toc="default">
        <name>IOAM Option-Type for HTS</name>
        <t>
The IOAM Option-Type registry is requested in <xref target="RFC9197"/>. IANA is requested
to allocate a new code point as listed in <xref target="ioam-option-hts-tbl" format="default"/>.
        </t>
        <table anchor="ioam-option-hts-tbl" align="center">
          <name>IOAM Option-Type for HTS</name>
          <thead>
            <tr>
              <th align="left">Value</th>
              <th align="left">Name</th>
              <th align="center">Description</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">TBA1</td>
              <td align="center">IOAM Hybrid Two-Step (HTS) Option-Type</td>
              <td align="left">HTS Exporting</td>
              <td align="left">This&nbsp;document</td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="iana-hts-tlv-registry" numbered="true" toc="default">
        <name>HTS TLV Registry</name>
        <t>
        IANA is requested to create "Hybrid Two-Step" registry group.
   IANA is requested to create the HTS TLV Type registry in "Hybrid Two-Step" registry group.
    All code points in the range 1 through 175 in this registry shall be allocated
    according to the "IETF Review" procedure specified in <xref target="RFC8126" format="default"/>.
    Code points in the range
     176 through 239 in this registry shall be allocated according to the "First Come First Served" procedure
     specified in <xref target="RFC8126" format="default"/>.
         The remaining code points are allocated according to <xref target="iana-hts-type-tbl" format="default"/>:
        </t>
        <table anchor="iana-hts-type-tbl" align="center">
          <name>HTS TLV Type Registry</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">0</td>
              <td align="center">Reserved</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">1- 175</td>
              <td align="center">Unassigned</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">176 - 239</td>
              <td align="center">Unassigned</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">240 - 251</td>
              <td align="center">Experimental</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">252 - 254</td>
              <td align="center">Private Use</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">255</td>
              <td align="center">Reserved</td>
              <td align="left">This document</td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="iana-hts-sub-tlv-registry" numbered="true" toc="default">
        <name>HTS Sub-TLV Type Sub-registry</name>
        <t>
   IANA is requested to create the HTS sub-TLV Type sub-registry as part of the HTS TLV Type registry.
    All code points in the range 1 through 175 in this registry shall be allocated
    according to the "IETF Review" procedure specified in <xref target="RFC8126" format="default"/>.
    Code points in the range
     176 through 239 in this registry shall be allocated according to the "First Come First Served" procedure
     specified in <xref target="RFC8126" format="default"/>.
         The remaining code points are allocated according to <xref target="iana-hts-sub-type-tbl" format="default"/>:
        </t>
        <table anchor="iana-hts-sub-type-tbl" align="center">
          <name>HTS Sub-TLV Type Sub-registry</name>
          <thead>
            <tr>
              <th align="left">Value</th>
              <th align="center">Description</th>
              <th align="left">TLV Used</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">0</td>
              <td align="center">Reserved</td>
              <td align="center">None</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">1</td>
              <td align="center">HMAC</td>
              <td align="center">Any</td>
              <td align="left">This&nbsp;document</td>
            </tr>
            <tr>
              <td align="left">2 - 175</td>
              <td align="center">Unassigned</td>
              <td align="center"/>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">176 - 239</td>
              <td align="center">Unassigned</td>
              <td align="center"/>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">240 - 251</td>
              <td align="center">Experimental</td>
              <td align="center"/>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">252 - 254</td>
              <td align="center">Private Use</td>
              <td align="center"/>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">255</td>
              <td align="center">Reserved</td>
              <td align="center">None</td>
              <td align="left">This document</td>
            </tr>
          </tbody>
        </table>

      </section>
      <section anchor="iana-sha-type-reg" numbered="true" toc="default">
        <name>HMAC Type Sub-registry</name>
        <t>
   IANA is requested to create the HMAC Type sub-registry as part of the HTS TLV Type registry.
    All code points in the range 1 through 127 in this registry shall be allocated
    according to the "IETF Review" procedure specified in <xref target="RFC8126" format="default"/>.
    Code points in the range
     128 through 239 in this registry shall be allocated according to the "First Come First Served" procedure
     specified in <xref target="RFC8126" format="default"/>.
         The remaining code points are allocated according to <xref target="iana-sha-type-tbl" format="default"/>:
        </t>
        <table anchor="iana-sha-type-tbl" align="center">
          <name>HMAC Type Sub-registry</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">0</td>
              <td align="center">Reserved</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">1</td>
              <td align="center">HMAC-SHA-256 16 octets long</td>
              <td align="left">This&nbsp;document</td>
            </tr>
            <tr>
              <td align="left">2 - 127</td>
              <td align="center">Unassigned</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">128 - 239</td>
              <td align="center">Unassigned</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">240 - 249</td>
              <td align="center">Experimental</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">250 - 254</td>
              <td align="center">Private Use</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">255</td>
              <td align="center">Reserved</td>
              <td align="left">This document</td>
            </tr>
          </tbody>
        </table>

      </section>
    </section>
    <section anchor="security" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
Nodes that practice the HTS method are presumed to share a trust model that depends on the existence of a trusted
relationship among nodes. This is necessary as these nodes are expected to
   correctly modify the specific content of the data in the follow-up packet, and the
   degree to which HTS measurement is useful for network operation depends on this ability. In
   practice, this means either confidentiality or integrity protection
   cannot cover those portions of messages that contain the network operational state data. Though
   there are methods that make it possible in theory to provide either
   or both such protections and still allow for intermediate nodes to
   make detectable yet authenticated modifications, such methods do not
   seem practical at present, particularly for protocols that used to
   measure latency and/or jitter.
      </t>
      <t>
This document defines the use of authentication (<xref target="authen-sec" format="default"/>) to protect the integrity of
the telemetry information collected using the HTS method. Privacy protection can be achieved by, for example, sharing
the IPsec tunnel with a data flow that generates information that is collected using HTS.
</t>
      <t>
   While it is possible for a supposed compromised node to intercept and
   modify the network operational state information in the follow-up packet;
  this is an issue that exists for nodes in
   general - for all data that to be carried over the particular networking
   technology - and is therefore the basis for an additional presumed trust model
   associated with an existing network.
</t>
    </section>
    <section numbered="true" toc="default">
      <name>Acknowledgments</name>
      <t>
         Authors express their gratitude and appreciation to Joel Halpern
         for the most helpful and insightful discussion on the applicability of
         HTS in a Service Function Chaining domain. Also, the authors thank Bjørn Ivar Teigen
         for the discussion about ensuring proper correlation between generated telemetry information
         and an HTS Follow-up packet.
         And a special thank you to Xiao Min for thorough review and thoughtful suggestions that helped in improving the document.
      </t>
    </section>
  </middle>
  
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2104.xml"/>
                <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9197.xml"/>
                <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9326.xml"/>
      </references>
      
      <references>
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7799.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8169.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8296.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9341.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9342.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4868.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8300.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8402.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6437.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6790.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2992.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1191.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2681.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9450.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9232.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8342.xml"/>
        <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-ietf-nmop-terminology.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8799.xml"/>
        <reference anchor="P4.INT">
          <front>
            <title>In-band Network Telemetry (INT)</title>
            <author>
              <organization/>
            </author>
            <date month="November" year="2020"/>
          </front>
          <seriesInfo name="P4.org" value="Specification"/>
        </reference>
      </references>
    </references>
  </back>
</rfc>
