Network Working Group P. Francois, Ed.
Internet-Draft Individual Contributor
Intended status: Informational B. Decraene, Ed.
Expires: March 25, 2018 Orange
C. Pelsser
Strasbourg University
K. Patel
Arrcus, Inc.
C. Filsfils
Cisco Systems
September 21, 2017

Graceful BGP session shutdown


This draft standardizes a new well-known BGP community GRACEFUL_SHUTDOWN to signal the graceful shutdown of paths. This draft also describes operational procedures which use this community to reduce the amount of traffic lost when BGP peering sessions are about to be shut down deliberately, e.g. for planned maintenance.

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

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 March 25, 2018.

Copyright Notice

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

Routing changes in BGP can be caused by planned maintenance operations. This document defines a well-known community [RFC1997], called GRACEFUL_SHUTDOWN, for the purpose of reducing the management overhead of gracefully shutting down BGP sessions. The well-known community allows implementers to provide an automated graceful shutdown mechanism that does not require any router reconfiguration at maintenance time.

This document discusses operational procedures to be applied in order to reduce or eliminate loss of packets during a maintenance. Loss comes from transient lack of reachability during BGP convergence which follows the shutdown of an EBGP peering session between two Autonomous System Border Routers (ASBR).

This document presents procedures for the cases where the forwarding plane is impacted by the maintenance, hence when the use of Graceful Restart does not apply.

The procedures described in this document can be applied to reduce or avoid packet loss for outbound and inbound traffic flows initially forwarded along the peering link to be shut down. These procedures trigger, in both ASes, rerouting to alternate paths if they exist within the AS, while allowing the use of the old path until alternate ones are learned. This ensures that routers always have a valid route available during the convergence process.

The goal of the document is to meet the requirements described in [RFC6198] at best, without changing the BGP protocol.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].

2. Terminology

graceful shutdown initiator: a router on which the session shutdown is performed for the maintenance.

graceful shutdown receiver: a router that has a BGP session, to be shutdown, with the graceful shutdown initiator.

3. Packet loss upon manual EBGP session shutdown

Packets can be lost during the BGP convergence following a manual shutdown of an EBGP session for two reasons.

First, some routers can have no path toward an affected prefix, and drop traffic destined to this prefix. This is because alternate paths can be hidden by nodes of an AS. This happens when [RFC7911] is not used and the paths are not selected as best by the ASBR that receive them on an EBGP session, or by Route Reflectors that do not propagate them further in the IBGP topology because they do not select them as best.

Second, the FIB can be inconsistent between routers within the AS, and packets toward affected prefixes can loop and be dropped unless encapsulation is used within the AS.

This document only addresses the first reason.

4. EBGP graceful shutdown procedure

This section describes configurations and actions to be performed for the graceful shutdown of EBGP peering links.

The goal of this procedure is to retain the paths to be shutdown between the peers, but with a lower LOCAL_PREF value, allowing the paths to remain in use while alternate paths are selected and propagated, rather than simply withdrawing the paths. The LOCAL_PREF value must be lower than the one of the alternate path. 0 being the lowest value, it can be used in all cases, except if it already has a special meaning within the AS.

4.1. Pre-configuration

On each ASBR supporting the graceful shutdown receiver procedure, an inbound BGP route policy is applied on all EBGP sessions of the ASBR, that:

4.2. Operations at maintenance time

On the graceful shutdown initiator, at maintenance time, the operator:

In the case of a shutdown of the whole router, in addition to the graceful shutdown of all EBGP sessions, there is a need to gracefully shutdown the routes originated by this router (e.g, BGP aggregates redistributed from other protocols, including static routes). This can be performed by tagging these routes with the GRACEFUL_SHUTDOWN community and setting LOCAL_PREF to a low value.

4.3. BGP implementation support for graceful shutdown

BGP Implementers SHOULD provide configuration knobs that utilize the GRACEFUL_SHUTDOWN community to drain BGP neighbors in preparation of impending neighbor shutdown. Implementation details are outside the scope of this document.

5. IANA Considerations

The IANA has assigned the community value 0xFFFF0000 to the planned-shut community in the "BGP Well-known Communities" registry. IANA is requested to change the name planned-shut to GRACEFUL_SHUTDOWN and set this document as the reference.

6. Security Considerations

By providing the graceful shutdown service to a neighboring AS, an ISP provides means to this neighbor and possibly its downstream ASes to lower the LOCAL_PREF value assigned to the paths received from this neighbor.

The neighbor could abuse the technique and do inbound traffic engineering by declaring some prefixes as undergoing a maintenance so as to switch traffic to another peering link.

If this behavior is not tolerated by the ISP, it SHOULD monitor the use of the graceful shutdown community.

7. Acknowledgments

The authors wish to thank Olivier Bonaventure, Pradosh Mohapatra, Job Snijders John Heasley, and Christopher Morrow for their useful comments.

8. References

8.1. Normative References

[RFC1997] Chandra, R., Traina, P. and T. Li, "BGP Communities Attribute", RFC 1997, DOI 10.17487/RFC1997, August 1996.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.
[RFC6198] Decraene, B., Francois, P., Pelsser, C., Ahmad, Z., Elizondo Armengol, A. and T. Takeda, "Requirements for the Graceful Shutdown of BGP Sessions", RFC 6198, DOI 10.17487/RFC6198, April 2011.

