跳到主要内容

3.5. LDP 消息

所有 LDP 消息都具有以下格式:

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|U| Message Type | Message Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Message ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| Mandatory Parameters |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| Optional Parameters |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

U-bit

未知消息位 (Unknown message bit)。收到未知消息时, 如果 U 为 0, 则向消息发起方返回一个通知; 如果 U 为 1, 则静默忽略该未知消息。随后定义消息的各节为该 U 位规定取值。

Message Type

标识消息的类型。

Message Length

规定 Message ID、Mandatory Parameters 和 Optional Parameters 的累计长度 (以八位组为单位)。

Message ID

用于标识本消息的 32 位值。发送方 LSR 用它来便于识别可能适用于本消息的通知消息。响应本消息而发送通知消息的 LSR 应当 (SHOULD) 在通知消息所携带的 Status TLV 中包含本 Message ID; 见 "Notification Message" 一节。

Mandatory Parameters

必需消息参数的可变长度集合。有些消息没有必需参数。

对于有必需参数的消息, 必需参数必须按随后各节中各个消息规范所规定的顺序出现。

Optional Parameters

可选消息参数的可变长度集合。许多消息没有可选参数。

对于有可选参数的消息, 可选参数可以按任意顺序出现。

请注意, LDP 消息的第一个八位组没有对齐要求, 并且消息末尾没有填充; 也就是说, 参数可以在奇数字节边界处结束。

本版本 LDP 中定义了以下消息类型:

   Message Name            Section Title

Notification "Notification Message"
Hello "Hello Message"
Initialization "Initialization Message"
KeepAlive "KeepAlive Message"
Address "Address Message"
Address Withdraw "Address Withdraw Message"
Label Mapping "Label Mapping Message"
Label Request "Label Request Message"
Label Abort Request "Label Abort Request Message"
Label Withdraw "Label Withdraw Message"
Label Release "Label Release Message"

随后各节规定这些消息的编码和过程。

上述某些消息彼此相关, 例如 Label Mapping、Label Request、Label Withdraw 和 Label Release 消息。

虽然可以按 "规定消息类别的 message type" 与 "规定该类别中特定消息的 message subtype" 的方式来考虑这样相互关联的消息, 但本规范并未形式化 message subtype 的概念。

本规范从 16 位消息类型编号空间的某个连续块中, 为相关消息 (例如标签 (Label) 消息) 分配类型值。