IP protocol itself does not provide a direct method for the terminal system to find those sent to the destination address of the IP packet fails. Further, the IP does not provide a direct way to get diagnostic information (e.g., a router which is used or a method to estimate round trip time along the way).
To address these deficiencies, a special Internet Control Message Protocol (Internet Control Message Protocol, ICMP) used in conjunction with IP to provide IP configuration and protocol layer IP packets and related diagnostic and control information disposal
ICMP belong to that level? ICMP is usually part of the IP layer is considered, it requires the presence of all IP implementations. It uses the IP protocol for transmission. Thus, more particularly, neither a network layer protocol, a transport protocol is not, but in between
ICMP version:
ICMP divided ICMPv4, ICMPv6 (respectively corresponding to IPv4, IPv6)
Compared to IPv4, ICMPv4, ICMPv6 plays a more important role in IPv6
ICMP functions
ICMP is responsible for delivery may be noted that errors and control messages
ICMP packets by the IP layer itself is usually the upper layer protocol (e.g. TCP or the UDP), and even in some cases trigger the execution of the user application
Please note, ICMP does not provide reliability to IP networks . On the contrary, it shows that certain categories of fault and configuration information . The most common loss (router buffer overflow) will not trigger any ICMP messages. By other protocols such as TCP to handle the situation
Two, ICMP in IPv4, IPv6 packets encapsulated
ICMP messages are encapsulated within an IP datagram transmitted , as shown in FIG.
ICMP packets may be like other IP datagram that is fragmented (see later in the article IP fragmentation), although this is not common
In IPv4
In IPv4 , the protocol (Protocol) field is 1 indicating that the message carries the ICMPv4
In IPv6
In IPv6, ICMPv6 packets may be after the beginning of zero or more extension header
The last extension header is located before the ICMPv6 header contains a value of 58, the next head (Next Header) field
Three, ICMP packet format
The first 4 bytes are fixed in all packets, but not in the portions of different packets
Type field
In ICMPv4, the type field is reserved 42 different values, for determining a specific packets
However, probably only eight are frequently used (described later)
Code field
Many types of ICMP packets also use different code field value further specifies the meaning of the message
Checksum field
Checksum field covers the entire packet ICMPv4
In ICMPv6, it covers a pseudo header from the IPv6 header (pseudo-header)
In the checksum algorithm described earlier and the Internet checksum for the IP header checksum is calculated of the same algorithm
Please note that this is our first end (end-to-end) checksum example . The checksum is carried all the way from the sender ICMP message to the final recipient. In contrast, IPv4 header checksum check Internet discussion described earlier and will change at each hop router. If a received ICMP implement a checksum error ICMP packets, the packet is dropped; no ICMP packets may indicate the received ICMP packet checksum is wrong. Recall, IP layer can not protect the payload of the datagram. If the checksum does not include ICMP, ICMP message content may be incorrect, leading to a false system behavior
Message types,
ICMP can be divided into two categories:
About the IP datagram delivery of ICMP packets (referred to as error messages)
For information collection and configuration of ICMP packets (referred to as query or informational messages)
Four, ICMPv4 message
For ICMPv4:
Info message comprises: echo request, echo response (type-division ratio of 8 and 0), and the router advertisement and router solicitation (9 and 10 dB type, referred to the same router discovery)
Error message comprises: Destination Unreachable (Type 3), the redirection (type 5), time-out (type 11), parameters of the problem (Type 12)
Here is the ICMPv4 message types
Below is a table-by-segment for each type
Five, ICMPv6 packets
ICMPv6 is not only responsible for the error and informational messages, also responsible for configuring routers and hosts a large number of IPv6:
In the following table, the presence of evident separation (i.e., packet type 128 and below 128 and above) between a first set of packet types and packet type of the second set
Within ICMPv6, and as ICMPv4, packets are also grouped into classes, and class information of the error
However, all the high order bits of the error ICMPv6 packet type (Type) field is 0. Thus, the ICMPv6 type from 0 to 127 are the error message , the type of from 128 to 255 are informational message
Many informational message is a request / response pair