<?xml version="1.0" encoding="US-ASCII"?>
<!-- This is built from a template for a generic Internet Draft. Suggestions for
     improvement welcome - write to Brian Carpenter, brian.e.carpenter @ gmail.com 
     This can be converted using the Web service at http://xml.resource.org/ -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<!-- You want a table of contents -->
<!-- Use symbolic labels for references -->
<!-- This sorts the references -->
<!-- Change to "yes" if someone has disclosed IPR for the draft -->
<!-- This defines the specific filename and version number of your draft (and inserts the appropriate IETF boilerplate -->
<?rfc sortrefs="yes"?>
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc topblock="yes"?>
<?rfc comments="no"?>
<rfc category="std" docName="draft-li-ippm-ref-delay-measurement-02"
     ipr="trust200902">
  <front>
    <title abbrev="Network Working Group">One-way Delay Measurement Based on
    Reference Delay</title>

    <author fullname="Yang Li" initials="Y." surname="Li">
      <organization>China Mobile</organization>

      <address>
        <postal>
          <street/>

          <city>Beijing</city>

          <code>100053</code>

          <country>China</country>
        </postal>

        <email>liyangzn@chinamobile.com</email>
      </address>
    </author>

    <author fullname="Tao Sun" initials="T." surname="Sun">
      <organization>China Mobile</organization>

      <address>
        <postal>
          <street/>

          <city>Beijing</city>

          <code>100053</code>

          <country>China</country>
        </postal>

        <email>suntao@chinamobile.com</email>
      </address>
    </author>

    <author fullname="Hongwei Yang" initials="H." surname="Yang">
      <organization>China Mobile</organization>

      <address>
        <postal>
          <street/>

          <city>Beijing</city>

          <code>100053</code>

          <country>China</country>
        </postal>

        <email>yanghongwei@chinamobile.com</email>
      </address>
    </author>

    <author fullname="Danyang Chen" initials="D." surname="Chen">
      <organization>China Mobile</organization>

      <address>
        <postal>
          <street/>

          <city>Beijing</city>

          <code>100053</code>

          <country>China</country>
        </postal>

        <email>chendanyang@chinamobile.com</email>
      </address>
    </author>

    <author fullname="Yali Wang" initials="Y." surname="Wang">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>156 Beiqing Rd., Haidian District</street>

          <city>Beijing</city>

          <country>China</country>
        </postal>

        <email>wangyali11@huawei.com</email>
      </address>
    </author>

    <date day="10" month="February" year="2022"/>

    <area>Transport</area>

    <workgroup>Network Working Group</workgroup>

    <keyword>reference delay;delay measurement</keyword>

    <abstract>
      <t>The end-to-end network one-way delay is an important performance
      metric in the 5G network. For realizing the accurate one-way delay
      measurement, existing methods requires the end-to-end deployment of
      accurate clock synchronization mechanism, such as PTP or GPS, which
      results in relatively high deployment cost. Another method can derive
      the one-way delay from the round-trip delay. In this case, since the
      delay of the downlink and uplink may be asymmetric, the measurement
      accuracy is relatively low. Hence, this document introduces a method to
      measure the end-to-end network one-way delay based on a reference delay
      guaranteed by deterministic networking without clock synchronization.The
      advantage of this solution is that it has high measurement accuracy and
      can test any flow type.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t>With the gradual promotion of new-generation network technologies
      (such as 5G networks) and their application in various industries, SLA
      guarantees for network quality become more and more important. For
      example, different 5G services have different requirements for network
      performance indicators such as delay, jitter, packet loss, and
      bandwidth. Among them, the 5G network delay is defined as end-to-end
      one-way delay of the network. Real-time and accurate measurement of the
      end-to-end one-way delay is very important for the SLA guarantee of
      network services, and has become an urgent and important
      requirement.</t>

      <t>As shown in figure 1, 5G network HD video surveillance service is a
      common scenario having requirement of end-to-end one-way delay
      measurement. In this case, one end of the network is a high-definition
      surveillance camera in the wireless access side, and the other end of
      the network is a video server. The end-to-end one-way delay from the
      surveillance camera to the video server is the sum of T1, T2, T3 and T4,
      which is composed of delay in wireless access network, optical
      transmission network, 5G core network, and IP data network.</t>

      <figure align="center"
              title="Figure 1:A Scenario for End-to-end One-way Delay">
        <artwork type="ascii-art" xml:space="preserve">           +--------+   +-------+   +-------+   +-------+
+------+   |Wireless|   |Optical|   |5G Core|   |  IP   |   +------+
|Camera+&lt;-&gt;+ Access +&lt;-&gt;+ Trans +&lt;-&gt;+Network+&lt;-&gt;+ Data  +&lt;-&gt;+Server|
+------+   |Network |   |Network|   |       |   |Network|   +------+
           +--------+   +-------+   +-------+   +-------+

       |&lt;---- T1 ----&gt;|&lt;--- T2 --&gt;|&lt;--- T3 --&gt;|&lt;--- T4 ----&gt;|</artwork>
      </figure>

      <t>The existing one-way delay measurement solutions are divided into two
      types. One type of mechanism to calculate one-way delay is based on the
      measurement of round-trip delay. However, for example, because upstream
      traffic and downstream traffic do not share the same path in 5G network,
      the accuracy of the end-to-end one-way delay calculated from the
      round-trip delay is low. Another type of mechanism is in-band OAM with
      accurate network time synchronization mechanism , such as NTP<xref
      target="RFC5905"/> or PTP<xref target="IEEE.1588.2008"/>.</t>

      <t>The one-way delay measurement solution based on precise network time
      synchronization requires the deployment of an end-to-end time
      synchronization mechanism. The current time synchronization accuracy
      based on the NTP protocol can only reach millisecond level, which cannot
      fully meet the measurement accuracy requirements. The time
      synchronization accuracy based on the GPS module or the PTP protocol can
      meet the requirements. However, because many data centers are actually
      located underground or in rooms without GPS signals, so GPS clock
      information cannot be continuously obtained for time synchronization.
      For time synchronization solutions based on the PTP protocol, each
      device in the wireless access network, 5G transport network, and 5G core
      network must support the PTP protocol, which is unrealistic at the
      moment. So the one-way delay measurement solution based on precise
      end-to-end time synchronization is expensive and difficult to be
      deployed.</t>

      <t>This document introduces a one-way delay measurement mechanism for
      Deterministic Networking (DetNet) <xref target="RFC8655"/>. The one-way
      delay measurement is based on a stable one-way delay of a reference
      DetNet packet, named as reference delay, which is known in advance and
      has extremely low jitter. We can use the reference delay provided by the
      reference DetNet packet to derive the one-way delay of other common
      service packets.</t>
    </section>

    <section title="Conventions Used in This Document">
      <section title="Terminology">
        <t>NTP Network Time Protocol</t>

        <t>PTP Precision Time Protocol</t>

        <t>SLA Service Level Agreement</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 title="The method of One-way Delay Measurement Based on Reference Delay">
      <t>The end-to-end one-way delay of a reference packet with a stable
      delay in the network can be used as a reference delay, denoted as Dref,
      which is known in advance and has extremely low jitter. This section
      will describe in detail the end-to-end one-way delay measurement method
      based on reference delay of the reference packet. Assume that the
      end-to-end one-way delay from the sender to the receiver is measured, as
      shown in figure 2. The intermediate network devices other than the
      sender and receiver are hidden in the figure.</t>

      <figure align="center"
              title="Figure 2:Topology of One-way Delay Measurement">
        <artwork type="ascii-art" xml:space="preserve">       +------------+                   +------------+
       |            |   Clock Offset    |            |
       |   Sender   | +---------------&gt; |  Receiver  |
       |            |                   |            |
       +------------+                   +------------+

Reference  +-----+          Dref           +-----+
  Packet:  | Ts1 |  +-------------------&gt;  | Tr1 |
           +-----+                         +-----+

 Target    +-----+         Dtarget         +-----+
 Packet:   | Ts2 |  +-------------------&gt;  | Tr2 |
           +-----+                         +-----+</artwork>
      </figure>

      <section title="One-way Delay Measurement Method">
        <t>The measurement steps are shown in figure 3, which describe the
        measurement steps at the sender side and receiver side respectively.
        For the sender side, a reference packet is sent. In the first step,
        the sender gets ready to send a reference packet; in the second step,
        the sender marks an egress timestamp Ts1 for the reference packet; in
        the third step, the sender encapsulates the egress timestamp of the
        reference packet in the measurement header of the reference packet; in
        the fourth step, the sender sends the reference packet. For the target
        packet, the sender side procedures are the same,we omit it for
        simplicity. The sending time of the target packet is according to the
        traffic model of real applications. On the other hand, the sender can
        send the reference packet according to a fixed frequency or adjust the
        sending frequency according to the link usage rate, so that the target
        packet can always find a nearby reference packet to make sure that the
        sending time interval between the reference packet and the target
        packet is small.</t>

        <t>For the reference packet, the processing steps at the receiver are
        shown in figure 3. In the first step, the reference packet arrives at
        the receiver, and the receiver receives the reference packet; in the
        second step, the receiver timestamps the reference packet at the
        entrance, which is denoted as Tr1; in the third step, the receiver
        decapsulates the measurement header of the reference packet to obtain
        the sender side timestamp Ts1; in the fourth step, the receiver
        records the timestamp information of Ts1 and Tr1; in the fifth step,
        the receiver uses the source/destination pair obtained by
        decapsulation in the third step as the search key, queries the
        reference delay table and records the reference delay search result,
        denoted as Dref.</t>

        <t>For the target packet, the processing steps at the receiver are
        also shown in figure 3. In the first step, the target packet arrives
        at the receiver, and the receiver receives the target packet; in the
        second step, the receiver timestamps the target packet at the
        entrance, which is denoted as Tr2; in the third step, the receiver
        decapsulates the measurement header of the target packet to obtain the
        sender side timestamp Ts2; in the fourth step, the receiver records
        the timestamp information of Ts2 and Tr2; in the fifth step, the
        receiver calculates the target one-way delay, which we want to
        measure, according to the recorded timestamp information Ts1, Ts2,
        Tr1, Tr2 and reference delay information Dref. The target one-way
        delay of the target packet is recorded as Dtarget.</t>

        <figure align="center"
                title="Figure 3: Measurement steps for Sender and Receiver Respectively">
          <artwork type="ascii-art">Sender Side Procedures for both Reference and Target Packet:

+-------+   +------------+   +-------------+   +-------+
|Sender |   |Sender Side |   |Sender Side  |   |Sending|
|Ready  +--&gt;+Timestamping+--&gt;+Encapsulation+--&gt;+ Packet|
|       |   |            |   |             |   |       |
+-------+   +------------+   +-------------+   +-------+

Receiver Side Procedures for Reference Packet:

+---------+  +-------------+  +-------------+  +---------+  +---------+
|Reference|  |Receiver Side|  |Receiver Side|  |Timestamp|  |Query for|
|Packet   +-&gt;+Timestamping +-&gt;+Decapsulation+-&gt;+Recorded +-&gt;+Reference|
|Arrival  |  |             |  |             |  |         |  |  Delay  |
+---------+  +-------------+  +-------------+  +---------+  +---------+

Receiver Side Procedures for Target Packet:

+-------+  +-------------+  +-------------+  +---------+  +-----------+
| Target|  |Receiver Side|  |Receiver Side|  |Timestamp|  |  One-way  |
| Packet+-&gt;+Timestamping +-&gt;+Decapsulation+-&gt;+Recorded +-&gt;+   Delay   |
|Arrival|  |             |  |             |  |         |  |Calculation|
+-------+  +-------------+  +-------------+  +---------+  +-----------+</artwork>
        </figure>

        <t>Now we describe the fifth step of the receiver procedures for the
        target packet in figure 3, that is, calculating the one-way delay
        Dtarget of the target packet based on the recorded timestamp
        information Ts1, Ts2, Tr1, Tr2 and the reference delay information
        Dref. The calculation method is the core of this solution. For the
        reference packet, leveraging the receiver timestamp minus the sender
        timestamp, we can get Equation 1.</t>

        <t>Equation 1: Tr1 - Ts1 = Dref + Offset1</t>

        <t>where Offset1 is the time offset between the sender and the
        receiver when the reference packet transmission occurs. Similarly, for
        the target packet, we can get Equation 2 using the same method.</t>

        <t>Equation 2: Tr2 - Ts2 = Dtarget + Offset2</t>

        <t>where Offset2 is the time offset between the sender and the
        receiver when the target packet transmission occurs. Assuming that the
        sending time interval between the reference packet and the target
        packet is very small, we can get that Offset1 = Offset2. By (Equation
        2 - Equation 1), we can get Equation 3.</t>

        <t>Equation 3: Dtarget = (Tr2 + Ts1) - (Tr1 + Ts2) + Dref</t>

        <t>So the one-way delay of the target packet can be calculated by
        Equation 3.</t>
      </section>

      <section title="Packet and Measurement Header Format">
        <t>The sender encapsulates the timestamp information and
        sender-receiver pair information in the measurement header of the sent
        packet, as shown in figure 4. The position of measurement header is in
        the option field of the TCP protocol header. The delay measurement
        option format is defined in figure 5. The Length value is 8 octets,
        which is in accordance with TCP option. The sender ID is one octet,
        and the receiver ID is also one octet. The sender side timestamp is 4
        octets, which can store accurate timestamp information.</t>

        <figure align="center"
                title="Figure 4: Format of Reference or Target Packet">
          <artwork type="ascii-art"> 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                    Ethernet header (14 octets)                |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                       IP header (20 octets)                   |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                       TCP header (20 octets)                  |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                TCP Delay Measurement Option (8 octets)        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            Data                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</artwork>
        </figure>

        <figure align="center"
                title="Figure 5: TCP Delay Measurement Option Format">
          <artwork type="ascii-art"> 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    Kind=TBA   |    Length     |  Sender ID    | Receiver ID   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               Sender Side Timestamp (4 octets)                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</artwork>
        </figure>
      </section>
    </section>

    <section title="Acquisition of Reference Delay">
      <t>The end-to-end one-way delay includes three parts, namely the
      transmission delay, the internal processing delay of the network
      devices, and the internal queueing delay of the network devices. Among
      them, fixed parts of the delay include transmission delay and internal
      processing delay. The transmission delay is related to transmission
      distance and transmission media. For example, in optical fiber, it is
      about 5ns per meter. With transmission path and media determined, it is
      basically a fixed value. The internal processing delay of a network
      device includes processing delay of the device's internal pipeline or
      processor and serial-to-parallel conversion delay of the interface,
      which is related to in/out port rate of the device, message length and
      forwarding behavior. The magnitude of the internal processing delay is
      at microsecond level, and it is basically a fixed value related to the
      chip design specifications of a particular network device. Variable part
      of the delay is the internal queueing delay. The queueing delay of the
      device internal buffer is related to the queue depth, queue scheduling
      algorithm, message priority and message length. For each device along
      the end-to-end path, the queueing delay can reach microsecond or even
      millisecond level, depending on values of the above parameters and
      network congestion state.</t>

      <t>With the continuous development of networking technologies and
      application requirements, a series of new network technologies have
      emerged which can guarantee bounded end-to-end delay and ultra small
      jitter. For example, deterministic network<xref target="RFC8655"/>, by
      leveraging novel scheduling algorithms and packet priority settings, can
      stabilize queuing delay of network device on the end-to-end path. As a
      result, the end-to-end one-way delay is extremely low and bounded. So
      packets transmitted by a deterministic network with delay guarantee can
      be used as reference packets, and their end-to-end one-way delay can be
      used as reference delays. The acquisition method of reference delay is
      not limited to the above method based on deterministic network
      technology.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>TBD.</t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document requests IANA to assign a Kind Number in TCP Option to
      indicate TCP Delay Measurement option.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <reference anchor="IEEE.1588.2008">
        <front>
          <title>IEEE Standard for a Precision Clock Synchronization Protocol
          for Networked Measurement and Control Systems</title>

          <author>
            <organization>IEEE</organization>
          </author>

          <date month="July" year="2008"/>
        </front>
      </reference>

      <?rfc include="reference.RFC.2119"?>

      <?rfc include="reference.RFC.8655"?>

      <?rfc include="reference.RFC.8174"?>

      <?rfc include="reference.RFC.5905"?>
    </references>
  </back>
</rfc>
