<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std" ipr="trust200902" docName="draft-ietf-bier-pmmm-oam-13" 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="PM with Marking Method in BIER">Performance Measurement (PM) with Marking Method in Bit Index Explicit Replication (BIER) Layer</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-bier-pmmm-oam-13"/>
    
    <author initials="G." surname="Mirsky" fullname="Greg Mirsky">
      <organization>Ericsson</organization>
      <address>
        <email>gregimirsky@gmail.com</email>
      </address>
    </author>
    
    <author initials="L." surname="Zheng" fullname="Lianshu Zheng">
      <organization>Individual Contributor</organization>
      <address>
        <email>veronique_zheng@hotmail.com</email>
      </address>
    </author>
    
    <author initials="M." surname="Chen" fullname="Mach Chen">
      <organization>Huawei Technologies</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>
    <date year="2023"/>
    <area>Routing</area>
    <workgroup>BIER  Working Group</workgroup>
    <keyword>Internet-Draft</keyword>
    <keyword>BIER</keyword>
    <keyword>OAM</keyword>
    <keyword>Performance Measurement   </keyword>
    <abstract>
      <t>
	   This document describes the applicability of a hybrid performance measurement method 
	   for packet loss and packet delay measurements of a multicast service
	   through a Bit Index Explicit Replication domain.
      </t>
    </abstract>
  </front>
  <middle>
    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
   <xref target="RFC8279" format="default"/> introduces and explains the Bit Index Explicit Replication (BIER)
   architecture and how it supports the forwarding of multicast data packets.
 <xref target="RFC8296" format="default"/> specified that in 
   the case of BIER encapsulation in an MPLS network, a BIER-MPLS label, the label that is at the bottom of the label stack,
   uniquely identifies the multicast flow.
   <xref target="RFC9341"/> and <xref target="RFC9342"/> describe a hybrid performance measurement method, according to the
   classification of measurement methods in <xref target="RFC7799" format="default"/>.
   The method, called Packet Network Performance Monitoring (PNPM), can be used to measure packet loss,
   latency, and jitter on live traffic complies with requirements R-5 and R-12 listed in <xref target="I-D.ietf-bier-oam-requirements" format="default"/>.
  Because this method is based on marking consecutive batches of
   packets, the method is often referred to as a marking method. Terms PNPM and "marking method"
   in this document are used interchangeably.
      </t>
      <t>
   This document defines how the marking method can be used on the BIER layer to measure packet loss and delay metrics
   of a multicast flow in an MPLS network. 
      </t>
    </section>
    <section numbered="true" toc="default">
      <name>Conventions used in this document</name>
      <section numbered="true" toc="default">
        <name>Terminology</name>
        <t>
This document uses the terms related to the Alternate Marking Method
   as defined in <xref target="RFC9341"/>, <xref target="RFC9342"/>.
   This document uses the terms related to the Bit Indexed Explicit Replication
   as defined in <xref target="RFC8296"/>.
   </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="oam-pm-field" numbered="true" toc="default">
      <name>OAM Field in BIER Header</name>
      <t>
  <xref target="RFC8296" format="default"/> defined the two-bits long field, referred to as OAM. The OAM field can be used
  for the marking performance measurement method. Because the setting of the field to any value does not affect
  forwarding and/or quality of service treatment of a packet, using the OAM field for PNPM in BIER layer can be viewed as 
  the example of the hybrid performance measurement method.
      </t>
      <t>
<xref target="oam-field-figure" format="default"/> displays the interpretation of the OAM field defined in this
specification for the use of the PNPM method. The context of interpretation of the OAM field
MAY be signaled via the control plane or configured using an
extension to the BIER YANG data model <xref target="I-D.ietf-bier-bier-yang" format="default"/>.
These extensions are outside the scope of this document.
</t>
      <figure anchor="oam-field-figure">
        <name>OAM field of BIER Header format</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[ 
  0      
  0   1 
+-+-+-+-+
| S | D |
+-+-+-+-+
]]></artwork>
      </figure>
      <t> 
	where:
      </t>
      <ul spacing="normal">
        <li>S - Single-Marking flag;
	</li>
        <li>D - Double-Marking flag.
	</li>
      </ul>
    </section>
    <section anchor="theory-of-operation" numbered="true" toc="default">
      <name>Theory of Operation</name>
      <t>
