Windows7: Troubleshooting Networking from the Command Line (part 2)

1/5/2011 2:41:50 PM

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 7 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

-tPings the specified target_name until you interrupt the command.
-n countSends the number of echo packets specified by count. The default is 4.
target_nameSpecifies 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 domain:


Pinging [] with 32 bytes of data:

Reply from bytes=32 time=43ms TTL=240
Reply from bytes=32 time=42ms TTL=239
Reply from bytes=32 time=43ms TTL=239
Reply from bytes=32 time=42ms TTL=240

Ping statistics for
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:


    The only reason this PING would fail is if your computer doesn’t have the Internet Protocol installed. However, all Windows 7 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.

  • 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, your NIC may not be inserted properly or the device drivers may not be installed.

  • 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.

Tracking Packets with the TRACERT Command

If you can’t PING a remote host, it could be that your echo packets are getting held up along the way. To find out, you can use the TRACERT (trace route) command:

tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name

-dSpecifies not to resolve IP addresses to hostnames.
-h maximum_hopsSpecifies the maximum number of hops to search for the target_name. (The default is 30.)
-j host-listSpecifies loose source route along the host-list.
-w timeoutWaits the number of milliseconds specified by timeout for each reply.
target_nameSpecifies the hostname of the destination computer.

TRACERT operates by sending ICMP echo packets with varying TTL values. Recall that TTL places a limit on the number of hops that a packet can take. Each host along the packet’s route decrements the TTL value until, when the TTL value is 0, the packet is discarded (assuming that it hasn’t reached its destination by then).

In TRACERT, the ICMP packets specify that whichever host decrements the echo packet to 0 should send back a response. So, the first packet has a TTL value of 1, the second has a TTL value of 2, and so on. TRACERT keeps sending packets with incrementally higher TTL values until either a response is received from the remote host or a packet receives no response. Here’s an example of a TRACERT command in action:


Tracing route to []
over a maximum of 30 hops:

1 <1 ms <1 ms <1 ms
2 8 ms 8 ms 8 ms
3 6 ms 6 ms 6 ms
4 6 ms 6 ms 6 ms
5 8 ms 6 ms 7 ms
6 17 ms 17 ms 16 ms []
7 17 ms 17 ms 17 ms []
8 17 ms 17 ms 17 ms []
9 18 ms 17 ms 18 ms []
10 36 ms 36 ms 36 ms []
11 47 ms 46 ms 46 ms []
12 48 ms 48 ms 48 ms []
13 48 ms 48 ms 48 ms
14 49 ms 49 ms 49 ms
15 100 ms 100 ms 100 ms
16 99 ms 99 ms 99 ms
17 99 ms 99 ms 99 ms
18 99 ms 99 ms 99 ms
19 102 ms 101 ms 101 ms
20 99 ms 100 ms 99 ms

Trace complete.

The first column is the hop number (that is, the TTL value set in the packet). Notice that, in my case, it took 20 hops to get to The next three columns contain round-trip times for an attempt to reach the destination with that TTL value. (Asterisks indicate that the attempt timed out.) The last column contains the hostname (if it was resolved) and the IP address of the responding system.

Changing the Default TTL Value

One of the reasons your packets might not be getting to their destination is that the default TTL value used by Windows 7 might be set too low. This is actually very unlikely because the default is 128, which should be more than enough. However, you can increase this value if you want. Start the Registry Editor and highlight the following key:


Select Edit, New, DWORD Value, type DefaultTTL, and press Enter. Change the value of this new setting to any decimal value between 0 and 255 (0 to FF in hexadecimal).

Other -----------------
- Windows7: General Solutions to Network Problems (part 2) - Updating the Router Firmware
- Windows7: General Solutions to Network Problems (part 1) - Turning On Network Discovery
- Windows 7: Troubleshooting Networking - Checking the Connection Status
- Windows 7: Troubleshooting Networking - Repairing a Network Connection
- Windows 7: Troubleshooting Startup Using the System Configuration Utility
- Windows 7: Troubleshooting Startup - Recovering Using the System Recovery Options
- Windows 7: Troubleshooting Startup - When to Use the Various Advanced Startup Options
- Windows Vista: Windows Firewall Settings - Advanced Configuration
- Windows Vista: Windows Firewall Settings - Basic Configuration
- Windows 7: Troubleshooting Device Problems (part 3)
- Windows 7: Troubleshooting Device Problems (part 2) - Displaying a List of Nonworking Devices
- Windows 7: Troubleshooting Device Problems (part 1) - Troubleshooting with Device Manager
- Windows 7: Working with Device Security Policies
- Windows Vista : Configuring Network Security - Windows Defender
- Windows 7: Managing Your Hardware with Device Manager (part 4) - Writing a Complete List of Device Drivers to a Text File
- Windows 7: Managing Your Hardware with Device Manager (part 3) - Configuring Windows to Ignore Unsigned Device Drivers
- Windows 7: Managing Your Hardware with Device Manager (part 2) - Working with Device Drivers
- Windows 7: Managing Your Hardware with Device Manager (part 1)
- SOA with .NET and Windows Azure: WCF Extensions - WCF Transactions (part 2)
- SOA with .NET and Windows Azure: WCF Extensions - WCF Transactions (part 1)
- First look: Apple Watch

- 10 Amazing Tools You Should Be Using with Dropbox

- Sigma 24mm f/1.4 DG HSM Art

- Canon EF11-24mm f/4L USM

- Creative Sound Blaster Roar 2

- Alienware 17 - Dell's Alienware laptops

- Smartwatch : Wellograph

- Xiaomi Redmi 2
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8