跳到主要内容

8.2.2. 有限状态机

8.2.2. 有限状态机 (Finite State Machine)

Idle state:

初始时, BGP peer FSM 处于 Idle state. 下文中, BGP peer FSM 简称为 BGP FSM.

在此 state 中, BGP FSM 拒绝此 peer 的所有 incoming BGP connection. 不为该 peer 分配 resource. 响应 ManualStart event (Event 1) 或 AutomaticStart event (Event 3) 时, local system:

  • 初始化 peer connection 的所有 BGP resource,
  • 将 ConnectRetryCounter 设置为 zero,
  • 使用 initial value 启动 ConnectRetryTimer,
  • 发起到另一个 BGP peer 的 TCP connection,
  • listen 可能由 remote BGP peer 发起的 connection, 并且
  • 将其 state 改为 Connect.

ManualStop event (Event 2) 和 AutomaticStop event (Event 8) 在 Idle state 中被忽略.

响应 ManualStart_with_PassiveTcpEstablishment event (Event 4) 或 AutomaticStart_with_PassiveTcpEstablishment event (Event 5) 时, local system:

  • 初始化所有 BGP resource,
  • 将 ConnectRetryCounter 设置为 zero,
  • 使用 initial value 启动 ConnectRetryTimer,
  • listen 可能由 remote peer 发起的 connection, 并且
  • 将其 state 改为 Active.

ConnectRetryTimer 的确切值是 local matter, 但它 SHOULD 足够大, 以允许 TCP initialization.

如果 DampPeerOscillations attribute 设置为 TRUE, 则 Idle state 内可能出现以下三个 additional event:

  • AutomaticStart_with_DampPeerOscillations (Event 6),
  • AutomaticStart_with_DampPeerOscillations_and_PassiveTcpEstablishment (Event 7),
  • IdleHoldTimer_Expires (Event 13).

收到这 3 个 event 后, local system 会使用这些 event 防止 peer oscillation. 防止 persistent peer oscillation 的方法不在本文档范围内.

在 Idle state 中收到任何其他 event (Event 9-12, 15-28) 不会导致 local system 的 state 改变.

Connect state:

在此 state 中, BGP FSM 等待 TCP connection 完成.

start event (Event 1, 3-7) 在 Connect state 中被忽略.

响应 ManualStop event (Event 2) 时, local system:

  • drop TCP connection,
  • release 所有 BGP resource,
  • 将 ConnectRetryCounter 设置为 zero,
  • 停止 ConnectRetryTimer 并将 ConnectRetryTimer 设置为 zero, 并且
  • 将其 state 改为 Idle.

响应 ConnectRetryTimer_Expires event (Event 9) 时, local system:

  • drop TCP connection,
  • 重启 ConnectRetryTimer,
  • 停止 DelayOpenTimer 并将 timer 重置为 zero,
  • 发起到另一个 BGP peer 的 TCP connection,
  • 继续 listen 可能由 remote BGP peer 发起的 connection, 并且
  • 保持在 Connect state.

如果 DelayOpenTimer_Expires event (Event 12) 在 Connect state 中发生, local system:

  • 向其 peer 发送 OPEN message,
  • 将 HoldTimer 设置为一个 large value, 并且
  • 将其 state 改为 OpenSent.

如果 BGP FSM 收到 TcpConnection_Valid event (Event 14), 则处理 TCP connection, 并且 connection 保持在 Connect state.

如果 BGP FSM 收到 Tcp_CR_Invalid event (Event 15), local system 拒绝 TCP connection, 并且 connection 保持在 Connect state.

如果 TCP connection 成功 (Event 16 或 Event 17), local system 在处理前检查 DelayOpen attribute. 如果 DelayOpen attribute 设置为 TRUE, local system:

  • 停止 ConnectRetryTimer (如果正在运行) 并将 ConnectRetryTimer 设置为 zero,
  • 将 DelayOpenTimer 设置为 initial value, 并且
  • 保持在 Connect state.

如果 DelayOpen attribute 设置为 FALSE, local system:

  • 停止 ConnectRetryTimer (如果正在运行) 并将 ConnectRetryTimer 设置为 zero,
  • 完成 BGP initialization,
  • 向其 peer 发送 OPEN message,
  • 将 HoldTimer 设置为一个 large value, 并且
  • 将其 state 改为 OpenSent.

建议 HoldTimer value 为 4 分钟.

如果 TCP connection 失败 (Event 18), local system 检查 DelayOpenTimer. 如果 DelayOpenTimer 正在运行, local system:

  • 使用 initial value 重启 ConnectRetryTimer,
  • 停止 DelayOpenTimer 并将其 value 重置为 zero,
  • 继续 listen 可能由 remote BGP peer 发起的 connection, 并且
  • 将其 state 改为 Active.

如果 DelayOpenTimer 未运行, local system:

  • 将 ConnectRetryTimer 停止为 zero,
  • drop TCP connection,
  • release 所有 BGP resource, 并且
  • 将其 state 改为 Idle.

如果在 DelayOpenTimer 正在运行时收到 OPEN message (Event 20), local system:

  • 停止 ConnectRetryTimer (如果正在运行) 并将 ConnectRetryTimer 设置为 zero,
  • 完成 BGP initialization,
  • 停止并清除 DelayOpenTimer (将 value 设置为 zero),
  • 发送 OPEN message,
  • 发送 KEEPALIVE message,
  • 如果 HoldTimer initial value 非零:
    • 使用 initial value 启动 KeepaliveTimer, 并且
    • 将 HoldTimer 重置为 negotiated value,
  • 否则, 如果 HoldTimer initial value 为 zero:
    • 重置 KeepaliveTimer, 并且
    • 将 HoldTimer value 重置为 zero,
  • 并将其 state 改为 OpenConfirm.

如果 autonomous system field 的值与 local Autonomous System number 相同, 则将 connection status 设置为 internal connection; 否则为 "external".

如果 BGP message header checking (Event 21) 或 OPEN message checking 检测到 error (Event 22) (见 Section 6.2), local system:

  • (可选) 如果 SendNOTIFICATIONwithoutOPEN attribute 设置为 TRUE, 则 local system 首先发送带有 appropriate error code 的 NOTIFICATION message, 然后
  • 停止 ConnectRetryTimer (如果正在运行) 并将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • (可选) 如果 DampPeerOscillations attribute 设置为 TRUE, 则执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

如果收到带有 version error 的 NOTIFICATION message (Event 24), local system 检查 DelayOpenTimer. 如果 DelayOpenTimer 正在运行, local system:

  • 停止 ConnectRetryTimer (如果正在运行) 并将 ConnectRetryTimer 设置为 zero,
  • 停止并重置 DelayOpenTimer (设置为 zero),
  • release 所有 BGP resource,
  • drop TCP connection, 并且
  • 将其 state 改为 Idle.

如果 DelayOpenTimer 未运行, local system:

  • 停止 ConnectRetryTimer 并将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

响应任何其他 event (Event 8, 10-11, 13, 19, 23, 25-28) 时, local system:

  • 如果 ConnectRetryTimer 正在运行, 则停止并重置 ConnectRetryTimer (设置为 zero),
  • 如果 DelayOpenTimer 正在运行, 则停止并重置 DelayOpenTimer (设置为 zero),
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

Active state:

在此 state 中, BGP FSM 通过 listen 并接受 TCP connection 来尝试获得 peer.

start event (Event 1, 3-7) 在 Active state 中被忽略.

响应 ManualStop event (Event 2) 时, local system:

  • 如果 DelayOpenTimer 正在运行且 SendNOTIFICATIONwithoutOPEN session attribute 已设置, local system 会发送带有 Cease 的 NOTIFICATION,
  • release 所有 BGP resource, 包括停止 DelayOpenTimer,
  • drop TCP connection,
  • 将 ConnectRetryCounter 设置为 zero,
  • 停止 ConnectRetryTimer 并将 ConnectRetryTimer 设置为 zero, 并且
  • 将其 state 改为 Idle.

响应 ConnectRetryTimer_Expires event (Event 9) 时, local system:

  • 重启 ConnectRetryTimer (使用 initial value),
  • 发起到另一个 BGP peer 的 TCP connection,
  • 继续 listen 可能由 remote BGP peer 发起的 TCP connection, 并且
  • 将其 state 改为 Connect.

如果 local system 收到 DelayOpenTimer_Expires event (Event 12), local system:

  • 将 ConnectRetryTimer 设置为 zero,
  • 停止并清除 DelayOpenTimer (设置为 zero),
  • 完成 BGP initialization,
  • 向其 remote peer 发送 OPEN message,
  • 将其 hold timer 设置为一个 large value, 并且
  • 将其 state 改为 OpenSent.

对于此 state transition, 也建议 HoldTimer value 为 4 分钟.

如果 local system 收到 TcpConnection_Valid event (Event 14), local system 处理 TCP connection flag 并保持在 Active state.

