はじめに
本ドキュメントでは、IOS-XR ルータで BGP Graceful Restart (GR) を使用している環境において、GR が中断されるシナリオについてまとめています。
BGP Graceful Restart -前提知識-
GR は、BGP セッションの再開中に、BGP ルーティングにおけるピアがトラフィックの転送を継続する仕組みです。
具体的には、BGP の再開中にピアから学習した経路の状態が保持され、stale としてマークされます。
RP/0/RP0/CPU0:IOS-XR#show bgp
-snip-
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
BGP Graceful Restart が中断されるシナリオ
GR は、再起動するピアが依然としてすべての BGP 経路を転送できることを前提として動作します。
そのため、GR が中断されるシナリオとして以下が挙げられます。
- BGP のホールドタイムの時間切れ
- ピアへのインターフェイスのダウン
- ピアとの BFD セッションのダウン
特に、BFD セッション障害はデータの転送が不可となったことを意味します。
よって、BFD が設定されている環境において、BFD セッションがダウンした際に GR は中断されます。
BFD セッションのダウンが検知された場合、BGP の再開中にピアから学習した経路の状態が保持されないことは期待動作です。
この動作は、BFD セッション障害時に実行中の GR が、ブラックホールを避けるために中断されるべきであるという RFC 5882 の記載に基づいています。
参考資料
RFC 5882: Generic Application of Bidirectional Forwarding Detection (BFD)
4.3.1. BFD Fate Independent of the Control Plane
If BFD is implemented in the forwarding plane and does not share fate with the control plane on either system (the "C" bit is set in the BFD Control packets in both directions), control protocol restarts should not affect the BFD session. In this case, a BFD session failure implies that data can no longer be forwarded, so any Graceful Restart in progress at the time of the BFD session failure SHOULD be aborted in order to avoid black holes, and a topology change SHOULD be signaled in the control protocol.
Routing Configuration Guide for Cisco ASR 9000 Series Routers, IOS XR Release 7.1.x
Graceful Restart
BGP Graceful Restart operates under the basis that the restarting speaker is still capable of forwarding to all its BGP routes. If a forwarding failure on the restarting speaker is detected, then BGP graceful restart must be aborted. The following scenarios indicate that the BGP neighbor isn’t forwarding:
- The BGP hold time has expired. The local speaker sends keepalive messages and update messages to the neighbor. If the neighbor does not respond to the keepalive messages with TCP RST packets, then TCP is no longer functional, indicating that the neighbor is non-functional.
- The interface to the neighbor goes down.
- The BFD session to the neighbor fails.