<?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" ipr="trust200902" docName="draft-ietf-mpls-rfc6374-sfl-10" number="9571" obsoletes="" updates=""
submissionType="IETF" category="std" consensus="true" xml:lang="en" tocInclude="true"
sortRefs="true" symRefs="true" version="3">

  <!-- xml2rfc v2v3 conversion 3.6.0 -->
  <front>
    <title abbrev="SFL">Extension of RFC 6374-Based Performance Measurement Using Synonymous Flow Labels</title>
    <seriesInfo name="RFC" value="9571"/>
    <author initials="S." surname="Bryant" fullname="Stewart Bryant" role="editor">
      <organization>University of Surrey</organization>
      <address>
        <email>sb@stewartbryant.com</email>
      </address>
    </author>
    <author initials="G." surname="Swallow" fullname="George Swallow">
      <organization>Independent</organization>
      <address>
        <email>swallow.ietf@gmail.com</email>
      </address>
    </author>
    <author initials="M." surname="Chen" fullname="Mach(Guoyi) Chen">
      <organization>Huawei</organization>
      <address>
        <email>mach.chen@huawei.com</email>
      </address>
    </author>
    <author initials="G." surname="Fioccola" fullname="Giuseppe Fioccola">
      <organization>Huawei Technologies</organization>
      <address>
        <email>giuseppe.fioccola@huawei.com</email>
      </address>
    </author>
    <author initials="G." surname="Mirsky" fullname="Gregory Mirsky">
      <organization>ZTE Corp.</organization>
      <address>
        <email>gregimirsky@gmail.com</email>
      </address>
    </author>
    <date year="2024" month="May"/>
    <workgroup>MPLS</workgroup>

    <keyword>Performance Measurement</keyword>
    <keyword>OAM</keyword>

    <abstract>
      <t>RFC 6374 describes methods of making loss and delay measurements on
      Label Switched Paths (LSPs) primarily as they are used in MPLS Transport
      Profile (MPLS-TP) networks.  This document describes a method of
      extending the performance measurements (specified in RFC 6374) from
      flows carried over MPLS-TP to flows carried over generic MPLS LSPs.  In
      particular, it extends the technique to allow loss and delay
      measurements to be made on multipoint-to-point LSPs and introduces some
      additional techniques to allow more sophisticated measurements to be
      made in both MPLS-TP and generic MPLS networks.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="introduction" numbered="true" toc="default">
      <name>Introduction</name>
      <t><xref target="RFC6374" format="default"/> was originally designed for use as an Operations, Administration, and
Maintenance (OAM) protocol
for use with MPLS Transport Profile (MPLS-TP) <xref target="RFC5921" format="default"/> LSPs. MPLS-TP only
supports point-to-point and point-to-multipoint LSPs. This document describes 
how to use <xref target="RFC6374" format="default"/> in the generic MPLS case and also introduces a number
of more sophisticated measurements of applicability to both cases.</t>
      <t><xref target="RFC8372" format="default"/> describes the requirement for introducing
flow identities when using packet loss measurements described in <xref target="RFC6374" format="default"/>.  

In summary, <xref target="RFC6374" format="default"/> describes use of the loss measurement (LM) message as the
packet accounting
demarcation point. Unfortunately, this gives rise to a number of
problems that may lead to significant packet accounting errors in
certain situations.  For example:</t>
      <ol spacing="normal" type="1"><li>Where a flow is subjected to Equal-Cost Multipath (ECMP)
treatment, packets can arrive out of order with respect to the LM
packet.</li>
        <li>Where a flow is subjected to ECMP treatment, packets can arrive
at different hardware interfaces, thus requiring reception of an
LM packet on one interface to trigger a packet accounting action
on a different interface that may not be co-located with it.
This is a difficult technical problem to address with the
required degree of accuracy.</li>
        <li>Even where there is no ECMP (for example, on RSVP-TE, MPLS-TP LSPs,
and pseudowires (PWs)), local processing may be distributed over a number of
processor cores, leading to synchronization problems.</li>
        <li>Link aggregation techniques <xref target="RFC7190" format="default"/> may also lead to synchronization
