<?xml version='1.0' encoding='utf-8'?>
<rfc ipr="trust200902" docName="draft-saum-grow-bmp-afi-safi-evpn-04" category="std" submissionType="IETF" consensus="true">
  <front>
    <title abbrev="EVPN BMP Stats">EVPN-Specific BMP RIB Statistics Extensions</title>
    <author initials="S." surname="Dikshit" fullname="Saumya Dikshit">
      <organization>Aruba Networks, HPE</organization>
      <address>
        <postal>
          <street>Mahadevpura</street>
          <city>Bangalore</city>
          <region>Karnataka</region>
          <code>560 048</code>
          <country>India</country>
        </postal>
        <email>saumya.dikshit@hpe.com</email>
      </address>
    </author>
    <author initials="M." surname="Srivastava" fullname="Mukul Srivastava">
      <organization>Hewlett Packard Enterprise</organization>
      <address>
        <postal>
          <street>10 Technology Park Dr</street>
          <city>Westford</city>
          <region>MA</region>
          <code>01886</code>
          <country>United States of America</country>
        </postal>
        <email>mukul.srivastava@hpe.com</email>
      </address>
    </author>
    <author initials="C." surname="Lin" fullname="Changwang Lin" >
      <organization>New H3C Technologies</organization>
      <address>
        <postal>
          <street>8 Yongjia North Road</street>
          <city>Beijing</city>
          <region>Haidian District</region>
          <code>100094</code>
          <country>China</country>
        </postal>
        <email>linchangwang.04414@h3c.com</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <date year="2025"/>
    <area>Routing</area>
    <workgroup>GROW</workgroup>
    <keyword>BMP, EVPN, Statistics, BGP, RIB</keyword>
    <abstract>
      <t>This document defines new EVPN-specific BGP Monitoring Protocol (BMP) statistics types. 
      These extensions include scalar counters for EVPN route types specifically, 
      while also keeping scope for defining counters which are EVPN route-type agnostic but related to BGP-EVPN RIB like, 
      number of multihoming Ethernet Segments, number of multihomed EVIs, number of aliased paths, 
      number of dynamic inter-VRF route leaking (IVRL).
       </t>
    </abstract>
  </front>
  <middle>
    <section title="Introduction" anchor="intro">
      <t><xref target="RFC7854"/> defines different BMP statistics message types and <xref target="I-D.ietf-grow-bmp-bgp-rib-stats"/> 
      extends the BMP statistics to provide more insights into the BGP RIBs.
      This document extends the BMP RIB statistics by adding EVPN-specific statistics types to monitor EVPN-related events in 
      Adj-RIB-In, Adj-RIB-Out, and Local-RIB for the EVPN address family (AFI=25, SAFI=70) as defined in <xref target="RFC7432"/> 
      and extended by <xref target="RFC9135"/> for integrated routing and bridging, forms the basis for these statistics.
      </t>
      <t>The format of the BMP statistics message remains same as defined in <xref target="RFC7854"/>.
      </t>
      <section title="Requirements Language" anchor="req-lang">
        <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"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t>
      </section>
    </section>
    <section title="EVPN-Specific BMP Statistics Extensions" anchor="evpn-stats">
      <t>This section defines EVPN-specific statistics types for BMP, applicable to the EVPN address family (AFI=25, SAFI=70).
      These statistics type for all 5 RIB views: Adj-RIB-In-Pre, Adj-RIB-In-Post, Local-RIB, Adj-RIB-Out-Pre and Adj-RIB-Out-Pre.
      and to define more specific counters other than the route-types in future. 
      </t>
      <section title="Global EVPN Route Statistics" anchor="global-evpn-stats">
      <t>The section defines global EVPN route or other information statistics, e.g., the overall Ethernet Auto-discovery Route counters.
      </t>
      <section title="Statistics Definitions" anchor="global-definition">
       <t>This section defines different statistics type for global EVPN monitoring type.
      </t>
      <t>
        <list style="symbols">
          <t>Type=TBD_01: Statistics for global EVPN routes received in Adj-RIB-In before inbound policy is applied.</t>
          <t>Type=TBD_02: Statistics for global EVPN routes in Adj-RIB-In after inbound policy is applied.</t>
          <t>Type=TBD_03: Statistics for global EVPN routes in the local RIB.</t>
          <t>Type=TBD_04: Statistics for global EVPN routes in Adj-RIB-Out before outbound policy is applied.</t>
          <t>Type=TBD_05: Statistics for global EVPN routes in Adj-RIB-Out after outbound policy is applied.</t>
          <t>Type=TBD_06: Statistics for global EVPN information of ESs/EVIs/aliased paths.</t>
          </list>
      </t>
      </section>
      <section title="Statistics Format" anchor="global-format">
      <t>The statistics values are encoded as 1-octet Stats types, 1-octet Stats Subtype followed by 64-bit gauges.
         The statistics values are encoded in Stat Data as defined in 4.8 of <xref target="RFC7854"/>.
         Each counter is encoded as follows:
      </t>
      <figure>
        <artwork align="center" name="Figure 1"><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stats Type    | Stats Subtype |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Gauge (64 bits)                         |
