<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
        <!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
        <!ENTITY RFC8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
	<!ENTITY IANA_REL_CODE_BGP_PDU "TBD1">
	<!ENTITY IANA_REL_CODE_EVENT_REASON "TBD2">
]>

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>

<rfc category="std" docName="draft-lucente-grow-bmp-rel-00"
     ipr="trust200902" submissionType="IETF"
     updates="7854">

    <front>
        <title abbrev="BMP REL">
	    Logging of routing events in BGP Monitoring Protocol (BMP)
	</title>

        <author fullname="Paolo Lucente" initials="P" surname="Lucente">
            <organization>NTT</organization>
            <address>
                <postal>
                    <street>Veemweg 23</street>
                    <city>Barneveld</city>
                    <code>3771</code>
                    <region>MT</region>
                    <country>NL</country>
                </postal>
                <email>paolo@ntt.net</email>
            </address>
        </author>

        <date year="2022"/>

        <area>General</area>

        <workgroup>Global Routing Operations</workgroup>
        <keyword>BMP</keyword>
        <keyword>BGP</keyword>
        <keyword>REL</keyword>

        <abstract>
            <t>
		The BGP Monitoring Protocol (BMP) does provision for BGP session event
		logging (Peer Up, Peer Down), state synchronization (Route Monitoring),
		debugging (Route Mirroring) and Statistics messages, among the others.
		This document defines a new Route Event Logging (REL) message type for
		BMP with the aim of covering use-cases with affinity to alerting,
		reporting and on-change analysis.
            </t>
        </abstract>
    </front>

    <middle>
        <section title="Introduction" anchor="Introduction">
            <t>
		As NLRIs are advertised and distributed, policies are applied and, as a
		result, actions are performed on them. Currently, in order to infer the
		outcome of an evaluation process, a comparative analysis needs to be
		performed between Route Monitoring data for two distinct observation
		points of interest. It would be instead more useful if a monitored
		router could export event-driven data with the relevant information.
            </t>
            <t>
		The envisioned use-cases are the most diverse and range from logging
		route filtering to reporting the outcome of validation processes taking
		place on the monitored router, to isolating certain subsets of data
		to be validated offline, to broader closed-loop operations. 
            </t>
            <t>
		Since no other existing BMP message type does fit the described purpose,
		this document defines a new Route Event Logging (REL) message type that
		is suitable to carry event-driven data and is extensible in nature.
		While the message format is similar to the Route Mirroring message
		type defined in <xref target="RFC7854">RFC 7854</xref> and to the Route
		Monitoring message type as defined in <xref target="I-D.ietf-grow-bmp-tlv">
		TLV support for BMP Route Monitoring and Peer Down Messages</xref>,
		the semantics are different.
            </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 BCP 14 <xref target="RFC2119">RFC 2119</xref>
		<xref target="RFC8174">RFC 8174</xref> when, and only when, they
		appear in all capitals, as shown here.
            </t>
        </section>

	<section title="Route Event Logging (REL) message">
            <t>
		In basic terms a REL message does carry Events. Each Event is
		logically composed by one Event Subject and one or more Event
		Attributes.
	    </t>
	    <t>
		The structure of the Route Event Logging message is the same as
		the Route Monitoring message defined in <xref target="I-D.ietf-grow-bmp-tlv">
		TLV support for BMP Route Monitoring and Peer Down Messages</xref>
		where the Per-Peer Header is followed by indexed TLVs.
	    </t>
	    <t>
		One or more Event Subjects are packed as part of a BGP Update PDU.
		The BGP Update PDU <xref target="RFC4271">Section 4.3 of</xref> is
		encoded itself as part of a BGP Message TLV with code point &IANA_REL_CODE_BGP_PDU;
		and index set to zero. Each Event Subject is represented by an
		NLRI carried in the PDU.
	    </t>
	    <t>
		The BGP Message TLV may be preceeded and followed by indexed
		Informational TLVs that carry Event Attributes, where attributes
		are bound to subjects referring to their index in the PDU or via
		a Group TLV as described in <xref target="I-D.ietf-grow-bmp-tlv">
                TLV support for BMP Route Monitoring and Peer Down Messages</xref>.
	    </t>
	    <t>
		Speaking comparatively to other existing message types, REL does
		not require an initial flooding of information as per the state
		synchronization nature of Route Monitoring and does not aim to
		provide a non-state-compressed full-fidelity view of all messages
		received as per the debugging nature of Route Mirroring.
	    </t>
	    <t>
		In the context of BMP REL message, and hence in the reminder of
		this document, the term Event Subject and NLRI will be used
		interchangeably. Also the term Event Attribute and Informational
		TLV will be used interchangeably.
	    </t>
	    <t>
		The following sections will describe each component of the REL
		message in more detail. 
	    </t>
	<section title="Per-Peer Header">
	    <t>
		The message does start with a BMP per-peer header as defined in
		<xref target="RFC7854">RFC 7854</xref>, subsequently extended by
		<xref target="RFC8671">RFC 8671</xref> and
		<xref target="RFC9069">RFC 9069</xref> allowing, among the other
		things, to timestamp an Event and set its observation point among
		those defined in BMP.  
	    </t>
	    <t>
		Because the main purpose of the REL message is to log events at
		the time of applying an action, the Peer Flags field - even if
		applied to Adj-Rib-In or Adj-Rib-Out does not have the concept
		of pre- and post-policy. The flags are hence defined as follows:
	    </t>
	    <t>
	    <figure align="center">
        <artwork align="center"><![CDATA[
 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
|V|A| Reserved  |
+-+-+-+-+-+-+-+-+
            ]]></artwork>
	    </figure>
	    </t>
	    <t>
		The V flag and A flag do carry the same meaning as originally defined
		by <xref target="RFC7854">RFC 7854</xref>. The remaining bits are
		reserved for future use. They MUST be transmitted as 0 and their
		values MUST be ignored on receipt. 
	    </t>
	</section>
	<section title="BGP Update PDU">
	    <t>
		The PDU enclosed as part of a BGP Message TLV is artificial,
		either packed from scratch or repacked starting from an
		existing BGP Update PDU to only contain the relevant NLRIs
		affected by an Event (one or multiple). The Event is going
		to be further described by means of Event Attributes by
		indexed Informational TLVs. 
	    </t>
	    <t>
		The choice of describing one or multiple Event Subjects via
		a BGP Update PDU is because, on one hand, this does allow to
		not have to invent new encodings for NLRIs, while on the
		other, to support all types and encodings already supported
		by BGP. The advantage being that only minimal new code, on
		both the exporting and the receiving sides, will have to be
		produced. 
	    </t>
	</section>
	<section title="Informational TLVs">
	    <t>
		Informational TLVs in BMP are formalized by the
		intersection of <xref target="RFC7854">RFC 7854</xref>,
		<xref target="I-D.ietf-grow-bmp-tlv">TLV support for BMP Route
		Monitoring and Peer Down Messages</xref> and
		<xref target="I-D.ietf-grow-bmp-tlv-ebit">Support for Enterprise-
		specific TLVs in the BGP Monitoring Protocol</xref>. TLVs in
		a REL message are indexed.
	    </t>
	    <t>
		Contrary to other BMP messages where all Informational TLVs are
		entirely optional, in order for a REL message to be meaningful,
		it MUST contain at least one Event Reason TLV per Event Subject
		(ie. NLRI) carried by the BGP Update PDU and MAY contain further
		optional attribute TLVs to further characterize the Event.
	    </t>
	    <t>
		A new registry called "Route Event Logging TLVs" is defined and
		is seeded with the following TLVs:
	    </t>
	    <t>
		<list style="symbols">
		<t>&IANA_REL_CODE_EVENT_REASON; = Event Reason TLV (4 octets).
		Indicates the IANA-registered reason code describing the type
		of the event. The following reason codes are defined as part
		of the "Event Reason TLV" registry:

<figure>
              <artwork align="center"><![CDATA[
+--------+----------------------+
| Value  | Path type            |
+-------------------------------+
| 0x0000 | Unknown              |
| 0x0001 | Log Action		|
| 0x0002 | Policy Discard	|
| 0x0004 | Validation Fail	|
+--------+----------------------+

     Table 1: Event Reason Codes ]]></artwork>
            </figure>
		</t>
		</list>
	    </t>
	</section>
	</section>

        <section title="Security Considerations">
            <t>
		It is not believed that this document adds any additional security
		considerations.
            </t>
        </section>

        <section title="IANA Considerations">
            <t>
		TBD
	    </t>
        </section>

    </middle>

    <back>

        <references title="Normative References">
		&RFC2119;
		&RFC8174;

		<?rfc include="reference.RFC.4271.xml"?>
		<?rfc include="reference.RFC.7854.xml"?>
                <?rfc include="reference.RFC.8671.xml"?>
                <?rfc include="reference.RFC.9069.xml"?>
		<?rfc include='reference.I-D.ietf-grow-bmp-tlv'?>
		<?rfc include='reference.I-D.ietf-grow-bmp-tlv-ebit'?>
        </references>

        <section anchor="Acknowledgements" title="Acknowledgements" numbered="no">
            <t>
		TBD
            </t>
        </section>

    </back>
</rfc>
