Checking Connectivity with the PING Command
As you might know, a submarine can detect a nearby object by using sonar to send out a sound wave and then seeing whether the wave is reflected. This is called pinging an object.
Windows Vista has a PING command that performs a similar function. PING sends out a special type of IP packet-called an Internet Control Message Protocol (ICMP) echo packet-to a remote location. This packet requests that the remote location send back a response packet. PING then tells you whether the response was received. In this way, you can check your network configuration to see whether your computer can connect with a remote host.
To use PING, first open a command-line session by selecting Start, All Programs, Accessories, Command Prompt. Here's a simplified version of the PING syntax:
ping [-t] [-n count] target_name
-t | Pings the specified target_name until you interrupt the command. |
-n count | Sends the number of echo packets specified by count. The default is 4. |
target_name | Specifies either the IP address or the hostname (a fully qualified domain name) of the remote host you want to ping. |
Here's an example that uses PING on the Google.com domain:
C:\Users\Paul>ping google.com Pinging google.com [64.233.187.99] with 32 bytes of data: Reply from 64.233.187.99: bytes=32 time=43ms TTL=240 Reply from 64.233.187.99: bytes=32 time=42ms TTL=239 Reply from 64.233.187.99: bytes=32 time=43ms TTL=239 Reply from 64.233.187.99: bytes=32 time=42ms TTL=240 Ping statistics for 64.233.187.99: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),A Approximate round trip times in milli-seconds: Minimum = 42ms, Maximum = 43ms, Average = 42ms
Here you see that each echo packet received a reply. If you can't connect to the remote host, ping returns a Request timed out message for each packet. If you can't connect to a remote host, here are some notes on using PING to troubleshoot problems:
- First, check to see whether you can use PING successfully on the loopback address:
ping 127.0.0.1.
The only reason this PING would fail is if your computer doesn't have the Internet Protocol installed. However, all Vista machines have IP installed, and the option to uninstall it is disabled, so pinging the loopback address will almost certainly work. The only reason to include it in your troubleshooting is that if it doesn't work, it means you have a serious problem with your machine. Either revert to a working configuration (see "Reverting to an Earlier Configuration," later in this tutorial), reinstall Windows Vista, or take your machine to a computer repair professional. - Try using PING on your computer's IP address. (If you're using DHCP, run the IPCONFIG utility to get your current IP address.) If you don't get a successful echo, then your NIC may not be inserted properly or the device drivers may not be installed. See "Troubleshooting the NIC," later in this tutorial.
- Now PING another computer on your network. If PING fails, check your cable or wireless connections.
- The next test you should run is on your default gateway (that is, your router). If you can't successfully ping the router's internal IP address, you won't be able to access remote Internet sites. In this case, check the IP address you entered for the gateway, check the cable connections, and make sure the router is turned on. You may need to power cycle the router.
- If you get this far, try using PING on the remote host you're trying to contact. If you're unsuccessful, check to make sure that you're using the correct IP address for the host. Try power cycling your broadband modem.
In this tutorial:
- Vista Troubleshooting Network
- Repairing a Network Connection
- Checking the Connection Status
- Checking for Solutions to Problems
- Troubleshooting Using Online Resources
- Checking Connectivity with the PING Command
- Troubleshooting Cables
- Troubleshooting the NIC
- Viewing the NIC in Device Manager
- Troubleshooting Wireless Network Problems
- Reverting to an Earlier Configuration