<?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" docName="draft-mmm-rtgwg-integrated-oam-02" ipr="trust200902" 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="Integrated OAM">Integrated Operation, Administration, and Maintenance</title>
    <seriesInfo name="Internet-Draft" value="draft-mmm-rtgwg-integrated-oam-02"/>
    
    <author fullname="Greg Mirsky" initials="G." surname="Mirsky">
      <organization>Ericsson</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <code/>
          <country/>
        </postal>
        <email>gregimirsky@gmail.com</email>
      </address>
    </author>
    
    <author fullname="Xiao Min" initials="X." surname="Min">
      <organization>ZTE Corp.</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <code/>
          <country/>
        </postal>
        <email>xiao.min2@zte.com.cn</email>
      </address>
    </author>
    
    <author fullname="Gyan Mishra" initials="G. " surname="Mishra">
      <organization>Verizon Inc.</organization>
      <address>
        <email>gyan.s.mishra@verizon.com</email>
      </address>
    </author>
    
    <date year="2022"/>
    
    <area>Routing</area>
    <workgroup>RTGWG Working Group</workgroup>
    
    <keyword>Internet-Draft</keyword>
    <keyword>OAM</keyword>
    <keyword>Fault Management</keyword>
    <keyword>Performance Monitoring</keyword>
    
    <abstract>
      <t>
      This document describes the Integrated Operation, Administration, and Maintenance (IntOAM) protocol.
      IntOAM is based on the lightweight capabilities of Bidirectional Forwarding Detection defined in RFC 5880
      Bidirectional Forwarding Detection,
      and  the RFC 6374 Packet Loss and Delay Measurement for MPLS Networks
      to measure performance metrics like packet loss and packet delay. Also,
      a method to perform lightweight on-demand authentication is defined in this specification.
      </t>
    </abstract>
  </front>
  <middle>
    <section anchor="intro-section" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
      <xref target="RFC5880" format="default"/> has provided the base specification of a lightweight mechanism, Bidirectional Forwarding
      Detection (BFD) to monitor a path continuity between two systems
      and detect a failure in the data plane. Since its introduction, BFD has been broadly deployed.
      There were several attempts to introduce new capabilities in the protocol, some more successful than others.
      One of the obstacles to extending
      BFD capabilities may be seen in the compact format of the BFD control message.
      This document introduces the Integrated Operation, Administration, and Maintenance (IntOAM)
      protocol based on BFD's lightweight capabilities. It uses informational elements defined in <xref target="RFC6374" format="default"/>
      to measure various performance metrics, e.g., synthetic packet loss or packet delay.
Combination of both Fault Management (FM)
      Performance Monitoring (PM) OAM functions in the IntOAM protocol is beneficial in some networks.
      For example, in a Deterministic Networking (DetNet) domain
      <xref target="RFC8655" format="default"/>, it is easier to ensure that an IntOAM's
      test packet is fate-sharing with data packets
      rather than mapping several FM and PM OAM protocols to that DetNet data flow.
      </t>
    </section>
    <section numbered="true" toc="default">
      <name>Conventions used in this document</name>
      <section numbered="true" toc="default">
        <name>Acronyms</name>
        <t>BFD:        Bidirectional Forwarding Detection</t>
        <t>G-ACh     Generic Associated Channel</t>
        <t>IntOAM          Integrated OAM</t>
        <t>HMAC      Hashed Message Authentication Code</t>
        <t>MTU        Maximum Transmission Unit</t>
        <t>PMTUD   Path MTU Discovery</t>
        <t>PMTUM     Path MTU Monitoring</t>
        <t>p2p:        Point-to-Point</t>
        <t>TLV        Type, Length, Value</t>
        <t>OAM       Operations, Administration, and Maintenance</t>
        <t>FM          Fault Management</t>
        <t>PM          Performance Monitoring</t>
        <t>DetNet    Deterministic Networking</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="extended-bfd-section" numbered="true" toc="default">
      <name>Integrated OAM Control Message</name>
      
      <t>
      <xref target="extended-bfd-figure"/> displays the format of an Integrated OAM Control message.
      </t>
      
      <figure anchor="extended-bfd-figure">
        <name>Integrated OAM Control 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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
   | V |  Diag   |Sta|P|F|D|M|               Reserved              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |          Detect Mult          |            Length             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                       My Discriminator                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                      Your Discriminator                       |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                    Desired Min TX Interval                    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                   Required Min RX Interval                    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                 Required Min Echo RX Interval                 |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   ~                      TLVs   (variable)                        ~
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
      </figure>
      <t> 
      Where fields are defined as the following:
      </t>
      <ul spacing="normal">
        <li>
