<?xml version='1.0' encoding='utf-8'?>

<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">

<rfc number="8671" xmlns:xi="http://www.w3.org/2001/XInclude" category="std"
     docName="draft-ietf-grow-bmp-adj-rib-out-07" ipr="trust200902" consensus="true"
     submissionType="IETF" updates="7854" obsoletes="" xml:lang="en"
     tocInclude="true" symRefs="true" sortRefs="true" version="3">

  <!-- xml2rfc v2v3 conversion 2.27.1 -->
  <front>
    <title abbrev="BMP Adj-RIB-Out">
            Support for Adj-RIB-Out in the BGP Monitoring Protocol (BMP)</title>


    <seriesInfo name="RFC" value="8671" />

    <author fullname="Tim Evens" initials="T" surname="Evens">
      <organization>Cisco Systems</organization>
      <address>
        <postal>
          <street>2901 Third Avenue, Suite 600</street>
          <city>Seattle</city>
          <region>WA</region>
          <code>98121</code>
          <country>United States of America</country>
        </postal>
        <email>tievens@cisco.com</email>
      </address>
    </author>
    <author fullname="Serpil Bayraktar" initials="S" surname="Bayraktar">
      <organization>Cisco Systems</organization>
      <address>
        <postal>
          <street>3700 Cisco Way</street>
          <city>San Jose</city>
          <region>CA</region>
          <code>95134</code>
          <country>United States of America</country>
        </postal>
        <email>serpil@cisco.com</email>
      </address>
    </author>
    <author fullname="Paolo Lucente" initials="P" surname="Lucente">
      <organization>NTT Communications</organization>
      <address>
        <postal>
          <street>Siriusdreef 70-72</street>
          <city>Hoofddorp</city>
          <code>2132</code>
          <region>WT</region>
          <country>NL</country>
        </postal>
        <email>paolo@ntt.net</email>
      </address>
    </author>
    <author fullname="Penghui Mi" initials="P" surname="Mi">
      <organization>Tencent</organization>
      <address>
        <postal>
          <street>Tengyun Building, Tower A, No. 397 Tianlin Road</street>
          <city>Shanghai</city>
          <code>200233</code>
          <region/>
          <country>China</country>
        </postal>
        <email>Penghui.Mi@gmail.com</email>
      </address>
    </author>
    <author fullname="Shunwan Zhuang" initials="S" surname="Zhuang">
      <organization>Huawei</organization>
      <address>
        <postal>
          <street>Huawei Building, No.156 Beiqing Rd.</street>
          <city>Beijing</city>
          <code>100095</code>
          <region/>
          <country>China</country>
        </postal>
        <email>zhuangshunwan@huawei.com</email>
      </address>
    </author>
    <date month="November" year="2019"/>

    <area>General</area>
    <workgroup>Global Routing Operations</workgroup>
    <keyword>BGP</keyword>
    <keyword>BMP</keyword>
    <keyword>adj-rib-out</keyword>

    <abstract>
      <t>
                The BGP Monitoring Protocol (BMP) only defines access to the
                Adj-RIB-In Routing Information Bases (RIBs).  This document
                updates BMP (RFC 7854) by adding access to the Adj-RIB-Out
                RIBs. It also adds a new flag to the peer header to
                distinguish between Adj-RIB-In and Adj-RIB-Out.
      </t>
    </abstract>
  </front>
  <middle>
    <section anchor="Introduction" numbered="true" toc="default">
      <name>Introduction</name>


      <t>
                The BGP Monitoring Protocol (BMP) defines monitoring of the received
                (e.g., Adj-RIB-In) Routing Information Bases (RIBs) per peer.  
                The pre-policy Adj-RIB-In conveys to a BMP receiver all RIB data before
                any policy has been applied.  The post-policy Adj-RIB-In conveys to a
                BMP receiver all RIB data after policy filters and/or modifications
                have been applied.  An example of pre-policy versus post-policy is
                when an inbound policy applies attribute modification or filters.
                Pre-policy would contain information prior to the inbound policy
                changes or filters of data. Post-policy would convey the changed data
                or would not contain the filtered data.
      </t>
      <t>

                Monitoring the received updates that the router received before any
                policy has been applied is the primary level of monitoring for most
                use cases.  Inbound policy validation and auditing are the primary
                use cases for enabling post-policy monitoring.

      </t>
      <t>

                In order for a BMP receiver to receive any BGP data, the BMP sender
                (e.g., router) needs to have an established BGP peering session and
                actively be receiving updates for an Adj-RIB-In.

      </t>
      <t>

                Being able to only monitor the Adj-RIB-In puts a restriction on what
                data is available to BMP receivers via BMP senders (e.g., routers).
                This is an issue when the receiving end of the BGP peer is not
                enabled for BMP or when it is not accessible for administrative
                reasons.  For example, a service provider advertises prefixes to a
                customer, but the service provider cannot see what it advertises via
                BMP. Asking the customer to enable BMP and monitoring of the Adj-RIB-In
                are not feasible.

      </t>
      <t>

                BMP <xref target="RFC7854" format="default"/> only
                defines Adj-RIB-In being sent to BMP receivers. This document updates
                the per-peer header defined in <xref target="RFC7854"
		sectionFormat="of" section="4.2" /> by
		adding a new flag to distinguish between Adj-RIB-In and Adj-RIB-Out. BMP
		senders use the new flag to send either Adj-RIB-In or Adj-RIB-Out.

      </t>
      <t>

                Adding Adj-RIB-Out provides the ability for a BMP sender to send to 
                BMP receivers what it advertises to BGP peers, which can be used for
                outbound policy validation and to monitor routes that were advertised.
      </t>
    </section>
    <section numbered="true" toc="default">
      <name>Terminology</name>

        <t>
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
    NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>


    </section>
    <section numbered="true" toc="default">
      <name>Definitions</name>

      <dl newline="true" spacing="normal">
        <dt>Adj-RIB-Out</dt> 
        <dd>As defined in <xref target="RFC4271" format="default"/>, "The Adj-RIBs-Out contains
                        the routes for advertisement to specific peers by means of the
                        local speaker's UPDATE messages."</dd>

        <dt>Pre-policy Adj-RIB-Out</dt> 
        <dd>The result before applying the outbound policy to an
        Adj-RIB-Out. This normally would match what is in the local RIB.</dd>

        <dt>Post-policy Adj-RIB-Out</dt> 
        <dd>The result of applying outbound policy to an Adj-RIB-Out. This
        <bcp14>MUST</bcp14> convey to the BMP receiver what is actually
        transmitted to the peer.</dd>
        
      </dl>

    </section>
    <section anchor="PeerFlags" numbered="true" toc="default">
      <name>Per-Peer Header</name>
      <t>
                The per-peer header has the same structure and flags as defined in
                <xref target="RFC7854" sectionFormat="of" section="4.2"/> with
		the addition of the O flag as shown here:
      </t>
      <artwork align="left" name="" type="" alt=""><![CDATA[
 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
|V|L|A|O| Resv  |
+-+-+-+-+-+-+-+-+
]]></artwork>
      <ul spacing="normal">
        <li>
                        The O flag indicates Adj-RIB-In if set to 0 and Adj-RIB-Out if
                        set to 1.
                    </li>
      </ul>
      <t>

                The existing flags are defined in <xref target="RFC7854"
		sectionFormat="of" section="4.2"/>, and
		the remaining bits are reserved for future use.  They <bcp14>MUST</bcp14> be transmitted as 0, and
		their values <bcp14>MUST</bcp14> be ignored on receipt.

      </t>
      <t>
                When the O flag is set to 1, the following fields in the per-peer header are
		redefined:

      </t>
      <ul spacing="normal">
        <li>
                        Peer Address: The remote IP address associated with the TCP
                        session over which the encapsulated Protocol Data Unit
			(PDU) is sent.
                    </li>

        <li>
                        Peer AS: The Autonomous System number of the peer to which the
                        encapsulated PDU is sent.
                    </li>
        <li>
                        Peer BGP ID: The BGP Identifier of the peer to which the
                        encapsulated PDU is sent.
                    </li>
        <li>
			Timestamp: The time when the encapsulated routes were advertised
      			(one may also think of this as the time when they were installed
      			in the Adj-RIB-Out), expressed in seconds and microseconds since
      			midnight (zero hour), January 1, 1970 (UTC).  If zero, the time is
			unavailable. Precision of the timestamp is
			implementation-dependent.
                    </li>
      </ul>
    </section>
    <section numbered="true" toc="default">
      <name>Adj-RIB-Out</name>
      <section numbered="true" toc="default">
        <name>Post-policy</name>
        <t>
                    The primary use case in monitoring Adj-RIB-Out is to monitor the
                    updates transmitted to a BGP peer after outbound policy has been
                    applied. These updates reflect the result after modifications and
                    filters have been applied (e.g., post-policy Adj-RIB-Out). Some
                    attributes are set when the BGP message is transmitted,
                    such as next hop. Post-policy Adj-RIB-Out <bcp14>MUST</bcp14> convey to the BMP
		    receiver what is actually transmitted to the peer.

        </t>        <t>
                    The L flag <bcp14>MUST</bcp14> be set to 1 to indicate post-policy.
        </t>
      </section>
      <section numbered="true" toc="default">
        <name>Pre-policy</name>
        <t>
                    Similar to Adj-RIB-In policy validation, pre-policy Adj-RIB-Out can
		    be used to validate and audit outbound policies. For example, a
		    comparison between pre-policy and post-policy can be used to validate
		    the outbound policy.

        </t>
        <t>
                    Depending on the BGP peering session type -- Internal BGP (IBGP), IBGP route reflector client,
                    External BGP (EBGP), BGP confederations, route server
		    client -- the candidate routes that
                    make up the pre-policy Adj-RIB-Out do not contain all
		    local RIB routes.
                    Pre-policy Adj-RIB-Out conveys only routes that are available based on
                    the peering type.  Post-policy represents the filtered/changed routes
                    from the available routes.

        </t>
        <t>
                    Some attributes are set only during transmission of the BGP message,
                    i.e., post-policy.  It is common that the next hop may be null, loopback, or
                    similar during the pre-policy phase. All mandatory attributes,
		    such as next hop,
                    <bcp14>MUST</bcp14> be either zero or have an empty length if they are unknown at the
                    pre-policy phase completion.  The BMP receiver will treat zero or empty
                    mandatory attributes as self-originated.
        </t>
        <t>

                    The L flag <bcp14>MUST</bcp14> be set to 0 to indicate pre-policy.
        </t>
      </section>
    </section>
    <section numbered="true" toc="default">
      <name>BMP Messages</name>
      <t>
                Many BMP messages have a per-peer header, but some are not
                applicable to Adj-RIB-In or Adj-RIB-Out monitoring, such as
                Peer Up and Down Notifications.  Unless otherwise defined, the
                O flag should be set to 0 in the per-peer header in BMP
                messages.
      </t>
      <section numbered="true" toc="default">
        <name>Route Monitoring and Route Mirroring</name>
        <t>
                    The O flag <bcp14>MUST</bcp14> be set accordingly to indicate if the route monitor
                    or route mirroring message conveys Adj-RIB-In or Adj-RIB-Out.
        </t>
      </section>
      <section anchor="StatisticsReport" numbered="true" toc="default">
        <name>Statistics Report</name>
        <t>
                    The Statistics Report message has a Stat Type field to indicate the
                    statistic carried in the Stat Data field. Statistics report messages
                    are not specific to Adj-RIB-In or Adj-RIB-Out and <bcp14>MUST</bcp14> have the O
                    flag set to zero. The O flag <bcp14>SHOULD</bcp14> be ignored by the BMP receiver.

        </t>
        <t>
                    This document defines the following new statistics types:

        </t>

        <ul spacing="normal">
          <li>
                            Stat Type = 14: 
                            Number of routes in pre-policy Adj-RIB-Out. This
			    statistics type is 64-bit Gauge.
                        </li>
          <li>
                            Stat Type = 15:
                            Number of routes in post-policy Adj-RIB-Out. This
			    statistics type is 64-bit Gauge.
                        </li>
          <li>
                            Stat Type = 16: Number of routes
                            in per-AFI/SAFI pre-policy Adj-RIB-Out.  The value is structured
                            as: 2-byte Address Family Identifier (AFI), 1-byte Subsequent Address Family Identifier
                            (SAFI), followed by a 64-bit Gauge.
                        </li>
          <li>
                            Stat Type = 17: Number of routes in per-AFI/SAFI
                            post-policy Adj-RIB-Out.  The value is structured
                            as: 2-byte Address Family Identifier (AFI), 1-byte
                            Subsequent Address Family Identifier (SAFI),
                            followed by a 64-bit Gauge.
                        </li>
        </ul>
      </section>
      <section numbered="true" toc="default">
        <name>Peer Up and Down Notifications</name>
        <t>
                    Peer Up and Down Notifications convey BGP peering session state to
                    BMP receivers.  The state is independent of whether or not route
                    monitoring or route mirroring messages will be sent for Adj-RIB-In,
                    Adj-RIB-Out, or both.  BMP receiver implementations <bcp14>SHOULD</bcp14> ignore the
                    O flag in Peer Up and Down Notifications.
        </t>
        <section anchor="PeerUpInfoTlv" numbered="true" toc="default">
          <name>Peer Up Information</name>
          <t>
                        This document defines the following Peer Up Information TLV type:

          </t>
          <ul spacing="normal">
            <li>
              <t>
                                Type = 4: Admin Label.
                                The Information field contains a free-form UTF-8 string whose byte
				                length is given by the Information Length field.  The value is
				                administratively assigned.  There is no requirement to terminate
				                the string with null or any other character.

              </t>
              <t>

                                Multiple Admin Labels can be included in the
                                Peer Up Notification.  When multiple Admin
                                Labels are included, the BMP receiver
                                <bcp14>MUST</bcp14> preserve their order.

              </t>
              <t>

                                The Admin Label is optional.
              </t>
            </li>
          </ul>
        </section>
      </section>
    </section>
    <section numbered="true" toc="default">
      <name>Other Considerations</name>
      <section numbered="true" toc="default">
        <name>Peer and Update Groups</name>
        <t>
                    Peer and update groups are used to group updates shared by many peers.
                    This is a level of efficiency in implementations, not a true
                    representation of what is conveyed to a peer in either pre-policy or
                    post-policy.

        </t>
        <t>

                    One of the use cases to monitor post-policy Adj-RIB-Out is to validate and continually
                    ensure the egress updates match what is expected. For example, wholesale peers should
                    never have routes with community X:Y sent to them.  In
		    this use case, there may be
                    hundreds of wholesale peers, but a single peer could have represented the group.

        </t>


        <t>
                    From a BMP perspective, it should be simple to include a group name in the Peer Up,
		            but it is more complex than that. BGP implementations have evolved to provide
		            comprehensive and structured policy grouping, such
			    as session, AFI/SAFI, and
                    template-based group policy inheritances.

        </t>
        <t>
                    This level of structure and inheritance of polices does not provide a simple peer group
                    name or ID, such as wholesale peer.

        </t>
        <t>
                    
