Ping and Traceroute


Ping and Traceroute are utilities that can be used to help troubleshoot network or Internet connections. The Rackspace Cloud technical support team may request you to initiate a ping or traceroute to a destination (such as your FTP address or email server) to ensure that your PC is able to contact these network locations and locate the point of failure if it cannot.

Contents

//

Why would you want to ping or run a traceroute to a network host?

  • The ping utility tests responsiveness between two hosts (computers, routers, switches, etc.).

If you are unable to connect to a network host (such as your FTP server), you might try to ping that location to determine if you can contact that machine at all. If you are unable to ping a location this often indicates a problem with DNS resolution. To further troubleshoot a DNS problem, we recommend contacting our technical support team via phone, chat, or email.
 

  • The traceroute utility will check responsiveness as well as trace the path a packet takes to get from one host to the other.

If you are experiencing intermittent connection problems to a network host (such as your FTP server), you might try to traceroute to that location to determine where the problem is occurring. Some devices on a network path will not respond to ping or traceroute requests. In this case, using the traceroute utility can show the location right before the host that's not responding. This is useful to determine which host in the path is actually causing the problem with the connection.

System Requirements

The ping and traceroute (tracert) utilities are basic TCP/IP tools and are included with most computer operating systems (they are standard with Windows 98 through Windows 7, Macintosh OS X, and Linux/UNIX). A third-party program is necessary to use ping and tracert functions in Mac OS 9.x and below. Traceroute and Ping are small programs and will run with small amounts of RAM and hard drive space.

Ping

General Information

Ping is used primarily to find out if a computer is reachable. Ping accomplishes this task by sending out a special packet called the Internet Control Message Protocol (ICMP) echo request packet. ICMP packets are special IP messages that are used to send network information between two hosts (computers, routers, switches, etc.). When a machine receives an echo request, it responds with an echo reply, which indicates that network host is online.

Example

C:\> ping www.example.com 

or

C:\> ping 208.77.188.166 

will show:

 
Pinging www.example.com [208.77.188.166] with 32 bytes of data:
 
Reply from 208.77.188.166: bytes=32 time=45ms TTL=52

If you receive a response other than a reply, such as "Request timed out," that can indicate that the host doesn't reply to ICMP requests, but generally indicates there is a problem with your connection, the destination host's connection, or some problem between the two locations--which may be more identifiable by using traceroute.

Technical Information

One ICMP echo request packet is sent every second to www.example.com. When the ping program gets an echo reply back from the remote host (www.apple.com), it prints out the response, giving several pieces of information:

  • IP address of where the Echo Reply came from (usually this should be the IP address of www.example.com)
  • Number of bytes of data sent
  • Round trip time it took for a packet to go to and from the remote host
  • Time-to-live (TTL) field

Every packet that gets sent out has a TTL field which is set to a relatively high number (ping packets get a TTL of 255). As the packet travels over the network, the TTL field gets decreased by one for each node, server, or router it passes through. When the TTL drops to 0, the packet is discarded by the router. The main purpose of this is so that a packet doesn't live forever on the network and will eventually die when it is deemed "lost." If the TTL field varies in successive pings, it could indicate that the successive reply packets are going via different routes. This could indicate that certain network routes may be experiencing problems. Packets are being sent along different paths (and not the same path each time) trying to find the quickest alternative route.

The time field is an indication of the round-trip time to get a packet to the remote host. The reply is measured in milliseconds. In general, it's best if round-trip times are under 200 milliseconds. The time it takes a packet to reach its destination is called latency. If there is a large variance in the round-trip times, the network path may be experiencing problems. This is not necessarily an indication of a problem at the delivering network host or the destination network host--to get a better idea of where the latency is occurring it's a good idea to use traceroute.

How to use Ping

Windows Environment

Ping can be accessed at a DOS or command prompt. An Internet connection must already be established.

  1. Open a command prompt.
    • For Windows 95-98, click on Start > Programs > DOS Prompt.
    • For Windows NT, click on Start > Programs > Command Prompt.
    • In a Windows 2000, XP, or Vista environment, click on Start > Run. Type command into the dialog box, then click OK.
  2. In the resulting command line window, type ping hostname, where hostname can be a domain name, a machine name or an IP address.
  3. Press Enter.

For example:

C:\> ping www.example.com 

Mac OS X Environment

Mac OS X provides a graphical interface to the network utilities. An Internet connection must already be established.

  1. Double-click on the Hard Drive icon > Applications folder > Utilities folder > Network Utility program
  2. Select the Ping tab and enter the hostname, where hostname can be a domain name, a machine name or an IP address.
  3. Press Enter.

Linux/UNIX Environment

Ping can be accessed from the command line interface or terminal. An Internet connection must already be established.

  1. Launch a command line interface, console, or terminal (will vary depending on operating system distribution).
  2. In the resulting command line window or screen, type ping hostname, where hostname can be a domain name, a machine name or an IP address.
  3. Press Enter.

