跳到主要内容

22. IPv4 TOS Octet 的历史定义

22. IPv4 TOS Octet 的历史定义

IPv4 TOS (Type of Service) byte 在历史上有过多种定义和用途. 本节简要回顾这些历史定义, 为理解 ECN 如何与这些字段交互提供背景.

RFC 791 中的原始定义:

RFC 791 [RFC791] 最初定义 TOS byte 包含以下字段:

  0   1   2   3   4   5   6   7
+---+---+---+---+---+---+---+---+
| Precedence | D | T | R | C | 0 |
+---+---+---+---+---+---+---+---+

其中:

  • Bits 0-2: Precedence
  • Bit 3: Delay (D)
  • Bit 4: Throughput (T)
  • Bit 5: Reliability (R)
  • Bit 6: Cost (C)
  • Bit 7: Reserved (must be zero)

RFC 1349 修订:

RFC 1349 [RFC1349] 修订了 TOS byte 定义, 但基本结构仍然类似.

RFC 2474 Differentiated Services 定义:

RFC 2474 [RFC2474] 为 Differentiated Services (DS) 重新定义了该 byte:

  0   1   2   3   4   5   6   7
+---+---+---+---+---+---+---+---+
| DSCP | ECN |
+---+---+---+---+---+---+---+---+

其中:

  • Bits 0-5: DSCP (Differentiated Services Codepoint)
  • Bits 6-7: ECN (Explicit Congestion Notification)

本文档 (RFC 3168) 与 RFC 2474 一致, 使用 TOS byte 的最后两位 (bits 6-7) 作为 ECN.

需要注意, ECN field 的定义与 Differentiated Services 架构相协调, 以确保二者可以共存并互操作. DSCP field 和 ECN field 可以独立使用, 互不干扰.