Version (V) - two-bit field. The definition of the field, interpretation, use in the protocol operation,
and assigned values are defined in <xref target="RFC5880" format="default"/>
for the Version field.
</li>
        <li>
Diagnostic (Diag) - five-bit field.
The definition of the field, interpretation, use in the protocol operation,
and assigned values are defined in <xref target="RFC5880" format="default"/>
for the Diagnostic field.
</li>
        <li>
Status (Sta) - two-bit field.
The definition of the field, interpretation, use in the protocol operation,
and assigned values are defined in <xref target="RFC5880" format="default"/>
for the Status field.
</li>
        <li>
Poll (P) - one-bit field
The definition of the field, its interpretation, use in the protocol operation,
and assigned values are defined in <xref target="RFC5880" format="default"/>
for the Poll field.
</li>
        <li>
Final (F) - one-bit field.
The definition of the field, interpretation, use in the protocol operation,
and assigned values are defined in <xref target="RFC5880" format="default"/>
for the Final field.
</li>
        <li>
Demand (D) - one-bit field.
The definition of the field, interpretation, use in the protocol operation,
and assigned values are defined in <xref target="RFC5880" format="default"/>
for the Demand field.
</li>
        <li>Multipoint (M) - one-bit field.
The definition of the field, interpretation, and use in the protocol operation
are defined in <xref target="RFC5880" format="default"/> for the Multipoint field.
</li>
        <li>Reserved - is a seventeen-bit field that can be defined in the future. It MUST be zeroed on transmission and ignored on receipt.</li>
        <li>
Detect Mult - two-octet field.
The definition of the field, interpretation, and use in the protocol operation
are defined in <xref target="RFC5880" format="default"/> for the Detect Mult field.
</li>
        <li>
Length - two-octet field equal to the length of the IntOAM Control message in octets.
</li>
        <li>
My Discriminator - four-octet field.
The definition of the field, interpretation, use in the protocol operation,
and assigned values are defined in <xref target="RFC5880" format="default"/>
for the My Discriminator field.
</li>
        <li>
Your Discriminator - four-octet field.
The definition of the field, interpretation, and use in the protocol operation
are as defined in <xref target="RFC5880" format="default"/>
for the Your Discriminator field.
</li>
        <li>
Desired Min TX Interval - four-octet field.
The definition of the field, interpretation, and use in the protocol operation
are as defined in <xref target="RFC5880" format="default"/>
for the Desired Min TX Interval field. Additional use cases for the Desired Min TX Interval field
described in <xref target="pm-timer-negotiation-sec" format="default"/>.
</li>
        <li>
Required Min RX Interval - four-octet field.
 The field, interpretation, and use of the protocol operation are defined in
 <xref target="RFC5880"/> for the Required Min RX Interval field.
Additional use cases for the Required Min RX Interval field
described in <xref target="pm-timer-negotiation-sec" format="default"/>.
</li>
        <li>Required Min Echo RX Interval - four-octet field.