如果 local system 收到 Tcp_CR_Invalid event (Event 15), local system 拒绝 TCP connection 并保持在 Active State.

响应 TCP connection 成功 (Event 16 或 Event 17) 时, local system 在处理前检查 DelayOpen optional attribute.

如果 DelayOpen attribute 设置为 TRUE, local system:

  • 停止 ConnectRetryTimer 并将 ConnectRetryTimer 设置为 zero,
  • 将 DelayOpenTimer 设置为 initial value (DelayOpenTime), 并且
  • 保持在 Active state.

如果 DelayOpen attribute 设置为 FALSE, local system:

  • 将 ConnectRetryTimer 设置为 zero,
  • 完成 BGP initialization,
  • 向其 peer 发送 OPEN message,
  • 将其 HoldTimer 设置为一个 large value, 并且
  • 将其 state 改为 OpenSent.

建议将 4 分钟作为 HoldTimer 的 "large value".

如果 local system 收到 TcpConnectionFails event (Event 18), local system:

  • 重启 ConnectRetryTimer (使用 initial value),
  • 停止并清除 DelayOpenTimer (将 value 设置为 zero),
  • release 所有 BGP resource,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则可选地执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

如果收到 OPEN message 且 DelayOpenTimer 正在运行 (Event 20), local system:

  • 停止 ConnectRetryTimer (如果正在运行) 并将 ConnectRetryTimer 设置为 zero,
  • 停止并清除 DelayOpenTimer (设置为 zero),
  • 完成 BGP initialization,
  • 发送 OPEN message,
  • 发送 KEEPALIVE message,
  • 如果 HoldTimer value 非零:
    • 将 KeepaliveTimer 启动为 initial value,
    • 将 HoldTimer 重置为 negotiated value,
  • 否则, 如果 HoldTimer 为 zero:
    • 重置 KeepaliveTimer (设置为 zero),
    • 将 HoldTimer 重置为 zero, 并且
  • 将其 state 改为 OpenConfirm.

如果 autonomous system field 的值与 local Autonomous System number 相同, 则将 connection status 设置为 internal connection; 否则为 external.

如果 BGP message header checking (Event 21) 或 OPEN message checking 检测到 error (Event 22) (见 Section 6.2), local system:

  • 如果 SendNOTIFICATIONwithoutOPEN attribute 设置为 TRUE, 则 (可选) 发送带有 appropriate error code 的 NOTIFICATION message,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

如果收到带有 version error 的 NOTIFICATION message (Event 24), local system 检查 DelayOpenTimer. 如果 DelayOpenTimer 正在运行, local system:

  • 停止 ConnectRetryTimer (如果正在运行) 并将 ConnectRetryTimer 设置为 zero,
  • 停止并重置 DelayOpenTimer (设置为 zero),
  • release 所有 BGP resource,
  • drop TCP connection, 并且
  • 将其 state 改为 Idle.

如果 DelayOpenTimer 未运行, local system:

  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

响应任何其他 event (Event 8, 10-11, 13, 19, 23, 25-28) 时, local system:

  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

OpenSent:

在此 state 中, BGP FSM 等待来自其 peer 的 OPEN message.

start event (Event 1, 3-7) 在 OpenSent state 中被忽略.

如果 ManualStop event (Event 2) 在 OpenSent state 中发出, local system:

  • 发送带有 Cease 的 NOTIFICATION,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 设置为 zero, 并且
  • 将其 state 改为 Idle.

如果 AutomaticStop event (Event 8) 在 OpenSent state 中发出, local system:

  • 发送带有 Cease 的 NOTIFICATION,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

如果 HoldTimer_Expires (Event 10), local system:

  • 发送 Error Code 为 Hold Timer Expired 的 NOTIFICATION message,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 增加 ConnectRetryCounter,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

如果收到 TcpConnection_Valid (Event 14), Tcp_CR_Acked (Event 16) 或 TcpConnectionConfirmed event (Event 17), 第二条 TCP connection 可能正在进行. 这条第二 TCP connection 按 Connection Collision processing (Section 6.8) 跟踪, 直到收到 OPEN message.

对 invalid port 的 TCP Connection Request (Tcp_CR_Invalid (Event 15)) 会被忽略.

如果收到 TcpConnectionFails event (Event 18), local system:

  • 关闭 BGP connection,
  • 重启 ConnectRetryTimer,
  • 继续 listen 可能由 remote BGP peer 发起的 connection, 并且
  • 将其 state 改为 Active.

