Skip to main content

6.8.4. Calculating the Detection Time (计算检测时间)

Detection Time (检测时间)(即在未接收 BFD 报文的时间段之后确定会话失败的时间段)不在协议中显式携带。相反,它是由接收系统根据协商的传输间隔和检测倍数在每个方向上独立计算的。请注意,每个方向的 Detection Time 可能不同。

在 Demand 模式与 Asynchronous 模式下,Detection Time 的计算略有不同。

在 Asynchronous 模式下,本地系统中计算的 Detection Time 等于从远程系统接收到的 Detect Mult 值,乘以远程系统的商定传输间隔(bfd.RequiredMinRxInterval 和最后接收到的 Desired Min TX Interval 中的较大值)。Detect Mult 值(由于抖动,大致而言)是必须连续丢失的报文数量才能将会话声明为 down。

如果 Demand 模式未激活,并且经过一段等于 Detection Time 的时间而未从远程系统接收到 BFD Control 报文,并且 bfd.SessionState 为 Init 或 Up,则会话已失败——本地系统必须将 bfd.SessionState 设置为 Down,并将 bfd.LocalDiag 设置为 1 (Control Detection Time Expired - Control 检测时间过期)。

在 Demand 模式下,本地系统中计算的 Detection Time 等于 bfd.DetectMult 乘以本地系统的商定传输间隔(bfd.DesiredMinTxInterval 和 bfd.RemoteMinRxInterval 中的较大值)。bfd.DetectMult(由于抖动,大致而言)是必须连续丢失的报文数量才能将会话声明为 down。

如果 Demand 模式激活,并且在 Poll Sequence 启动后(传输第一个设置了 Poll 位的 BFD Control 报文后)经过一段等于 Detection Time 的时间,则会话已失败——本地系统必须将 bfd.SessionState 设置为 Down,并将 bfd.LocalDiag 设置为 1 (Control Detection Time Expired - Control 检测时间过期)。

(请注意,对于 Detection Time 过期的目的,仅当报文未根据第 6.8.6 节的规则"丢弃"时,才认为报文已被接收。)