issues.</li>
        <li>Some forwarder implementations have a long pipeline between
processing a packet and incrementing the associated counter, again
leading to synchronization difficulties.</li>
      </ol>

      <t>An approach to mitigating these synchronization issues is described in
<xref target="RFC9341" format="default"/> -- the packets are
batched by the sender, and each batch is marked in some way such that
adjacent batches can be easily recognized by the receiver.</t>
      <t>An additional problem arises where the LSP is a multipoint-to-point
LSP since MPLS does not include a source address in the packet.
Network management operations require the measurement of packet loss
between a source and destination.  It is thus necessary to introduce
some source-specific information into the packet to identify packet
batches from a specific source.</t>
      <t><xref target="RFC8957" format="default"/> describes a method of encoding per-flow
instructions in an MPLS label stack using a technique called
Synonymous Flow Labels (SFLs), in which labels that mimic the
behavior of other labels provide the packet batch identifiers and
enable the per-batch packet accounting.  This memo specifies how SFLs
are used to perform packet loss and delay measurements as described in <xref target="RFC6374" format="default"/>.</t>
<t>
  When the terms "performance measurement method," "Query," "packet," or "message" are used in this document,
  they refer to a performance measurement method, Query, packet, or message as specified in <xref
  target="RFC6374"/>.  </t> </section> <section anchor="requirements-language"
  numbered="true" toc="default"> <name>Requirements Language</name>
        <t>
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
    NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>
    </section>
    <section anchor="rfc6374-packet-loss-measurement-with-sfl" numbered="true" toc="default">
      <name>Packet Loss Measurement Using SFL</name>
      <t>The data service packets of the flow being instrumented are grouped
into batches, and all the packets within a batch are marked with
the SFL <xref target="RFC8372" format="default"/> corresponding to that batch.
The sender counts the number of packets in the batch. When the
batch has completed and the sender is confident that all of the
packets in that batch will have been received, the sender issues
a Query message to determine the number actually
received and hence the number of packets lost. The 
Query message is sent using the same SFL as the corresponding batch of
data service packets. The format of the Query and Response packets is
described in <xref target="sec-RFC6374SFL" format="default"/>.</t>
    </section>
    <section anchor="SPD" numbered="true" toc="default">
      <name>Single Packet Delay Measurement Using SFL</name>
      <t><xref target="RFC6374" format="default"/> describes how to measure the packet delay by measuring the
transit time of a packet over an LSP. Such a packet may not 
need to be carried over an SFL since the delay over a particular LSP 
should be a function of the Traffic Class (TC) bits.</t>
      <t>However, where SFLs are being used to monitor packet loss or where
label-inferred scheduling is used <xref target="RFC3270" format="default"/>, then
the SFL would be <bcp14>REQUIRED</bcp14> to ensure that the packet
that was being used as a proxy for a data service packet experienced
a representative delay. The format of a packet carried over the LSP using an SFL is shown in <xref target="sec-RFC6374SFL" format="default"/>.</t>
    </section>
    <section anchor="data-service-packet-delay-measurement" numbered="true" toc="default">
      <name>Data Service Packet Delay Measurement</name>
      <t>Where it is desired to more thoroughly instrument a packet flow and to
determine the delay of a number of packets, it is undesirable to
send a large number of packets acting as proxy data service
packets (see <xref target="SPD" format="default"/>). A method of directly measuring the delay characteristics
of a batch of packets is therefore needed.</t>
      <t>Given the long intervals over which it is necessary to measure packet
loss, it is not necessarily the case that the batch times for the two
measurement types would be identical. Thus, we use a technique that
permits the two measurements to be made concurrently and yet relatively
independently from each other. The notion that they are relatively
independent arises from the potential for the two batches to overlap in time,
in which case either the delay batch time will need to be cut short or the loss
time will need to be extended to allow correct reconciliation of the
various counters.</t>
<t>The problem is illustrated in <xref target="fig1"/>.</t>

<figure anchor="fig1">
<name>Query Packet with SFL</name>
<artwork>
(Case 1)  AAAAAAAAAABBBBBBBBBBAAAAAAAAAABBBBBBBBBB

          SFL marking of a packet batch for loss measurement

