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

<rfc number="0000" xmlns:xi="http://www.w3.org/2001/XInclude" category="std"
     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 BGP Monitoring Protocol (BMP)</title>

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

    <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>USA</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>USA</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>kevinmi@tencent.com</email>
      </address>
    </author>
    <author fullname="Shunwan Zhuang" initials="S" surname="Zhuang">
      <organization>Huawei</organization>
      <address>
        <postal>
          <street>Huawei Bld., 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="September" 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) defines access to only the Adj-RIB-
                In Routing Information Bases (RIBs).  This document updates the BGP
                Monitoring Protocol (BMP) RFC 7854 by adding access to the Adj-RIB-
                Out RIBs. It adds a new flag to the peer header to distinguish Adj-
                RIB-In and Adj-RIB-Out.
      </t>
    </abstract>
  </front>
  <middle>
    <section anchor="Introduction" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
                BGP Monitoring Protocol (BMP) defines monitoring of the received
                (e.g., Adj-RIB-In) Routing Information Bases (RIBs) per peer.  The
                Adj-RIB-In pre-policy conveys to a BMP receiver all RIB data before
                any policy has been applied.  The Adj-RIB-In post-policy 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 is the primary
                use-case 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
                is not feasible.

      </t>
      <t>

                BGP Monitoring Protocol (BMP) <xref target="RFC7854" format="default">RFC 7854</xref> only
                defines Adj-RIB-In being sent to BMP receivers. This document updates
                the per-peer header in <xref target="RFC7854"
		sectionFormat="of" section="4.2" /> by
		adding a new flag to distinguish Adj-RIB-In versus 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 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>
      <ul spacing="normal">
        <li>
                        Adj-RIB-Out: 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."
                    </li>
        <li>
                        Pre-Policy Adj-RIB-Out: The result before applying the outbound
                        policy to an Adj-RIB-Out. This normally would match what is in the
                        local RIB.
                    </li>
        <li>
                        Post-Policy Adj-RIB-Out: 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.
                    </li>
      </ul>
    </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 following O flag
		addition:
            
      </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 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., Adj-RIB-Out Post-Policy). Some
                    attributes are set when the BGP message is transmitted,
                    such as next-hop. Adj-RIB-Out Post-Policy <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>
                    Similarly 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 BGP peering session type (IBGP, IBGP route reflector client,
                    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 next-hop may be null, loopback, or
                    similar during 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>
                    The following new statistic types are added:

        </t>
        <ul spacing="normal">
          <li>
                            Stat Type = 14: (64-bit Gauge)
                            Number of routes in Adj-RIBs-Out Pre-Policy.
                        </li>
          <li>
                            Stat Type = 15: (64-bit Gauge)
                            Number of routes in Adj-RIBs-Out Post-Policy.
                        </li>
          <li>
                            Stat Type = 16: Number of routes
                            in per-AFI/SAFI Adj-RIB-Out Pre- Policy.  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 Adj-RIB-Out
                            Post-Policy.  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 Down and Up 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>
                        The following Peer Up message Information TLV type is added:

          </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 TLV 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 Adj-RIB-Out Post-Policy 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, this 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>
                    Instead of requiring a group name to be used, a new administrative label
                     informational TLV (<xref target="PeerUpInfoTlv" format="default"/>) is added to the Peer Up
                    message.  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 is 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 behaviour of
          an existing BMP session, ie. changes to filtering and table names,
          the session MUST be bounced with a Peer DOWN/Peer UP sequence.
    </t>
  </section>
    </section>

    <section numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
                The same considerations as in <xref target="RFC7854"
		sectionFormat="of" section="11"/> apply to this
		document. Implementations of this protocol <bcp14>SHOULD</bcp14> require to establish 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>
                This document requests that IANA assign the following new parameters
                to the <eref target="https://www.iana.org/assignments/bmp-parameters/bmp-parameters.xhtml">
                BMP parameters name space</eref>.
      </t>
      <section numbered="true" toc="default">
        <name>BMP Peer Flags</name>
        <t>
                    This document defines the following per-peer header flags (<xref target="PeerFlags" format="default"/>):

        </t>
        <ul spacing="normal">
          <li>
                            Flag 3 as O flag: The O flag indicates Adj-RIB-In if set to 0 and Adj-RIB-Out if
                            set to 1.
                        </li>
        </ul>
      </section>
      <section numbered="true" toc="default">
        <name>BMP Statistics Types</name>
        <t>
                    This document defines four statistic types for statistics
                    reporting (<xref target="StatisticsReport" format="default"/>):

        </t>
        <ul spacing="normal">
          <li>
                            Stat Type = 14: (64-bit Gauge)
                            Number of routes in Adj-RIBs-Out Pre-Policy.
                        </li>
          <li>
                            Stat Type = 15: (64-bit Gauge)
                            Number of routes in Adj-RIBs-Out Post-Policy.
                        </li>
          <li>
                            Stat Type = 16: Number of routes
                            in per-AFI/SAFI Adj-RIB-Out Pre- Policy.  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 Adj-RIB-Out
                            Post-Policy.  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 Information TLV</name>
        <t>
                    This document defines the following BMP Peer Up Information
                    TLV types (<xref target="PeerUpInfoTlv" format="default"/>):

        </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 TLV is optional.
            </t>
          </li>
        </ul>
      </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>


<artwork name="" type="" align="left" alt=""><![CDATA[
Manish Bhardwaj 
Cisco Systems 
3700 Cisco Way 
San Jose, CA 95134 
USA 
 
Email: manbhard@cisco.com 


Xianyuzheng 
Tencent 
Tencent Building, Kejizhongyi Avenue, 
Hi-techPark, Nanshan District,Shenzhen 518057, P.R.China 
 

Weiguo 
Tencent 
Tencent Building, Kejizhongyi Avenue, 
Hi-techPark, Nanshan District,Shenzhen 518057, P.R.China 


Shugang cheng 
H3C 
]]></artwork>
    </section>
  </back>
</rfc>