The marking method can be used in the multicast environment supported by BIER layer.
Without limiting any generality consider multicast network presented in <xref target="mcast-network" format="default"/>.
Any combination of markings can be applied to a multicast flow by
the Bit Forwarding Ingress Router (BFIR) at either ingress or egress point
to perform node, link, segment or end-to-end measurement to detect 
performance degradation defect and localize it efficiently.
</t>
      <figure anchor="mcast-network">
        <name>Multicast network</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[
 
	                -----  
                      --| D |	  
              -----  /  -----
            --| B |--
           /  -----  \  -----
          /           --| E |
-----    /              -----
| A |---                -----
-----    \            --| F |         
          \  -----   /  -----
           --| C |--
             -----   \  -----
                      --| G |   
                        -----     

]]></artwork>
      </figure>
      <t>
      Using the marking method, a BFIR creates distinct sub-flows in the particular multicast traffic
      over BIER layer. Each sub-flow consists of consecutive blocks
      of identically marked packets. For example, a block of N packets, with each packet being marked as X,
      is followed by the block of M packets with each packet being marked as Y. These blocks are unambiguously
      recognizable by a monitoring point at any Bit Forwarding Router (BFR) and can be measured to calculate packet loss
      and/or packet delay metrics. The marking method can be used on multiple flows concurently. Demultiplexing of monitored
      flows might be achived using n-tuple, for example, two-tuple as combination of the values in the
      Entropy and BFIR-id fields <xref target="RFC8296" format="default"/>.
      Also, that can be achieved by using an explicit Flow Identifiier. The definition of the Flow Identifier is outside the scope of
      this specification. It is expected that the marking values be set and
      cleared at the edge of BIER domain. Thus for the scenario presented in <xref target="mcast-network" format="default"/> if the operator
      initially monitors the A-C-G and A-B-D segments he may enable measurements on segments C-F and B-E at any time.
      </t>
      <section anchor="sinle-tag" numbered="true" toc="default">
        <name>Single-Marking Enabled Measurement</name>
        <t>
As explained in <xref target="RFC9341"/>, marking can be
applied to delineate blocks of packets
based either on the equal number of packets in a block or based on the equal time interval.
The latter method offers better control
as it allows a better account for capabilities of downstream nodes to report
statistics related to batches of packets and, at the same time,
time resolution that affects defect detection interval.
</t>
        <t>
If the Single-Marking measurement is used to measure packet loss, then the D flag MUST be set to zero on transmit and ignored
by the monitoring point.
</t>
        <t>
The S flag is used to create sub-flows to measure the packet loss by switching the value
of the S flag every N-th packet or at certain time intervals. Delay metrics MAY be calculated
with the sub-flow using any of the following methods:
</t>
        <ul spacing="normal">
          <li>
First/Last Packet Delay calculation: whenever the marking, i.e., the value of S flag changes,
a BFR can store the timestamp of the first/last packet of the block. The timestamp can be
compared with the timestamp of the packet that arrived in the same order through a monitoring 
point  at a downstream BFR to compute packet delay. 
Because timestamps collected based on the order of arrival this method is sensitive to packet 
loss and re-ordering of packets (see <xref target="oper-sec" format="default"/> for more details).
</li>
          <li>
Average Packet Delay calculation: an average delay is calculated by considering the average 
arrival time of the packets within a single block.  A BFR may collect timestamps for each 
packet received within a single block. Average of the timestamp is the sum of all the timestamps
divided by the total 
number of packets received. Then the difference between the average packet arrival time calculated
for the downstream monitoring point and the same metric but calculated at the upstream monitoring point
is the average packet delay on the segment between these two points.
This method is robust to out of order packets and also 
to packet loss on the segment between the measurement points (packet loss
may cause a minor loss of accuracy in the calculated metric because the number
of packets used is different at each measurement point).
This method only provides a single metric for the 
duration of the block, and it doesn't give the minimum and maximum delay values.
This limitation of producing only the single metric could be overcome by reducing the duration of the block.
As a result, the calculated value of the average delay will better reflect the minimum and maximum delay values
of the block's duration time.
</li>
        </ul>
      </section>
      <section anchor="double-tag" numbered="true" toc="default">
        <name>Double-Marking Enabled Measurement</name>
        <t>
Double-Marking method allows measurement of minimum and maximum delays for the monitored flow,
but it requires more nodal and network resources. If the Double-Marking method used, then
the S flag is used to create the sub-flow, i.e., mark blocks of packets. The D flag
is used to mark single packets within a block to measure delay and jitter.
</t>
        <t>
