Troubleshoot TCP/IP Problems with Ping

Troubleshoot TCP/IP Problems with Ping

Troubleshoot TCP/IP Problems with ping

The quickest, most commonly used, and, frequently most helpful TCP/IP troubleshooting tool is the command-line tool ping. Use ping to find out whether the resource or server you're trying to connect to on your network or the Internet is active, and to see if there are any problems with the hops along the way to that resource or server. ping sends Internet Control Message Protocol (ICMP) Echo Request messages to the destination you're checking on, receives responses in return, and reports to you information about the connection path between you and the destination and how quickly the packets made their trip. For example, if you are having trouble getting email from a server, your first step in troubleshooting should be to ping the server to see whether the server is live, and to see how responsive it is. To use ping, first open a command prompt:

Opening a Command Prompt in Windows

Then type:

ping target

where target is either a hostname or an IP address—for example, pop3.catalog.com, zdnet.com, or 209.124.112.1

In response, you'll get information in this format:


If the host isn't active, instead of getting this report, you'll get the message "Request timed out."

If you enter a hostname, ping reports back with its IP address and then gives details about its four attempts to contact the host, a measurement of how long (in milliseconds) the packet took to make the round trip between your PC and the host, the Time To Live (TTL) information about each packet, and a summary of its findings.

The TTL field can tell you how many hops the packets took to get from your PC to its destination. TTL initially specified the amount of time a packet could live, in seconds, before it expires, as a way to make sure that packets didn't simply bounce around the Internet forever and create traffic jams. However, it has been reinterpreted to mean the maximum number of hops that a packet will be allowed to take before its destination. The default number is 255. Each time a packet takes another hop, its TTL is reduced by one. The TTL number that ping reports is the packet's final TTL when it reaches its destination. To find out the number of hops a packet takes, subtract its initial TTL (by default 255) from the TTL reported by ping. In our example, the packets took 13 hops to get to their destination.

You can use ping with switches, like so:

ping -a -l 45 www.litecloudhosting.com

This command changes the packet size sent from its default size of 32 bytes to 45 bites, and resolves the IP address to a hostname—in other words, it lists the IP address's hostname.

ping has a wide variety of useful switches that you can use for all kinds of troubleshooting. You use the basic ping command to check whether an Internet or network resource is live and to see if there are any delays in reaching it. But, as the table below shows, you can use ping and its switches for many other purposes as well—for example, to find out the IP address of a hostname and vice versa.

Table:. Useful ping switches

Switch

What it does

-a

Resolves an IP address to a hostname.

-f

Turns on the "Don't Fragment" flag for a packet. This lets you send packets that don't get broken up and can be useful for when you want to test whether packets of a certain size are getting through.

-i value

Sets the value of the TTL field, using a number from 0 to 255. When you use this field, even though the field will be set to the number you specify, note that the ping report will report back as if it were set to 255. For example, if you set a TTL of 20 and the packet takes 15 hops, the TTL value that ping reports will be 240.

-l value

Pings using the value specified, in number of bytes.

-n count

Specifies the number of ICMP Echo Request messages sent, instead of the default number of 4.

-r count

Displays the IP addresses of the hops taken along the route to the destination. Specify a number between 1 and 9. If the number of actual hops exceeds the number you specify, you will get a "Request timed out" message.

-s count

Displays a timestamp for the Echo Request and the Echo Reply Request for hops along the route. Specify a number between 1 and 4. If the number of actual hops exceeds the number you specify, you will get a "Request timed out" message.

-t

Keeps sending the Echo Request message continually until stopped by pressing Ctrl-Break, Pause, or Ctrl-C.

-w value

The maximum amount of time (in milliseconds) to wait for an Echo Reply message for each Echo Request message before issuing a timeout message. The default is 4,000 (4 seconds) .


    • Related Articles

    • Troubleshoot Network Problems with pathping

      The pathping command is more similar to tracert than a simple ping. Just like the tracert command, pathping will give you information about all the steps along the path to the website you want to test. It does this by sending out full ping commands ...
    • Determining Your Public IP Address

      What Is My Public IP Address? Your public IP address is an external facing IP Address that's provided by your Internet Service Provider (ISP). A Pubic IP Address is accessible by anyone on the Internet. Internal IP's are known as Private IP's, which ...
    • How can I adjust the mic volume on my Polycom phone's handset?

      If your Polycom IP phone's mic is not outputting audio loud enough for parties to hear you on the other end of a call or if the mic is overly sensitive, the following procedure will allow you to make a small edit to the phone's configuration to ...