Karla News

A Tutorial to Troubleshoot Your Computer Network Using the PING Utility

Command Line

The PING command is one of the simplest commands that a computer user can play around with, and yet it is also an incredibly powerful diagnostic and probing tool. Knowing more about how to use PING can truly help beginner, intermediate and advanced users. If you are already a highly trained networking professional, you may already know all you need to know about PING. If not, this article might help you. If you aren’t looking for in-depth information about this single tool, you may want to jump to my article on the “Most Useful Run Commands,” but otherwise stick around for this ride!

PING is a TCP/IP utility application program that is included in just about every protocol stack imaginable. If you are involved in technical work or play and you need simple tools to help you, PING is applicable to most versions of Windows, Mac, Unix, and Linux. If you’d classify yourself as a total geek, you might want to know some things about the history and inner-workings of this tool, but if you are bored by that sort of thing then just skip on to the next paragraph! For those of you who are still with me, PING operates by generating an ICMP (Internet Control Message Protocol) Echo Message that results in the destination address issuing an Echo Response Message. It isn’t unlike the technique that bats use when bouncing short sonar pulses (pings?) off of their prey and waiting for the “bounce back” to achieve location. The original author of this tool is Mike Muuss who has said that he’d been studying radar and sonar when he had the idea to apply the idea to a computer problem.

Regardless, this tool is often the first to come to mind when troubleshooting network devices of all sorts on all operating systems. For example, you can use PING to determine whether a server, single-computer, or router is actually cabled to the network correctly and whether the configuration is correct. Once you have two devices networked, you can test this by sending a ping request from one to the other, usually by IP address. If the ping gets a response, that tells you that both devices are cabled and configured well enough to communicate. Ping also gives you some information about the timing between the source and the destination, so this can further assist you in troubleshooting your network. You can also ping by a host name (like www.lynnc.info) instead of the IP address. It is important to note, though, that the first ping will need to resolve the name to an IP address so this action will add to the round-trip time of the ping request.

See also  Review: BMG Music Service

If there is a problem with the network, the ping request can tell you a variety of things to help you fix the problem. If you receive a timeout message in response to an attempted ping, this just means that the destination device did not respond within a reasonable time period. It doesn’t necessarily mean that the destination is completely unavailable or that the cause is one definite thing such as a bad cable. If you are pinging across your own local network and you have intermediary devices included such as a router or hub, the problem may be with one of those devices. If you are pinging across a wide area network this further increase the variables. What you want to do in either of these cases is to try to locate the “bottleneck” or the place where the network activity is being stopped or slowed down. To go further with network troubleshooting using ping, it is helpful to have an idea of more than the basic command format.

Many computer users are familiar with the most basic use of ping, which is simple to include the command PING and the destination IP address or host name. For example, you can open a command-line window and use this command to get some basic results:

ping 216.241.164.182

This sort of ping command will most often result in one of two responses. You will either see something like this:

72 bytes from 216.241.164.182 time = 12.2 ms
72 bytes from 216.241.164.182 time = 12.2 ms
72 bytes from 216.241.164.182 time = 12.2 ms
72 bytes from 216.241.164.182 time = 12.2 ms

Or you might see something like this:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

The reason you will see multiple results is that the ping command will generally attempt to “bounce” off of the destination four times. (As you will soon see, there are ways to change this.) In a case where the network is “dropping” you might get a negative result from the first “bounce” and positive results from others. For example, you might see this:

Request timed out.
52 bytes from 216.241.164.182 time = 50 ms
Request timed out.
Request timed out.

In this case, ping did not locate the destination in a reasonable amount of time on the first attempt, it did succeed on the second attempt, and it then failed on the last two attempts. When you have network problems or when you just need to know more about what is happening on your network, it is good to know more advanced ways to utilize ping. The first option to try in network-problem situation is to ping the software loopback interface. To do this, just ping 127.0.0.1. If this ping fails, then you know right away that you have a problem with the software driver and need not go any further looking for network problems until that is resolved. If that succeeds, though, you are ready for more ping troubleshooting. Let’s cover some of the other common ping command formats.

See also  Open Source IPMI Software Summary

In order to use additional command-line parameter with ping, you will usually add a dash and a letter to tell ping what you want it to do. For example, to ping the specified host constantly instead of stopping at four times, you’d do this:

ping -t 216.241.164.182

Here is a basic list of types of command-line operators that you might want to use:

-t Ping the specified host until stopped.

-a Resolve addresses to hostnames.

-n count Number of echo requests to send.

-l size Send buffer size.

-f Set Don’t Fragment flag in packets.

-i TTL Time to Live.

-v TOS Type of Service

-r count Record route for count hops

-s count Timestamp for count hops

-j host-list Loose source route along host-list.

-k host-list Strict source route along host-list.

-w timeout Timeout in milliseconds to wait for each reply.

To give an example of how an additional operator can be useful, let’s consider ping -t. Let’s say that you are just a general user on your company network and you aren’t in charging of fixing something if it goes wrong, but you do have employees who’d like to know when the network is back up so they can continue their work. You could try refreshing a page in your internet browser once in awhile, of course, and this might tell you that you are online again. This will also require you to remember to do it, though, and it might be up for some time before you catch it if you get busy doing something else. A much simpler method would be to open a command-line window on a second monitor (or just to the side of the window you are working on) and in a simple ping request to bounce off of a destination host that you know should be up and working most of the time. To keep that ping going, you’ll use ping -t. So, if you set up this:

ping -t www.google.com OR ping -t 72.14.207.99

It will ping the destination host an unlimited number of times instead of just four. If your network is down, it will give you a message something like “request timed out” or “destination network unreachable” and those messages will keep repeating. In many cases, when your network comes back up you’ll see a few spotty positives mixed with some negatives like this:

See also  How to Fix Common DSN Problems

Destination host unreachable.
Destination host unreachable.
72 bytes from 216.241.164.182 time = 12.2 ms
Request timed out.
72 bytes from 216.241.164.182 time = 12.2 ms
72 bytes from 216.241.164.182 time = 12.2 ms
72 bytes from 216.241.164.182 time = 12.2 ms

And so on….

This tells you that your network is now up and your employees can go back to work! To stop the endless ping requests, you just hit CTRL-c and the pinging will stop. I used this command many times when I ran a public computer lab where students were waiting to use the internet. They appreciated the timely notice of the restore and I was glad to be able to tell them with assurance that they didn’t have to ask for repeated updates. One thing to note when using “ping -t” or other ping commands. If you aren’t super-familiar with the PING utility you may be concerned about accidentally causing a problem by using it. You may have read articles about “Denial of Service” (DOS/DOSS/DDS) attacks caused by the use of PING. It is beyond the scope of this article to go into detail on these type of attacks but if you are concerned you can do searches on “Denial of Service” and you’ll get all sorts of info. It would also be imprudent to give too much information here on launching this sort of attack which is absolutely both vandalism and illegal. Generally speaking, though, you’d have to launch massive ping efforts from multiple computers with a specific target to cause a problem with “ping.” When using the utility for its intended purposes it is unlikely that you have to be overly concerned with this.

This should give you a basic start to the use of the PING utility when troubleshooting a network. Try some of the tips given here to get started and hopefully you’ll understand a bit more about how to locate the source of a network problem. Then you may be ready to go onto other command-line and GUI network utilities.