The first marking (S flag alternation) is needed for packet loss and 
also for average delay measurement.  The second marking (D flag is put
to one) creates a new set of marked packets that are fully identified
over the BIER network, so that a BFR can store the timestamps of these
packets; these timestamps can be compared with the timestamps of the
same packets on a second BFR to compute packet delay values for each
packet.  The number of measurements can be easily increased by
changing the frequency of the second marking. On the other hand,
the higher frequency of the second marking will cause a higher volume of
the measurement data being transported through the BIER domain.
An operator should consider and balance both effects.
This method is useful to measure not only the average delay but
also the minimum and maximum delay values and, in wider terms, to know
more about the statistic distribution of delay values.  
</t>
      </section>
      <section anchor="oper-sec" numbered="true" toc="default">
        <name>Operational Considerations</name>
        <t>
For the ease of operational procedures, the initial marking of a multicast flow is
performed at BFIR. and cleared, by way of removing BIER encapsulation
form a payload packet, at the edge of the BIER domain by BFERs.
</t>
        <t>
Since at the time of writing this specification, there are no proposals to using auto-discovery
or signaling mechanism to inform downstream nodes what methodology is used each monitoring point
MUST be configured beforehand.
</t>
        <t>
Section  5 <xref target="RFC9341"/> provides a detailed analysis of how packet re-ordering and the duration
of the block in the Single-Marking mode of the marking method impact the accuracy of the packet loss
measurement. Re-ordering of packets in the Single-Marking mode will be noticeable only at the edge
of a block of packets (re-ordering within the block cannot be detected in the Single-Marking mode).
If the extra delay for some packets is much smaller than half of the duration of a block, then it should be easier to
attribute re-ordered packets to the proper block and thus maintain the accuracy of the packet loss measurement.
</t>
        <t>
Selection of a time interval to switch the marking of a batch of packets should be based on the service
requirements. In the course of the regular operation, reports, including performance metrics like packet loss ratio,
packet delay, and inter-packet delay variation, are logged every 15 minutes. Thus, it is reasonable to
maintain the duration of the measurement interval at 5 minutes with 100 measurements per each interval.
To support these measurements, marking of the packet batch is switched every 3 seconds. In case when
performance metrics are required in near-real-time, the duration interval of a single batch of identically marked
packets will be in the range of tens of milliseconds.
</t>
      </section>
    </section>
    <section anchor="iana-considerations" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <!--
  <t>
  This document requests IANA to register format of the OAM field of BIER Header as the following:
  </t>
    <texttable anchor="oam-field-table" title="OAM field of BIER Header">
     <ttcol align="center">Bit Position</ttcol>
    <ttcol align="center">Marking</ttcol>
    <ttcol align="left">Description</ttcol>
    <ttcol align="left">Reference</ttcol>
    <c>0&nbsp;</c> <c>S&nbsp;</c> <c>Single-Marking&nbsp;</c><c>This document</c>
    <c>1&nbsp;</c> <c>D&nbsp;</c> <c>Double-Marking&nbsp;</c><c>This document</c>
    </texttable>
-->
<t>This document sets no requirements to IANA. This section can be removed before the publication.</t>
    </section>
    <section anchor="security-considerations" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
Regarding using the marking method, <xref target="RFC9341"/>
stressed two types of security concerns. First, the potential harm caused by
   the measurements, is a lesser threat as <xref target="RFC8296" format="default"/> defines
   OAM field used by the marking method so that the value of "two bits have no effect on the path
      taken by a BIER packet and have no effect on the quality of
      service applied to a BIER packet." Second security concern, potential harm to the measurements
      can be mitigated by using policy, suggested in <xref target="RFC8296" format="default"/>,
      to accept BIER packets only from trusted routers,
      not from customer-facing interfaces.
      </t>
      <t>
   All the security considerations for BIER discussed in <xref target="RFC8296" format="default"/>
   are inherited by this document.
      </t>
    </section>
    <section anchor="ack" numbered="true" toc="default">
      <name>Acknowledgement</name>
      <t>
   Comments from Alvaro Retana helped improve the document and are much appreciated.
      </t>
      <t>
   Reviews and comments from Quan Xiong and Xiao Min are thankfully acknowledged.
      </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.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"/>
      </references>
      <references>
      
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8279.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7799.xml"/>
        <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-ietf-bier-oam-requirements.xml"/>
        <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-ietf-bier-bier-yang.xml"/>
      </references>
    </references>
  </back>
</rfc>
