<?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_RM_CODE_4B_ASN "TBD1">
        <!ENTITY IANA_RM_CODE_PATH_ID "TBD2">
        <!ENTITY IANA_RM_CODE_MULTI_LABELS "TBD3">
        ]>

<?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-ietf-grow-bmp-tlv-04"
     ipr="trust200902" submissionType="IETF"
     updates="7854">

    <front>
        <title abbrev="BMP TLV">
	    TLV support for BMP Route Monitoring and Peer Down Messages
	</title>

        <author fullname="Paolo Lucente" initials="P" surname="Lucente">
            <organization>NTT</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="Yunan Gu" initials="Y" surname="Gu">
            <organization>Huawei</organization>
            <address>
                <postal>
                    <street>Huawei Bld., No.156 Beiqing Rd.</street>
                    <city>Beijing</city>
                    <code>100095</code>
                    <region></region>
                    <country>China</country>
                </postal>
                <email>guyunan@huawei.com</email>
            </address>
        </author>
        <author fullname="Henk Smit" initials="H" surname="Smit">
            <organization>Independent</organization>
            <address>
                <postal>
                    <street></street>
                    <city></city>
                    <code></code>
                    <region></region>
                    <country>NL</country>
                </postal>
                <email>hhw.smit@xs4all.nl</email>
            </address>
        </author>

        <date year="2020"/>

        <area>General</area>

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

        <abstract>
            <t>
		Most of the message types defined by the BGP Monitoring Protocol (BMP)
		do provision for optional trailing data. However, Route Monitoring 
		messages (to provide a snapshot of the monitored Routing Information
		Base) and Peer Down messages (to indicate that a peering session was
		terminated) do not. Supporting optional data in TLV format across
		all BMP message types allows for an homogeneous and extensible surface
		that would be useful for the most different use-cases that need to
		convey additional data to a BMP station. While it is not intended
		for this document to cover any specific utilization scenario, it defines
		a simple way to support optional TLV data in all message types.
            </t>
        </abstract>
    </front>

    <middle>
        <section title="Introduction" anchor="Introduction">
            <t>
		The BGP Monitoring Protocol (BMP) is defined in <xref target="RFC7854">RFC 7854</xref>.

		<vspace blankLines="1"/>

		The Route Monitoring message consists of:
		<list style="symbols">
			<t>Common Header</t>
			<t>Per-Peer Header</t>
			<t>BGP Update PDU</t>
		</list>

		<vspace blankLines="1"/>

		The Peer Down Notification message consists of:
		<list style="symbols">
			<t>Common Header</t>
			<t>Per-Peer Header</t>
			<t>Reason</t>
			<t>Data (only if Reason code is 1, 2 or 3)</t>
		</list>
	   </t>

           <t>
		This means that both Route Monitoring and Peer Down messages have
		a non-extensible format. In the Route Monitoring case, this is limiting
		if wanting to transmit characteristics of transported NLRIs (ie. to
		help stateless parsing) or to add vendor-specific data. In the Peer
		Down case, this is limiting if matching TLVs sent with the Peer Up is
		desired. The proposal of this document is to bump the BMP version, for
		backward compatibility, and allow all message types to provision for
		trailing TLV data.
            </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="TLV encoding">
	    <t>
		The TLV data type is already defined in <xref target="RFC7854">Section 4.4 of</xref>
		for the Initiation and Peer Up message types. A TLV consists of:
	    </t>
	    <t>
		<list style="symbols">
		    <t>
			2 octets of TLV Type,
		    </t>
		    <t>
			2 octets of TLV Length,
		    </t>
		    <t>
			0 or more octets of TLV Value.
		    </t>
		</list>
	    </t>

	    <figure anchor="BMP-TLV-header" align="center">
	    	<artwork align="center">
	    	    <![CDATA[
  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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |        Type (2 octets)        |     Length (2 octets)         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  ~                      Value (variable)                         ~
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	    	    ]]>
	    	</artwork>
	    </figure>

	    <t>
		TLVs SHOULD be sorted by their code point. Multiple TLVs of the
		same type can be repeated as part of the same message, and it is
		left to the specific use-cases whether all, any, the first or
		the last TLV should be considered. 
	    </t>

	    <t>
	        In Route Monitoring messages there may be a need to map TLVs to NLRIs
		contained in the BGP Update message, for example, to express additional
		characteristics of a specific NLRI. For this purpose specifically TLVs
		in Route Monitoring messages can be optionally indexed, with the index
		starting at zero to refer to the first NLRI, and encoded as in the
		following figure:
	    </t>

	    <figure anchor="BMP-indexed-TLV-header" align="center">
	    	<artwork align="center">
	    	    <![CDATA[
  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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |        Type (2 octets)        |     Length (2 octets)         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |        Index (2 octets)       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  ~                      Value (variable)                         ~
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	    	    ]]>
	    	</artwork>
	    </figure>
	</section>

        <section title="BMP Message Format">
            <section title="Common Header" anchor="CommonHeader">
                <t>
		    <xref target="RFC7854">Section 4.1 of</xref> defines the Common
		    Header. While the structure remains unaltered, the following
		    two definitions are changed:
		     
		    <list style="symbols">
			<t>
				Version: Indicates the BMP version. This is set
				to '4' for all messages.
			</t>
			<t>
				Message Length: Total length of the message in
				bytes (including headers, encapsulated BGP message
				and optional data)
			</t>
		    </list> 
                </t>
            </section>
	    <section title="TLV data in Route Monitoring" anchor="TLVinRM">
		<t>
		    The Route Monitoring message type is defined in <xref target="RFC7854">Section 4.6 of</xref>.
		    The BGP Update PDU <xref target="RFC4271">Section 4.3 of</xref> MAY
		    be followed by TLV data. This document defines the following new
		    code points to help stateless parsing of BGP Update PDUs:
                    <list style="symbols">
                        <t>Type = &IANA_RM_CODE_4B_ASN;: the BGP Update PDU is encoded with support for the 4-octet AS number capability <xref target="RFC6793">RFC 6793</xref>, value MUST be boolean.</t>
			<t>Type = &IANA_RM_CODE_PATH_ID;: the BGP Update PDU is encoded with the ADD-PATH capability <xref target="RFC7911">RFC 7911</xref>, value MUST be boolean.</t>
			<t>Type = &IANA_RM_CODE_MULTI_LABELS;: the BGP Update PDU is encoded with the Multiple Labels capability <xref target="RFC8277">RFC 8277</xref>, value MUST be boolean.</t>
                    </list>
		</t>
	    </section>
	    <section title="TLV data in Peer Down" anchor="TLVinPD">
		<t>
		    The Peer Down Notification message type is defined in <xref target="RFC7854">Section 4.9 of</xref>.
		    For Reason codes 1 or 3, a BGP Notification PDU follows; the PDU MAY be followed by TLV data.
		    For Reason code 2, a 2-byte field to give additional FSM info follows; this field MAY be
		    followed by TLV data. For all other Reason codes, TLV data MAY follow the Reason field.
		</t>
	    </section>
	    <section title="TLV data in other BMP messages" anchor="TLVinOther">
		<t>
		    All other message types defined in <xref target="RFC7854">RFC7854</xref> do already provision for TLV data.
		    It is RECOMMENDED that all future BMP message types will provision for trailing TLV data.
		</t>
	    </section>
        </section>

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

        <section title="Operational Considerations">
            <t>
                In Route Monitoring messages, the number of TLVs can be bound to the amount of NLRIs
		carried in the BGP Update message. This may degrade the packing of information in such
		messages and have specific impacts on the memory and CPU used in a BMP implementation.
		As a result of that it should always be possible to disable such features to mitigate
		their impact.
            </t>
        </section>

        <section title="IANA Considerations">
            <t>
		This document defines the following new TLV types for BMP Route Monitoring and Peer Down messages (<xref target="TLVinRM"/>):

		<list style="symbols">
		    <t>
			Type = &IANA_RM_CODE_4B_ASN;: Support for the 4-octet AS number capability.
			The value field contains a boolean value of 1 if the BGP Update PDU
			enclosed in the Route Monitoring message was encoded according to the
			capability.
		    </t>
		    <t>
			Type = &IANA_RM_CODE_PATH_ID;: ADD-PATH capability. The value field
			contains a boolean value of 1 if the BGP Update PDU enclosed in the Route
			Monitoring message was encoded according to the capability.
		    </t>
		    <t>
			Type = &IANA_RM_CODE_MULTI_LABELS;: Multiple Labels capability. The
			value field contains a boolean value of 1 if the BGP Update PDU
			enclosed in the Route Monitoring message was encoded according to the
			capability.
		    </t>
		</list>
            </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.6793.xml"?>
		<?rfc include="reference.RFC.7911.xml"?>
		<?rfc include="reference.RFC.8277.xml"?>
        </references>

        <section anchor="Acknowledgements" title="Acknowledgements" numbered="no">
            <t>
		The authors would like to thank Jeff Haas and Camilo Cardona for their valuable
		input. The authors would also like to thank Greg Skinner for his review.
            </t>
        </section>

    </back>
</rfc>
