Upon completion of this chapter, you will be able to answer the following questions:
• How is ICMP used to test network connectivity?
• How do you use ping and traceroute utilities to test network connectivity?
Welcome to ICMP! Imagine that you have an intricate model train set. Your tracks and trains are all connected and powered up and ready to go. You throw the switch. The train goes halfway around the track and stops. You know right away that the problem is most likely located where the train has stopped, so you look there first. It is not as easy to visualize this with a network. Like a train, packets might not make it to their destination. Fortunately, there are tools to help you locate problem areas in your network, and they work with both IPv4 and IPv6 networks! You will be happy to know that this chapter has a couple Packet Tracer activities to help you practice using these tools, so let’s get testing!
In this section, you will learn about the different types of Internet Control Message Protocol (ICMP) messages and the tools that are used to send them.
ICMPv4 and ICMPv6 Messages (29.1.1)
Although IP is only a best-effort protocol, the TCP/IP suite does provide for error messages and informational messages when communicating with another IP device. These messages are sent using the services of ICMP. The purpose of these messages is to provide feedback about issues related to the processing of IP packets under certain conditions, not to make IP reliable. ICMP messages are not required and are often not allowed within a network for security reasons.
ICMP is available for both IPv4 and IPv6. ICMPv4 is the messaging protocol for IPv4. ICMPv6 provides these same services for IPv6 but includes additional functionality. In this chapter, the term ICMP is used when referring to both ICMPv4 and ICMPv6.
The types of ICMP messages, and the reasons why they are sent, are extensive. The ICMP messages common to both ICMPv4 and ICMPv6 and discussed in this section include
• Host reachability messages
• Destination Unreachable
• Time Exceeded
An ICMP Echo message can be used to test whether a host on an IP network is reachable. The local host sends an ICMP Echo Request to a host. If the destination host is available, it responds with an Echo Reply, as shown in Figure 29-1. This use of the ICMP Echo messages is the basis of the ping utility.
Figure 29-1 Echo Request and Echo Reply
Destination or Service Unreachable (29.1.3)
When a host or gateway receives a packet that it cannot deliver, it can use an ICMP Destination Unreachable message to notify the source that the destination or service is unreachable. The message includes a code that indicates why the packet could not be delivered.
Some of the Destination Unreachable codes for ICMPv4 are as follows:
• 0—Net unreachable
• 1—Host unreachable
• 2—Protocol unreachable
• 3—Port unreachable
Some of the Destination Unreachable codes for ICMPv6 are as follows:
• 0—No route to destination
• 1—Communication with the destination is administratively prohibited (for example, by a firewall)
• 2—Beyond scope of the source address
• 3—Address unreachable
• 4—Port unreachable
An ICMPv4 Time Exceeded message is used by a router to indicate that a packet cannot be forwarded because the Time-to-Live (TTL) field of the packet was decremented to 0. If a router receives a packet and decrements the TTL field in the IPv4 packet to 0, it discards the packet and sends a Time Exceeded message to the source host.
ICMPv6 also sends a Time Exceeded message if the router cannot forward an IPv6 packet because the packet has expired. Unlike IPv4, IPv6 doesn’t have a TTL field; ICMPv6 uses the IPv6 Hop Limit field to determine if the packet has expired.
Note
Time Exceeded messages are used by the traceroute tool.