This document defines a new Admin Label type for Peer Up Information TLVs
(<xref target="PeerUpInfoTlv" format="default"/>) that can be used instead of
requiring a group name.
These labels have administrative scope
relevance.  For example, labels "type=wholesale" and
"region=west" could be used to monitor expected policies.

        </t>
        <t>

                    Configuration and assignment of labels to peers are BGP implementation-specific.
        </t>
      </section>

    <section numbered="true" toc="default">
      <name>Changes to Existing BMP Session</name>
    <t>
          In case of any change that results in the alteration of behavior of
          an existing BMP session (i.e., changes to filtering and table names),
          the session <bcp14>MUST</bcp14> be bounced with a Peer Down/Peer Up sequence.
    </t>
  </section>
    </section>

    <section numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
                The considerations in <xref target="RFC7854"
                sectionFormat="of" section="11"/> apply to this
                document. Implementations of this protocol
                <bcp14>SHOULD</bcp14> require establishing sessions with
                authorized and trusted monitoring devices.



It is also believed that this document does
		not add any additional security considerations.
      </t>
    </section>


    <section numbered="true" toc="default">
      <name>IANA Considerations</name>


      <t>IANA has assigned the following new parameters
                to the <eref target="https://www.iana.org/assignments/bmp-parameters/">
                "BGP Monitoring Protocol (BMP) Parameters" registry</eref>.
      </t>
      <section numbered="true" toc="default">
        <name>Addition to BMP Peer Flags Registry</name>
        <t>IANA has made the following assignment for the per-peer header flag
        defined in <xref target="PeerFlags" format="default"/> of this
        document:
        </t>

<table anchor="iana1" align="left">
  <name>Addition to the "BMP Peer Flags" Registry</name>  
  <thead>
    <tr>
      <th>Flag</th>
      <th>Description</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>          
    <tr>
      <td>3</td>
      <td>O flag</td>
      <td>RFC 8671</td>
    </tr>
  </tbody>
</table>

      </section>

      <section numbered="true" toc="default">
        <name>Additions to BMP Statistics Types Registry</name>

        <t>IANA has made the following assignment for the four statistics types
        defined in <xref target="StatisticsReport" format="default"/> of this
        document:
        </t>

<table anchor="iana2" align="left"> 
  <name>Additions to the "BMP Statistics Types" Registry</name>    
  <thead>
    <tr>
      <th>Stat Type</th>    
      <th>Description</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>          
    <tr>
      <td>14</td>
      <td>Number of routes in pre-policy Adj-RIB-Out</td>
      <td>RFC 8671</td>
    </tr>
    <tr>
      <td>15</td>
      <td>Number of routes in post-policy Adj-RIB-Out</td>
      <td>RFC 8671</td>
    </tr>
    <tr>
      <td>16</td>
      <td>Number of routes in per-AFI/SAFI pre-policy Adj-RIB-Out</td>
      <td>RFC 8671</td>
    </tr>
    <tr>
      <td>17</td>
      <td>Number of routes in per-AFI/SAFI post-policy Adj-RIB-Out</td>
      <td>RFC 8671</td>
    </tr>
  </tbody>
