Internet Control Message Protocol ICMP

ICMP messages are encapsulated within IP packets. Using a connectionless, unreliable transfer mechanism, ICMP is used to report errors within a network. Usually, only higher-level protocols are encapsulated within another protocol. However, ICMP is an integral part of the IP protocol suite that still is encapsulated within the data portion of an IP packet. RFCs 792 and 1700 define ICMP.

Even though ICMP message formats vary based on which service is requested, all ICMP messages have the first three fields in common. These fields are type, code, and checksum. Code is a single byte field whose purpose is to explain the type field further. The ICMP checksum is a 2-byte field that uses the same algorithm as the IP checksum field. However, the ICMP checksum only pertains to the ICMP portion of the IP message, not to the whole IP packet. All ICMP messages that report errors also carry the header and the first 8 bytes of the datagram that caused the error. Because the most critical information of a higher-level protocol using IP is carried within these first 8 bytes, this helps with detecting what caused the error.

The formats of echo request, echo reply, and destination unreachable messages are shown in Figure 1-10. Remember that this ICMP message is imbedded within the data portion of an IP packet, which is in turn encapsulated within another protocol, such as Ethernet.

Figure 1-10. ICMP Message Formats

ICMP Echo

IC UP Eclto Rtpty

ICMP Report of unfcachablc Ck'jirrilbon

Figure 1-10. ICMP Message Formats

Type value - S

Codn value = a

Checkst! m

Scqutncc riumhsr

□ftäul riete

Type value -0

Code variH - 0

Checksum

Sequence numbe*

Qpitonai data

Type wii.jc - e

Code value -1 -12

Checksum

UNUfAd {must he zero)

IP htadtr - ' rat ti h ts er Echo Revest datagram

The main use of ICMP is to provide a reporting function that identifies error conditions on network devices. Routers usually generate ICMP messages as they receive and route the IP packet. These ICMP messages contain three fields at the beginning of the packet:

• Type field— The type field is an 8-bit field that identifies the message. These type field values are displayed in Table 1-2.

Table 1-2. ICMP Type Field Values

Type Value

Message Type

0

Echo Reply

1

Unassigned

2

Unassigned

3

Destination Unreachable

4

Source Quench

5

Redirect

6

Alternate Host Address

7

Unassigned

8

Echo Request

9

Router Advertisement

10

Router Selection

11

Time Exceeded

12

Parameter Problem

13

Timestamp Request

14

Timestamp Reply

15

Obsolete (Information Request)

16

Obsolete (Information Reply)

17

Address Mask Request

18

Address Mask Reply

19-29

Reserved

30

Traceroute

31

Datagram Conversion Error

32

Mobile Host Redirect

33

IPv6—Where Are You?

34

IPv6—Here I am.

35

Mobile Registration Request

36

Mobile Registration Reply

37-255

Reserved

• Code field— The code field is an 8-bit field that provides further information about the ICMP message.

• Checksum field— The checksum field is a 16-bit field that is used to verify the integrity of the whole ICMP message.

Continue reading here: Simple Network Management Protocol SNMP

Was this article helpful?

0 0

Readers' Questions

  • pietro
    What is primary use of icmp?
    7 months ago
  • The primary use of ICMP (Internet Control Message Protocol) is for network debugging, error reporting, and communication between network devices. It is part of the Internet Protocol suite and it can provide information about network status, packet delivery, and other errors. It is also used for diagnostic testing and troubleshooting.
    • mezan
      Where are icmp packets identified?
      8 months ago
    • ICMP packets are identified by the protocol type field in the IP header. The value for ICMP is 0x01.
      • elias
        What is icmp protocol?
        8 months ago
      • Internet Control Message Protocol (ICMP) is a network layer protocol that is used to send control messages, such as error and query messages, between network devices. ICMP is part of the Internet Protocol Suite and an integral part of the TCP/IP (Transmission Control Protocol/Internet Protocol) protocol stack.
        • erno
          What is the purpose of icmp messages?
          8 months ago
        • The purpose of ICMP messages is to provide feedback about network issues. They are typically used to troubleshoot network issues, check for reachability, and monitor connections. ICMP messages can also be used for things such as determining the maximum transmission unit for IP datagrams, and reporting errors.