One command of interest is command 08, the echo request. When an IP stack receives an ICMP packet, it passes it to the ICMP protocol. When the ICMP protocol receives a command 08, it simply sends the packet back to the sender through the same interface from which it came in. This is the technology which allows the PING application to function. If a packet can be 'ECHOed' off of a remote host we know that the host is alive and that routing is in place between our host and the remote host.
PING is an excellent tool for network debugging.
If a remote host is not responding to echo requests, it is either off-line or there is a routing problem. Routing can be tested by PINGing nodes between the two hosts. I've used this utility to great advantage by exploiting its behavior of setting the errorlevel depending on the echo status. It can be used to test routing between hosts and restore a connection should there be a problem. Below is a script I use to connect to the Internet.