Skip to main content

Border Gateway Protocol 4 (BGP-4) Send Hold Timer
draft-ietf-idr-bgp-sendholdtimer-01

The information below is for an old version of the document.
Document Type
This is an older version of an Internet-Draft whose latest revision state is "Active".
Authors Job Snijders , Ben Cartwright-Cox , Yingzhen Qu
Last updated 2023-12-13 (Latest revision 2023-05-05)
Replaces draft-spaghetti-idr-bgp-sendholdtimer
RFC stream Internet Engineering Task Force (IETF)
Formats
Additional resources Mailing list discussion
Stream WG state WG Document
Document shepherd Susan Hares
Shepherd write-up Show Last changed 2023-05-23
IESG IESG state I-D Exists
Consensus boilerplate Unknown
Telechat date (None)
Responsible AD (None)
Send notices to shares@ndzh.com
draft-ietf-idr-bgp-sendholdtimer-01
IDR                                                          J. Snijders
Internet-Draft                                                    Fastly
Updates: 4271 (if approved)                            B. Cartwright-Cox
Intended status: Standards Track                            Port 179 Ltd
Expires: 15 June 2024                                              Y. Qu
                                                  Futurewei Technologies
                                                        13 December 2023

           Border Gateway Protocol 4 (BGP-4) Send Hold Timer
                  draft-ietf-idr-bgp-sendholdtimer-01

Abstract

   This document defines the SendHoldTimer and SendHoldTime session
   attributes 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.

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 15 June 2024.

Snijders, et al.          Expires 15 June 2024                  [Page 1]
Internet-Draft              BGP SendHoldTimer              December 2023

Copyright Notice

   Copyright (c) 2023 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.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Example of a problematic scenario . . . . . . . . . . . . . .   3
   3.  SendHoldTimer - Changes to RFC 4271 . . . . . . . . . . . . .   3
     3.1.  Session Attributes  . . . . . . . . . . . . . . . . . . .   4
     3.2.  Timer Event: SendHoldTimer_Expires  . . . . . . . . . . .   4
     3.3.  Changes to the FSM  . . . . . . . . . . . . . . . . . . .   4
     3.4.  Changes to BGP Timers . . . . . . . . . . . . . . . . . .   5
   4.  Send Hold Timer Expired Error Handling  . . . . . . . . . . .   5
   5.  Operational Considerations  . . . . . . . . . . . . . . . . .   6
   6.  Security Considerations . . . . . . . . . . . . . . . . . . .   6
   7.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   6
   8.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .   7
   9.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   7
     9.1.  Normative References  . . . . . . . . . . . . . . . . . .   7
     9.2.  Informative References  . . . . . . . . . . . . . . . . .   7
   Appendix A.  Implementation status - RFC EDITOR: REMOVE BEFORE
           PUBLICATION . . . . . . . . . . . . . . . . . . . . . . .   8
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .   8

1.  Introduction

   This document defines the SendHoldTimer and SendHoldTime session
   attributes for the Border Gateway Protocol (BGP) [RFC4271] Finite
   State Machine (FSM) defined in section 8.

   Failure to terminate a 'stuck' BGP session can result in Denial Of
   Service, and the subsequent failure to generate and deliver BGP
   WITHDRAW messages to other BGP peers of the local system is
   detrimental to all participants of the inter-domain routing system.
   This phenomena is theorized to have contributed to IP traffic
   blackholing events in global Internet routing system [bgpzombies].

Snijders, et al.          Expires 15 June 2024                  [Page 2]
Internet-Draft              BGP SendHoldTimer              December 2023

   This specification intends to improve this situation by requiring
   sessions to be terminated if the local system has detected that the
   remote system cannot possibly have received any BGP messages for the
   duration of the SendHoldTime.  Through codification of the
   aforementioned requirement, operators will benefit from consistent
   behavior across different BGP implementations.

   BGP speakers following this specification do not exclusively rely on
   remote systems robustly closing connections, but will also locally
   close connections.

2.  Example of a problematic scenario

   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 successfully across the network socket to the remote peer,
   and this causes the BGP FSM to stuck.

   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 stuck session to be
   torn down.  Hence BGP implementations are not able to handle this
   situation in a robust and 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.

3.  SendHoldTimer - Changes to RFC 4271

   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 following:

Snijders, et al.          Expires 15 June 2024                  [Page 3]
Internet-Draft              BGP SendHoldTimer              December 2023

3.1.  Session Attributes

   The following mandatory session attributes for each connection are
   added to Section 8, before "The state session attribute indicates the
   current state of the BGP FSM":

      9) SendHoldTimer

      10) SendHoldTime (an initial value of 8 minutes is recommended)

   The SendHoldTime determines how long a BGP speaker would stay in
   Established state before the TCP connection is dropped because no BGP
   messages can be successfully transmitted to its peer.  A BGP speaker
   can configure the value of the SendHoldTime to each peer
   independently.

3.2.  Timer Event: SendHoldTimer_Expires

   Another timer event is added to Section 8.1.3 of [RFC4271] as
   following:

   Event XX1: SendHoldTimer_Expires
      Definition:  An event generated when the SendHoldTimer expires.

      Status:  Mandatory

3.3.  Changes to the FSM

   The following changes are made to section 8.2.2 in [RFC4271].

   In "OpenConfirm State", the handling of Event 26 is revised as
   follows:

   Old Text:
      If the local system receives a KEEPALIVE message (KeepAliveMsg
      (Event 26)), the local system:

      -  restarts the HoldTimer and

      -  changes its state to Established.

   Next Text:
      If the local system receives a KEEPALIVE message (KeepAliveMsg
      (Event 26)), the local system:

      -  restarts the HoldTimer,

      -  sets the SendHoldTimer to the default or configured value, and

