Global Routing Operations J. Snijders Internet-Draft NTT Communications Intended status: Standards Track M. Aelmans Expires: September 9, 2019 Juniper Networks March 8, 2019 BGP Maximum Prefix Limits draft-sa-grow-maxprefix-02 Abstract This document describes mechanisms to limit the negative impact of route leaks [RFC7908] and/or resource exhaustion in BGP [RFC4271] implementations. Requirements Language 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 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. 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 September 9, 2019. Copyright Notice Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents Snijders & Aelmans Expires September 9, 2019 [Page 1] Internet-Draft BGP Maximum Prefix Limits March 2019 (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 Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Inbound Maximum Prefix Limits . . . . . . . . . . . . . . . . 2 2.1. Type A: Pre-Policy Inbound Maximum Prefix Limits . . . . 3 2.2. Type B: Post-Policy Inbound Maximum Prefix Limits . . . . 3 3. Outbound Maximum Prefix Limits . . . . . . . . . . . . . . . 3 4. Considerations for Operations with Multi-Protocol BGP . . . . 4 5. Considerations for soft thresholds . . . . . . . . . . . . . 4 6. Security Considerations . . . . . . . . . . . . . . . . . . . 4 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 5 9. Implementation status - RFC EDITOR: REMOVE BEFORE PUBLICATION 5 10. Appendix: Implementation Guidance . . . . . . . . . . . . . . 6 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 11.1. Normative References . . . . . . . . . . . . . . . . . . 7 11.2. Informative References . . . . . . . . . . . . . . . . . 7 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7 1. Introduction This document describes mechanisms to reduce the negative impact of certain types of misconfigurations and/or resource exhaustions in BGP [RFC4271] operations. While [RFC4271] already described a method to tear down BGP sessions when certain thresholds are exceeded, some nuances in this specification were missing resulting in inconsistencies between BGP implementations. In addition to clarifying "inbound maximum prefix limits", this document also introduces a specification for "outbound maximum prefix limits". 2. Inbound Maximum Prefix Limits An operator MAY configure a BGP speaker to terminate its BGP session with a neighbor when the number of address prefixes received from that neighbor exceeds a locally configured upper limit. The BGP speaker then MUST send the neighbor a NOTIFICATION message with the Error Code Cease and the Error Subcode "Threshold reached: Maximum Number of Prefixes Received", and MAY support other actions. Reporting when thresholds have been exceeded is an implementation specific consideration, but SHOULD include methods such as Syslog Snijders & Aelmans Expires September 9, 2019 [Page 2] Internet-Draft BGP Maximum Prefix Limits March 2019 [RFC5424]. Inbound Maximum Prefix Limits can be applied in two distinct places in the conceptual model: before or after the application of routing policy. 2.1. Type A: Pre-Policy Inbound Maximum Prefix Limits The Adj-RIBs-In stores routing information learned from inbound UPDATE messages that were received from another BGP speaker Section 3.2 [RFC4271]. The Type A pre-policy limit uses the number of NLRIs per Address Family Identifier (AFI) per Subsequent Address Family Identifier (SAFI) as input into its threshold comparisons. For example, when an operator configures the Type A pre-policy limit for IPv4 Unicast to be 50 on a given EBGP session, and the other BGP speaker announces its 51st IPv4 Unicast NLRI, the session MUST be terminated. Type A pre-policy limits are particularly useful to help dampen the effects of full table route leaks and memory exhaustion when the implementation stores rejected routes. 2.2. Type B: Post-Policy Inbound Maximum Prefix Limits RFC4271 describes a Policy Information Base (PIB) that contains local policies that can be applied to the information in the Routing Information Base (RIB). The Type B post-policy limit uses the number of NLRIs per Address Family Identifier (AFI) per Subsequent Address Family Identifier (SAFI), after application of the Import Policy as input into its threshold comparisons. For example, when an operator configures the Type B post-policy limit for IPv4 Unicast to be 50 on a given EBGP session, and the other BGP speaker announces a hundred IPv4 Unicast routes of which none are accepted as a result of the local import policy (and thus not considered for the Loc-RIB by the local BGP speaker), the session is not terminated. Type B post-policy limits are useful to help prevent FIB exhaustion and prevent accidental BGP session teardown due to prefixes not accepted by policy anyway. 3. Outbound Maximum Prefix Limits An operator MAY configure a BGP speaker to terminate its BGP session with a neighbor when the number of address prefixes to be advertised to that neighbor exceeds a locally configured upper limit. The BGP speaker then MUST send the neighbor a NOTIFICATION message with the Error Code Cease and the Error Subcode "Threshold reached: Maximum Number of Prefixes Send", and MAY support other actions. Reporting when thresholds have been exceeded is an implementation specific Snijders & Aelmans Expires September 9, 2019 [Page 3] Internet-Draft BGP Maximum Prefix Limits March 2019 consideration, but SHOULD include methods such as Syslog [RFC5424]. By definition, Outbound Maximum Prefix Limits are Post-Policy. The Adj-RIBs-Out stores information selected by the local BGP speaker for advertisement to its neighbors. The routing information stored in the Adj-RIBs-Out will be carried in the local BGP speaker's UPDATE messages and advertised to its neighbors Section 3.2 [RFC4271]. The Outbound Maximum Prefix Limit uses the number of NLRIs per Address Family Identifier (AFI) per Subsequent Address Family Identifier (SAFI), after application of the Export Policy, as input into its threshold comparisons. For example, when an operator configures the Outbound Maximum Prefix Limit for IPv4 Unicast to be 50 on a given EBGP session, and were about to announce its 51st IPv4 Unicast NLRI to the other BGP speaker as a result of the local export policy, the session MUST be terminated. Outbound Maximum Prefix Limits are useful to help dampen the negative effects of a misconfiguration in local policy. In many cases, it would be more desirable to tear down a BGP session rather than causing or propagating a route leak. 4. Considerations for Operations with Multi-Protocol BGP 5. Considerations for soft thresholds describe soft and hard limits (warning vs teardown) 6. Security Considerations Maximum Prefix Limits are an essential tool for routing operations and SHOULD be used to increase stability. 7. IANA Considerations This memo requests that IANA updates the name of subcode "Maximum Number of Prefixes Reached" to "Threshold exceeded: Maximum Number of Prefixes Received" in the "Cease NOTIFICATION message subcodes" registry under the "Border Gateway Protocol (BGP) Parameters" group. This memo requests that IANA assigns a new subcode named "Threshold exceeded: Maximum Number of Prefixes Send" in the "Cease NOTIFICATION message subcodes" registry under the "Border Gateway Protocol (BGP) Parameters" group. Snijders & Aelmans Expires September 9, 2019 [Page 4] Internet-Draft BGP Maximum Prefix Limits March 2019 8. Acknowledgments The authors would like to thank Saku Ytti and John Heasley (NTT Communications), Jeff Haas, Colby Barth and John Scudder (Juniper Networks), Martijn Schmidt (i3D.net), Teun Vink (BIT), Sabri Berisha (eBay), Martin Pels (Quanza), Steven Bakker (AMS-IX), Aftab Siddiqui (ISOC) and Yu Tianpeng for their support, insightful review, and comments. 9. Implementation status - RFC EDITOR: REMOVE BEFORE PUBLICATION This section records the status of known implementations of the protocol defined by this specification at the time of posting of this Internet-Draft, and is based on a proposal described in RFC7942. The description of implementations in this section is intended to assist the IETF in its decision processes in progressing drafts to RFCs. Please note that the listing of any individual implementation here does not imply endorsement by the IETF. Furthermore, no effort has been spent to verify the information presented here that was supplied by IETF contributors. This is not intended as, and must not be construed to be, a catalog of available implementations or their features. Readers are advised to note that other implementations may exist. The below table provides an overview (as of the moment of writing) of which vendors have produced implementation of inbound or outbound maximum prefix limits. Each table cell shows the applicable configuration keywords if the vendor implemented the feature. Snijders & Aelmans Expires September 9, 2019 [Page 5] Internet-Draft BGP Maximum Prefix Limits March 2019 +-------------+----------------+-------------------------+----------+ | Vendor | Type A Pre- | Type B Post-Policy | Outbound | | | Policy | | | +-------------+----------------+-------------------------+----------+ | Cisco IOS | | maximum-prefix | | | XR | | | | +-------------+----------------+-------------------------+----------+ | Cisco IOS | | maximum-prefix | | | XE | | | | +-------------+----------------+-------------------------+----------+ | Juniper | prefix-limit | accepted-prefix-limit, | | | Junos OS | | or prefix-limit | | | | | combined with 'keep | | | | | none' | | +-------------+----------------+-------------------------+----------+ | Nokia SR OS | prefix-limit | | | +-------------+----------------+-------------------------+----------+ | NIC.CZ BIRD | 'import keep | 'import limit' or | export | | | filtered' | 'receive limit' | limit | | | combined with | | | | | 'receive | | | | | limit' | | | +-------------+----------------+-------------------------+----------+ | OpenBSD | max-prefix | | | | OpenBGPD | | | | +-------------+----------------+-------------------------+----------+ | Arista EOS | maximum-routes | maximum-accepted-routes | | +-------------+----------------+-------------------------+----------+ | Huawei | peer route- | | | | VRPv5 | limit | | | +-------------+----------------+-------------------------+----------+ | Huawei | peer route- | peer route-limit | | | VRPv8 | limit | accept-prefix | | +-------------+----------------+-------------------------+----------+ First presented by Snijders at [RIPE77] Table 1: Maximum prefix limits capabilities per implementation 10. Appendix: Implementation Guidance 1) make it clear who does what: if A sends too many prefixes to B A should see "ABC" in log B should see "DEF" in log to make it clear which of the two parties does what 2) recommended by default automatically restart after between 15 and 30 minutes Snijders & Aelmans Expires September 9, 2019 [Page 6] Internet-Draft BGP Maximum Prefix Limits March 2019 11. References 11.1. Normative References [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, . [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . 11.2. Informative References [RFC5424] Gerhards, R., "The Syslog Protocol", RFC 5424, DOI 10.17487/RFC5424, March 2009, . [RFC7908] Sriram, K., Montgomery, D., McPherson, D., Osterweil, E., and B. Dickson, "Problem Definition and Classification of BGP Route Leaks", RFC 7908, DOI 10.17487/RFC7908, June 2016, . [RIPE77] Snijders, J., "Robust Routing Policy Architecture", May 2018, . Authors' Addresses Job Snijders NTT Communications Theodorus Majofskistraat 100 Amsterdam 1065 SZ The Netherlands Email: job@ntt.net Snijders & Aelmans Expires September 9, 2019 [Page 7] Internet-Draft BGP Maximum Prefix Limits March 2019 Melchior Aelmans Juniper Networks Boeing Avenue 240 Schiphol-Rijk 1119 PZ The Netherlands Email: maelmans@juniper.net Snijders & Aelmans Expires September 9, 2019 [Page 8]