<?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-mfm-ippm-sfc-nsh-pmamm-00" 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 Alternate Marking Method in SFC">Performance Measurement (PM) with Alternate Marking Method in Service Function Chaining (SFC) Network Service Header (NSH) Domain</title>
    <seriesInfo name="Internet-Draft" value="draft-mfm-ippm-sfc-nsh-pmamm-00"/>
    
    <author initials="G." surname="Mirsky" fullname="Greg Mirsky">
      <organization>Ericsson</organization>
      <address>
        <email>gregimirsky@gmail.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 fullname="Tal Mizrahi" initials="T." surname="Mizrahi">
      <organization abbrev="">Huawei Network.IO Innovation Lab</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <code/>
          <country>Israel</country>
        </postal>
        <email>tal.mizrahi.phd@gmail.com</email>
      </address>
    </author>
    <date year="2022"/>
    <area>Routing</area>
    <workgroup>IPPM  Working Group</workgroup>
    <keyword>Internet-Draft</keyword>
    <keyword>SFC</keyword>
    <keyword>NSH</keyword>
    <keyword>OAM</keyword>
    <keyword>Performance Measurement   </keyword>
    <abstract>
      <t>
	   This document describes how the alternate marking method can be used
	   as the efficient performance measurement method taking advantage of the actual data flows
	   in a Service Function Chaining domain using Network Service Header encapsulation.
      </t>
    </abstract>
  </front>
  <middle>
    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
   <xref target="RFC7665" format="default"/> introduced the architecture of a Service Function 
   Chain (SFC) in the network and defined its components. These include Classifier,
   Service Function Forwarder (SFF), Service Function (SF), and Service Function proxy.
   <xref target="RFC8924" format="default"/> provides a reference framework for Operations,
   Administration and Maintenance (OAM) for SFC.
   <xref target="I-D.fioccola-rfc8321bis" format="default"/> describes the hybrid performance measurement method,
   which can be used to measure packet loss,
   latency, and jitter on live traffic. Because this method is based on marking consecutive batches of
   packets, the procedure is often referred to as Alternate Marking Method (AMM).
      </t>
      <t>
   This document defines how packet loss and delay metrics
   of a service flow over end-to-end (E2E) Service Function Path (SFP) or any SFP segment can be measured using AMM.
  This document is aligned with the SFC OAM Performance Measurement 
   requirements defined in <xref target="RFC8924" format="default"/>. It states that any SFC-aware network device 
   must have the ability to perform loss and delay measurements over the service function chain as a unit,
   i.e., E2E, or to a specific segment of service function through the SFC. Besides, AMM
   can be used in combination with <xref target="I-D.ietf-sfc-ioam-nsh" format="default"/> complementing it in achieving the 
   SFC performance measurement objective with Network Service Header <xref target="RFC8300"/> data plane.
      </t>
    </section>
    <section numbered="true" toc="default">
      <name>Conventions used in this document</name>
      <section numbered="true" toc="default">
        <name>Acronyms</name>
        <t>AMM:        Alternate Marking Method            </t>
        <t>OAM:      Operations, Administration and Maintenance</t>
        <t>SFC:      Service Function Chain</t>
        <t>SFP:      Service Function Path</t>
        <t>SF:       Service Function</t>
        <t>SFF:      Service Function Forwarder</t>
        <t>SPI:       Service Path Identifier</t>
        <t>NSH:     Network Service Header</t>
        <t>E2E         end-to-end</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>Mark Field in NSH Base Header</name>
      <t>
  <xref target="RFC8300" format="default"/> defines the format of the Network Service Header (NSH).
 <!--
  The format of NSH Base is presented in <xref target="nsh-base-figure"/>.
