Global Routing Operations P. Lucente Internet-Draft NTT Updates: 7854 (if approved) Y. Gu Intended status: Standards Track Huawei Expires: 28 September 2023 27 March 2023 TLV support for BMP Route Monitoring and Peer Down Messages draft-ietf-grow-bmp-tlv-12 Abstract Most of the message types defined by the BGP Monitoring Protocol (BMP) make provision for data in TLV format. However, Route Monitoring messages (which provide a snapshot of the monitored Routing Information Base) and Peer Down messages (which indicate that a peering session was terminated) do not. Supporting (optional) data in TLV format across all BMP message types allows for a 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 TLV data in all message types. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on 28 September 2023. Copyright Notice Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved. Lucente & Gu Expires 28 September 2023 [Page 1] Internet-Draft BMP TLV March 2023 This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/ license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. TLV encoding . . . . . . . . . . . . . . . . . . . . . . . . 3 4. BMP Message Format . . . . . . . . . . . . . . . . . . . . . 4 4.1. Common Header . . . . . . . . . . . . . . . . . . . . . . 4 4.2. TLV data in Route Monitoring . . . . . . . . . . . . . . 5 4.2.1. Group TLV . . . . . . . . . . . . . . . . . . . . . . 5 4.2.1.1. Wire-format example . . . . . . . . . . . . . . . 5 4.2.2. VRF/Table Name TLV . . . . . . . . . . . . . . . . . 7 4.2.3. Stateless parsing TLVs . . . . . . . . . . . . . . . 7 4.3. TLV data in Peer Down . . . . . . . . . . . . . . . . . . 7 4.4. TLV data in other BMP messages . . . . . . . . . . . . . 8 5. Error handling . . . . . . . . . . . . . . . . . . . . . . . 8 6. Security Considerations . . . . . . . . . . . . . . . . . . . 8 7. Operational Considerations . . . . . . . . . . . . . . . . . 8 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 9. Normative References . . . . . . . . . . . . . . . . . . . . 9 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 10 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 10 1. Introduction The BGP Monitoring Protocol (BMP) is defined in RFC 7854 [RFC7854]. The Route Monitoring message consists of: * Common Header * Per-Peer Header * BGP Update PDU The Peer Down Notification message consists of: * Common Header * Per-Peer Header Lucente & Gu Expires 28 September 2023 [Page 2] Internet-Draft BMP TLV March 2023 * Reason * Data (only if Reason code is 1, 2 or 3) * TLV (only if Reason code is 6) This means that both Route Monitoring and Peer Down messages have a non-extensible format (except for the specific case of Peer Down Reason Code 6 as defined by RFC 9069 [RFC9069]). In the Route Monitoring case, this prevents the transmission of characteristics of transported NLRIs (e.g. to help with stateless parsing) or of vendor- specific data. In the Peer Down case, this prevents matching with TLVs previously sent with the Peer Up message. The proposal of this document is to bump the BMP version, for backward compatibility, and allow all defined BMP message types to make provision for TLV data. 2. Terminology 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 RFC 2119 [RFC2119] RFC 8174 [RFC8174] when, and only when, they appear in all capitals, as shown here. 3. TLV encoding The TLV data type is already defined in Section 4.4 of [RFC7854] for the Initiation and Peer Up message types. A TLV consists of: * 2 octets of TLV Type, * 2 octets of TLV Length, * 0 or more octets of TLV Value. 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) ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 1 Lucente & Gu Expires 28 September 2023 [Page 3] Internet-Draft BMP TLV March 2023 TLVs SHOULD be sorted by the sender 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 as well as whether ordering matters. Route Monitoring messages may require per-NLRI TLVs, that is, 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 MUST be indexed, with the index starting at one (1) to refer to the first NLRI. Index zero (0) specifies that a TLV does apply to all NLRIs contained in the BGP Update message. Multiple TLVs of the same type and with the same index can be repeated as part of the same message. Indexed TLVs are encoded as in the following figure: 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) ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 2 In indexed TLVs, the reported length refers to the total encoded TLV value (ie. it does exclude the length of the index field). Of the BMP message types defined so far, indexed TLVs apply only to Route Monitoring messages and, for example, they do not apply to Route Mirroring messages because the sender may not be aware of the payload of the transported BGP Update message. 4. BMP Message Format 4.1. Common Header Section 4.1 of [RFC7854] defines the Common Header. While the structure remains unaltered, the following two definitions are changed: * Version: Indicates the BMP version. This is set to '4' for all messages. Lucente & Gu Expires 28 September 2023 [Page 4] Internet-Draft BMP TLV March 2023 * Message Length: Total length of the message in bytes (including headers, encapsulated BGP message and optional data) 4.2. TLV data in Route Monitoring The Route Monitoring message type is defined in Section 4.6 of [RFC7854]. The consistency model selected to extend this message type with TLVs is with the Route Mirroring type where the Per-peer header is being followed by TLVs. The BGP Update PDU Section 4.3 of [RFC4271] is encoded itself as part of a BGP Message TLV with code point TBD1 and index set to zero. A Route Monitoring message MUST contain one BGP Message TLV which may be preceeded and followed by other optional TLV data. 4.2.1. Group TLV In a Route Monitoring message where the BGP Update PDU carries N NLRIs, indexed TLVs do allow to handle the cases of 1:1 and N:1 relationship among NLRIs and TLVs. The case of N:M relationship does instead require a form of grouping and hence this document defines a Group TLV to achieve this. The TLV MUST have an index set to zero. The value MUST contain: * A 2 bytes Group Index whose value MUST be greater than the amount of NLRIs packed in the BGP Update PDU and MUST be unique to the message * One or more 2 bytes indexes whose values MUST be less or equal to the amount of NLRIs packed in the BGP Update PDU. A NLRI index can be listed as part of multiple Group TLVs within the same message. NLRI indexes within a Group TLV SHOULD be sorted by the sender. A Group Index can not reference an NLRI index 0. Finally, a Group TLV MUST NOT include its own or another Group Index. Multiple TLVs can point to the same Group Index, i.e. a group can be reused within the same Route Monitoring message. The Group TLV code point is TBD2 4.2.1.1. Wire-format example The diagram in Figure 3 shows an example of a Route Monitoring message carrying a BGP UPDATE containing 10 NLRIs. The TLVs are comprised of: 1. a Group TLV with index 0x000b, pointing to NLRI 1, 2, 3 and 10 Lucente & Gu Expires 28 September 2023 [Page 5] Internet-Draft BMP TLV March 2023 2. a Group TLV with index 0x000c, pointing to NLRI 4, 5 and 6 3. a TLV pertaining to NLRI 7 4. a TLV pertaining to the NLRIs listed in the Group TLV defined in 1 5. a TLV pertaining to the NLRIs listed in the Group TLV defined in 2 0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Common Header + Per-Peer Header (6 + 48 bytes) ~ ~ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | type=TBD1 | length=X | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | index=0 | value=$BGP_UPDATE_PDU{ ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ~ ~ ~ NLRI_1 .. NLRI_10 ~ ~ } | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | type=TBD2 | length=0x000c | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | index=0 | group_index=0x000b | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | value={0x0001, 0x0002, | | 0x0003, 0x000a} | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | type=TBD2 | length=0x000a | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | index=0 | group_index=0x000c | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | value={0x0004, 0x0005, | | 0x0006} | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | type=SomeTlvX | length=0x0006 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | index=0x0007 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | value={4 bytes} | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | type=SomeTlvY | length=0x000a | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | index=0x000b | Lucente & Gu Expires 28 September 2023 [Page 6] Internet-Draft BMP TLV March 2023 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | value={8 bytes} ~ ~ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | type=SomeTlvZ | length=0x0006 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | index=0x000c | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | value={4 bytes} | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 3 4.2.2. VRF/Table Name TLV The Information field contains a UTF-8 string whose value MUST be equal to the value of the VRF or table name (ie. RD instance name) being conveyed. The string size MUST be within the range of 1 to 255 bytes. The VRF/Table Name TLV code point is TBD3 4.2.3. Stateless parsing TLVs This document also defines the following new code points to help stateless parsing of BGP Update PDUs: * Type = TBD4: the BGP Update PDU is encoded with support for the 4-octet AS number capability RFC 6793 [RFC6793], length MUST be 1 and value MUST be 0 for false and 1 for true. * Type = TBD5: the BGP Update PDU is encoded with the ADD-PATH capability RFC 7911 [RFC7911], length MUST be 1 and value MUST be 0 for false and 1 for true. * Type = TBD6: the BGP Update PDU is encoded with the Multiple Labels capability RFC 8277 [RFC8277], length MUST be 1 and value MUST be 0 for false and 1 for true. 4.3. TLV data in Peer Down The Peer Down Notification message type is defined in Section 4.9 of [RFC7854]. The consistency model selected to extend this message type with TLVs is with the Peer Up type where optional TLVs are placed at the end of the message. Lucente & Gu Expires 28 September 2023 [Page 7] Internet-Draft BMP TLV March 2023 This means 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. 4.4. TLV data in other BMP messages All other message types defined in RFC7854 [RFC7854] do already provision for TLV data. It is RECOMMENDED that all future BMP message types will also provide for TLV data following a consistency model with existing message types. 5. Error handling It is worth nothing that RFC8654 [RFC8654] permits BGP Update and other messages to grow to a length of 65535 octets. This may cause a BMP PDU that attempts to encapsulate such long messages to overflow. 6. Security Considerations It is not believed that this document adds any additional security considerations. 7. Operational Considerations 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. 8. IANA Considerations This document requests the renaming of the "Peer Up TLVs" registry defined by BMP Peer Up Message Namespace [I-D.ietf-grow-bmp-peer-up] into "Peer Up and Peer Down TLVs" and the definition of one new registry "BMP Route Monitoring TLVs". As part of the "BMP Route Monitoring TLVs" registry, the following new TLV types are defined (Section 4.2): * Type = TBD1: Support for BGP Message TLV. The value field is defined in Section 4.2 * Type = TBD2: Support for grouping of TLVs. The value field is defined in Section 4.2.1 Lucente & Gu Expires 28 September 2023 [Page 8] Internet-Draft BMP TLV March 2023 * Type = TBD3: Support for VRF/Table Name TLV. The value field is defined in Section 4.2.2 * Type = TBD4: Support for the 4-octet AS number capability. The value field is set to 1 if the BGP Update PDU enclosed in the Route Monitoring message was encoded according to the capability. * Type = TBD5: ADD-PATH capability. The value field is set to 1 if the BGP Update PDU enclosed in the Route Monitoring message was encoded according to the capability. * Type = TBD6: Multiple Labels capability. The value field is set to 1 if the BGP Update PDU enclosed in the Route Monitoring message was encoded according to the capability. 9. Normative References [I-D.ietf-grow-bmp-peer-up] Scudder, J., "BMP Peer Up Message Namespace", Work in Progress, Internet-Draft, draft-ietf-grow-bmp-peer-up-00, 24 July 2019, . [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC4271] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A Border Gateway Protocol 4 (BGP-4)", RFC 4271, DOI 10.17487/RFC4271, January 2006, . [RFC6793] Vohra, Q. and E. Chen, "BGP Support for Four-Octet Autonomous System (AS) Number Space", RFC 6793, DOI 10.17487/RFC6793, December 2012, . [RFC7854] Scudder, J., Ed., Fernando, R., and S. Stuart, "BGP Monitoring Protocol (BMP)", RFC 7854, DOI 10.17487/RFC7854, June 2016, . [RFC7911] Walton, D., Retana, A., Chen, E., and J. Scudder, "Advertisement of Multiple Paths in BGP", RFC 7911, DOI 10.17487/RFC7911, July 2016, . Lucente & Gu Expires 28 September 2023 [Page 9] Internet-Draft BMP TLV March 2023 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . [RFC8277] Rosen, E., "Using BGP to Bind MPLS Labels to Address Prefixes", RFC 8277, DOI 10.17487/RFC8277, October 2017, . [RFC8654] Bush, R., Patel, K., and D. Ward, "Extended Message Support for BGP", RFC 8654, DOI 10.17487/RFC8654, October 2019, . [RFC9069] Evens, T., Bayraktar, S., Bhardwaj, M., and P. Lucente, "Support for Local RIB in the BGP Monitoring Protocol (BMP)", RFC 9069, DOI 10.17487/RFC9069, February 2022, . Acknowledgements The authors would like to thank Jeff Haas, Camilo Cardona, Thomas Graf, Pierre Francois, Ben Maddison, Tim Evens and Luuk Hendriks for their valuable input. The authors would also like to thank Greg Skinner, Zongpeng Du and Maxence Younsi for their review. Authors' Addresses Paolo Lucente NTT Veemweg 23 3771 Barneveld Netherlands Email: paolo@ntt.net Yunan Gu Huawei Huawei Bld., No.156 Beiqing Rd. Beijing 100095 China Email: guyunan@huawei.com Lucente & Gu Expires 28 September 2023 [Page 10]