(Case 2)  AADDDDAAAABBBBBBBBBBAAAAAAAAAABBBBBBBBBB

          SFL marking of a subset of the packets for delay

(Case 3)  AAAAAAAADDDDBBBBBBBBAAAAAAAAAABBBBBBBBBB

          SFL marking of a subset of the packets across a packet loss
          measurement boundary

(Case 4)  AACDCDCDAABBBBBBBBBBAAAAAAAAAABBBBBBBBBB

          A case of multiple delay measurements within a packet loss
          measurement

where
   A and B are packets where loss is being measured.
   C and D are packets where loss and delay are being measured.
</artwork></figure>

      <t>In Case 1, we show where loss measurement alone
is being carried out on the flow under analysis. For illustrative
purposes, consider that 10 packets are used in each flow in the
time interval being analyzed.</t>
      <t>Now consider Case 2, where a small batch of
packets need to be analyzed for delay. These are marked with a different
SFL type, indicating that they are to be monitored for both loss
and delay. The SFL=A indicates loss batch A, and SFL=D indicates a batch
of packets that are to be instrumented for delay, but SFL D is
synonymous with SFL A, which in turn is synonymous with the underlying
Forwarding Equivalence Class (FEC). Thus, a packet marked "D" will be accumulated into the A loss
batch, into the delay statistics, and will be forwarded as normal.
Whether the packet is actually counted twice (for loss and delay)
or whether the two counters are reconciled during reporting is
a local matter.</t>
      <t>Now consider Case 3, where a small batch of packets
is marked for delay across a loss batch boundary. These packets
need to be considered as a part of batch A or a part of batch B, and
any Query needs to take place after all packets
A or D (whichever option is chosen) have arrived at the receiving Label Switching Router (LSR).</t>
      <t>Now consider Case 4. Here, we have a case where
it is required to take a number of delay measurements within
a batch of packets that we are measuring for loss. To do this,
we need two SFLs for delay (C and D) and alternate between
them (on a delay-batch-by-delay-batch basis) for the purposes of
measuring the delay characteristics of the different batches of packets.</t>
    </section>
    <section anchor="some-simplifying-rules" numbered="true" toc="default">
      <name>Some Simplifying Rules</name>
      <t>It is possible to construct a large set of overlapping measurement
types in terms of loss, delay, loss and delay, and batch overlap. If
we allow all combinations of cases, this leads to configuration,
testing, and implementation complexity and, hence, increased costs.
The following simplifying rules represent the
default case:</t>
      <ol spacing="normal" type="1"><li>Any system that needs to measure delay <bcp14>MUST</bcp14> be able to
measure loss.</li>
        <li>Any system that is to measure delay <bcp14>MUST</bcp14> be configured to
measure loss. Whether the loss statistics are collected
or not is a local matter.</li>
        <li>A delay measurement <bcp14>MAY</bcp14> start at any point during a loss measurement
batch, subject to rule 4.</li>
        <li>A delay measurement interval <bcp14>MUST</bcp14> be short enough that it
will complete before the enclosing loss batch completes.</li>
        <li>The duration of a second delay batch (D in <xref target="fig1"/>) must be such
that all packets from the packets belonging to a first
delay batch (C in <xref target="fig1"/>) will have been received before
the second delay batch completes. This condition is satisfied
when the time to send a batch is long compared to the network
propagation time and is a parameter that can be established
by the network operator.</li>
      </ol>
      <t>Given that the sender controls both the start and duration of
a loss and a delay packet batch, these rules are readily implemented
in the control plane.</t>
    </section>
    <section anchor="multiple-packet-delay-characteristics" numbered="true" toc="default">
      <name>Multiple Packet Delay Characteristics</name>
      <t>A number of methods are described that add to the set of measurements
