This article explains how to use ping and traceroute tools to test network connectivity between two hosts. Ping performs a simple check to verify if a remote host is reachable, while traceroute maps the complete path that network packets take from one host to another. Traceroute is particularly useful for identifying points of network slowdowns or congestion.
Testing Network Connectivity
There are situations where local testing on your computer via the command line is necessary. For instance, when verifying connectivity between your computer and a remote host, web-based tools won’t provide the required details, as they only test connectivity from their server to the remote host.
The steps to use ping and traceroute vary based on your computer’s operating system. Below are the instructions for each system.
Checking Host Availability with a Ping Test
The ping test is a simple and effective method to confirm connectivity between your computer and a remote host. This test can easily be run using the command line.
Using Ping on Microsoft Windows
To perform a ping test on a Windows system:
Click Start, select Run, type
cmd
, and press Enter.At the command prompt, enter the following command, replacing
example.com
with the domain you wish to test:ping example.com
Analyze the results to determine the connectivity status.
- If the remote host is online and set to reply to ping requests, you will see responses. For instance, the output below displays ping responses from a BrawHosting server:
C:\Documents and Settings\user>ping a2s78.brawhosting.com
Pinging a2s78.brawhosting.com [216.119.143.98] with 32 bytes of data:
Reply from 216.119.143.98: bytes=32 time=46ms TTL=54
Reply from 216.119.143.98: bytes=32 time=45ms TTL=54
Reply from 216.119.143.98: bytes=32 time=47ms TTL=54
Ping statistics for 216.119.143.98:
Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 45ms, Maximum = 47ms, Average = 46ms
- If the remote host is offline or not configured to respond to ping requests, you will not receive any responses. Additionally, firewalls can be set to block ping packets. In such cases, a remote host may be operational and functioning normally but is configured to ignore ping requests.
Using ping test on Apple Mac OS X and Linux
To run the ping program on Mac OS X and Linux, follow these steps:
- Open a terminal window:
- On Mac OS X: Navigate to Applications, select Utilities, and then click Terminal.
- On Linux: Open a terminal window, which is accessible from the applications menu or by pressing a shortcut key combination, depending on your desktop environment.
2. At the command prompt, type the following command, replacing example.com
with the domain you want to test:
ping example.com
- If the remote host is active and configured to respond to ping requests, you will see responses. For example, the following output shows ping responses from an A2 Hosting server:
user@localhost:~$ ping a2s78.BrawHosting.com
PING a2s78.BrawHosting.com (216.119.143.98) 56(84) bytes of data.
64 bytes from a2s78.BrawHosting.com (216.119.143.98): icmp_req=1 ttl=54 time=44.4 ms
64 bytes from a2s78.BrawHosting.com (216.119.143.98): icmp_req=2 ttl=54 time=43.8 ms
64 bytes from a2s78.BrawHosting.com (216.119.143.98): icmp_req=3 ttl=54 time=44.7 ms
- Conversely, if the remote host is unavailable or not set up to respond to ping requests, no responses will appear. Firewalls can also be configured to block ping packets. Therefore, if a remote host does not reply to ping requests, it may still be operational and functioning normally but is simply ignoring the ping requests.
Testing the path to a remote host with traceroute
Using tracert on Microsoft Windows
On Windows systems, the tracert
program can be used to analyze the path to a server. Follow these steps to perform the test:
1. Open a Command Prompt window by clicking Start, selecting Run, typing cmd
, and pressing Enter.
2. In the Command Prompt, type the following command, replacing example.com
with the domain you want to test:tracert example.com
3. Analyze the tracert output:
Each hop is displayed as a numbered entry in the left column. The output includes the domain and IP address for each hop, along with the time it takes for the packet to reach that point. For instance, the following example illustrates the route taken to a BrawHosting server:
C:\>tracert a2s78.BrawHosting.com
Tracing route to a2s78.BrawHosting.com [216.119.143.98]
over a maximum of 30 hops:
1 1 ms <1 ms <1 ms Linksys [192.168.0.1]
[Lines omitted for brevity]
8 45 ms 38 ms 38 ms pos-1-6-0-0-pe01.350ecermak.il.ibone.comcast.net [68.86.87.130]
9 67 ms 150 ms 76 ms cr-1.sfld-mi.123.net [66.208.233.62]
10 44 ms 63 ms 46 ms gateway1.BrawHosting.com [216.234.104.254]
11 72 ms 57 ms 63 ms a2s78.BrawHosting.com [216.119.143.98]
Trace complete.
You can check the times between each hop to identify any locations where the connection may be delayed. If tracert times out, it will display an asterisk (*) to indicate that no response was received from that hop.
Using traceroute on Apple Mac OS X and Linux
To use the traceroute program on Apple Mac OS X and Linux, follow these steps:
Open a terminal window. The method for doing this depends on your operating system and desktop environment:
- On Mac OS X, go to Applications, then Utilities, and click Terminal.
- On Linux, simply open a terminal window.
At the command prompt, type the following command. Replace “example.com” with the domain you want to test:
traceroute example.com
- Interpret the output from traceroute:
- Traceroute shows each hop in the left column, which is numbered sequentially. For each hop, it displays the domain and IP address, as well as the time spent for the packet to reach that hop. For example, the following output demonstrates the path to a BrawHosting server:
1 Linksys (192.168.0.1) 0.315 ms 0.452 ms 0.472 ms
[Lines omitted for brevity]
8 pos-1-6-0-0-pe01.350ecermak.il.ibone.comcast.net (68.86.87.130) 39.010 ms 38.054 ms 38.092 ms
9 cr-1.sfld-mi.123.net (66.208.233.62) 45.056 ms 44.335 ms 44.974 ms
10 gateway1.BrawHosting.com (216.234.104.254) 45.274 ms 46.650 ms 46.089 ms
11 a2s78.BrawHosting.com (216.119.143.98) 44.654 ms 46.028 ms 43.852 ms
You can analyze the times between each hop to identify any locations where the connection might be slowing down or hanging. If there are delays or no response at any hop, it may indicate congestion or issues at that specific point in the network path. In some cases, a timeout might occur, shown as an asterisk (*), which means that the request was not answered within the expected time frame. This could happen due to network congestion, firewall rules, or routing issues.
Testing network connectivity with MTR
MTR (My Traceroute) is a network diagnostic tool that combines the capabilities of both the ping and traceroute utilities. It offers a real-time view of the path that network packets take to reach their destination.
Using MTR on Microsoft Windows
WinMTR is the Windows version of MTR. You can download WinMTR from sourceforge.net/projects/winmtr and install it on your machine.
Once WinMTR is installed, follow these steps to run a network test:
- Open WinMTR.
- Enter the domain you want to test in the Host text field.
- Click “Start” to begin testing. MTR will continuously check connectivity to the host and show the packet route, along with the total number of pings sent.
- To stop the test, click “Stop.”
If needed, click “Copy Text to Clipboard” to copy the MTR output. This allows you to paste the data into another application, such as a text editor or email client. For instance, if you raise a support ticket with BrawHosting’s Guru Crew, they may ask you to provide the MTR output for troubleshooting network connectivity issues.
Using MTR on Linux
MTR may already be pre-installed with your Linux distribution. If not, you can easily install it using your package manager (such as apt-get
or yum
). After installing MTR, follow these steps to run a network test:
Open a terminal window on your Linux system.
To begin the network test, type the following command, replacing
example.com
with the domain you want to test:
This command runs MTR in text mode. If your Linux system has a desktop environment installed, you can opt for the following command to launch MTR with a graphical user interface (GUI):
3. MTR will continuously monitor connectivity to the host, displaying the packet route and the total number of pings.
- To change the display mode, type
d
. - To restart the test, type
r
. - For additional help, type
h
.
- To change the display mode, type
4. To stop the test, type q
.