~                                                               ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ]]></artwork>
      </figure>
  <t>
<list style="symbols">
<t>
     Stats Type (1 octet): EVPN stats type.
     Defined types are:
<list style="symbols">
<t>
      Type = 0: EVPN route statistics in the RIB.
</t>
<t>
      Type = 1: EVPN leaked route statistics in the local RIB.
</t>
<t>
      Type = 2: EVPN multihoming Ethernet Segments (ESs) statistics.
</t>
<t>
      Type = 3: EVPN multihomed EVPN instances (EVIs) statistics.
</t>
<t>
      Type = 4: EVPN aliased paths statistics.
</t>
</list>
</t>
<t>
      Stats Subtype (1 octet): Indicates the EVPN route type associated with this statistic, as defined in 
    <list style="symbols">
<t>
      Subtype = 0: Reserved.
</t>
<t>
      Subtype = 1: EVPN route type 1 (Ethernet Auto-discovery).
</t>
<t>
      Subtype = 2: EVPN route type 2 (MAC/IP Advertisement).
</t>
<t>
      Subtype = 3: EVPN route type 3 (Inclusive Multicast Ethernet Tag Route).
</t>
<t>
      Subtype = 4: EVPN route type 4 (Ethernet Segment Route).
</t>
<t>
      Subtype = 5: EVPN route type 5 (IP Prefix Route).
</t>
<t>
      Subtype = 6: EVPN route type 6 (Selective Multicast Ethernet Tag Route).
</t>
<t>
      Subtype = 7: EVPN route type 7 (IGMP Join Synchronization Route).
</t>
<t>
      Subtype = 8: EVPN route type 8 (IGMP Leave Synchronization Route).
</t>
<t>
      Subtype = 9: EVPN route type 9 (Per-Region I-PMSI A-D route).
</t>
<t>
      Subtype = 10: EVPN route type 10 (S-PMSI A-D route).
</t>
<t>
      Subtype = 11: EVPN route type 11 (Leaf A-D route).
</t>
</list>
      Stats Subtype is only used when Stats Type is set to 0 and 1; otherwise, Stats Subtype is omitted.
      A BMP implementation MUST ignore unrecognized stat types on receipt, and
      likewise MUST ignore unexpected data in the Stat Data field.
</t>
</list>
</t>
      </section>

      </section>
      <section title="Per-EVI EVPN Route Statistics" anchor="per-evi-evpn-stats">
      <t>The section defines specific EVI EVPN route statistics, e.g., per-EVI IP Prefix Route counters.
      </t>
      <section title="Statistics Definitions" anchor="per-evi-definition">
       <t>This section defines different statistics type for per-EVI EVPN monitoring type.
      </t>
      <t>
        <list style="symbols">
          <t>Type=TBD_07: Statistics for per-EVI EVPN routes received in Adj-RIB-In before inbound policy is applied.</t>
          <t>Type=TBD_08: Statistics for per-EVI EVPN routes in Adj-RIB-In after inbound policy is applied.</t>
          <t>Type=TBD_09: Statistics for per-EVI EVPN routes in the local RIB.</t>
          <t>Type=TBD_10: Statistics for per-EVI EVPN routes in Adj-RIB-Out before outbound policy is applied.</t>
          <t>Type=TBD_11: Statistics for per-EVI EVPN routes in Adj-RIB-Out after outbound policy is applied.</t>
          </list>
      </t>
      </section>
      <section title="Statistics Format" anchor="per-evi-format">
      <t>The statistics values are encoded as 1-octet Stats types, 1-octet Stats Subtype, and 8-octet Route Distinguisher (RD) followed by 64-bit gauges.
         The statistics values are encoded in Stat Data as defined in 4.8 of <xref target="RFC7854"/>.
         Each counter is encoded as follows:
      </t>
      <figure>
        <artwork align="center" name="Figure 1"><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stats Type    | Stats Subtype |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                   Route Distinguisher (RD)                    |