originally specified in <xref target="RFC6374" format="default"/>. Each of these methods has different
characteristics and different processing demands on the packet forwarder.
The choice of method will depend on the type of diagnostic that the operator seeks.</t>
      <t>Three methods are discussed:</t>
      <ol spacing="normal" type="1"><li>Time Buckets</li>
        <li>Classic Standard Deviation</li>
        <li>Average Delay</li>
      </ol>
      <section anchor="method-1-time-buckets" numbered="true" toc="default">
        <name>Method 1: Time Buckets</name>

  <t>In this method, the receiving LSR measures the inter-packet gap, classifies the
  delay into a number of delay buckets, and records the number of packets
  in each bucket. 
  As an example, if the operator were concerned about packets with a delay of 
  up to 1 μs, 2 μs, 4 μs, 8 μs, and over 8 μs, then there would be five 
  buckets, and packets that arrived up to 1 μs would cause the "up to 1 μs" 
  bucket counter to increase.  Likewise, for those that arrived between 1 μs and 2 μs, the "2 μs" bucket counter would increase, etc. In practice, it
  might be better in terms of processing and potential parallelism if both the "up to 1 μs" and "2 μs" counters were incremented when a packet had
a delay relative to its predecessor of 2 μs, and any more detailed information was calculated in the analytics
system.</t>
        <t>This method allows the operator to see more structure in the jitter characteristics
than simply measuring the average jitter and avoids the complication of needing
to perform a per-packet multiply but will probably need the time intervals between
buckets to be programmable by the operator.</t>
        <t>The packet format of a Time Bucket Jitter Measurement message
is shown below:</t>

        <figure anchor="FIGBucket">
          <name>Time Bucket Jitter Measurement Message 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Flags |  Control Code |        Message Length         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  QTF  |  RTF  | RPTF  |              Reserved                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Session Identifier          |    DS     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Number of     |      Reserved 1                               |
| Buckets       |                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                   Interval (in 10 ns units)                   |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                   Number of Pkts in Bucket 1                  |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~                                                               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                   Number of Pkts in Bucket N                  |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~                                                               ~
~                           TLV Block                           ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
]]></artwork>
        </figure>
        <t>The Version, Flags, Control Code, Message Length, Querier Timestamp Format (QTF), Responder Timestamp Format (RTF), Responder's Preferred Timestamp Format (RPTF),
Session Identifier, Reserved, and Differentiated Services (DS) fields are as defined in <xref target="RFC6374" sectionFormat="of" section="3.2"/>. The remaining fields, which are unsigned integers, are as follows:</t>
<ul empty="false">
<li>Number of Buckets in the measurement.</li>

<li>Reserved 1 must be sent as zero and ignored on receipt.</li>

<li>Interval (in 10 ns units) is the inter-packet interval for
  this bucket.</li>

<li>Number of Pkts in Bucket 1 is the number of packets found in
  the first bucket.</li>
<li>Number of Pkts in Bucket N is the number of packets found in
  the Nth bucket, where N is the value in the Number of Buckets field.</li>
</ul>
        <t>There will be a number of Interval/Number pairs depending on the
number of buckets being specified by the Querier. If a message is being used to configure the buckets (i.e., the responder 
is creating or modifying the buckets according to the intervals in
the Query message), then the responder
<bcp14>MUST</bcp14> respond with 0 packets in each bucket until it has been
configured for a full measurement period. This indicates that it was configured
at the time of the last response message, and thus, the response
is valid for the whole interval. 

As per the convention in <xref target="RFC6374" format="default"/>,
the Number of Pkts in Bucket fields are included in the Query message and set
to zero.</t>
        <t>Out-of-band configuration is permitted by this mode of operation.</t>
        <t>Note this is a departure from the normal fixed format used in
<xref target="RFC6374" format="default"/>.</t>
        <t>The Time Bucket Jitter Measurement message is carried over an LSP in the way described in
<xref target="RFC6374" format="default"/> and over an LSP with an SFL as described in <xref target="sec-RFC6374SFL" format="default"/>.</t>
      </section>
      <section anchor="method-2-classic-standard-deviation" numbered="true" toc="default">
        <name>Method 2: Classic Standard Deviation</name>
        <t>In this method, provision is made for reporting the following delay
characteristics:</t>
        <ol spacing="normal" type="1"><li>Number of packets in the batch (n)</li>
          <li>Sum of delays in a batch (S)</li>
          <li>Maximum delay</li>
          <li>Minimum delay</li>
          <li>Sum of squares of inter-packet delay (SumS)</li>
        </ol>
        <t>Characteristics 1 and 2 give the mean delay. Measuring the delay of each
