Skip to main content

5. Updates to Existing Standards (对现有标准的更新)

本章节详细说明了本文档对 RFC 791、RFC 1122 和 RFC 2003 的具体更新内容。


5.1 Updates to RFC 791 (对 RFC 791 的更新)

RFC 791 是 IPv4 协议的基础规范,定义了 IPv4 头部格式和各字段的语义。本文档对 RFC 791 中关于标识 (Identification, ID) 字段的规范进行了以下更新:

5.1.1 原始规范 (Original Specification)

RFC 791 第 3.2 节对 ID 字段的描述如下:

"Identification: 16 bits

An identifying value assigned by the sender to aid in assembling the fragments of a datagram."

RFC 791 还规定:

"The choice of the Identification value is left to the sender, but it must be unique for each datagram during the time the datagram (or any fragment of it) could be alive in the internet."

这意味着,对于具有相同源地址、目的地址和协议的数据报,其 ID 字段在最大生存时间 (MSL) 内必须唯一。

5.1.2 更新内容 (Updates)

本文档对 RFC 791 的更新如下:

对于原子数据报 (DF=1):

  • 发送端 可以 (MAY) 将 ID 字段设置为任意值。
  • ID 字段不需要在数据报之间保持唯一性。
  • 接收端 必须 (MUST) 忽略原子数据报的 ID 字段值。

对于非原子数据报 (DF=0):

  • 发送端 必须 (MUST) 确保 ID 字段在重组超时期间内唯一。
  • 对于具有相同源地址、目的地址和协议的数据报,其 ID 字段在重组超时期间内不得重复。
  • 接收端 必须 (MUST) 使用 ID 字段来重组分片。

5.1.3 更新后的规范文本 (Updated Specification Text)

RFC 791 第 3.2 节中关于 ID 字段的描述应更新为:

"Identification: 16 bits

An identifying value assigned by the sender to aid in assembling the fragments of a datagram.

For atomic datagrams (DF=1), the sender MAY set the Identification field to any value, and the receiver MUST ignore the Identification field.

For non-atomic datagrams (DF=0), the sender MUST ensure that the Identification field is unique for all datagrams with the same source address, destination address, and protocol during the reassembly timeout period. The receiver MUST use the Identification field to reassemble fragments."


5.2 Updates to RFC 1122 (对 RFC 1122 的更新)

RFC 1122 定义了互联网主机的要求,包括对 IPv4 协议的实现要求。本文档对 RFC 1122 中关于 ID 字段的规范进行了以下更新:

5.2.1 原始规范 (Original Specification)

RFC 1122 第 3.2.1.5 节对 ID 字段的描述如下:

"When sending an identical copy of an earlier datagram, a host MAY optionally retain the same Identification field in the copy."

RFC 1122 还规定:

"Some Internet protocol experts have maintained that when a host sends an identical copy of an earlier datagram, the new copy should contain the same Identification value as the original. There are two suggested advantages: (1) if the datagrams are fragmented and some of the fragments are lost, the receiver may be able to reconstruct a complete datagram from fragments of the original and the copies; (2) a congested gateway might use the IP Identification field (and Fragment Offset) to discard duplicate datagrams from the queue."

然而,RFC 1122 也指出:

"However, the Identification field is not intended for this purpose. The IP Identification field is intended to be used only for fragmentation and reassembly."

5.2.2 更新内容 (Updates)

本文档对 RFC 1122 的更新如下:

对于原子数据报 (DF=1):

  • 主机 可以 (MAY) 将 ID 字段设置为任意值,包括固定值、计数器或随机值。
  • 主机 不应 (SHOULD NOT) 依赖 ID 字段来检测重复数据报。
  • 主机 必须 (MUST) 使用传输层协议 (如 TCP 序列号) 来检测重复数据报。

对于非原子数据报 (DF=0):

  • 主机 必须 (MUST) 确保 ID 字段在重组超时期间内唯一。
  • 主机 应该 (SHOULD) 为每个 (源地址, 目的地址, 协议) 元组维护独立的 ID 计数器。

5.2.3 更新后的规范文本 (Updated Specification Text)

RFC 1122 第 3.2.1.5 节应更新为:

"For atomic datagrams (DF=1), a host MAY set the Identification field to any value. The host MUST NOT rely on the Identification field for duplicate detection and MUST use transport-layer mechanisms (e.g., TCP sequence numbers) for this purpose.

For non-atomic datagrams (DF=0), a host MUST ensure that the Identification field is unique for all datagrams with the same source address, destination address, and protocol during the reassembly timeout period. The host SHOULD maintain separate Identification counters for each (source address, destination address, protocol) tuple."


5.3 Updates to RFC 2003 (对 RFC 2003 的更新)

RFC 2003 定义了 IP-in-IP 封装 (IP Encapsulation within IP),用于 IP 隧道和移动 IP。本文档对 RFC 2003 中关于 ID 字段的规范进行了以下更新:

5.3.1 原始规范 (Original Specification)

RFC 2003 第 3.1 节对外部 IPv4 头部的 ID 字段描述如下:

"Identification: A new number must be assigned for the encapsulating datagram. This is not related to the Identification field of the original datagram."

这意味着,在执行 IP-in-IP 封装时,外部 IPv4 头部的 ID 字段必须独立于内部 IPv4 头部的 ID 字段。

5.3.2 更新内容 (Updates)

本文档对 RFC 2003 的更新如下:

对于外部 IPv4 头部 (Outer IPv4 Header):

  • 如果外部头部的 DF 标志位设置为 1 (原子数据报),封装设备 可以 (MAY) 将外部头部的 ID 字段设置为任意值。

  • 如果外部头部的 DF 标志位设置为 0 (非原子数据报),封装设备 必须 (MUST) 确保外部头部的 ID 字段在重组超时期间内唯一。

对于内部 IPv4 头部 (Inner IPv4 Header):

  • 封装设备 不得 (MUST NOT) 修改内部 IPv4 头部的 ID 字段。

  • 解封装设备 必须 (MUST) 保留内部 IPv4 头部的 ID 字段,并根据内部头部的 DF 标志位来处理该字段。

5.3.3 更新后的规范文本 (Updated Specification Text)

RFC 2003 第 3.1 节应更新为:

"Identification: A new number must be assigned for the outer encapsulating datagram. This is not related to the Identification field of the inner datagram.

For atomic outer datagrams (outer DF=1), the encapsulator MAY set the outer Identification field to any value.

For non-atomic outer datagrams (outer DF=0), the encapsulator MUST ensure that the outer Identification field is unique for all outer datagrams with the same outer source address, outer destination address, and protocol during the reassembly timeout period.

The encapsulator MUST NOT modify the Identification field of the inner datagram. The decapsulator MUST preserve the Identification field of the inner datagram and process it according to the inner DF flag."


5.4 Summary of Updates (更新总结)

本文档对以下 RFC 进行了更新:

RFC更新内容影响范围
RFC 791区分原子数据报和非原子数据报的 ID 字段要求IPv4 协议规范
RFC 1122更新主机对 ID 字段的生成和处理要求互联网主机实现
RFC 2003更新 IP-in-IP 封装中对 ID 字段的处理要求IP 隧道和移动 IP

这些更新使得 IPv4 的 ID 字段处理方式与 IPv6 保持一致,并解决了高速网络环境下的 ID 字段耗尽问题。


Navigation: