<?xml version="1.0" encoding="US-ASCII"?>
<?rfc toc="yes"?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc
    category="std"
    docName="draft-ietf-bfd-stability-11"
    ipr="trust200902"
    consensus="true"
    submissionType="IETF">
  <front>
    <title abbrev="BFD Stability">BFD Stability</title>
    <author fullname="Ashesh Mishra" initials="A" surname="Mishra">
      <organization>SES</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <region/>
          <code/>
          <country/>
        </postal>
        <phone/>
        <email>mishra.ashesh@gmail.com</email>
        <uri/>
      </address>
    </author>

    <author fullname="Mahesh Jethanandani"
	    initials="M"
	    surname="Jethanandani">
      <organization>Kloud Services</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <region>CA</region>
          <code/>
          <country>USA</country>
        </postal>
        <phone/>
        <facsimile/>
        <email>mjethanandani@gmail.com</email>
      </address>
    </author>

    <author fullname="Ankur Saxena" initials="A" surname="Saxena">
      <organization>Ciena Corporation</organization>
      <address>
        <postal>
          <street>3939 North 1st Street</street>
          <city>San Jose</city>
          <region>CA</region>
          <code>95134</code>
          <country>USA</country>
        </postal>
        <phone/>
        <facsimile/>
        <email>ankurpsaxena@gmail.com</email>
        <uri>www.ciena.com</uri>
      </address>
    </author>

    <author fullname="Santosh Pallagatti" initials="S" surname="Pallagatti">
      <organization>VMware</organization>
      <address>
        <postal>
          <street/>
          <city>Bangalore</city>
          <region>Karnataka</region>
          <code>560103</code>
          <country>India</country>
        </postal>
        <phone/>
        <facsimile/>
        <email>santosh.pallagatti@gmail.com</email>
        <uri/>
      </address>
    </author>

    <author fullname="Mach Chen" initials="M" surname="Chen">
      <organization>Huawei</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <region/>
          <code/>
          <country/>
        </postal>
        <phone/>
        <facsimile/>
        <email>mach.chen@huawei.com</email>
        <uri/>
      </address>
    </author>

    <author fullname="Peng Fan" initials="P." surname="Fan">
      <organization>China Mobile</organization>
      <address>
        <postal>
          <street>32 Xuanwumen West Street</street>
          <city>Beijing</city>
          <region>Beijing</region>
          <country>China</country>
        </postal>
        <email>fanp08@gmail.com</email>
      </address>
    </author>

    <date/>

    <abstract>
      <t>This document describes extensions to the Bidirectional Forwarding
      Detection (BFD) protocol to measure BFD stability. Specifically, it
      describes a mechanism for detection of BFD packet loss.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>The Bidirectional Forwarding Detection ( <xref
      target="RFC5880">BFD)</xref> protocol operates by transmitting and
      receiving BFD control packets, generally at high frequency, over the
      datapath being monitored. In order to prevent significant data loss due
      to a datapath failure, BFD session detection time as defined in <xref
      target="RFC5880">BFD</xref> is set to the smallest feasible value.</t>

      <t>This document proposes a mechanism to detect lost packets in a BFD
      session in addition to the datapath fault detection mechanisms of BFD.
      Such a mechanism presents significant value to measure the stability of
      BFD sessions and provides data to the operators for the cause of a BFD
      failure.</t>

      <t>This document does not propose any BFD extension to measure data
      traffic loss or delay on a link or tunnel and the scope is limited to
      BFD packets.</t>
    </section>

    <section title="Terminology">
      <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 <xref
      target="RFC2119">RFC 2119</xref> and <xref target="RFC8174">RFC
      8174</xref>.</t>

      <t>The reader is expected to be familiar with the <xref
      target="RFC5880">BFD </xref>, <xref
      target="I-D.ietf-bfd-optimizing-authentication">Optimizing BFD
      Authentication </xref> and <xref
      target="I-D.ietf-bfd-secure-sequence-numbers">BFD Secure
      Sequence Numbers </xref>.</t>
    </section>

    <section title="Use Cases">
      <t>Bidirectional Forwarding Detection as defined in <xref
      target="RFC5880">BFD</xref> cannot detect any BFD packet loss if the
      loss does not last for detection time. This document proposes a method
      to detect a dropped packet on the receiver. For example, if the receiver
      receives BFD control packet k at time t but receives packet k+3 at time
      t+10ms, and never receives packet k+1 and/or k+2, then it has
      experienced a drop.</t>

      <t>This proposal enables BFD implementations to generate diagnostic
      information on the health of each BFD session that could be used to
      preempt a failure on a datapath that BFD was monitoring by allowing time
      for a corrective action to be taken.</t>

      <t>In a faulty datapath scenario, an operator can use BFD health
      information to trigger delay and loss measurement OAM protocol
      (Connectivity Fault Management (CFM) or Loss Measurement (LM)-Delay
      Measurement (DM)) to further isolate the issue.</t>
    </section>

    <section title="BFD Null-Authentication Type">
      <t>The functionality proposed for BFD stability measurement is achieved
      by appending an authentication section with the NULL Authentication type
      (as defined in <xref
      target="I-D.ietf-bfd-optimizing-authentication">Optimizing BFD
      Authentication</xref> ) to the BFD control packets that do not have
      authentication enabled.</t>
    </section>

    <section title="Theory of Operation">
      <t>This mechanism allows operators to measure the loss of BFD control
      packets.</t>

      <t>When using MD5 or SHA authentication, BFD uses an authentication
      section that carries the Sequence Number. However, if non-meticulous
      authentication is being used, or no authentication is in use, then the
      non-authenticated BFD control packets MUST include an authentication
      section with the NULL Authentication type.</t>

      <section title="Loss Measurement">
        <t>Loss measurement counts the number of BFD control packets missed at
        the receiver during any Detection Time period. The loss is detected by
        comparing the Sequence Number field in the Auth TLV (NULL or
        otherwise) in successive BFD control packets. The Sequence Number in
        each successive control packet generated on a BFD session by the
        transmitter is incremented by one. This loss count can then be exposed
        using the YANG module defined in the subsequent section.</t>

        <t>The first BFD authentication section with a non-zero sequence
        number, in a valid BFD control packet, processed by the receiver is
        used for bootstrapping the logic. When using secure sequence numbers,
        if the expected values are pre-calculated, the value must be matched
        to detect lost packets as defined in <xref
        target="I-D.ietf-bfd-secure-sequence-numbers"> BFD secure sequence
        numbers </xref>.</t>
      </section>
    </section>

    <section title="ietf-bfd-stability YANG Module">
      <section title="Data Model Overview">
        <t>This YANG module augments the "ietf-bfd" module to add the loss
        count to the per-session or lsp for BFD packets that are lost.</t>

        <t><figure>
            <artwork><![CDATA[
module: ietf-bfd-stability

  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bfd:bfd/bfd-ip-sh:ip-sh
            /bfd-ip-sh:sessions/bfd-ip-sh:session
            /bfd-ip-sh:session-statistics:
    +--ro lost-packet-count?   yang:counter32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bfd:bfd/bfd-ip-mh:ip-mh
            /bfd-ip-mh:session-groups/bfd-ip-mh:session-group
            /bfd-ip-mh:sessions/bfd-ip-mh:session-statistics:
    +--ro lost-packet-count?   yang:counter32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bfd:bfd/bfd-lag:lag
            /bfd-lag:sessions/bfd-lag:session/bfd-lag:member-links
            /bfd-lag:micro-bfd-ipv4/bfd-lag:session-statistics:
    +--ro lost-packet-count?   yang:counter32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bfd:bfd/bfd-lag:lag
            /bfd-lag:sessions/bfd-lag:session/bfd-lag:member-links
            /bfd-lag:micro-bfd-ipv6/bfd-lag:session-statistics:
    +--ro lost-packet-count?   yang:counter32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bfd:bfd/bfd-mpls:mpls
            /bfd-mpls:session-groups/bfd-mpls:session-group
            /bfd-mpls:sessions/bfd-mpls:session-statistics:
    +--ro lost-packet-count?   yang:counter32
]]></artwork>
          </figure></t>
      </section>

      <section title="YANG Module">
        <t>This YANG module imports <xref target="RFC6991">Common YANG
        Types</xref>, <xref target="RFC8349">A YANG Data Model for
        Routing</xref>, and <xref target="RFC9314">YANG Data Model
        for Bidirectional Forwading Detection (BFD)</xref>.</t>

        <t><figure>
            <artwork><![CDATA[
<CODE BEGINS> file "ietf-bfd-stability@2024-01-23.yang"
module ietf-bfd-stability {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-bfd-stability";
  prefix "bfds";

  import ietf-yang-types {
    prefix "yang";
    reference
      "RFC 6991: Common YANG Data Types";
  }
  
  import ietf-routing {
    prefix "rt";
    reference
      "RFC 8349: A YANG Data Model for Routing Management
       (NMDA version)";
  }

  import ietf-bfd {
    prefix bfd;
    reference
      "RFC 9314: YANG Data Model for Bidirectional
       Forwarding Detection.";
  }

  import ietf-bfd-ip-sh {
    prefix bfd-ip-sh;
    reference
      "RFC 9314: YANG Data Model for Bidirectional
       Forwarding Detection.";
  }

  import ietf-bfd-ip-mh {
    prefix bfd-ip-mh;
    reference
      "RFC 9314: YANG Data Model for Bidirectional
       Forwarding Detection.";
  }

  import ietf-bfd-lag {
    prefix bfd-lag;
    reference
      "RFC 9314: YANG Data Model for Bidirectional
       Forwarding Detection.";
  }

  import ietf-bfd-mpls {
    prefix bfd-mpls;
    reference
      "RFC 9314: YANG Data Model for Bidirectional
       Forwarding Detection.";
  }

  organization
    "IETF BFD Working Group";

  contact
    "WG Web:   <http://tools.ietf.org/wg/bfd>
     WG List:  <bfd@ietf.org>

     Authors: Mahesh Jethanandani (mjethanandani@gmail.com)
              Ashesh Mishra (mishra.ashesh@gmail.com)
              Ankur Saxena (ankurpsaxena@gmail.com)
              Santosh Pallagatti (santosh.pallagati@gmail.com)
              Mach Chen (mach.chen@huawei.com)
              Peng Fan (fanp08@gmail.com).";
              

  description
    "This YANG module augments the base BFD YANG model to add
     attributes related to BFD Stability. In particular it adds a
     a per session count for BFD packets that are lost.

     Copyright (c) 2024 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject to
     the license terms contained in, the Revised BSD License set
     forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX
     (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself
     for full legal notices.

     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 (RFC 2119) (RFC 8174) when, and only when,
     they appear in all capitals, as shown here.";

  revision "2024-01-23" {
    description
      "Initial Version.";
    reference
      "RFC XXXX, BFD Stability.";
  }

  augment "/rt:routing/rt:control-plane-protocols/" +
          "rt:control-plane-protocol/bfd:bfd/bfd-ip-sh:ip-sh/" +
          "bfd-ip-sh:sessions/bfd-ip-sh:session/" +
          "bfd-ip-sh:session-statistics" {
    leaf lost-packet-count {
      type yang:counter32;
      description
        "Number of BFD packets that were lost without bringing the
         session down.";
    }
    description
      "Augment the 'bfd' container to add attributes related to BFD
       stability.";
  }

  augment "/rt:routing/rt:control-plane-protocols/" +
          "rt:control-plane-protocol/bfd:bfd/bfd-ip-mh:ip-mh/" +
          "bfd-ip-mh:session-groups/bfd-ip-mh:session-group/" +
          "bfd-ip-mh:sessions/bfd-ip-mh:session-statistics" {
    leaf lost-packet-count {
      type yang:counter32;
      description
        "Number of BFD packets that were lost without bringing the
         session down.";
    }
    description
      "Augment the 'bfd' container to add attributes related to BFD
       stability.";
  }

  augment "/rt:routing/rt:control-plane-protocols/" +
          "rt:control-plane-protocol/bfd:bfd/bfd-lag:lag/" +
          "bfd-lag:sessions/bfd-lag:session/bfd-lag:member-links/" +
          "bfd-lag:micro-bfd-ipv4/bfd-lag:session-statistics" {
    leaf lost-packet-count {
      type yang:counter32;
      description
        "Number of BFD packets that were lost without bringing the
         session down.";
    }
    description
      "Augment the 'bfd' container to add attributes related to BFD
       stability.";
  }

  augment "/rt:routing/rt:control-plane-protocols/" +
          "rt:control-plane-protocol/bfd:bfd/bfd-lag:lag/" +
          "bfd-lag:sessions/bfd-lag:session/bfd-lag:member-links/" +
          "bfd-lag:micro-bfd-ipv6/bfd-lag:session-statistics" {
    leaf lost-packet-count {
      type yang:counter32;
      description
        "Number of BFD packets that were lost without bringing the
         session down.";
    }
    description
      "Augment the 'bfd' container to add attributes related to BFD
       stability.";
  }

  augment "/rt:routing/rt:control-plane-protocols/" +
          "rt:control-plane-protocol/bfd:bfd/bfd-mpls:mpls/" +
          "bfd-mpls:session-groups/bfd-mpls:session-group/" +
          "bfd-mpls:sessions/bfd-mpls:session-statistics" {
    leaf lost-packet-count {
      type yang:counter32;
      description
        "Number of BFD packets that were lost without bringing the
         session down.";
    }
    description
      "Augment the 'bfd' container to add attributes related to BFD
       stability.";
  }
}
<CODE ENDS>
]]></artwork>
          </figure></t>
      </section>
    </section>

    <section title="IANA Considerations">
      <section title="The &quot;IETF XML&quot; Registry">
        <t>This document registers one URIs in the "ns" subregistry of the
        "IETF XML" registry <xref target="RFC3688"/>. Following the format in
        <xref target="RFC3688"/>, the following registration is requested:</t>

        <t><figure>
            <artwork><![CDATA[URI: urn:ietf:params:xml:ns:yang:ietf-bfd-stability
Registrant Contact: The IESG
XML: N/A, the requested URI is an XML namespace.
]]></artwork>
          </figure></t>
      </section>

      <section title="The &quot;YANG Module Names&quot; Registry">
        <t>This document registers one YANG modules in the "YANG Module Names"
        registry <xref target="RFC6020"/>. Following the format in <xref
        target="RFC6020"/>, the following registrations are requested:</t>

        <t><figure>
            <artwork><![CDATA[
name:         ietf-bfd-stability
namespace:    urn:ietf:params:xml:ns:yang:ietf-bfd-stability
prefix:       bfds
reference:    RFC XXXX
]]></artwork>
          </figure></t>
      </section>
    </section>

    <section title="Security Consideration">
      <t>The YANG module specified in this document defines a schema for data
      that is designed to be accessed via network management protocols such as
      <xref target="RFC6241">NETCONF</xref> or <xref
      target="RFC8040">RESTCONF</xref>. The lowest NETCONF layer is the secure
      transport layer, and the mandatory-to-implement secure transport is
      <xref target="RFC6242">Secure Shell (SSH)</xref>. The lowest RESTCONF
      layer is HTTPS, and the mandatory-to-implement secure transport is <xref
      target="RFC8446">TLS</xref>. The <xref target="RFC8341">NETCONF Access
      Control Model (NACM)</xref> provides the means to restrict access for
      particular NETCONF or RESTCONF users to a preconfigured subset of all
      available NETCONF or RESTCONF protocol operations and content.</t>

      <t>The YANG module does not define any writeable/creatable/deletable
      data nodes.</t>

      <t>The only readable data nodes in YANG module may be considered
      sensitive or vulnerable in some network environments. It is thus
      important to control read access (e.g., via get, get-config, or
      notification) to these data nodes. The model does not define any
      readable subtrees and data nodes.</t>

      <t>The YANG module does not define any RPC operations.</t>
    </section>

    <section title="Contributors">
      <t>Manav Bhatia</t>
    </section>

    <section title="Acknowledgements">
      <t>Authors would like to thank Nobo Akiya, Jeffery Haas, Dileep Singh,
      Basil Saji, Sagar Soni, Albert Fu and Mallik Mudigonda who also
      contributed to this document.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include='reference.RFC.2119.xml'?>

      <?rfc include='reference.RFC.3688.xml'?>

      <?rfc include='reference.RFC.5880.xml'?>

      <?rfc include='reference.RFC.6020.xml'?>

      <?rfc include='reference.RFC.6241.xml'?>

      <?rfc include='reference.RFC.6242.xml'?>

      <?rfc include='reference.RFC.6991.xml'?>

      <?rfc include='reference.RFC.8040.xml'?>

      <?rfc include='reference.RFC.8174.xml'?>

      <?rfc include='reference.RFC.8341.xml'?>

      <?rfc include='reference.RFC.8349.xml'?>

      <?rfc include='reference.RFC.8446.xml'?>

      <?rfc include='reference.RFC.9314.xml'?>
      <?rfc include='reference.I-D.ietf-bfd-optimizing-authentication.xml'?>

      <?rfc include='reference.I-D.ietf-bfd-secure-sequence-numbers.xml'?>


    </references>
  </back>
</rfc>
