ICMP
The Internet Control Message Protocol, or ICMP, described in RFC 792, specifies a variety of messages whose common purpose is to manage the internetwork. ICMP messages may be
Figure 2.28. The ICMP packet header includes a type field, a code field that further identifies some types, and a checksum. The rest of the fields depend on the type and code.
Table 2.5. ICMP packet types and code fields.
Figures 2.29 and 2.30 show analyzer captures of two of the most well-known ICMP messages ”Echo Request and Echo Reply, which are used by the ping function. Figure 2.29. An ICMP Echo message, shown with its IP header.
Figure 2.30. An ICMP Echo Reply without the IP header displayed. The packet summary window in the background shows four Echo/Echo Reply pairs, which make up four Pings.
Although most ICMP types have some
Router Advertisement and Router Selection , types 9 and 10, respectively, are used by the ICMP Router Discovery Protocol (IRDP).
Redirect
, ICMP type 5, is used by routers to notify
Figure 2.31. Using the debugging function debug ip icmp, this router can be seen sending a redirect to host 10.158.43.25, informing it that the correct router for reaching destination 10.158.40.1 is reachable via gateway (gw) 10.158.43.10.
A frequently used trick to avoid redirects on data links with multiple attached gateways is to set each host's default gateway as its own IP address. The hosts will then ARP for any address, and if the address is not on the data link, the correct router should respond via proxy ARP. The benefits of using this tactic merely to avoid redirects are debatable; redirects are decreased or eliminated but at the expense of increased ARP traffic. Redirects are enabled by default on Cisco routers and may be disabled on a per interface basis with the command no ip redirects . |