The Internet Control Message Protocol (ICMP) is one of the core protocols of the Internet Protocol Suite.
A D V E R T I S E M E N T
It is chiefly used by networked computers' operating systems to send error messages�indicating, for instance, that a requested service is not available or that a host or router could not be reached.
Internet Control Message Protocol is part of the Internet Protocol Suite as defined in RFC 792. ICMP messages are typically generated in response to errors in IP datagrams (as specified in RFC 1122) or for diagnostic or routing purposes.
The version of ICMP for Internet Protocol version 4 is also known as ICMPv4, as it is part of IPv4. IPv6 has an equivalent protocol, ICMPv6.
ICMP messages are constructed at the IP layer, usually from a normal IP datagram that has generated an ICMP response. IP encapsulates the appropriate ICMP message with a new IP header (to get the ICMP message back to the original sending host) and transmits the resulting datagram in the usual manner.
For example, every machine (such as an intermediate router) that forwards an IP datagram has to decrement the time to live (TTL) field of the IP header by one; if the TTL reaches 0, an ICMP Time to live exceeded in transit message is sent to the source of the datagram.
Each ICMP message is encapsulated directly within a single IP datagram, and thus, like UDP, ICMP is unreliable.
ICMP will report the following network information:
- Timeouts
- Network congestion
- Network errors such as an unreachable host or network.
The ping command is also supported by ICMP, and this can be used to
debug network problems.
ICMP Messages:
The ICMP message consists of an 8 bit type, an 8 bit code, an 8 bit
checksum, and contents which vary depending on code and type. The below
table is a list of ICMP messages showing the type and code of the
messages and their meanings.
Type |
Codes |
Description |
Purpose |
0 |
0 |
Echo reply |
Query |
3 |
0 |
Network Unreachable |
Error |
3 |
1 |
Host Unreachable |
Error |
3 |
2 |
Protocol Unreachable |
Error |
3 |
3 |
Protocol Unreachable |
Error |
3 |
4 |
Fragmentation needed with don't fragment bit set |
Error |
3 |
5 |
Source route failed |
Error |
3 |
6 |
Destination network unknown |
Error |
3 |
7 |
Destination host unknown |
Error |
3 |
8 |
Source host isolated |
Error |
3 |
9 |
Destination network administratively prohibited |
Error |
3 |
10 |
Destination host administratively prohibited |
Error |
3 |
11 |
Network Unreachable for TOS |
Error |
3 |
12 |
Host Unreachable for TOS |
Error |
3 |
13 |
Communication administratively prohibited by filtering |
Error |
3 |
14 |
Host precedence violation |
Error |
3 |
15 |
Precedence cutoff in effect |
Error |
4 |
0 |
Source quench |
Error |
5 |
0 |
Redirect for network |
Error |
5 |
1 |
Redirect for host |
Error |
5 |
2 |
Redirect for type of service and network |
Error |
5 |
3 |
Redirect for type of service and host |
Error |
8 |
0 |
Echo request |
Query |
9 |
0 |
Normal router advertisement |
Query |
9 |
16 |
Router does not route common traffic |
Query |
10 |
0 |
Router Solicitation |
Query |
11 |
0 |
Time to live is zero during transit |
Error |
11 |
1 |
Time to live is zero during reassembly |
Error |
12 |
0 |
IP header bad |
Error |
12 |
1 |
Required option missing |
Error |
12 |
2 |
Bad length |
Error |
13 |
0 |
Timestamp request |
Query |
14 |
0 |
Timestamp reply |
Query |
15 |
0 |
Information request |
Query |
16 |
0 |
Information reply |
Query |
17 |
0 |
Address mask request |
Query |
18 |
0 |
Address mask request |
Query |
ICMP is used for many different functions, the most important of which is
error reporting. Some of these are "port unreachable", "host unreachable",
"network unreachable", "destination network unknown", and "destination host
unknown". Some not related to errors are:
- Timestamp request and reply allows one system to ask another one for the
current time.
- Address mask and reply is used by a diskless workstation to get its
subnet mask at boot time.
- Echo request and echo reply is used by the ping program to test to see
if another unit will respond.
|