-->
      </t>
      <figure anchor="nsh-base-figure">
        <name>NSH Base 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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |Ver|O|M|    TTL    |   Length  |U|U|U|U|MD Type|     Proto     |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
      </figure>
      <t> 
	
  This document defines the one-bit long field, referred to as Mark field (M in <xref target="nsh-base-figure" format="default"/>,
  as part of NSH Base and designated
  for the alternate marking performance measurement method <xref target="I-D.fioccola-rfc8321bis" format="default"/>. The Mark field MUST be set to
  0 at initialization of NSH and ignored on the receipt when the method is not in use.
  The Mark field MUST NOT be used in defining forwarding
  and/or quality of service treatment of an SFC packet. The Mark field MUST be used only for  the 
  performance measurement of data traffic in the SFC layer. Though the setting of the field to any value likely not affect
  forwarding and/or quality of service treatment of a packet, the alternate marking method in the SFC layer is characterized as
  an example of a hybrid performance measurement method according to <xref target="RFC7799" format="default"/>.
      </t>
      <!--
<t>
<xref target="mark-field-figure"/> displays the format of the Mark field.
</t>

<t>
	<figure align="left" anchor="mark-field-figure" title="Mark field format">
	  <artwork><![CDATA[ 
 0      
 0   1 
+-+-+-+-+
| L | D |
+-+-+-+-+
]]></artwork>                                             
	</figure> 
	where:
	<list style="symbols">
	<t>L- Loss flag;</t>
	<t>D - Delay flag.</t>
	</list>                                                                                                 
      </t>
      -->
</section>
    <section anchor="theory-of-operation" numbered="true" toc="default">
      <name>Theory of Operation</name>
      <t>
The marking method can be successfully used in the SFC.
Without limiting any generality consider SFC presented in <xref target="sfc-network" format="default"/>.
Any combination of markings, Loss and/or Delay,  can be applied to a service flow by
any SFC component at either ingress or egress point
to perform node, link, segment, or E2E measurement to detect 
performance degradation defects and localize them efficiently.
</t>
      <figure anchor="sfc-network">
        <name>SFC network</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[
 
                +---+  +---+   +---+  +---+   +---+  +---+
                |SF1|  |SF2|   |SF3|  |SF4|   |SF5|  |SF6|
                +---+  +---+   +---+  +---+   +---+  +---+
                   \   /          \  /           \  /    
   +----------+   +----+         +----+         +----+    
   |Classifier|---|SFF1|---------|SFF2|---------|SFF3|
   +----------+   +----+         +----+         +----+           

]]></artwork>
      </figure>
      <t>
      An SFP might include a Re-classifier. Processing of an SFC packet by the Re-classifier might result in
      that packet being directed to a different SFP identified, for example, by Service Path Identifier's (SPI) value A'.
      In that case, the Re-classifier MUST set the value of the Mark field
      according to the local AMM policy defined for the SPI's value A'. Note that the default
      AMM policy is to set the value of the Mark field to 0.
      </t>
      <t>
      Using the marking method, a component of the SFC creates distinct sub-flows in 
      the particular service traffic over SFC. Each sub-flow consists of consecutive 
      blocks that are unambiguously recognizable by a monitoring point at any component 
      of the SFC and can be measured to calculate packet loss and/or packet delay metrics.
      </t>
      <section anchor="sinle-tag" numbered="true" toc="default">
        <name>Single Mark Enabled Measurement</name>
        <t>
As explained in the <xref target="I-D.fioccola-rfc8321bis" format="default"/>, marking can be
applied to delineate blocks of packets
based either on the equal number of packets in a block or based on the same 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 Mark measurement used, then the Delay flag <xref target="mark-field-figure"/> MUST be set to zero on 
transmit and ignored on reception by monitoring point.
</t>
-->
<t>
The Mark flag is used to create distinctive flows to measure the packet loss by
switching the value of the Mark flag every N-th packet or at specified time intervals.
Delay metrics MAY be calculated with the alternate 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 Mark flag changes a component of the SFC 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 component of the SFC 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
</li>
          <li>
Average Packet Delay calculation: an average delay is calculated by
considering the packets' average arrival time within a single block.
A component of the SFC may collect timestamps for each packet received within 
a single block. The timestamp average is the sum of all the timestamps
divided by the total  number of packets received. Then the difference between 
averages calculated at two monitoring points is the average packet delay 
on that segment. This method is robust to out-of-order packets and
packet loss (only a small error is introduced). This method only provides 
a single metric for the duration of the block, and it doesn't give the minimum 
and maximum delay values. Highly optimized implementation of the method
can reduce the duration of the block and thus overcome the limitation.
</li>
        </ul>
      </section>
      <section anchor="multiplex-tag" numbered="true" toc="default">
        <name>Multiplexed Mark Enabled Measurement</name>
        <t>
   There is also a scheme that method allows measurement of minimum and maximum delays for the monitored flow
   using a single marking flag.  This methodology is
   described in <xref target="I-D.mizrahi-ippm-compact-alternate-marking" format="default"/>. The
   concept is that in the middle of each block of packets with a certain
   value of the M flag, a single packet has the M flag inverted. By
   examining the stream, the packets with the inverted bit can be easily
   identified and employed for delay measurement.  This variation of AMM
   is advantageous because it requires only one bit
   from each packet, and such bits are always in short supply.
