跳到主要内容

5. 错误报告与控制消息处理

CLNP 与 IP 向主机报告错误的方式不同. 在 IP 环境中, 使用互联网控制报文协议 (ICMP, [7]) 向发起无法处理的数据报的主机返回 (错误) 消息. ICMP 消息作为用户数据在 IP 数据报中传送. 报告的情况包括: 不可达目的地, 构造错误的 IP 数据报首部, 因拥塞导致的 IP 数据报丢弃, 以及生存期/重组超时; 引起错误的完整互联网首部加上该 IP 数据报中所含段至少 8 个八位组作为 ICMP 错误消息的一部分返回给发送方. 对于某些错误, 例如构造错误的 IP 数据报首部, 会标识出引发问题的具体八位组.

在 CLNP 环境中, 网络层协议首部中使用一种独特的消息类型, 即错误报告类型, 以区分错误报告与 CLNP 数据报. CLNP 错误报告在检测到与 ICMP 相同类型的错误时生成. 与 ICMP 错误消息一样, 引起错误的完整 CLNP 首部在错误报告的数据部分返回给发送方. 实现应当 (SHOULD) 将 CLNP 数据报中所含数据报至少 8 个八位组返回给原始 CLNP 数据报的发送方. 此处同样会针对某些错误标识出引发问题的具体八位组.

图 5-1 展示了拟用于 TUBA 环境的 CLNP 错误报告内容概要:

    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |        ........Data Link Header........       | NLP ID        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |Header Length  |     Version   | Lifetime (TTL)| 000 | Type=ER |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  TOTAL Length of Error Report |           Checksum            |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | Dest Addr Len |               Destination Address...          |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               ... Destination Address...                      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               ... Destination Address...                      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               ... Destination Address...                      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               ... Destination Address...                      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | PROTO field   | Src  Addr Len |  Source  Address...           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               ... Source Address...                           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               ... Source Address...                           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               ... Source Address...                           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               ... Source Address...                           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |       ... Source Address      | Reason for Discard (type/len) |
   |                               |   1100 0001   | 0000 0010     |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Reason for Discard        |    Options...                 |
   |   code        |   pointer     |                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                           Options                             |

: :

   |                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data |

: :

   |                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note that each tick mark represents one bit position.

Figure 5-1. Error Report Format

5.1. 处理错误报告的规则​

以下是处理错误报告的规则摘要:

         * An Error Report is not generated to report a problem
encountered while processing an Error Report.

* Error Reports MAY NOT be fragmented (hence, the
fragmentation part is absent).

* The Reason for Discard Code field is populated with one of
the values from Table 5-1.

* The Pointer field is populated with number of the first
octet of the field that caused the Error Report to be
generated. If it is not possible to identify the offending
octet, this field MUST be zeroed.

* If the Priority or Type of Service option is present in the
errored datagram, the Error Report MUST specify the same
option, using the value specified in the original datagram.

* If the Security option is present in the errored datagram,
the Error Report MUST specify the same option, using the
value specified in the original datagram; if the Security
option is not supported by the intermediate system, no Error
Report is to be generated (i.e., "silently discard" the
received datagram).

* If the Complete Source Route option is specified in the
errored datagram, the Error Report MUST compose a reverse of
that route, and return the datagram along the same path.

5.2. ICMP 与 CLNP 错误消息的比较​

表 5-1 对 ICMP 消息类型和代码与 CLNP 错误类型代码 (采用十进制互联网表示的值) 进行了粗略比较:

 CLNP Error Type  Codes            | ICMP Message           (Type, Code)
 ----------------------------------|------------------------------------
 Reason not specified          (0) | Parameter Problem           (12, 0)
 Protocol Procedure Error      (1) | Parameter Problem           (12, 0)
 Incorrect Checksum            (2) | Parameter Problem           (12, 0)
 PDU Discarded--Congestion     (3) | Source Quench                (4, 0)
 Header Syntax Error           (4) | Parameter problem           (12, 0)
 Need to Fragment could not    (5) | Frag needed, DF set          (3, 4)
 Incomplete PDU received       (6) | Parameter Problem           (12, 0)
 Duplicate Option              (7) | Parameter Problem           (12, 0)
 Destination Unreachable     (128) | Dest Unreachable,Net unknown (3, 0)
 Destination Unknown         (129) | Dest Unreachable,host unknown(3, 1)
 Source Routing Error        (144) | Source Route failed          (3, 5)
 Source Route Syntax Error   (145) | Source Route failed          (3, 5)
 Unknown Address in Src Route(146) | Source Route failed          (3, 5)
 Path not acceptable         (147) | Source Route failed          (3, 5)
 Lifetime expired            (160) | TTL exceeded                (11, 0)
 Reassembly Lifetime Expired (161) | Reassembly time exceeded    (11, 1)
 Unsupported Option          (176) | Parameter Problem           (12, 0)
 Unsupported Protocol Version(177) | Parameter problem           (12, 0)
 Unsupported Security Option (178) | Parameter problem           (12, 0)
 Unsupported Src Rte Option  (179) | Parameter problem           (12, 0)
 Unsupported Rcrd Rte        (180) | Parameter problem           (12, 0)
 Reassembly interference     (192) | Reassembly time exceeded    (11, 1)

    Table 5-1. Comparison of CLNP Error Reports to ICMP Error Messages

 Note 1: The current accepted practice for IP is that source quench
         should not be used; if it is used, implementations MUST
         not return a source quench packet for every relevant packet.
         TUBA/CLNP implementations are encouraged to adhere to these
         guidelines.

 Note 2: There are no corresponding CLNP Error Report Codes for the
         following ICMP error message types:
         - Protocol Unreachable  (3, 2)
         - Port Unreachable      (3, 3)
         [Note: Additional error code points available in the ER type
              code block can be used to identify these message types.]