pair in the batch is discussed in <xref target="PPDM" format="default"/>.</t>
        <t>Characteristics 3 and 4 give the outliers.</t>
        <t>Characteristics 1, 2, and 5 can be used to calculate the variance of the
inter-packet gap, hence the standard deviation giving a view of
the distribution of packet delays and hence the jitter. The equation
for the variance (var) is given by:</t>
<artwork><![CDATA[
var = (SumS - S*S/n)/(n-1) 
]]></artwork>

        <t>There is some concern over the use of this algorithm for measuring
variance because SumS and S*S/n can be similar numbers, particularly
where variance is low. However, the method is acceptable because it does
not require a division in the hardware.</t>
        <section anchor="multi-packet-delay-measurement-message-format" numbered="true" toc="default">
          <name>Multi-packet Delay Measurement Message Format</name>
          <t>The packet format of a  Multi-packet Delay Measurement message
is shown below:</t>
          <figure anchor="FIGMPM">
            <name>Multi-packet Delay Measurement Message 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Flags |  Control Code |        Message Length         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  QTF  |  RTF  | RPTF  |              Reserved                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Session Identifier          |    DS     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Number of Packets                        |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                   Sum of Delays for Batch                     |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Minimum Delay                           |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Maximum Delay                           |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                Sum of squares of Inter-packet delay           |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~                                                               ~
~                           TLV Block                           ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
          </figure>
          <t>The Version, Flags, Control Code, Message Length, QTF, RTF, RPTF,
Session Identifier, Reserved, and DS fields are as defined in <xref target="RFC6374" sectionFormat="of" section="3.2"/>. The remaining fields are as follows:</t>
<ul empty="false">
<li>Number of Packets is the number of packets in this batch.</li>

<li>Sum of Delays for Batch is the duration of the batch in the
  time measurement format specified in the RTF field.</li>

<li>Minimum Delay is the minimum inter-packet gap observed during
  the batch in the time format specified in the RTF field.</li>

<li>Maximum Delay is the maximum inter-packet gap observed during
  the batch in the time format specified in the RTF field.</li>
</ul>
          <t>The Multi-packet Delay Measurement message is carried over an LSP in the way described in
<xref target="RFC6374" format="default"/> and over an LSP with an SFL as described in <xref target="sec-RFC6374SFL" format="default"/>.</t>
        </section>
      </section>
      <section anchor="PPDM" numbered="true" toc="default">
        <name>Per-Packet Delay Measurement</name>
        <t>If detailed packet delay measurement is required, then it might be
possible to record the inter-packet gap for each packet pair. 
   In cases other than the exceptions of slow flows or small batch sizes,
   this would create a large (per-packet) demand on storage in the
   instrumentation system, a large bandwidth for such a storage system and
   large bandwidth for the analytics system.
Such a measurement technique is outside the scope of this document.</t>
      </section>
      <section anchor="average-delay" numbered="true" toc="default">
        <name>Average Delay</name>
        <t>Introduced in <xref target="RFC9341" format="default"/> is the concept of a one-way delay measurement in which the average time of arrival of a
set of packets is measured. In this approach, the packet is timestamped
at arrival, and the responder returns the sum of the timestamps
and the number of timestamps. From this, the analytics engine can
determine the mean delay. An alternative model is that the responder
returns the timestamp of the first and last packet and the
number of packets. This latter method has the advantage of allowing the
average delay to be determined at a number of points along the
packet path and allowing the components of the delay to be
characterized. Unless specifically configured otherwise, the
responder may return either or both types of response, and
the analytics engine should process the response appropriately.</t>
        <t>The packet format of an Average Delay Measurement message
is shown below:</t>
        <figure anchor="FIGAD">
          <name>Average Delay Measurement Message 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Flags |  Control Code |        Message Length         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  QTF  |  RTF  | RPTF  |              Reserved                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Session Identifier          |    DS     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Number of Packets                        |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Time of First Packet                     |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Time of Last Packet                      |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                   Sum of Timestamps of Batch                  |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

