Error message headers

ICMP error messages consist of a predefined set of fields that indicate the type of message being passed, and that also provide message-specific services (such as IP addresses or pointers to corrupt data). These predefined fields are followed by the IP header and the first eight bytes of data from the datagram that caused the error to be generated.

Since delivery problems can occur at any layer, ICMP error messages must include the full header and the first eight bytes of data from the failing IP datagram in order for the sender to see which packet failed, and in order for the sender to notify the transport and application protocols that generated the failure. This process allows the sender to pass the error message to the appropriate layer for subsequent processing.

Table 5.2 lists all of the fields in an ICMP error message’s header, along with their size (in bytes), and some usage notes. For more information on these fields, refer to the individual discussions throughout this section.

Table 5.2. Format of the ICMP Error Message

Field

Size

Usage Notes

Message Type

1 byte

Indicates the specific ICMP error message.

Message Code

1 byte

Indicates the specific subclass of the specific ICMP error message.

Checksum

2 bytes

Used to validate the ICMP message’s contents.

Message Data

4 bytes

Used for message-specific needs.

Original Headers

20-60 bytes

The full header of the IP datagram that failed.

Original Data

8 bytes

The first 64 bits of the IP datagram’s data. This data will contain ...

Get Internet Core Protocols: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.