Snijders, et al.          Expires 15 June 2024                  [Page 4]
Internet-Draft              BGP SendHoldTimer              December 2023

      -  changes its state to Established.

   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:

      -  sends a NOTIFICATION message with the BGP Error Code "Send Hold
         Timer Expired",

      -  logs an error message in the local system with the BGP Error
         Code "Send Hold Timer Expired",

      -  releases all BGP resources,

      -  sets the ConnectRetryTimer to zero,

      -  drops the TCP connection,

      -  increments the ConnectRetryCounter by 1,

      -  (optionally) performs peer oscillation damping if the
         DampPeerOscillations attribute is set to TRUE, and

      -  changes its state to Idle.

      Each time the local system successfully sends a KEEPALIVE, UPDATE,
      and/or NOTIFICATION message, it restarts its SendHoldTimer.

3.4.  Changes to BGP Timers

   In Section 10 of [RFC4271] summarizes BGP Timers.  This document adds
   another BGP timer: SendHoldTimer.

   SendHoldTime is a mandatory FSM attribute that stores the initial
   value for the SendHoldTimer.  The suggested default value for
   SendHoldTime is 8 minutes.  An implementation MAY make it
   configurable.

4.  Send Hold Timer Expired Error Handling

   If a system does not send successive KEEPALIVE, UPDATE, and/or
   NOTIFICATION messages within the period specified in the Send Hold
   Time, then the BGP connection is closed and a log message is emitted.

Snijders, et al.          Expires 15 June 2024                  [Page 5]
Internet-Draft              BGP SendHoldTimer              December 2023

5.  Operational Considerations

   When the local system recognizes a remote peer is not processing any
   BGP messages for the duration of the SendHoldTime, likely the local
   system will not be able to inform the remote peer through a BGP
   message as to why the session is being closed by sending a
   NOTIFICATION.  This documents suggests that a NOTIFICATION message
   with the "Send Hold Timer Expired" error code is still sent,
   meanwhile an error message SHOULD be 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].

6.  Security Considerations

   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 'stuck' peers:

   *  Failure to send BGP messages to a peer implies the peer is
      operating based on stale routing information.

   *  Failure to disconnect from a 'stuck' peer hinders the local
      system's ability to construct a non-stale local Routing
      Information Base (RIB).

   *  Failure to disconnect from a 'stuck' 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.

7.  IANA Considerations

   This document requests IANA to assign a value named "Send Hold Timer
   Expired" in the "BGP Error (Notification) Codes" sub-registry under
   the "Border Gateway Protocol (BGP) Parameters" registry.

Snijders, et al.          Expires 15 June 2024                  [Page 6]
Internet-Draft              BGP SendHoldTimer              December 2023

8.  Acknowledgements

   The authors would like to thank William McCall, Theo de Raadt, John
   Heasley, Nick Hilliard, Jeffrey Haas, and Tom Petch for their helpful
   review of this document.

9.  References

9.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,
              <https://www.rfc-editor.org/info/rfc2119>.

   [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,
              <https://www.rfc-editor.org/info/rfc4271>.

   [RFC4273]  Haas, J., Ed. and S. Hares, Ed., "Definitions of Managed
              Objects for BGP-4", RFC 4273, DOI 10.17487/RFC4273,
              January 2006, <https://www.rfc-editor.org/info/rfc4273>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC9293]  Eddy, W., Ed., "Transmission Control Protocol (TCP)",
              RFC 9293, DOI 10.17487/RFC9293, August 2022,
              <https://www.rfc-editor.org/info/rfc9293>.

9.2.  Informative References

   [bgpzombies]
              Fontugne, R., "BGP Zombies", April 2019,
              <https://labs.ripe.net/author/romain_fontugne/bgp-
              zombies/>.

   [BIRD]     Kubecova, K., "BIRD Internet Routing Daemon", October
              2023, <https://gitlab.nic.cz/labs/bird/-/commit/
              bcf2327425d4dd96f381b87501cccf943bed606e>.

   [frr]      Lamparter, D., "bgpd: implement SendHoldTimer", May 2022,
              <https://github.com/FRRouting/frr/pull/11225>.

   [neo-bgp]  Cartwright-Cox, B., "What does bgp.tools support", August
              2022, <https://bgp.tools/kb/bgp-support>.

Snijders, et al.          Expires 15 June 2024                  [Page 7]
Internet-Draft              BGP SendHoldTimer              December 2023

   [openbgpd] Jeker, C., "bgpd send side hold timer", December 2020,
              <https://marc.info/?l=openbsd-tech&m=160820754925261&w=2>.

Appendix A.  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 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".

   *  OpenBGPD [openbgpd]

   *  FRRouting [frr]

   *  neo-bgp (bgp.tools) [neo-bgp]

   *  BIRD [BIRD]

Authors' Addresses

   Job Snijders
   Fastly
   Amsterdam
   Netherlands
   Email: job@fastly.com

   Ben Cartwright-Cox
   Port 179 Ltd
   London
   United Kingdom
   Email: ben@benjojo.co.uk

Snijders, et al.          Expires 15 June 2024                  [Page 8]
Internet-Draft              BGP SendHoldTimer              December 2023

   Yingzhen Qu
   Futurewei Technologies
   Santa Clara,
   United States
   Email: yingzhen.ietf@gmail.com

Snijders, et al.          Expires 15 June 2024                  [Page 9]