<?xml version="1.0" encoding="utf-8"?>
<?xml-model href="rfc7991bis.rnc"?>

<!DOCTYPE rfc [
  <!ENTITY nbsp   "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="std"
  docName="draft-patki-bmp-common-updates-00"
  ipr="trust200902"
  obsoletes=""
  updates=""
  submissionType="IETF"
  xml:lang="en"
  version="3">

<front>
    <title abbrev="Common BMP Messages">
    Common BMP Route-Monitoring Messages for Routes Unchanged by Policy
    </title>

    <author initials="D" surname="Patki" fullname="Dhananjay Patki">
    <organization abbrev="">Cisco Systems, Inc.</organization>
    <address>
    <postal>
    <street>Cessna Business Park SEZ, Kadubeesanahalli</street>
    <city>Bangalore</city>
    <region>Karnataka</region>
    <code>560103</code>
    <country>India</country>
    </postal>
    <email>dhpatki@cisco.com</email>
    </address>
    </author>

    <author initials="P" surname="Narasimha" fullname="Prasad S. Narasimha">
    <organization abbrev="">Cisco Systems, Inc.</organization>
    <address>
    <postal>
    <street>Cessna Business Park SEZ, Kadubeesanahalli</street>
    <city>Bangalore</city>
    <region>Karnataka</region>
    <code>560103</code>
    <country>India</country>
    </postal>
    <email>snprasad@cisco.com</email>
    </address>
    </author>

    <date year="2024" />
    <area>Routing</area>
    <workgroup>GROW</workgroup>


    <!--  SECTION 0:  Abstract  -->
    <abstract>
    <t>
    <xref target="RFC7854"/> and <xref target="RFC8671"/> define Pre-Policy
    Adj-RIB-In, Post-Policy Adj-RIB-In, Pre-Policy Adj-RIB-Out and Post-Policy
    Adj-RIB-Out Route-Monitoring messages. A route unmodified by the inbound
    policy is included both in Pre-Policy Adj-RIB-In as well as Post-Policy
    Adj-RIB-In Route-Monitoring messages when both the Pre-Policy and Post-Policy
    Route-Monitoring modes are enabled. Similarly, a route unmodified by the
    outbound policy is included in Pre-Policy Adj-RIB-Out as well as
    Post-Policy Adj-RIB-Out Route-Monitoring messages. To avoid duplicate
    inclusion of routes unmodified by policy either in Adj-RIB-In or Adj-RIB-Out this
    document defines two methods.
    </t>
    </abstract>
</front>

<middle>

<section anchor="introduction" title="Introduction">
    <t>
    <xref target="RFC7854"/> defined Pre-Policy and Post-Policy Adj-RIB-In
    Route-Monitoring messages, whereas <xref target="RFC8671"/> defined
    Pre-Policy and Post-Policy Adj-RIB-Out Route-Monitoring messages.
    If both Pre-Policy and Post-Policy Route-Monitoring modes are enabled
    on a device for a RIB (Adj-RIB-In or Adj-RIB-Out), the routes are
    included in both Pre-Policy and Post-Policy Route-Monitoring messages,
    even if the routes remains unmodified as a result of the application
    of policy.
    </t>
    <t>
    The optimization proposed in this document will help reduce the
    number of Route-Monitoring messages sent up to 2 times in the best
    case when policy does not modify any of the routes. The exact reduction
    in number of messages depends on the policy being used.

    The higher number of Route-monitoring messages impacts the
    performance/convergence of BMP and increases the load on the transport
    layers and the network connecting to the BMP server. Reducing this will
    aid in improving the BGP, BMP and network performance and scalability.
    </t>
    <t>
    To avoid sending duplicate unmodified routes in the Post-Policy
    Route-Monitoring messages, we introduce in this document two alternate
    methods based on:
    </t>
    <ul>
    <li>Common Update Flag, or C flag, in the Per-Peer header</li>
    <li>Common Update TLV based on <xref target="I-D.ietf-grow-bmp-tlv"/></li>
    </ul>
    <t>
    When the Monitored Router does not have TLV support as defined by
    <xref target="I-D.ietf-grow-bmp-tlv"/>, the method using the Common Update
    Flag MAY be used. When the Monitored Router does support TLV, either of
    the two methods MAY be used. However, it is to be noted that the two
    methods are mutually exclusive.
    </t>

    <section title="Requirements Language">
        <t>
        The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
        document are to be interpreted as described in <xref target="RFC2119"/>.
        </t>
    </section>
</section>

<section anchor="cflag" title="Common Update Flag in Peer Flags">
    <t>
    The per-peer header has the same structure and flags as defined in
    <xref target="RFC8671" section="4" sectionFormat="of"/>
    with the addition of the C flag in the Peer Flags in the Per-Peer
    Header as shown here.
    </t>

    <artwork>
     0 1 2 3 4 5 6 7
    +-+-+-+-+-+-+-+-+
    |V|L|A|O|C| Resv|
    +-+-+-+-+-+-+-+-+
    </artwork>

    <ul>
      <li>
        The C flag, when set to 0, indicates that the BGP Update PDU that follows the
        common BMP header and per-peer header in the Route-Monitoring message
        reflects either the Pre-Policy or the Post-Policy view as indicated by the
        L flag.
      </li>
      <li>
        The C flag, when set to 1, indicates that the BGP Update PDU that follows the
        common BMP header and per-peer header in the Route-Monitoring message
        is the same for Pre-Policy and Post-Policy views. The C flag and the L flag
        are mutually exclusive. When the C flag is set to 1, the L flag has no
        significance and MUST be transmitted as 0 and its value MUST be ignored on receipt.
      </li>
      <li>
        If the C flag is set to 1 and the O flag is set to 0, then it indicates that
        the BGP Update PDU reflects the Adj-RIB-In route which is the same for both
        Pre-Policy and Post-Policy views.
      </li>
      <li>
        If the C flag is set to 1 and the O flag is set to 1, then it indicates that
        the BGP Update PDU reflects the Adj-RIB-Out route which is the same for both
        Pre-Policy and Post-Policy views.
      </li>
    </ul>
    <t>
      Note that the C flag can be used only if the BGP Update PDU is common between
      Pre-Policy and Post-Policy Adj-RIB-In or Pre-Policy and Post-Policy Adj-RIB-Out.
      It does not allow for indicating a BGP Update PDU that is common between
      Adj-RIB-In and Adj-RIB-Out.
    </t>
</section>

<section anchor="ctlv" title="Common Update TLV">
  <t>
  Here we define a new TLV named Common Update TLV using the TLV construct defined in
  <xref target="I-D.ietf-grow-bmp-tlv" sectionFormat="of" section="4.2"/> as
  an alternative to C flag method proposed above. In addition to
  allowing sharing a common BGP Update PDU between pre-policy and post-policy modes
  of Adj-RIB-In and the same for Adj-RIB-Out like the Common Update Flag method,
  this method is extensible in allowing sharing across Adj-RIB-In and Adj-R-RIB-Out
  views, though we see it being used rarely.
  </t>
  <t>
  The TLV has Index zero (0) which specifies that a TLV applies to all NLRIs
  contained in the BGP Update PDU. The value of the TLC defines flags that
  are described below.
  </t>
  <figure anchor="ctlvfig" title="Common Update TLV">
  <artwork>
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |            Type=TBD2            |          Length = 3         |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |             Index=0             |I|J|O|P|  Resv |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  </artwork>
  </figure>
  <ul>
    <li>
      When I flag is set, it indicates that the BGP Update PDU reflects
      the Pre-Policy Adj-RIB-In view of all contained NLRIs
    </li>
    <li>
      When J flag is set, it indicates that the BGP Update PDU reflects
      the Post-Policy Adj-RIB-In view of all contained NLRIs
    </li>
    <li>
      When O flag is set, it indicates that the BGP Update PDU reflects
      the Pre-Policy Adj-RIB-Out view of all contained NLRIs
    </li>
    <li>
      When P flag is set, it indicates that the BGP Update PDU reflects
      the Post-Policy Adj-RIB-Out view of all contained NLRIs
    </li>
    <li>
      The remaining bits are reserved for future use. They MUST be
      transmitted as 0 and their values MUST be ignored on receipt.
    </li>
  </ul>

  <section anchor="examples" title="Examples of the Common Update TLV">
    <ul>
      <li>
        When I=1, J=1, O=0, P=0 it indicates that the BGP Update PDU
        is the same for Pre-Policy and Post-Policy Adj-RIB-In views.
      </li>
      <li>
        When I=0, J=0, O=1, P=1 it indicates that the BGP Update PDU
        is the same for Pre-Policy and Post-Policy Adj-RIB-Out views.
      </li>
    </ul>
      <t>
      The following examples demonstrate sharing across Adj-RIB-In and Adj-RIB-Out views
      as well, but we anticipate this not to be used
      </t>
    <ul>
      <li>
        When I=0, J=1, O=1, P=0 it indicates that the BGP Update PDU
        is the same for Post-Policy Adj-RIB-In and Pre-Policy
        Adj-RIB-Out views.
      </li>
      <li>
        When I=0, J=1, O=1, P=1 it indicates that the BGP Update PDU
        is the same for Post-Policy Adj-RIB-In, and Pre-Policy
        and Post-Policy Adj-RIB-Out views.
      </li>
    </ul>
  </section>
</section>

<section anchor="messages" title="BMP Messages">
    <t>
    Since the C flag is used in the context of BGP Update PDU, it has no
    significance for Peer-Up, Peer-Down, Initiation, Termination and
    Statistics Report messages. Though the Route Mirroring message contains
    a BGP Update PDU, as there is no policy execution involved in its
    transmission the C flag has no significance. In all messages
    except the Route-Monitoring message, the C flag MUST be set to 0 in the
    per-peer header during transmission and MUST be ignored on reception.
    </t>
    <t>
    Similarly, the Common Update TLV MUST not be included in the above
    listed BMP messages during transmission and MUST be ignored if found
    on reception.
    </t>

    <section anchor="routemon" title="Route Monitoring">
    <t>
    The C flag as well as the Common Update TLV are of relevance
    only in Adj-RIB-In and Adj-RIB-Out Route-Monitoring messages.
    They are of no relevance in Loc-RIB Route-Monitoring messages.
    </t>
    <t>
    The C flag and the Common Update TLV are mutually exclusive. If a Route-Monitoring
    message has C flag set to 1 and includes the Common Update TLV:
    </t>
    <ul>
      <li>
        If an implementation supports C flag and Common Update TLV, the C flag value SHOULD
        be ignored and the value of Common Update TLV SHOULD be considered.
      </li>
      <li>
        If an implementation only supports C flag but not the Common Update TLV,
        the Common Update TLV value SHOULD be ignored, and the C flag value MUST be
        considered.
      </li>
      <li>
        If an implementation only supports Common Update TLV and not the C flag,
        C flag value SHOULD be ignored and Common Update TLV value MUST be considered.
      </li>
    </ul>
    </section>

    <section anchor="stats" title="Statistics Report">
        <t>
          This document defines new statistics types that use the following bitmap
          which is used to indicate a combination of Route-Monitoring views
          for which routes are the same, i.e. unmodified by policy.
        </t>
        <figure anchor="cbmap" title="Bitmap of Route-Monitoring views">
        <artwork>
          +-+-+-+-+-+-+-+-+
          |I|J|O|P|  Resv |
          +-+-+-+-+-+-+-+-+
        </artwork>
        </figure>
        <ul>
          <li>I bit - Pre-Policy Adj-RIB-In</li>
          <li>J bit - Post-Policy Adj-RIB-In</li>
          <li>O bit - Pre-Policy Adj-RIB-Out</li>
          <li>P bit - Post-Policy Adj-RIB-Out</li>
          <li> The remaining bits are reserved for future use. They MUST be
               transmitted as 0 and their values MUST be ignored on receipt.</li>
        </ul>
        <t>
          The following new statistics types are defined.
        </t>
        <ul>
          <li>
            Stat Type = TBD3:
            Number of routes common across a combination of Route-Monitoring
            views. The value is structured as follows:
            Bitmap of Route-Monitoring views,
            Number of routes (64-bit Gauge) common between the views
            indicated by the bitmap.

            Multiple instances of this statistics type MAY be included in the
            same Statistics Report message, each for a unique value of the bitmap.
          </li>
          <li>
            Stat Type = TBD4:
            Number of routes common across a combination of Route-Monitoring
            views per-AFI/SAFI. The value is structured as follows:
            2-byte Address Family Identifier (AFI),
            1-byte Subsequent Address Family Identifier (SAFI),
            Bitmap of Route-Monitoring views,
            Number of routes (64-bit Gauge) common between the views indicated
            by the bitmap.

            Multiple instances of this statistics type MAY be included in the
            same Statistics Report message, each for a unique value of AFI/SAFI
            and the bitmap.
          </li>
        </ul>
    </section>
</section>

<section anchor="iana" title="IANA Considerations">
    <t>
      IANA needs to assign the following new parameters to the
      <eref target="https://www.iana.org/assignments/bmp-parameters/" brackets="none">
      "BGP Monitoring Protocol (BMP) Parameters" registry</eref>.
    </t>
    <section anchor="iana-peerflags" title="Addition to BMP Peer Flags Registry">
        <t>
        IANA needs to make the following assignment for the per-peer header flag
        defined in <xref target="cflag"/> of this document:
        </t>
        <table anchor="iana1" align="left">
          <name>Addition to the "BMP Peer Flags" Registry</name>
          <thead>
            <tr>
              <th align="left" colspan="1" rowspan="1">Flag</th>
              <th align="left" colspan="1" rowspan="1">Description</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left" colspan="1" rowspan="1">TBD1</td>
              <td align="left" colspan="1" rowspan="1">C flag</td>
            </tr>
          </tbody>
        </table>
    </section>

    <section anchor="iana-bmp-tlv" title="Addition to BMP Route Monitoring TLVs">
      <t>
      IANA needs to make the following assignment for the "Common Update TLV"
      in the "BMP Route Monitoring TLVs" registry.
      </t>
      <t>
      Type = TBD2 (15 Bits): Common Update TLV
      </t>
    </section>

    <section anchor="iana-stats" title="Additions to BMP Statistics Types Registry">
      <t>
        IANA needs to make the following assignment for the statistics types
        defined in <xref target="stats"/> of this document:
      </t>
      <table anchor="iana2" align="left">
        <name>Additions to the "BMP Statistics Types" Registry</name>
        <thead>
          <tr>
            <th align="left" colspan="1" rowspan="1">Stat Type</th>
            <th align="left" colspan="1" rowspan="1">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left" colspan="1" rowspan="1">TBD3</td>
            <td align="left" colspan="1" rowspan="1">
                Number of routes common across a combination of Route-Monitoring
                views.</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">TBD4</td>
            <td align="left" colspan="1" rowspan="1">
                Number of routes common across a combination of Route-Monitoring
                views per-AFI/SAFI.</td>
          </tr>
        </tbody>
      </table>
    </section>
</section>

<section anchor="secons" title="Security Considerations">
    <t>
    This document does not add any additional security considerations.
    The considerations in <xref target="RFC7854" section="11" sectionFormat="of"/> apply to this document.
    </t>
</section>

<section anchor="ack" title="Acknowledgements">
<t>
TBD
</t>
</section>

</middle>

<back>

<references>
    <name>Normative References</name>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7854.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8671.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-grow-bmp-tlv.xml"/>
</references>

</back>
</rfc>
