Internet-Draft | BGP SendHoldTimer | May 2024 |
Snijders, et al. | Expires 3 November 2024 | [Page] |
This document defines the SendHoldtimer, along with the SendHoldTimer_Expires event, for the Border Gateway Protocol (BGP) Finite State Machine (FSM). Implementation of the SendHoldTimer helps overcome situations where a BGP session is not terminated after the local system detects that the remote system is not processing BGP messages. This document specifies that the local system should close the BGP connection and not solely rely on the remote system for session closure when the SendHoldTimer expires. This document updates RFC4271.¶
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.¶
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 3 November 2024.¶
Copyright (c) 2024 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 (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.¶
This document defines the SendHoldtimer, along with the SendHoldTimer_Expires event, for the Border Gateway Protocol (BGP) [RFC4271] Finite State Machine (FSM) defined in section 8.¶
Failure to terminate a blocked BGP session can result in Denial Of Service, and the subsequent failure to generate and deliver BGP WITHDRAW and UPDATE messages to other BGP peers of the local system is detrimental to all participants of the inter-domain routing system. This phenomena is thought to have contributed to IP traffic blackholing events in the global Internet routing system [bgpzombies].¶
This specification intends to improve this situation by requiring that sessions be terminated if the local system has detected that the remote system cannot possibly have processed any BGP messages for the duration of the SendHoldTime. Through standardization of the aforementioned requirement, operators will benefit from consistent behavior across different BGP implementations.¶
BGP speakers following this specification do not rely exclusively on remote systems closing blocked sessions, but will also locally close blocked sessions.¶
In implementations lacking the concept of a SendHoldTimer, a malfunctioning or overwhelmed remote peer may cause data on the BGP socket in the local system to accumulate ad infinitum. This could result in forwarding failure and traffic loss, as the overwhelmed peer continues to utilize stale routes.¶
An example fault state: as BGP runs over TCP [RFC9293], it is possible for a BGP speaker in the Established state to encounter a BGP peer that is advertising a TCP Receive Window (RCV.WND) of size zero. This 0 window prevents the local system from sending KEEPALIVE, CEASE, WITHDRAW, UPDATE, or any other critical BGP messages across the network socket to the remote peer.¶
Generally BGP implementations have no visibility into lower-layer subsystems such as TCP or the peer's current Receive Window size, and there is no existing BGP mechanism for such a blocked session to be recognized. Hence BGP implementations are not able to handle this situation in a consistent fashion.¶
This document provides a mechanism for BGP implementations to detect whether the TCP socket to a BGP peer is progressing (data is being transmitted), or persisting in a stalled state. In case of a stalled state, the BGP session can be restarted.¶
BGP speakers are implemented following a conceptual model "BGP Finite State Machine" (FSM), which is outlined in section 8 of [RFC4271]. This specification adds a BGP timer, SendHoldTimer, and updates the BGP FSM as follows:¶
The following optional session attributes for each connection are added to Section 8, before "The state session attribute indicates the current state of the BGP FSM":¶
The SendHoldTime determines how long a BGP speaker will stay in Established state before the TCP connection is dropped because no BGP messages can be transmitted to its peer. A BGP speaker can configure the value of the SendHoldTime to each peer independently.¶
Another timer event is added to Section 8.1.3 of [RFC4271] as following:¶
The following changes are made to section 8.2.2 in [RFC4271].¶
In "OpenConfirm State", the handling of Event 26 is revised as follows:¶
If the local system receives a KEEPALIVE message (KeepAliveMsg (Event 26)), the local system:¶
If the local system receives a KEEPALIVE message (KeepAliveMsg (Event 26)), the local system:¶
The following paragraph is added to section 8.2.2 in "Established State", after the paragraph which ends "unless the negotiated HoldTime value is zero.":¶
If the SendHoldTimer_Expires (Event XX1), the local system:¶
Each time the local system sends a BGP message, it restarts the SendHoldTimer unless the SendHoldTime value is zero or the negotiated HoldTime value is zero, in which cases the SendHoldTimer is stopped.¶
The SendHoldTimer is stopped following any transition out of the Established state.¶
Section 10 of [RFC4271] summarizes BGP Timers. This document adds another BGP timer: SendHoldTimer.¶
SendHoldTime is an FSM attribute that stores the initial value for the SendHoldTimer. If SendHoldTime is non-zero then it MUST be greater than the value of HoldTime.¶
If a system does not send successive KEEPALIVE or UPDATE messages within the period specified in SendHoldTime, then a NOTIFICATION message with the "Send Hold Timer Expired" Error Code MAY be sent and the BGP connection MUST be closed. Additionally, an error MUST be logged in the local system, indicating the Send Hold Timer Expired Error Code.¶
Due to the relative rarity of the failure mode that this specification is designed to address, and also the fact that network operators may be unfamiliar with the formal specification of BGP fault detection mechanisms such as HoldTimer, it is likely that a large number of operators are unaware of the necessity of an additional mechanism such as SendHoldtimer.¶
Accordingly, it is RECOMMENDED that implementations of this specification enable SendHoldtimer by default, without requiring additional configuration of the BGP speaking device.¶
The default value of SendHoldTime for a BGP session SHOULD be the greater of:¶
Implementations MAY make the value of SendHoldTime configurable, either globally or on a per-session basis, within the constraints set out in Section 3.4 above.¶
When the local system recognizes a remote peer is not processing any BGP messages for the duration of the SendHoldTime, it is likely that the local system will not be able to inform the remote peer through a NOTIFICATION message as to why the session is being closed. This documents suggests that an attempt to send a NOTIFICATION message with the "Send Hold Timer Expired" error code is still made, if doing so will not delay closing the BGP connection. Meanwhile an error message is logged into the local system.¶
Other mechanisms can be used as well, for example BGP speakers SHOULD provide this reason as part of their operational state; e.g. bgpPeerLastError in the BGP MIB [RFC4273].¶
This specification addresses the vulnerability of a BGP speaker to a potential attack whereby a BGP peer can pretend to be unable to process BGP messages and in doing so create a scenario where the local system is poisoned with stale routing information.¶
There are three detrimental aspects to the problem of not robustly handling blocked peers:¶
Failure to send BGP messages to a peer implies the peer is operating based on stale routing information.¶
Failure to disconnect from a blocked peer hinders the local system's ability to construct a non-stale local Routing Information Base (RIB).¶
Failure to disconnect from a blocked peer hinders the local system's ability to inform other BGP peers with current network reachability information.¶
In other respects, this specification does not change BGP's security characteristics.¶
IANA has registered code 8 for "Send Hold Timer Expired" in the "BGP Error (Notification) Codes" sub-registry under the "Border Gateway Protocol (BGP) Parameters" registry.¶
The authors would like to thank William McCall, Theo de Raadt, John Heasley, Nick Hilliard, Jeffrey Haas, Tom Petch, Susan Hares, Ben Maddison, and Claudio Jeker for their helpful review of this document.¶
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 RFC 7942. 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.¶
According to RFC 7942, "this will allow reviewers and working groups to assign due consideration to documents that have the benefit of running code, which may serve as evidence of valuable experimentation and feedback that have made the implemented protocols more mature. It is up to the individual working groups to use this information as they see fit".¶
Patches to recognize error code 8 were merged into OpenBSD's and the-tcpdump-group's tcpdump implementations.¶