</table>

      </section>

      <section numbered="true" toc="default">
        <name>Addition to BMP Initiation Message TLVs Registry</name>
        <t>IANA has made the following assignment per
        <xref target="PeerUpInfoTlv"
        format="default"/> of this document:
        </t>

<table anchor="iana3" align="left">  
  <name>Addition to the "BMP Initiation Message TLVs" Registry</name>    
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>          
    <tr>
      <td>4</td>
      <td>Admin Label</td>
      <td>RFC 8671</td>
    </tr>
  </tbody>
</table>

      </section>
    </section>
  </middle>
  <back>
    <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.4271.xml"/>

<xi:include
    href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7854.xml"/>

<xi:include
    href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>


    </references>
    <section anchor="Acknowledgements" numbered="false" toc="default">
      <name>Acknowledgements</name>
      <t>
                The authors would like to thank John Scudder and Mukul Srivastava for their
		valuable input.
      </t>
    </section>
    <section anchor="Contributors" numbered="false" toc="default">
      <name>Contributors</name>

<t>The following individuals contributed to this document:
</t>

<ul spacing="normal">
   <li>Manish Bhardwaj, Cisco Systems</li>

   <li>Xianyu Zheng, Tencent</li>

   <li>Wei Guo, Tencent</li>

   <li>Shugang Cheng, H3C</li>
</ul>

    </section>

  </back>
</rfc>
