Network Tools

You won't use them often if your LAN and your Internet connection are working properly, but you should know about a handful of troubleshooting tools that allow you to examine the innards of your network and its Internet connection.

All of these tools are simple text commands that you can use with just about any operating system. When you type a command, the system will display the results in the same window or screen. In Microsoft Windows, you can open a Command Prompt window after selecting Start▸ Programs or by selecting Start▸ Run and then typing cmd. In Mac OS X, select Applications▸ Utilities and the Terminal program. If you're using Linux or Unix, use a command prompt or an XTerminal.

The IPConfig tool displays detailed information about your computer's current LAN and Internet connection, as shown in Example 4-1.


In this example, Connection-specific DNS Suffix is an address assigned by a DHCP host. This address is often an arbitrary name used internally within the network, but if your computer is connected directly to the Internet, it might be your computer's DNS address. If you try to connect to a domain name without a suffix (such as "example" rather than "example.net"), the network will assign this suffix to the address when it sends it to a DNS server.

The IP Address is the numeric address of this computer within the LAN or WAN. The Subnet Mask tells the network which parts of the numeric address identify individual computers, and the Default Gateway is the numeric address within the LAN of the gateway router that connects your LAN to the Internet.

For more details about your network connection, add /all to the command, as shown in Example 4-2.


Obviously, this command produces a lot more information. The Host Name is the name that this computer uses on the LAN. The Description identifies the type of network interface adapter that connects this computer to the network. The Physical Address is the MAC address—the unique hardware identifier—of the network adapter. The DHCP Server is the address of the device that assigns IP addresses to other devices on the LAN (in this case, this device is the same as the Default Gateway), and the DNS Servers are the computers that this network consults to convert DNS addresses into numeric IP addresses. The Lease Obtained and Lease Expires lines show the date and time that this computer obtained its IP address from the DHCP server and the time the computer will give up that address; the host automatically renews the lease long before it expires, so you don't have to worry about the expiry time.

The ifconfig command is available in Macinstosh OS X and in Unix and Linux. This command displays information about the current network interface, including the connection type and the connection's current status. The format of the information display, however, varies in different operating systems. Therefore, the best place to find a detailed explanation of the ifconfig display produced by your own system is the man page for the ifconfig command.

The ping command is an echo request. When you type ping target address, your computer sends a series of "please answer" messages to the target address, and that computer sends you a reply, as shown in Example 4-3. Your computer measures the amount of time for each roundtrip and displays the duration in milliseconds.


Many books and people will tell you that ping is an acronym for Packet InterNet Groper, but Mike Muuss, who wrote the original program, always insisted that he chose the name to imitate the sound of a sonar system aboard a submarine; the sonar system makes an audible "ping" when an echo pulse returns from a target.

ping has several uses. It can confirm that the distant computer is alive, and that your computer's connection is working properly. It can also provide a rough idea of the network's performance (less time means higher speed). ping is also useful for finding a DNS problem; if you get a successful ping echo when you enter the target's numeric IP address, but not when you enter the domain name, the glitch is almost certainly someplace in the DNS system.

In Example 4-3, it took about one-tenth of a second (100 ms) for each test to go from Seattle to San Francisco and back. That's a perfectly reasonable amount of time. But if one or more of the attempts had taken around 500 milliseconds or more, that would indicate some kind of problem.

Ping has also become a verb in computer jargon. You'll hear a technician at a help desk ask you to "ping me" at a specific address, meaning that you should send a ping request to that address. Some people have extended that usage beyond computer networks: They'll talk about "pinging" somebody when they intend to get that person's attention, either by email, telephone, or even poking their head into the recipient's office.

Many large commercial Internet sites, such as yahoo.com and microsoft.com, have chosen to block ping requests from outside their own network. If you get a no reply response to a ping request, try another address before you assume the problem is with your own Internet connection.

The TraceRoute tool measures and displays the amount of time it takes for your computer to receive an echo from each network device between your computer and the target. As a result, a TraceRoute display can show you the route between your computer and any other computer on the Internet and pinpoint the segment of that route where a problem is occurring. In Windows, the command is tracert; in OS X, Linux and Unix, it's traceroute. TraceRoute sends three requests to each intermediate node, and shows the timing for each request.

Example 4-4 shows a TraceRoute from my office in Seattle to No Starch Press in San Francisco.


In this case, it took 15 hops to complete the connection:

❶ The first two lines show the very fast response from the router sitting on the same table as the computer through a 6-foot cable. Line 2 repeats line 1 because of a software problem in the router.

❷ Line 3, whose domain name and IP address I have hidden, is my Internet service provider's WAN, a couple of miles away in downtown Seattle. Completing that echo takes longer, but it's still pretty fast.

❸ Lines 4 to 7 show the packets moving through various routers in the same switching center in Seattle.

❹ Starting at line 8, the route apparently jumps through routers in Chicago, Kansas City, Fort Worth, and Dallas, which increases the response times.

❺ The path moves around a routing center in Dallas at lines 11 through 15 until it ends up at the Laughing Squid web host that houses the No Starch web server.

This connection goes from origin to destination with several thousand miles of detours. However, the whole thing takes only about a tenth of a second, so those detours don't really matter.

TraceRoute can help identify several possible problems:

Unless you're a network manager, you probably won't have to analyze TraceRoute reports very often. But if you're having a connection problem, they can sometimes help you to understand why you're not getting through to a website or instant message recipient.