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 |
|
|
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?
Readers' Questions
-
pietro7 months ago
- Reply
-
mezan8 months ago
- Reply
-
elias8 months ago
- Reply
-
erno8 months ago
- Reply