</t>
      </section>
      <section anchor="residence-time-sec" numbered="true" toc="default">
        <name>Residence Time Measurement with the Alternate Marking Method</name>
        <t>
Residence time is the variable part of the propagation delay that a packet experiences while traversing a network, e.g., SFC.
Residence Time over an SFC is the sum of the nodal residence times, i.e., periods that the packet spent in each SFF that
composes the SFC. The nodal residence time in SFC itself is the sum of sub-nodal residence times that the packet spent in each of SFs that are
part of the given SFC and are mapped to the SFF. The residence time and deviation of the residence time
metrics may include any combination of minimum, maximum values over the measurement period.
It also may include mean, median, and percentiles calculated values. These metrics may be used to evaluate the performance of 
the SFC and its elements before and during its operation.
</t>
        <t>
Use of the specially marked packets simplifies residence time measurement
and correlation of the measured metrics over the E2E SFC. For example,
AMM may be used as described in <xref target="multiplex-tag" format="default"/> to identify
packets in the data flow to be used to measure the residence time. The nodal and sub-nodal residence time metrics
can be locally calculated and then collected using either in-band or out-band OAM mechanisms.
</t>
      </section>
    </section>
    <section anchor="iana-considerations" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <section anchor="mark-field-iana" numbered="true" toc="default">
        <name>Mark Field in NSH Base Header</name>
        <t>This document requests IANA to allocate the one-bit field from NSH Base Header Bits <xref target="RFC8300" format="default"/> as the Mark field of NSH as the following:</t>
        <table anchor="mark-field-table" align="center">
          <name>Mark field of SFC NSH</name>
          <thead>
            <tr>
              <th align="center">Bit Position</th>
              <th align="left">Description</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="center">TBA&nbsp;</td>
              <td align="left">Mark field&nbsp;</td>
              <td align="left">This document</td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>
    <section anchor="security-considerations" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
   This document defines the use of AMM in an SFC domain and thus all security considerations
   specific to SFC discussed in <xref target="RFC7665" format="default"/> and <xref target="RFC8300" format="default"/> are applicable.
   By introducing AMM into the SFC environment, it inherits all security considerations discussed in <xref target="I-D.fioccola-rfc8321bis" format="default"/>.
   A new Mark flag is defined in this specification to be used by AMM. Processing of
   AMM does require additional computational resources and creates a certain amount
   of state information per AMM flow performance metrics. An implementation MUST provide control over the number
   of concurrent AMM flows that a node process.
      </t>
    </section>
    <section anchor="ack" numbered="true" toc="default">
      <name>Acknowledgment</name>
      <t>
   TBD
      </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.8300.xml"/>
         <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-fioccola-rfc8321bis.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <!-- <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8321.xml"/> -->
        <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-mizrahi-ippm-compact-alternate-marking.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8924.xml"/>
        <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-ietf-sfc-ioam-nsh.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7665.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7799.xml"/>
      </references>
    </references>
    <!--
    <section anchor="double-tag" title="Double Mark Enabled Measurement">
<t>
Double Mark method allows measurement of minimum and maximum delays for the monitored flow,
but it requires more nodal and network resources. If the Double Mark method used, then
the Loss flag MUST be used to create the alternate flow, i.e.,
mark more substantia batches of packets. The Delay flag
MUST be used to denote single packets to measure delay jitter.
</t>
<t>
The first marking (Loss flag alternation) is needed for packet loss and 
also for average delay measurement.  The second marking (Delay flag is put
to one) creates a new set of marked packets that are fully identified
over the SFC, so that a component can store the timestamps of these
packets; these timestamps can be compared with the timestamps of the
same packets on another element of the SFC to compute packet delay 
values for each packet. The number of measurements can be easily increased by
changing the frequency of the second marking. But the rate of the
second marking must be not too high to avoid out of order
issues. This method supports the calculation of not only the average delay but
also the minimum and maximum delay values and, in broader terms, to know
more about the statistic distribution of delay values.  
</t>
</section>
-->

 </back>
</rfc>
