Internet Control Message Protocol

(ICMP)

The Internet Control Message Protocol (ICMP) protocol is classic example of a client server application. The ICMP server executes on all IP end system computers and all IP intermediate systems (i.e routers). The protocol is used to report problems with delivery of IP datagrams within an IP network. It can be sued to show when a particular End System (ES) is not responding, when an IP network is not reachable, when a node is overloaded, when an error occurs in the IP header information, etc. The protocol is also frequently used by Internet managers to verify correct operations of End Systems (ES) and to check that routers are correctly routing packets to the specified destination address.

ICMP messages generated by router R1, in response to message sent by H0 to H1 and forwarded by R0. This message could, for instance be generated if the MTU of the link between R0 and R1 was smaller than size of the IP packet, and the packet had the Don't Fragment (DF) bit set in the IP packet header. The ICMP message is returned to H0, since this is the source address specified in the IP packet which suffered the problem.

An ICMP message consisting of 4 bytes of PCI and an optional message

The format of an ICMP message is shown above. The 8-bit type code identifies the types of message. In this case two types of message are involved the ECHO request (sent by the client) and the ECHO reply (the response by the server). Each message may contain some optional data. When data are sent by a server, the server returns the data in the reply which is generated. ICMP packets are encapsulated in IP for transmission across an internet.

It is the responsibility of the network layer (IP) protocol to ensure that the ICMP message is sent to the correct destination. This is achieved by setting the destination address of the IP packet. The source address is set to the address of the computer generating the ICMP ECHO request and the IP protocol type is set to "ICMP" to indicate that the packet is to be handled by the remote end system's ICMP server program.

The figure below shows the encapsulation over an Ethernet LAN using an IP network layer header, and a MAC link layer header and trailer containing the 32-bit checksum:

Encapsulation for a complete ICMP packet (neglecting the Ethernet preamble)

The "ping" program contains a client interface to ICMP. This may be used by a user to verify an end to end connection is operational. The -s option of "ping" also collects some performance statistics (i.e. the measured round trip time and the number of times the remote server fails to reply. Each time an echo reply packet is received a single line of text is displayed. Each echo request packet contains a sequence number (starting at 0) which is incremented after each transmission, and a timestamp value indicating the transmission time. The text printed by ping shows the received sequence number, and the measured round trip time (in milliseconds).

Use of the ping program to test whether the computer "sysa" is operational.

The operation of ICMP is illustrated in the frame transition diagram shown above. In this case there is only one Intermediate System (IS) (router).


See also

ICMP Type and Code Values


Gorry Fairhurst - Department of Engineering, University of Aberdeen, Scotland, UK.

http://www.erg.abdn.ac.uk/users/gorry Date: 10/11/1995 Revised: 7/10/2003