[Ed.note: In BFD, as I understand, it serves several purposes -
indicate support of Echo (zero value - non-support) and throttle rate the remote will send its Echo.
But that only works if the Echo can be sent when the session is Up.
There's now a proposal to send Echo regardless of the session's state.
Hence, is it still a good use of four bytes?]</li>
        <li>
        TLVs - is a variable-length field that contains commands
       and/or data encoded as type-length-value (TLV) shown in <xref target="tlv-figure" format="default"/>.
       </li>
      </ul>
      <t>
         TLV is a variable-length field. Multiple TLVs MAY be placed
   in an IntOAM Control message. Additional TLVs may be enclosed within a given TLV, subject to the outer TLV's semantics.
   If more than one TLV is to be included, the value of the Type field of the outmost outer TLV MUST be set to Multiple TLVs Used (TBA0),
    as assigned by IANA according to <xref target="iana-ext-bfd-message-types-sec" format="default"/>.
       <xref target="tlv-figure" format="default"/> displays the TLV format in an IntOAM protocol.
      </t>
      
      <figure anchor="tlv-figure">
        <name>General Type-Length-Value Encoding</name>
      
        <artwork name="" type="" align="left" alt=""><![CDATA[    
       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |      Type     |    Reserved   |           Length              |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ~                            Value                              ~
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
      </figure>
      <t> 
      Where fields are defined as the following:
      </t>
      <ul spacing="normal">
        <li>
Type - one-octet field that characterizes the interpretation of the Value field.
   Type values are allocated according to <xref target="iana-ext-bfd-message-types-sec" format="default"/>.
</li>
        <li>Reserved - one-octet field. The value of the Type field determines its interpretation and encoding.</li>
        <li>
Length - two-octet field equal to the length of the Value field in octets.
</li>
        <li>
Value - a variable-length field. The value of the Type field determines its interpretation and encoding.
      </li>
      </ul>
    </section>
    <section anchor="operation-sec" numbered="true" toc="default">
      <name>Theory of Operation</name>
      <t>
[Ed.note: Should the document reference Asynchronous and Demand modes in RFC 5880?]
</t>
      <section anchor="discriminator-sec" numbered="true" toc="default">
        <name>Use of Discriminators</name>
        <t>
A discriminator is defined in the IntOAM as an unsigned 32-bit long integer that identifies a particular IntOAM session.
An IntOAM system MAY locally assign a discriminator for the given IntOAM session.
Also, a discriminator MAY be distributed by the control plane or management plane.
</t>
        <t>
In a point-to-point (p2p) IntOAM session, the value of the
Your Discriminator field is used to demultiplex IntOAM sessions.
An IntOAM system has to learn the value of discriminator that the remote IntOAM system associates with
the IntOAM session between these two systems. The IntOAM system MAY use a three-way handshake
mechanism to learn the value of the discriminator of the remote system. Besides, the control or management plane
MAY be used to associate discriminator values with the specific IntOAM session.
In other scenarios, e.g., point-to-multipoint (p2mp) IntOAM session,
the Your Discriminator's value could be left undefined for some nodes.
In that case, such a node uses the My Discriminator field's value in combination with
information that identifies the sender of the IntOAM Control message
and the path identifier.
</t>
      </section>
      <section anchor="intoam-mode-sec" numbered="true" toc="default">
        <name>Modes of IntOAM</name>
        <t>
IntOAM has two operational modes providing for proactive defect detection in a network- Asynchronous and Demand.
An IntOAM implementation MUST be capable of operating in either of them.
In the Asynchronous mode, an IntOAM system periodically transmits IntOAM Control messages.
When an IntOAM system is in Demand mode, it does not periodically transmit IntOAM Control messages.
An IntOAM system in the Demand mode MAY transmit a Control message as a part of the Poll sequence. A system
MAY be set into the Demand mode at any time during the IntOAM session.
</t>
      </section>
      <section anchor="echo-sec" numbered="true" toc="default">
        <name>Echo Function</name>
        <t>
The Echo function in IntOAM can be used in networks when an operator
has ensured that the sender's test packet will reach the intended
target before being returned to the sender. The target node is not required to support IntOAM as the IntOAM packet
is expected to be looped back by the data plane without inspecting the test packet itself. The IntOAM Control message
and IntOAM TLVs MAY be used as the test packet by the IntOAM Echo function.
</t>
      </section>
    </section>
    <section anchor="intoam-tlv-sec" numbered="true" toc="default">
      <name>Using TLVs in the IntOAM</name>
      <section anchor="ext-bfd-capability-sec" numbered="true" toc="default">
        <name>Integrated OAM Capability Negotiation</name>
        <t>
An IntOAM system, also referred to as a node in this document, that supports IntOAM first MUST
discover the extent to which other nodes in the given session support the Integrated OAM. The node MUST send
an IntOAM Control message initiating the Poll Sequence as defined in <xref target="RFC5880" format="default"/>.
If the remote system fails to respond with the IntOAM Control message and the 
Final flag set, then the initiator node MUST conclude that the peer does not
support using the IntOAM Control messages.
</t>
        <t>
The first IntOAM Control message
initiating the Poll Sequence SHOULD include the Capability TLV that lists capabilities
that may be used at some time during the lifetime of the IntOAM session.
A node MAY include TLVs in the IntOAM Control message other than the Capability TLV
once it negotiates the use of PM capabilities of the IntOAM. The format of the 
Capability TLV is presented in <xref target="capability-figure" format="default"/>.
        </t>
        <figure anchor="capability-figure">
          <name>Format of the Capability 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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
   |   Capability  |   Reserved    |           Length              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | L | D | M |                    Unassigned                     |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Authentication    ... |          Padding           ...
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
        <t> 
        Where fields are defined as the following:
        </t>
        <ul spacing="normal">
          <li>Capability - one-octet field. Its value (TBA2) allocated by IANA in <xref target="iana-ext-bfd-tlv-registry" format="default"/></li>
          <li>Reserved - one-octet field. It MUST be zeroed on the transmit and ignored on the receipt.</li>
          <li>Length - two-octet field. The value equals length on the Capability TLV in octets.
       The value of the Length field MUST be a multiple of 4.</li>
          <li>
        Loss - two-bit field. If the node can
        measure packet loss using a periodically transmitted IntOAM
        control message, then the least significant of the two bits MUST be set to 1.
        If the node can measure packet loss using the Poll Sequence
        with IntOAM Control message, then the most significant of the two bits MUST be set to 1.
        </li>
          <li>
        Delay - two-bit field. If the node can
        measure packet delay using a periodically transmitted IntOAM
        control message, then the least significant of the two bits MUST be set to 1.
        If the node can measure packet delay using the Poll Sequence
        with IntOAM Control message, then the most significant of the two bits MUST be set to 1.
        </li>
          <li>
       MTU - two-bit field. Set if the node is capable of using the IntOAM Control message in Path MTU Discovery (PMTUD).
       or PMTU Monitoring (PMTUM). If the node can
        perform PMTUD/PMTUM using periodically transmitted IntOAM
        control messages, then the least significant of the two bits MUST be set to 1.
        The most significant of the two bits is set if the node is capable
        of PMTUD/PMTUM using the Poll Sequence with IntOAM Control message.
        </li>
          <li>Unassigned - 26-bit field. It MUST be zeroed on transmission and ignored on receipt</li>
          <li>(Lightweight) Authentication - variable-length field. An IntOAM system uses the Authentication field for advertising its
        lightweight authentication capabilities.
        The format and the use of the Authentication field are defined in <xref target="auth-negotiate-sec" format="default"/>.</li>
          <li>Padding - variable-length field. The Padding field aligns
       the length of the Capability TLV to a four-octet boundary.
       It MUST be zeroed on transmission and ignored on receipt. </li>
        </ul>
        <t>
The remote IntOAM node that supports this specification MUST respond to the Capability
TLV with the IntOAM Control message, including the Capability TLV listing
capabilities the responder supports. The responder MUST set the Final flag in the
IntOAM Control message.
</t>
        <section anchor="pm-timer-negotiation-sec" numbered="true" toc="default">
          <name>Timer Negotiation for Performance Monitoring</name>
          <t>
IntOAM allows for the negotiation of time intervals at which an IntOAM system transmits and receives IntOAM Control packets.
That equally applies to packets used for performance monitoring, whether it measures packet delay or packet loss,
using TLVs defined in <xref target="pm-extended-bfd-section" format="default"/>. An IntOAM system sets its timer values in
an IntOAM Control packet that includes the Capabilities TLV.
The negotiation process is similar to the one described in <xref target="RFC5880" format="default"/>.
A local IntOAM system advertises its shortest interval for transmitting IntOAM packets to measure the indicated metrics
and the shortest interval capable of receiving PM IntOAM packets.
Suppose a system does not support the given metric measurement,
i.e., packet loss or packet delay. In that case, it MUST set the value of the Required Min RX Interval
to zero when transmitting the IntOAM Control message with the Capability TLV.
If an IntOAM system does not support one of the modes, periodic or on-demand,
for the given performance metric, it MUST zero
the appropriate bit in the field that describes the metric. The timer values apply to all PM modes
with their respective bits set in the Capacity TLV.
If an operator wants to use different time intervals for different performance metrics measurements,
then separate Poll sequences with the Capabilities TLV included MAY be used.
Thus IntOAM allows negotiating different time intervals for
packet loss and packet delay measurements.
</t>
        </section>
      </section>
      <section anchor="padding-sec" numbered="true" toc="default">
        <name>Padding TLV</name>
        <t>
Padding TLV MAY be used to generate IntOAM Control messages of the desired length.
        </t>
        <figure anchor="padding-figure">
          <name>Padding TLV Format</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[    
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
   |    Padding    |    Reserved   |           Length              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   ~                            Padding                            ~
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
        <t> 
        <xref target="padding-figure"/> displays the Padding TLV format where fields are defined as the following:
        </t>
        <ul spacing="normal">
          <li>Padding - one-octet field. Its value (TBA1) allocated by IANA in <xref target="iana-ext-bfd-tlv-registry" format="default"/></li>
          <li>Reserved - one-octet field. MUST be zeroed on the transmit and ignored on the receipt.</li>
          <li>Length - two-octet field equals length on the Padding TLV in octets. The value of the Length field MUST be a multiple of 4.</li>
          <li>Padding - variable-length field. It MUST be zeroed on transmit and ignored on receipt.</li>
        </ul>
        <t>
Padding TLV MAY be used to generate IntOAM Control messages of different lengths. That capability
is necessary to perform PMTUD, PMTUM, and measure synthetic packet loss and/or packet delay. When Padding TLV is
used in combination with one of the performance measurement messages
carried in Performance Metric TLVs as defined in <xref target="pm-extended-bfd-section" format="default"/>,
Padding TLV MUST follow the Performance Metric TLV.
</t>
        <t>
Padding TLV MAY be used in PMTUM as part of periodically sent IntOAM Control messages.
In this case, the number of consecutive messages that include Padding TLV MUST be not lesser than
Detect Multiplier to ensure that the remote IntOAM peer will detect the loss of messages with the Padding TLV.
Also, Padding TLV MAY be present in an IntOAM Control message with the Poll flag set. If the remote
IntOAM peer that supports this specification receives an IntOAM Control  message with Padding TLV,
it MUST include the Padding TLV with the Padding field of the same length as in the received packet and
set the Final flag.
</t>
      </section>
      <section anchor="diag-tlv-sec" numbered="true" toc="default">
        <name>Diagnostic TLV</name>
        <t>
Diagnostic TLV MAY be used to characterize the result of the last requested operation.
        </t>
        <figure anchor="diagnostic-figure">
          <name>Diagnostic TLV Format</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[    
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
   |   Diagnostic  |    Reserved   |           Length              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  Return Code  |                  Reserved                     |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
        <t> 
        <xref target="diagnostic-figure"/> displays the Diagnostic TLV format where fields are defined as the following:
        </t>
        <ul spacing="normal">
          <li>Diagnostic - one-octet field.Its value (TBA6) allocated by IANA in <xref target="iana-ext-bfd-tlv-registry" format="default"/>.</li>
          <li>Reserved - one-octet field. MUST be zeroed on the transmit and ignored on the receipt.</li>
          <li>Length - two-octet field. Its value MUST be set to eight.</li>
          <li>Return Code - eight-bit field. The responding IntOAM system MUST set it to one of the
       values defined in <xref target="iana-return-codes-sec" format="default"/>.</li>
          <li>Reserved - 24 bits-long field. MUST be zeroed on transmit and ignored on receipt.</li>
        </ul>
      </section>
      <section anchor="pm-extended-bfd-section" numbered="true" toc="default">
        <name>Performance Measurement with IntOAM Control Message</name>
        <t>
Loss measurement, delay measurement, and loss/delay measurement
messages can be used in the IntOAM Control message to obtain respective 
one-way and round-trip metrics. All the messages are encapsulated as TLVs with Type values
allocated by IANA, <xref target="iana-ext-bfd-tlv-registry" format="default"/>.
</t>
        <t>
The sender MAY use the Performance Metric TLV (presented in <xref target="metric-query-figure" format="default"/>)
to measure performance metrics and obtain the measurement report from the receiver.
</t>
        <figure anchor="metric-query-figure">
          <name>Performance Metric TLV Format</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[    
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
   |  Perf. Metric |    Reserved   |           Length              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                    Loss Measurement Message,                  |
   ~               Delay Measurement Message, or                   ~
   |              Combined Loss/Delay Measurement Message          |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
        <t> 
        Fields in the Performance Metric TLV are defined as the following:
        </t>
        <ul spacing="normal">
          <li>
            <t>Performance Metric - one-octet field. Valid values are TBA3 through TBA5 allocated by 
            IANA in <xref target="iana-ext-bfd-tlv-registry" format="default"/> as follows:
            </t>
            <ul spacing="normal">
              <li>TBA3 - Loss Measurement Type;</li>
              <li>TBA4 - Delay Measurement Type;</li>
              <li>TBA5 - Combined Loss/Delay Measurement Type</li>
            </ul>
          </li>
          <li>Reserved - one-octet field. MUST be zeroed on the transmit and ignored on the receipt.</li>
          <li>Length - two-octet field equals length on the Performance Metric TLV in octets.
       The value of the Length field MUST be a multiple of 4.</li>
          <li>Value - various performance metrics measured either directly or
      using synthetic methods accordingly using the messages defined in
      Sections 3.1 through 3.3 <xref target="RFC6374" format="default"/>.</li>
        </ul>
        <t>
An IntOAM node MAY periodically transmit the IntOAM
message with one of the TLVs listed above in Asynchronous mode
to perform one-way loss and/or delay measurement. To perform synthetic loss
measurement, the sender MUST monotonically increment the counter
of transmitted test packets. When using Performance Metric TLV for synthetic measurement,
an IntOAM Control message MAY include Padding TLV. In that case, the Padding TLV MUST immediately follow
Performance Metric TLV. Also, direct-mode loss measurement is supported, as described in <xref target="RFC6374"/>, 
Procedures to negotiate and manipulate transmission intervals defined in
Sections 6.8.2 and 6.8.3 in <xref target="RFC5880" format="default"/> SHOULD be used to control the performance impact
of using the IntOAM for performance measurement in the particular IntOAM session.
</t>
        <t>
An IntOAM node transmits the IntOAM Control message with the Performance Metric TLV with the Poll flag set
to measure the round-trip loss and/or delay metrics,
Before transmitting the IntOAM Control message with the Performance Metric TLV, the receiver MUST
clear the Poll flag and set the Final flag.
</t>
      </section>
      <section anchor="light-auth-sec" numbered="true" toc="default">
        <name>Lightweight Authentication</name>
        <t>
Using IntOAM without security measures, such as exchanging IntOAM Control
messages without authentication, increases the risk of an attack, especially over multiple nodes.
Thus, using IntOAM without security measures may cause false positive or false negative
defect detection situations.  In the former, an attacker may spoof IntOAM Control messages
pretending to be a remote peer and can thus view the IntOAM session operation even
though the real path had failed.  In the latter, the attacker may spoof an altered IntOAM
control message indicating that the IntOAM session is un-operational even though
the path and the remote IntOAM peer operate normally.
</t>
        <t>
BFD <xref target="RFC5880" format="default"/> allows for optional authentication protection of
BFD Control messages to minimize the chances of attacks in a networking system. However,
some supported authentication protocols do not provide sufficient protection
in modern networks. Also, the current BFD technology requires authentication of each
BFD Control message. Such an authentication requirement can put a computational
burden on networking devices, especially in the Asynchronous mode, at least because
authenticating each BFD Control message can require substantial computing resources
to support packet exchange at high rates.
</t>
        <t>
This specification defines a lightweight on-demand authentication mode for an IntOAM session.
The lightweight authentication is an optional mode.
The mechanism includes negotiation (<xref target="auth-negotiate-sec" format="default"/>) and
on-demand authentication (<xref target="on-demand-auth-sec" format="default"/>) phases. During the former,
IntOAM peers advertise supported authentication capabilities and independently select the
commonly supported mode of the authentication. In the authentication phase, each IntOAM
system transmits, at certain events or periodically, authenticated IntOAM Control messages
in Poll Sequence.
</t>
        <section anchor="auth-negotiate-sec" numbered="true" toc="default">
          <name>Lightweight Authentication Mode Negotiation</name>

          <figure anchor="authentication-encode-figure">
            <name>Lightweight Authentication Capability Field 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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  Len  | AuthL |    Authentication Mode         ...
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
          </figure>
          <t> 
          <xref target="authentication-encode-figure"/> displays the format of the Authentication field
that is part of the Capability Encoding, where fields are defined as the following:
          </t>
          <ul spacing="normal">
            <li>
        Len (Length) - four-bit field. The value of the Length field is equal to the 
        length of the Authentication field, including the Length, in octets.
        </li>
            <li>
        AuthL (Authentication Length) - four-bit field. The field's value is, in four octets long words,
        the longest authentication signature the IntOAM system can support for any of the methods
        advertised in the AuthMode field.
        </li>
            <li>
        Authentication Mode - variable-length field. It is a bit-coded field that an IntOAM system uses
        to list modes of lightweight authentication it supports.
        </li>
          </ul>
          <t>
An IntOAM system uses Capability TLV, defined in <xref target="ext-bfd-capability-sec" format="default"/>, to discover the
commonly supported mode of Lightweight Authentication. The system prpoperly sets the authentication field's values
to reflect its authentication capabilities. The IntOAM system transmits
the IntOAM Control message with Capability TLV as the first in a Poll Sequence.
The remote IntOAM system that supports this specification
receives the IntOAM Control message with the advertised
Lightweight Authentication modes and stores information locally. The system responds with the advertisement of
its Lightweight Authentication capabilities in the IntOAM Control message with the Final flag set.
Each IntOAM system uses local and received information about Lightweight Authentication capabilities
to deduce the commonly supported modes and selects from that set to use the strongest
authentication with the longest signature. If the common set is empty, i.e.,
none of supported by one IntOAM system authentication 
method is supported by another, an implementation MUST reflect this in its operational state
and SHOULD notify an operator.
</t>
        </section>
        <section anchor="on-demand-auth-sec" numbered="true" toc="default">
          <name>Using Lightweight Authentication</name>
          <t>
After IntOAM peers select an authentication mode of Lightweight Authentication, each IntOAM system
MUST use that mode to authenticate each IntOAM Control message transmitted as part of a Poll Sequence
using Lightweight Authentication TLV presented in <xref target="light-auth-tlv-figure" format="default"/>.
</t>
          <figure anchor="light-auth-tlv-figure">
            <name>Lightweight Authentication TLV Format</name>
            <artwork name="" type="" align="left" alt=""><![CDATA[    
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
   | Authentication|    Reserved   |           Length              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   ~                             HMAC                              ~
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
          </figure>
          <t> 
        Fields in <xref target="light-auth-tlv-figure"/> are defined as the following:
          </t>
          <ul spacing="normal">
            <li>Lightweight Authentication - one-octet field. Its value (TBA8) allocated by IANA in <xref target="iana-ext-bfd-tlv-registry" format="default"/></li>
            <li>Reserved - one-octet field. MUST be zeroed on the transmit and ignored on the receipt.</li>
            <li>Length - two-octet long field. The value equals the length on the Lightweight Authentication TLV field in octets.
       The value of the Length field MUST be a multiple of 4.</li>
            <li>
       HMAC (Hashed Message Authentication Code) - variable-length field.
       The value is the hash value calculated on the entire preceding IntOAM Control message data.
       </li>
          </ul>
          <t>
The Lightweight Authentication TLV MUST be
the last in an IntOAM Control message.
Padding TLV (<xref target="padding-sec" format="default"/>) MAY be used
to align the length of the IntOAM Control message,
excluding the Lightweight Authentication TLV, at a multiple of 16 boundary.
</t>
          <t>
The IntOAM system that receives the IntOAM
Control message with the Lightweight Authentication TLV
MUST first validate the .authentication by
calculating the hash over the IntOAM Control message.
If the validation succeeds, the receiver MUST transmit
the IntOAM Control message with the Final flag set
and the value of the Return code field in Diagnostic TLV
set to None value (<xref target="ext-bfd-new-return-codes-tbl" format="default"/>).
Suppose the validation of the lightweight authentication
fails. In that case, the IntOAM system MUST transmit the IntOAM
Control message with the Final flag set and the value
of the Return Code field of the Diagnostic TLV set to Lightweight
Authentication failed value (<xref target="ext-bfd-new-return-codes-tbl" format="default"/>).
The IntOAM system MUST have a control policy that defines actions when
the system receives the Lightweight Authentication failed return code.
</t>
        </section>
      </section>
    </section>
    <section anchor="iana-ext-bfd-tlv-registry" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <section anchor="iana-ext-bfd-message-types-sec" numbered="true" toc="default">
        <name>IntOAM Message Types</name>
        <t>
   IANA is requested to create the IntOAM TLV Type registry.
    All code points in the range 1 through 175 in this registry shall be allocated
    according to the "IETF Review" procedure specified in <xref target="RFC8126" format="default"/>.
    Code points in the range
     176 through 239 in this registry shall be allocated according to the "First Come First Served" procedure
     specified in <xref target="RFC8126" format="default"/>.
         The remaining code points are allocated according to <xref target="iana-extended-bfd-type-tbl" format="default"/>:
        </t>
        <table anchor="iana-extended-bfd-type-tbl" align="center">
          <name>IntOAM Type Registry</name>
          <thead>
            <tr>
              <th align="left">Value</th>
              <th align="center">Description</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">0</td>
              <td align="center">Reserved</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">1- 175</td>
              <td align="center">Unassigned</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">176 - 239</td>
              <td align="center">Unassigned</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">240 - 251</td>
              <td align="center">Experimental</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">252 - 254</td>
              <td align="center">Private Use</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">255</td>
              <td align="center">Reserved</td>
              <td align="left">This document</td>
            </tr>
          </tbody>
        </table>
        <t>
This document defines the following new values in IntOAM Type registry:</t>
        <table anchor="extended-bfd-new-type-tbl" align="center">
          <name>IntOAM Types</name>
          <thead>
            <tr>
              <th align="left">Value</th>
              <th align="center">Description</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">TBA0</td>
              <td align="center">Multiple TLVs Used</td>
              <td align="left">This&nbsp;document</td>
            </tr>
            <tr>
              <td align="left">TBA1</td>
              <td align="center">Padding</td>
              <td align="left">This&nbsp;document</td>
            </tr>
            <tr>
              <td align="left">TBA2</td>
              <td align="center">Capability</td>
              <td align="left">This&nbsp;document</td>
            </tr>
            <tr>
              <td align="left">TBA3</td>
              <td align="center">Loss Measurement</td>
              <td align="left">This&nbsp;document</td>
            </tr>
            <tr>
              <td align="left">TBA4</td>
              <td align="center">Delay Measurement</td>
              <td align="left">This&nbsp;document</td>
            </tr>
            <tr>
              <td align="left">TBA5</td>
              <td align="center">Combined Loss/Delay Measurement</td>
              <td align="left">This&nbsp;document</td>
            </tr>
            <tr>
              <td align="left">TBA6</td>
              <td align="center">Diagnostic</td>
              <td align="left">This&nbsp;document</td>
            </tr>
            <tr>
              <td align="left">TBA8</td>
              <td align="center">Lightweight Authentication</td>
              <td align="left">This&nbsp;document</td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="iana-auth-modes-sec" numbered="true" toc="default">
        <name>Lightweight Authentication Modes</name>
        <t>
    IANA is requested to create a Lightweight Authentication Modes registry.
    This registry shall allocate all code points according to the "IETF Review"
    procedure as specified in <xref target="RFC8126" format="default"/>.
        </t>
        <t>This document defines the following new values in the Lightweight Authentication Modes registry:</t>
        <table anchor="light-auth-modes-tbl" align="center">
          <name>Lightweight Authentication Modes</name>
          <thead>
            <tr>
              <th align="left">Bit Position</th>
              <th align="left">Value</th>
              <th align="center">Description</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">0</td>
              <td align="left">0x1</td>
              <td align="center">Keyed SHA-1</td>
              <td align="left">This&nbsp;document</td>
            </tr>
            <tr>
              <td align="left">1</td>
              <td align="left">0x2</td>
              <td align="center">Meticulous Keyed SHA-1</td>
              <td align="left">This&nbsp;document</td>
            </tr>
            <tr>
              <td align="left">2</td>
              <td align="left">0x4</td>
              <td align="center">SHA-256</td>
              <td align="left">This&nbsp;document</td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="iana-return-codes-sec" numbered="true" toc="default">
        <name>Return Codes</name>
        <t>
IANA is requested to create the IntOAM Return Codes registry.
All code points in the range 1 through 250 in this registry shall be allocated
    according to the "IETF Review" procedure as specified in <xref target="RFC8126" format="default"/>.
    The remaining code points are allocated according to <xref target="iana-ext-bfd-return-codes-tbl" format="default"/>:
        </t>
        <table anchor="iana-ext-bfd-return-codes-tbl" align="center">
          <name>IntOAM Return Codes Registry</name>
          <thead>
            <tr>
              <th align="left">Value</th>
              <th align="center">Description</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">0</td>
              <td align="center">Reserved</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">1- 250</td>
              <td align="center">Unassigned</td>
              <td align="left">IETF Review</td>
            </tr>
            <tr>
              <td align="left">251-253</td>
              <td align="center">Experimental</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">254</td>
              <td align="center">Private Use</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">255</td>
              <td align="center">Reserved</td>
              <td align="left">This document</td>
            </tr>
          </tbody>
        </table>
        <t>This document defines the following new values in IntOAM Return Codes registry:</t>
        <table anchor="ext-bfd-new-return-codes-tbl" align="center">
          <name>IntOAM Return Codes</name>
          <thead>
            <tr>
              <th align="left">Value</th>
              <th align="center">Description</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">0</td>
              <td align="center">None</td>
              <td align="left">This&nbsp;document</td>
            </tr>
            <tr>
              <td align="left">1</td>
              <td align="center">One or more TLVs were not understood</td>
              <td align="left">This&nbsp;document</td>
            </tr>
            <tr>
              <td align="left">2</td>
              <td align="center">Lightweight Authentication failed</td>
              <td align="left">This&nbsp;document</td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>
    <section anchor="Security" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
      The same security considerations as those described in
      <xref target="RFC5880"/>, <xref target="RFC6374"/>,  and <xref target="RFC8562"/> <!-- <xref target="RFC8563"/> -->
      apply to this document. Additionally, implementations that use a distribution of discriminators over the control or management plane
      MUST use secure channels to protect systems from an infinite number of IntOAM sessions being created.
      </t>
      <t>
      In some environments, an IntoOAM session can be instantiated using a bootstrapping mechanism supported by the control or management plane.
      As a result, the three-way handshaking mechanism between IntOAM systems is bypassed. That could cause a situation
      where one of the systems uses overaggressive transmission intervals that are not acceptable to the remote IntOAM system.
      As a result, IntOAM Control messages could be dropped, and the remote IntOAM system concludes the IntOAM session failed.
      The environment that does not use the three-way handshake mechanism to instantiate an IntOAM session MUST support
      means to balance resources used by the IntOAM.
      </t>
    </section>
    <section anchor="Acknowledgements" numbered="true" toc="default">
      <name>Acknowledgements</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.5880.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6374.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8562.xml"/>
        <!-- <?rfc include='reference.RFC.8563"?> -->
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8655.xml"/>
      </references>
    </references>
  </back>
</rfc>