8.2. Informative References

[I-D.ietf-idr-best-external] Marques, P., Fernando, R., Chen, E., Mohapatra, P. and H. Gredler, "Advertisement of the best external route in BGP", Internet-Draft draft-ietf-idr-best-external-05, January 2012.
[I-D.ietf-idr-shutdown] Snijders, J., Heitz, J. and J. Scudder, "BGP Administrative Shutdown Communication", Internet-Draft draft-ietf-idr-shutdown-10, June 2017.
[RFC7911] Walton, D., Retana, A., Chen, E. and J. Scudder, "Advertisement of Multiple Paths in BGP", RFC 7911, DOI 10.17487/RFC7911, July 2016.

Appendix A. Alternative techniques with limited applicability

A few alternative techniques have been considered to provide graceful shutdown capabilities but have been rejected due to their limited applicability. This section describe them for possible reference.

A.1. Multi Exit Discriminator tweaking

The MED attribute of the paths to be avoided can be increased so as to force the routers in the neighboring AS to select other paths.

The solution only works if the alternate paths are as good as the initial ones with respect to the Local-Pref value and the AS Path Length value. In the other cases, increasing the MED value will not have an impact on the decision process of the routers in the neighboring AS.

A.2. IGP distance Poisoning

The distance to the BGP NEXT_HOP corresponding to the maintained session can be increased in the IGP so that the old paths will be less preferred during the application of the IGP distance tie-break rule. However, this solution only works for the paths whose alternates are as good as the old paths with respect to their Local-Pref value, their AS Path length, and their MED value.

Also, this poisoning cannot be applied when nexthop self is used as there is no nexthop specific to the maintained session to poison in the IGP.

Appendix B. Configuration Examples

This appendix is non-normative.

Example routing policy configurations to honor the GRACEFUL_SHUTDOWN well-known BGP community.

B.1. Cisco IOS XR

community-set comm-graceful-shutdown
route-policy AS64497-ebgp-inbound
  ! normally this policy would contain much more
  if community matches-any comm-graceful-shutdown then
    set local-preference 0
router bgp 64496
 neighbor 2001:db8:1:2::1
  remote-as 64497
  address-family ipv6 unicast
   route-policy AS64497-ebgp-inbound in



function honor_graceful_shutdown() {
    if (65535, 0) ~ bgp_community then {
        bgp_local_pref = 0;
filter AS64497_ebgp_inbound
	# normally this policy would contain much more
protocol bgp peer_64497_1 {
    neighbor 2001:db8:1:2::1 as 64497;
    local as 64496;
    import keep filtered;
    import filter AS64497_ebgp_inbound;

B.3. OpenBGPD

AS 64496
neighbor 2001:db8:1:2::1 {
        remote-as 64497
# normally this policy would contain much more
match from any community GRACEFUL_SHUTDOWN set { localpref 0 }

Appendix C. Beyond EBGP graceful shutdown

C.1. IBGP graceful shutdown

For the shutdown of an IBGP session, provided the IBGP topology is viable after the maintenance of the session, i.e, if all BGP speakers of the AS have an IBGP signaling path for all prefixes advertised on this graceful shutdown IBGP session, then the shutdown of an IBGP session does not lead to transient unreachability. As a consequence, no specific graceful shutdown action is required.

C.2. EBGP session establishment

We identify two potential causes for transient packet losses upon the establishment of an EBGP session. The first one is local to the startup initiator, the second one is due to the BGP convergence following the injection of new best paths within the IBGP topology.

C.2.1. Unreachability local to the ASBR

An ASBR that selects as best a path received over a newly established EBGP session may transiently drop traffic. This can typically happen when the NEXT_HOP attribute differs from the IP address of the EBGP peer, and the receiving ASBR has not yet resolved the MAC address associated with the IP address of that "third party" NEXT_HOP.

A BGP speaker implementation may avoid such losses by ensuring that "third party" NEXT_HOPs are resolved before installing paths using these in the RIB.

Alternatively, the operator (script) may ping third party NEXT_HOPs that are expected to be used before establishing the session. By proceeding like this, the MAC addresses associated with these third party NEXT_HOPs are resolved by the startup initiator.

C.2.2. IBGP convergence

During the establishment of an EBGP session, in some corner cases a router may have no path toward an affected prefix, leading to loss of connectivity.

A typical example for such transient unreachability for a given prefix is the following:

Let's consider 3 route reflectors RR1, RR2, RR3. There is a full mesh of IBGP sessions between them.

The use of [RFC7911] or [I-D.ietf-idr-best-external] among the RR of the IBGP full-mesh can solve these corner cases by ensuring that within an AS, the advertisement of a new route is not translated into the withdraw of a former route.

Indeed, "best-external" ensures that an ASBR does not withdraw a previously advertised (EBGP) path when it receives an additional, preferred path over an IBGP session. Also, "best-intra-cluster" ensures that a RR does not withdraw a previously advertised (IBGP) path to its non clients (e.g. other RRs in a mesh of RR) when it receives a new, preferred path over an IBGP session.

Authors' Addresses

Pierre Francois (editor) Individual Contributor EMail:
Bruno Decraene (editor) Orange EMail:
Cristel Pelsser Strasbourg University EMail:
Keyur Patel Arrcus, Inc. EMail:
Clarence Filsfils Cisco Systems EMail: