Ping and Traceroute Tests (29.2)
This section discusses two important tools that are used to verify Layer 3 connectivity: ping and traceroute.
Ping—Test Connectivity (29.2.1)
This section explains when to use the ping and traceroute (tracert in Windows) tools and how to use them. Ping is an IPv4 and IPv6 testing utility that uses ICMP Echo Request and Echo Reply messages to test connectivity between hosts.
To test connectivity to another host on a network, an Echo Request is sent to the host address using the ping command. If the host at the specified address receives the Echo Request, it responds with an Echo Reply. As each Echo Reply is received, ping provides feedback on the time between when the request was sent and when the reply was received. This can provide a measure of network performance.
Ping has a timeout value for the reply. If a reply is not received within the timeout, ping provides a message indicating that a response was not received. This may indicate that there is a problem, but could also indicate that security features blocking ping messages have been enabled on the network. It is common for the first ping to time out if address resolution (ARP or ND) needs to be performed before sending the ICMP Echo Request.
After all the requests are sent, the ping utility provides a summary that includes the success rate and average round-trip time to the destination.
Types of connectivity tests performed with ping include the following:
• Pinging the local loopback
• Pinging the default gateway
• Pinging a remote host
Ping the Local Loopback (29.2.2)
Ping can be used to test the internal configuration of IPv4 or IPv6 on the local host. To perform this test, ping the local loopback address of 127.0.0.1 for IPv4 (::1 for IPv6), as shown in Figure 29-6.
Figure 29-6 Pinging the Local Loopback on a Windows Host
A response from 127.0.0.1 for IPv4, or ::1 for IPv6, indicates that IP is properly installed on the host. This response comes from the network layer. This response is not, however, an indication that the addresses, masks, or gateways are properly configured. Nor does it indicate anything about the status of the lower layers of the network stack. This simply tests IP down through the network layer of IP. An error message indicates that TCP/IP is not operational on the host.
Ping the Default Gateway (29.2.3)
You can also use ping to test the ability of a host to communicate on the local network. This is generally done by pinging the IP address of the default gateway of the host, as shown in Figure 29-7. A successful ping to the default gateway indicates that both the host and the router interface serving as the default gateway are operational on the local network.
Figure 29-7 Pinging the Default Gateway
For this test, the default gateway address is most often used because the router is normally always operational. If the default gateway address does not respond, a ping can be sent to the IP address of another host on the local network that is known to be operational.
If either the default gateway or another host responds, this confirms that the local host can successfully communicate over the local network. If the default gateway does not respond but another host does, this could indicate a problem with the router interface serving as the default gateway. One possibility is that the wrong default gateway address has been configured on the host. Another possibility is that the router interface is fully operational but has security applied to it that prevents it from processing or responding to ping requests.