收到 OPEN message 时, 会检查所有 field 的 correctness. 如果 OPEN message 中没有 error (Event 19), local system:

  • 将 DelayOpenTimer 重置为 zero,
  • 将 BGP ConnectRetryTimer 设置为 zero,
  • 发送 KEEPALIVE message,
  • 设置 KeepaliveTimer (通过下文文本),
  • 按 negotiated value 设置 HoldTimer (见 Section 4.2),
  • 将其 state 改为 OpenConfirm.

如果 negotiated hold time value 为 zero, 则不启动 HoldTimer 和 KeepaliveTimer. 如果 Autonomous System field 的值与 local Autonomous System number 相同, 则 connection 是 "internal" connection; 否则是 "external" connection. (这会影响如下所述的 UPDATE processing.)

如果 BGP message header checking (Event 21) 或 OPEN message checking 检测到 error (Event 22) (见 Section 6.2), local system:

  • 发送带有 appropriate error code 的 NOTIFICATION message,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

收到有效 BGP OPEN message (Event 19 或 Event 20) 时, 需要应用 collision detection mechanism (Section 6.8). 具体比较细节请参考 Section 6.8. 当 BGP implementation 通过本文档范围外的方法确定发生 connection collision 时, 会发生 CollisionDetectDump event.

如果 OpenSent state 中的某条 connection 被确定为必须关闭的 connection, 则向 state machine 发出 OpenCollisionDump (Event 23). 如果在 OpenSent state 中收到此类 event, local system:

  • 发送带有 Cease 的 NOTIFICATION,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

如果收到带有 version error 的 NOTIFICATION message (Event 24), local system:

  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection, 并且
  • 将其 state 改为 Idle.

响应任何其他 event (Event 9, 11-13, 20, 25-28) 时, local system:

  • 发送 Error Code 为 Finite State Machine Error 的 NOTIFICATION,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

OpenConfirm state:

在此 state 中, BGP 等待 KEEPALIVE 或 NOTIFICATION message.

任何 start event (Event 1, 3-7) 在 OpenConfirm state 中被忽略.

响应由 operator 发起的 ManualStop event (Event 2) 时, local system:

  • 发送带有 Cease 的 NOTIFICATION message,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 设置为 zero,
  • 将 ConnectRetryTimer 设置为 zero, 并且
  • 将其 state 改为 Idle.

响应由 system 发起的 AutomaticStop event (Event 8) 时, local system:

  • 发送带有 Cease 的 NOTIFICATION message,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

如果 HoldTimer_Expires event (Event 10) 在收到 KEEPALIVE message 之前发生, local system:

  • 发送 Error Code 为 Hold Timer Expired 的 NOTIFICATION message,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

如果 local system 收到 KeepaliveTimer_Expires event (Event 11), local system:

  • 发送 KEEPALIVE message,
  • 重启 KeepaliveTimer, 并且
  • 保持在 OpenConfirmed state.

在 OpenConfirm 中, 如果发生 TcpConnection_Valid event (Event 14) 或 TCP connection 成功 (Event 16 或 Event 17), local system 需要跟踪第二条 connection.

如果使用 invalid port 尝试 TCP connection (Event 15), local system 将忽略第二次 connection attempt.

如果 local system 从 underlying TCP 收到 TcpConnectionFails event (Event 18) 或收到 NOTIFICATION message (Event 25), local system:

  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

如果 local system 收到带有 version error 的 NOTIFICATION message (NotifMsgVerErr (Event 24)), local system:

  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection, 并且
  • 将其 state 改为 Idle.

如果 local system 收到有效 OPEN message (BGPOpen (Event 19)), collision detect function 按 Section 6.8 处理. 如果此 connection 因 connection collision 而需要被 drop, local system:

  • 发送带有 Cease 的 NOTIFICATION,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection (send TCP FIN),
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

收到 OPEN message 时, 会检查所有 field 的 correctness. 如果 BGP message header checking (BGPHeaderErr (Event 21)) 或 OPEN message checking 检测到 error (见 Section 6.2) (BGPOpenMsgErr (Event 22)), local system:

  • 发送带有 appropriate error code 的 NOTIFICATION message,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

如果在处理另一条 OPEN message 期间, BGP implementation 通过本文档范围外的方法确定发生了 connection collision 且此 connection 将被关闭, local system 将发出 OpenCollisionDump event (Event 23). 当 local system 收到 OpenCollisionDump event (Event 23) 时, local system:

  • 发送带有 Cease 的 NOTIFICATION,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