~                                                               ~
~                           TLV Block                           ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
        <t>The Version, Flags, Control Code, Message Length, QTF, RTF, RPTF,
Session Identifier, and DS fields are as defined in <xref target="RFC6374" sectionFormat="of" section="3.2"/>. The remaining fields are as follows:</t>
<ul empty="false">
<li>Number of Packets is the number of packets in this batch.</li>

<li>Time of First Packet is the time of arrival of the first
  packet in the batch.</li>

<li>Time of Last Packet is the time of arrival of the last
  packet in the batch.</li>
  
<li>Sum of Timestamps of Batch.</li> 
</ul>
        <t>The Average Delay Measurement message
is carried over an LSP in the way described in
<xref target="RFC6374" format="default"/> and over an LSP with an SFL as described in <xref target="sec-RFC6374SFL" format="default"/>.
As is the convention with <xref target="RFC6374" format="default"/>, the Query message contains placeholders
for the Response message. The placeholders are sent as zero.</t>
      </section>
    </section>
    <section anchor="sampled-measurement" numbered="true" toc="default">
      <name>Sampled Measurement</name>
      <t>In the discussion so far, it has been assumed that we would measure
the delay characteristics of every packet in a delay measurement
interval defined by an SFL of constant color.
In <xref target="RFC9341" format="default"/>, the concept of a sampled
measurement is considered. That is, the responder only measures a packet
at the start of a group of packets being marked for delay measurement
by a particular color, rather than every packet in the marked batch.
A measurement
interval is not defined by the duration of a marked batch of packets
but the interval between a pair of packets taking a readout
of the delay characteristic. This approach has the advantage that
the measurement is not impacted by ECMP effects.</t>
      <t>This sampled approach may be used if supported by the responder and
configured by the operator.</t>
    </section>
    <section anchor="sec-RFC6374SFL" numbered="true" toc="default">
      <name>Carrying Packets over an LSP Using an SFL</name>
      <t>We illustrate the packet format of a Query message using SFLs
for the case of an MPLS Direct Loss Measurement in
<xref target="Figure1" format="default"/>.</t>
      <figure anchor="Figure1">
        <name>Query Packet with SFL</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[
+-------------------------------+
|                               |
|             LSP               |
|            Label              |
+-------------------------------+
|                               |
|        Synonymous Flow        |
|            Label              |
+-------------------------------+
|                               |
|            GAL                |
|                               |
+-------------------------------+
|                               |
|      ACH Type = 0xA           |
|                               |
+-------------------------------+
|                               |
|      Measurement Message      |
|                               |
|  +-------------------------+  |
|  |                         |  |
|  |      Fixed-format       |  |
|  |      portion of msg     |  |
|  |                         |  |
|  +-------------------------+  |
|  |                         |  |
|  |      Optional SFL TLV   |  |
|  |                         |  |
|  +-------------------------+  |
|  |                         |  |
|  |      Optional Return    |  |
|  |      Information        |  |
|  |                         |  |
|  +-------------------------+  |
|                               |
+-------------------------------+
]]></artwork>
      </figure>
      <t>The MPLS label stack is exactly the same as that used for the user
data service packets being instrumented except for the inclusion
of the Generic Associated Channel Label (GAL) <xref target="RFC5586" format="default"/> to allow the receiver to distinguish between
normal data packets and OAM packets. Since the packet loss
measurements are being made on the data service packets,
an MPLS Direct Loss Measurement is being made,
which is indicated by the type field in the Associated Channel Header (ACH) (Type = 0x000A).</t>

      <t>The measurement message consists of up to three components as follows.</t>
      <ul>
	<li>
	  <t>The fixed-format portion of the message is carried over the ACH
	  channel. The ACH channel type specifies the type of measurement
	  being made (currently: loss, delay, or loss and delay).</t>
	</li>
	<li>
	  <t>(Optional) The SFL TLV specified in <xref target="sfltlv"
	  format="default"/> <bcp14>MAY</bcp14> be carried if needed. It is
	  used to provide the implementation with a reminder of the SFL that
	  was used to carry the message.  This is needed because a number of
	  MPLS implementations do not provide the MPLS label stack to the MPLS
	  OAM handler.  This TLV is required if messages are sent over UDP
	  <xref target="RFC7876" format="default"/>.  This TLV
	  <bcp14>MUST</bcp14> be included unless, by some method outside the
	  scope of this document, it is known that this information is not
	  needed by the responder.</t>
      </li>
      <li>
	<t>(Optional) The Return Information <bcp14>MAY</bcp14> be carried if
	needed. It allows the responder send the response to the Querier.  This is not needed if the
	response is requested in band and the MPLS construct being measured is
	a point-to-point LSP, but it otherwise <bcp14>MUST</bcp14> be carried.
	The Return Address TLV is defined in <xref target="RFC6374"
	format="default"/>, and the optional UDP Return Object is defined in
	<xref target="RFC7876" format="default"/>.</t>
      </li>
    </ul>
      <t>Where a measurement other than an MPLS Direct Loss Measurement is to be
made, the appropriate measurement message is used (for example, one of the
new types defined in this document), and this is indicated to the receiver
by the use of the corresponding ACH type.</t>
      <section anchor="sfltlv" numbered="true" toc="default">
        <name>Extending RFC 6374 with SFL TLV</name>
        <t>The <xref target="RFC6374" format="default"/> SFL TLV is shown in <xref target="Figure2" format="default"/>. 
   This contains the SFL that was carried in the label stack, the FEC that was
   used to allocate the SFL, and the index (into the batch of SFLs that were
   allocated for the FEC) that corresponds to this SFL.</t>

        <figure anchor="Figure2">
          <name>SFL 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    Type       |    Length     |MBZ| SFL Batch |    SFL Index  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 SFL                   |        Reserved       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 FEC                                           |
.                                                               .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
        <t>Where:</t>
<dl indent="15">
<dt>Type</dt><dd>      Set to Synonymous Flow Label (SFL-TLV).</dd>

<dt>Length</dt><dd>    The length of the TLV is as specified in <xref target="RFC6374"/>.</dd>

<dt>MBZ</dt><dd>       <bcp14>MUST</bcp14> be sent as zero and ignored on receive.</dd>

<dt>SFL Batch</dt><dd> An identifier for a collection of SFLs grouped together for management and control purposes. </dd>

<dt>SFL Index</dt><dd><t>The index of this SFL within the list of SFLs that were assigned
          for the FEC.</t>
<t>       Multiple SFLs can be assigned to a FEC, each
          with different actions. This index is an optional
          convenience for use in mapping between the TLV
          and the associated data structures in the LSRs.
          The use of this feature is agreed upon between the
          two parties during configuration. It is not required
          but is a convenience for the receiver if both parties
          support the facility.</t></dd>

<dt>SFL</dt><dd>The SFL used to deliver this packet.  This is an MPLS
          label that is a component of a label stack entry as
          defined in <xref target="RFC3032" sectionFormat="of" section="2.1"/>.</dd>

<dt>Reserved</dt><dd>  <bcp14>MUST</bcp14> be sent as zero and ignored on receive.</dd>

<dt>FEC</dt><dd>       The Forwarding Equivalence Class that was used to
          request this SFL.  This is encoded as per
          <xref target="RFC5036" sectionFormat="of" section="3.4.1"/>.</dd>
	</dl>
        <t>This information is needed to allow for operation with hardware that
discards the MPLS label stack before passing the remainder of the
stack to the OAM handler.  By providing both the SFL and the FEC plus
index into the array of allocated SFLs, a number of implementation
types are supported.</t>
      </section>
    </section>
    <section anchor="rfc6374-combined-loss-delay-measurement" numbered="true" toc="default">
      <name>Combined Loss/Delay Measurement Using SFL</name>
      <t>This mode of operation is not currently supported by this specification.</t>
    </section>
    <section anchor="PCSEC" numbered="true" toc="default">
      <name>Privacy Considerations</name>
      <t>The inclusion of originating and/or flow information in a packet
