跳到主要内容

4.5. NOTIFICATION Message 格式

4.5. NOTIFICATION Message 格式 (NOTIFICATION Message Format)

检测到 error condition 时会发送 NOTIFICATION message. 发送后会立即关闭 BGP connection.

除了固定大小的 BGP header 外, NOTIFICATION message 还包含以下字段:

      0                   1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error code | Error subcode | Data (variable) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Error Code:

这个 1-octet unsigned integer 指示 NOTIFICATION 的类型. 已定义以下 Error Code:

Error CodeSymbolic NameReference
1Message Header Error (Message Header 错误)Section 6.1
2OPEN Message Error (OPEN Message 错误)Section 6.2
3UPDATE Message Error (UPDATE Message 错误)Section 6.3
4Hold Timer Expired (Hold Timer 过期)Section 6.5
5Finite State Machine Error (有限状态机错误)Section 6.6
6Cease (终止)Section 6.7

Error subcode:

这个 1-octet unsigned integer 提供关于所报告 error 性质的更具体信息. 每个 Error Code 可以关联一个或多个 Error Subcode. 如果没有定义合适的 Error Subcode, 则 Error Subcode field 使用零值 (Unspecific).

Message Header Error subcodes:

  • 1 - Connection Not Synchronized (connection 未同步).
  • 2 - Bad Message Length (错误的 message length).
  • 3 - Bad Message Type (错误的 message type).

OPEN Message Error subcodes:

  • 1 - Unsupported Version Number (不支持的 version number).
  • 2 - Bad Peer AS (错误的 peer AS).
  • 3 - Bad BGP Identifier (错误的 BGP Identifier).
  • 4 - Unsupported Optional Parameter (不支持的 Optional Parameter).
  • 5 - [Deprecated - see Appendix A] (已废弃 - 见 Appendix A).
  • 6 - Unacceptable Hold Time (不可接受的 Hold Time).

UPDATE Message Error subcodes:

  • 1 - Malformed Attribute List (格式错误的 Attribute List).
  • 2 - Unrecognized Well-known Attribute (无法识别的 well-known Attribute).
  • 3 - Missing Well-known Attribute (缺少 well-known Attribute).
  • 4 - Attribute Flags Error (Attribute Flags 错误).
  • 5 - Attribute Length Error (Attribute Length 错误).
  • 6 - Invalid ORIGIN Attribute (无效的 ORIGIN Attribute).
  • 7 - [Deprecated - see Appendix A] (已废弃 - 见 Appendix A).
  • 8 - Invalid NEXT_HOP Attribute (无效的 NEXT_HOP Attribute).
  • 9 - Optional Attribute Error (Optional Attribute 错误).
  • 10 - Invalid Network Field (无效的 Network Field).
  • 11 - Malformed AS_PATH (格式错误的 AS_PATH).

Data:

这个 variable-length field 用于诊断 NOTIFICATION 的原因. Data field 的内容取决于 Error Code 和 Error Subcode. 更多细节见 Section 6.

注意, Data field 的长度可以通过以下公式从 message Length field 确定:

Message Length = 21 + Data Length

NOTIFICATION message 的最小长度为 21 octet (包括 message header).