|                          (8 octets)                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Gauge (64 bits)                         |
~                                                               ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ]]></artwork>
      </figure>
  <t>
<list style="symbols">
<t>
    Stats Type (1 octet): EVPN stats type, as defined in Section 2.1.2.
</t>
<t>
    Stats Subtype (1 octet): Indicates the EVPN route type associated with this statistic, as defined in Section 2.1.2.
</t>
<t>
    Route Distinguisher (RD) (8 octets): Indicates source EVI associated with the EVPN route.
    The Route Distinguisher (RD) field MUST be populated with the corresponding source EVI's RD of the EVPN route.
</t>
</list>
</t>
      </section>
      
      </section>
    </section>
    <section title="YANG Model Alignment" anchor="yang-align">
      <t>The counters defined in this document align with the EVPN YANG model described in <xref target="I-D.ietf-bess-evpn-yang-07"/>.
      Route type counters map to YANG leaves for EVPN route statistics, multihoming and IVRL counters align with Ethernet Segment and VRF-related leaves, the route-map bitmap aligns with policy-related leaves, and segment failure impact aligns with failure event counters. The referenced EVPN YANG model is expired but used due to its relevance to EVPN statistics alignment. Implementations SHOULD check for newer versions. Implementations SHOULD ensure compatibility with the YANG model for integrated monitoring.</t>
    </section>
    <section title="IANA Considerations" anchor="iana">
      <t>This document requests that IANA assign new BMP statistics types from the "BMP Statistics Type" registry for the following:</t>
      <t>
        <list style="symbols">
          <t>Type TBD_01: rib-in-pre-evpn-route-stats: Statistics for global EVPN routes received before inbound policy is applied.</t>
          <t>Type TBD_02: rib-in-post-evpn-route-stats: Statistics for global EVPN routes after inbound policy is applied.</t>
          <t>Type TBD_03: loc-rib-evpn-route-stats: Statistics for global EVPN routes in the local RIB.</t>
          <t>Type TBD_04: rib-out-pre-evpn-route-stats: Statistics for global EVPN routes before outbound policy is applied.</t>
          <t>Type TBD_05: rib-out-post-evpn-route-stats: Statistics for global EVPN routes after outbound policy is applied.</t>
          <t>Type TBD_06: rib-out-post-evpn-info-stats: Statistics for global EVPN information of ESs/EVIs/aliased paths.</t>
          <t>Type TBD_07: rib-in-pre-evpn-route-per-evi-stats: Statistics for per-EVI EVPN routes received before inbound policy is applied.</t>
          <t>Type TBD_08: rib-in-post-evpn-route-per-evi-stats: Statistics for per-EVI EVPN routes after inbound policy is applied.</t>
          <t>Type TBD_09: loc-rib-evpn-route-per-evi-stats: Statistics for per-EVI EVPN routes in the local RIB.</t>
          <t>Type TBD_10: rib-out-pre-evpn-route-per-evi-stats: Statistics for per-EVI EVPN routes before outbound policy is applied.</t>
          <t>Type TBD_11: rib-out-post-evpn-route-per-evi-stats: Statistics for per-EVI EVPN routes after outbound policy is applied.</t>
          </list>
      </t>
      <t>The 11 types are sufficient to provide generic monitoring of EVPN route types across Adj-RIB-In, Adj-RIB-Out, 
      and Local-RIB.
      </t>
    </section>
    <section title="Security Considerations" anchor="security">
      <t>The security considerations of <xref target="RFC7854"/> apply to this document. No additional security risks are introduced by these EVPN-specific statistics, including the route-map attributes bitmap.</t>
    </section>
  </middle>
  <back>
    <references title="References">
      <references title="Normative References">
        <reference anchor="RFC7854" target="https://www.rfc-editor.org/info/rfc7854">
          <front>
            <title>BGP Monitoring Protocol (BMP)</title>
            <author initials="J." surname="Scudder" fullname="John Scudder"/>
            <author initials="R." surname="Fernando" fullname="Rex Fernando"/>
            <author initials="S." surname="Stuart" fullname="Stephen Stuart"/>
            <date year="2016" month="June"/>
          </front>
          <seriesInfo name="RFC" value="7854"/>
          <seriesInfo name="DOI" value="10.17487/RFC7854"/>
        </reference>
        <reference anchor="RFC7432" target="https://www.rfc-editor.org/info/rfc7432">
          <front>
            <title>BGP MPLS-Based Ethernet VPN</title>
            <author initials="A." surname="Sajassi" fullname="Ali Sajassi"/>
            <author initials="R." surname="Aggarwal" fullname="Rahul Aggarwal"/>
            <author initials="N." surname="Bitar" fullname="Nabil Bitar"/>
            <author initials="A." surname="Isaac" fullname="Aldrin Isaac"/>
            <author initials="J." surname="Uttaro" fullname="James Uttaro"/>
            <author initials="J." surname="Drake" fullname="John Drake"/>
            <author initials="W." surname="Henderickx" fullname="Wim Henderickx"/>
            <date year="2015" month="February"/>
          </front>
          <seriesInfo name="RFC" value="7432"/>
          <seriesInfo name="DOI" value="10.17487/RFC7432"/>
        </reference>
        <reference anchor="RFC9135" target="https://www.rfc-editor.org/info/rfc9135">
          <front>
            <title>Integrated Routing and Bridging in Ethernet VPN (EVPN)</title>
            <author initials="A." surname="Sajassi" fullname="Ali Sajassi"/>
            <author initials="J." surname="Drake" fullname="John Drake"/>
            <author initials="S." surname="Boutros" fullname="Sami Boutros"/>
            <author initials="J." surname="Rabadan" fullname="Jorge Rabadan"/>
            <date year="2021" month="October"/>
          </front>
          <seriesInfo name="RFC" value="9135"/>
          <seriesInfo name="DOI" value="10.17487/RFC9135"/>
        </reference>
        <reference anchor="I-D.ietf-grow-bmp-bgp-rib-stats" target="https://datatracker.ietf.org/doc/html/draft-ietf-grow-bmp-bgp-rib-stats-15">
          <front>
            <title>Definition For New BGP Monitoring Protocol (BMP) Statistics Types</title>
            <author initials="M." surname="Srivastava" fullname="Manish Srivastava"/>
            <author initials="Y." surname="Liu" fullname="Ying Liu"/>
            <author initials="C." surname="Lin" fullname="Camilo Lin"/>
            <author initials="J." surname="Li" fullname="Jian Li"/>
            <date year="2025" month="April"/>
          </front>
          <seriesInfo name="Work in Progress" value="draft-ietf-grow-bmp-bgp-rib-stats-15"/>
        </reference>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author initials="S." surname="Bradner" fullname="Scott Bradner"/>
            <date year="1997" month="March"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author initials="B." surname="Leiba" fullname="Barry Leiba"/>
            <date year="2017" month="May"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references title="Informative References">
        <reference anchor="I-D.ietf-bess-evpn-yang-07" target="https://datatracker.ietf.org/doc/html/draft-ietf-bess-evpn-yang-07">
          <front>
            <title>Yang Data Model for EVPN</title>
            <author initials="P." surname="Brissette" fullname="Patrice Brissette"/>
            <author initials="H." surname="Shah" fullname="Hiren Shah"/>
            <author initials="I." surname="Chen" fullname="Ing-Wher Chen"/>
            <author initials="K." surname="Patel" fullname="Keyur Patel"/>
            <date year="2019" month="March"/>
          </front>
          <seriesInfo name="Work in Progress" value="draft-ietf-bess-evpn-yang-07"/>
        </reference>
      </references>
    </references>
  </back>
</rfc>