如果 local system 收到 KEEPALIVE message (KeepAliveMsg (Event 26)), local system:

  • 重启 HoldTimer, 并且
  • 将其 state 改为 Established.

响应任何其他 event (Event 9, 12-13, 20, 27-28) 时, local system:

  • 发送 code 为 Finite State Machine Error 的 NOTIFICATION,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

Established state:

在 Established state 中, BGP FSM 可以与其 peer 交换 UPDATE, NOTIFICATION 和 KEEPALIVE message.

任何 Start event (Event 1, 3-7) 在 Established state 中被忽略.

响应 ManualStop event (由 operator 发起) (Event 2) 时, local system:

  • 发送带有 Cease 的 NOTIFICATION message,
  • 将 ConnectRetryTimer 设置为 zero,
  • 删除与此 connection 关联的所有 route,
  • release BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 设置为 zero, 并且
  • 将其 state 改为 Idle.

响应 AutomaticStop event (Event 8) 时, local system:

  • 发送带有 Cease 的 NOTIFICATION,
  • 将 ConnectRetryTimer 设置为 zero,
  • 删除与此 connection 关联的所有 route,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

AutomaticStop event 的一个原因是: BGP 收到针对给定 peer 的 UPDATE message, 其中 prefix 数量使收到的 prefix 总数超过已配置的 maximum number of prefixes. local system 会自动断开该 peer.

如果 HoldTimer_Expires event 发生 (Event 10), local system:

  • 发送 Error Code 为 Hold Timer Expired 的 NOTIFICATION message,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

如果 KeepaliveTimer_Expires event 发生 (Event 11), local system:

  • 发送 KEEPALIVE message, 并且
  • 重启其 KeepaliveTimer, 除非 negotiated HoldTime value 为 zero.

每次 local system 发送 KEEPALIVE 或 UPDATE message 时, 它都会重启其 KeepaliveTimer, 除非 negotiated HoldTime value 为 zero.

在有效 port 上收到 TcpConnection_Valid (Event 14) 会导致第二条 connection 被跟踪.

invalid TCP connection (Tcp_CR_Invalid event (Event 15)) 将被忽略.

响应 TCP connection 成功建立的指示 (Event 16 或 Event 17) 时, 第二条 connection SHALL 被跟踪, 直到它发送 OPEN message.

如果收到有效 OPEN message (BGPOpen (Event 19)), 并且 CollisionDetectEstablishedState optional attribute 为 TRUE, 则会检查 OPEN message 是否与任何其他 connection 发生 collision (Section 6.8). 如果 BGP implementation 确定此 connection 需要终止, 它将处理 OpenCollisionDump event (Event 23). 如果此 connection 需要终止, local system:

  • 发送带有 Cease 的 NOTIFICATION,
  • 将 ConnectRetryTimer 设置为 zero,
  • 删除与此 connection 关联的所有 route,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

如果 local system 从 underlying TCP 收到 NOTIFICATION message (Event 24 或 Event 25) 或 TcpConnectionFails (Event 18), local system:

  • 将 ConnectRetryTimer 设置为 zero,
  • 删除与此 connection 关联的所有 route,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1, 并且
  • 将其 state 改为 Idle.

如果 local system 收到 KEEPALIVE message (Event 26), local system:

  • 如果 negotiated HoldTime value 非零, 则重启其 HoldTimer, 并且
  • 保持在 Established state.

如果 local system 收到 UPDATE message (Event 27), local system:

  • 处理该 message,
  • 如果 negotiated HoldTime value 非零, 则重启其 HoldTimer, 并且
  • 保持在 Established state.

如果 local system 收到 UPDATE message, 且 UPDATE message error handling procedure (见 Section 6.3) 检测到 error (Event 28), local system:

  • 发送带有 Update error 的 NOTIFICATION message,
  • 将 ConnectRetryTimer 设置为 zero,
  • 删除与此 connection 关联的所有 route,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.

响应任何其他 event (Event 9, 12-13, 20-22) 时, local system:

  • 发送 Error Code 为 Finite State Machine Error 的 NOTIFICATION message,
  • 删除与此 connection 关联的所有 route,
  • 将 ConnectRetryTimer 设置为 zero,
  • release 所有 BGP resource,
  • drop TCP connection,
  • 将 ConnectRetryCounter 增加 1,
  • 如果 DampPeerOscillations attribute 设置为 TRUE, 则 (可选) 执行 peer oscillation damping, 并且
  • 将其 state 改为 Idle.