provides more identity information and hence potentially degrades the
privacy of the communication.  While the inclusion of the additional
granularity does allow greater insight into the flow characteristics,
it does not specifically identify which node originated the packet
other than by inspection of the network at the point of ingress or
inspection of the control protocol packets.  This privacy threat may
be mitigated by encrypting the control protocol packets, regularly
changing the synonymous labels, and by concurrently using a number of
such labels.</t>
    </section>
    <section anchor="security-considerations" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>The security considerations documented in <xref target="RFC6374" format="default"/> and <xref target="RFC8372" format="default"/>
(which in turn calls up <xref target="RFC5920" format="default"/> and <xref target="RFC7258" format="default"/>) are applicable to this
protocol.</t>
      <t>The issue noted in <xref target="PCSEC" format="default"/> is a security consideration.  There are
no other new security issues associated with the MPLS data plane.  Any
control protocol used to request SFLs will need to ensure the
legitimacy of the request.</t>
      <t>An attacker that manages to corrupt the <xref target="RFC6374" format="default"/> SFL TLV in <xref target="sfltlv" format="default"/> could
disrupt the measurements in a way that the <xref target="RFC6374" format="default"/> responder is unable to
detect. However, the network operator is likely to notice the
anomalous network performance measurements, and in any case,
normal MPLS network security procedures make this type of attack extremely unlikely.</t>
    </section>
    <section anchor="iana-considerations" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <section anchor="allocation-of-mpls-generalized-associated-channel-g-ach-types" numbered="true" toc="default">
        <name>Allocation of MPLS Generalized Associated Channel (G-ACh) Types</name>
        <t>As per the IANA considerations in <xref target="RFC5586" format="default"/> updated by <xref target="RFC7026" format="default"/> and <xref target="RFC7214" format="default"/>, IANA has
allocated the following values in the "MPLS Generalized Associated Channel 
(G-ACh) Types" registry, in the "Generic Associated Channel (G-ACh) Parameters"
registry group:</t>

<table anchor="tab-1"> 
  <name/>   
  <thead>
    <tr>
      <th>Value</th>   
      <th>Description</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>         
    <tr>
      <td>0x0010</td>
      <td>Time Bucket Jitter Measurement</td>
      <td>RFC 9571</td>
    </tr>
    <tr>
      <td>0x0011</td>
      <td>Multi-packet Delay Measurement</td>
      <td>RFC 9571</td>
    </tr>
    <tr>
      <td>0x0012</td>
      <td>Average Delay Measurement</td>
      <td>RFC 9571</td>
    </tr>
  </tbody>
</table>
      </section>
      <section anchor="allocation-of-mpls-lossdelay-tlv-object" numbered="true" toc="default">
        <name>Allocation of MPLS Loss/Delay TLV Object</name>
        <t>IANA has allocated the following TLV from the 0-127 range of the
"MPLS Loss/Delay Measurement TLV Object" registry in the
"Generic Associated Channel (G-ACh) Parameters" registry group:</t>

<table anchor="tab-2">
  <name/>   
  <thead>
    <tr>
      <th>Type</th>   
      <th>Description</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>         
    <tr>
      <td>4</td>
      <td>Synonymous Flow Label</td>
      <td>RFC 9571</td>
    </tr>
  </tbody>
</table>
      </section>
    </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.8174.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3032.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7876.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5586.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6374.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8957.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5036.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7026.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7214.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8372.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3270.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5921.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7190.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7258.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5920.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9341.xml"/>
      </references>
    </references>
    <section anchor="acknowledgments" numbered="false" toc="default">
      <name>Acknowledgments</name>
      <t>The authors thank <contact fullname="Benjamin Kaduk"/> and <contact fullname="Elwyn Davies"/> for their thorough and thoughtful
review of this document.</t>
    </section>

    <section anchor="contributors" numbered="false" toc="default">
      <name>Contributors</name>
    <contact fullname="Zhenbin Li" >
        <organization>Huawei</organization>
        <address>
          <email>lizhenbin@huawei.com</email>
        </address>
    </contact>     

    <contact fullname="Siva Sivabalan">
        <organization>Ciena Corporation</organization>
        <address>
          <email>ssivabal@ciena.com</email>
        </address>
    </contact>
    </section>

  </back>
</rfc>