For example:

[user@homepc /home/user]# ping www.example.com 

Traceroute

General Information

The traceroute utility will check responsiveness as well as trace the path a packet takes to get from one host to the other.

Response times may vary dramatically because the packet is crossing long distances; other times the increases come from network congestion.

Example

C:\> tracert www.example.com 

or

C:\> tracert 208.77.188.166 

will show:

 
Tracing route to www.example.com [208.77.188.166]
over a maximum of 30 hops:
 
  1    14 ms    <1 ms    <1 ms  vl901.core1.sat.rackspace.com [64.39.2.65]
  2    47 ms    45 ms    45 ms  ge4-0.edge1.sat.rackspace.com [64.39.2.37]
  3    <1 ms    <1 ms    <1 ms  hagg-01-ge-1-1-0-0.snan.twtelecom.net [64.132.228.25]
  4     8 ms     8 ms     8 ms  peer-01-ge-4-0-0-0.dlfw.twtelecom.net [66.192.240.90]
  5    10 ms    10 ms    10 ms  te9-1.mpd01.dfw01.atlas.cogentco.com [66.28.4.173]
  6     *        *        *
  7    15 ms    15 ms    15 ms  te9-1.mpd02.iah01.atlas.cogentco.com [154.54.25.98]
  8    54 ms    54 ms    54 ms  te3-2.mpd02.lax01.atlas.cogentco.com [154.54.0.245]
  9    55 ms    55 ms    55 ms  te7-4.mpd01.lax06.atlas.cogentco.com [154.54.26.198]
 10    64 ms    55 ms    55 ms  38.106.6.34
 11    45 ms    45 ms    45 ms  www.example.com [208.77.188.166]
 
Trace complete.

Note the asterisks on line six. This can indicate that a response wasn't received. Some routers do not issue TTL-expired ICMP messages, but in most cases this indicates a failure to contact the next host in the chain. In this case we can see a problem occurred between te9-1.mpd01.dfw01.atlas.cogentco.com and te9-1.mpd02.iah01.atlas.cogentco.com, so this would suggest a problem in Cogent Co's configurations or a router that has failed on their network*. In this particular case, the failure is occurring at neither the client who is initiating the connection (myself in this case), nor the receiving party (www.example.com), and only the company who owns the router causing the issue would have the authority or ability to correct the problem. Luckily the problems that typically occur between two hosts are at major service providers; these providers typically know about the problems before you and I do and are working to correct them all ready. While you could try to contact these providers directly it's usually difficult to reach someone and it's typically unnecessary.

  • Please note this is an example failure, not an actual failure on the part of the Cogent Co company or their technical staff.

If the problem had occurred around lines 1 or 2 that would generally indicate a local network problem and we could contact our ISP (Internet Service Provider) to report the problem and request assistance--in this case, Rackspace.

If the problem had occurred at line 10, we could presume there was a problem within www.example.com's network and we could contact that company to report the problem and request assistance.

Technical Information

Traceroute (tracert) works by sending a packet to an open UDP port on a destination machine. For the initial three packets, traceroute sets the TTL (see explanation of TTL) to 1 and releases the packet. The packet then gets transferred to the first router (completing the first hop), and the TTL gets decremented by the router from 1 to 0. The router then discards the packet and sends off an ICMP notification packet to the original host with the message that the TTL expired from the router. This tells tracert what the first hop is and how long it takes to get there. Traceroute repeats this, gradually incrementing the TTL until a path to the remote host is traced and it gets back an ICMP Port Unreachable message, indicating that the remote host has been reached.

How to use Traceroute

Windows Environment

Traceroute can be accessed at a DOS or command prompt. An Internet connection must already be established.

  1. Open a command prompt.
    • For Windows 95-98, click on Start > Programs > DOS Prompt.
    • For Windows NT, click on Start > Programs > Command Prompt.
    • In a Windows 2000, XP, or Vista environment, click on Start > Run. Type command into the dialog box, then click OK.
  2. In the resulting command line window, type tracert hostname, where hostname can be a domain name, a machine name or an IP address.
  3. Press Enter.

For example:

C:\> tracert www.example.com 

Mac OS X Environment

Mac OS X provides a graphical interface to the network utilities. An Internet connection must already be established.

  1. Double-click on the Hard Drive icon > Applications folder > Utilities folder > Network Utility program
  2. Select the Traceroute tab and enter the hostname, where hostname can be a domain name, a machine name or an IP address.
  3. Press Enter.

Linux/UNIX Environment

Ping can be accessed from the command line interface or terminal. An Internet connection must already be established.

  1. Launch a command line interface, console, or terminal (will vary depending on operating system distribution).
  2. In the resulting command line window or screen, type traceroute hostname, where hostname can be a domain name, a machine name or an IP address.
  3. Press Enter.

For example:

[user@homepc /home/user]# traceroute www.example.com 


Was this content helpful?




© 2011-2013 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER