我在理解 RFC 1533 中 DHCP 的 Pad-Option 字段的描述时遇到了问题:
3.1. Pad Option
The pad option can be used to cause subsequent fields to align on
word boundaries.
The code for the pad option is 0, and its length is 1 octet.
Code
+-----+
| 0 |
+-----+
这意味着什么?一个词有 16 位长,但我为什么要用 Pad Bytes 填充其余部分?“对齐”是什么意思?我还必须使用 Pad-Option 还是可选的?它有什么用,我必须使用它吗?RFC 1533:https ://www.rfc-editor.org/rfc/rfc1533
RFC 2131 (DHCP) 也指出:
The 'options' field is now variable length. A DHCP client must be
prepared to receive DHCP messages with an 'options' field of at least
length 312 octets. This requirement implies that a DHCP client must
be prepared to receive a message of up to 576 octets, the minimum IP
当客户端必须准备好接收至少 312 字节的可选字段时,这是否也意味着它必须创建一个最小长度为 312 字节的 DHCP 可选字段?如果是这样,填充字段是否用于填充其余部分,直到达到 312 字节?在 Wireshark 中检查数据包时,我还看到了长度仅为 60 字节的选项字段。魔术 cookie 是否也算作选项字段的一部分,因为在 RFC 2131 的 DHCP 结构中它没有被描述为消息的自己的一部分。