Connectivity testing with Ping, Telnet, Tracert and PathPing:
All of the following command line tools are accessed from the command prompt. You can open a command prompt window by selecting Start | All Programs | Accessories | Command Prompt.
You can also open the command prompt window by selecting Start | Run - and then entering CMD.EXE into the dialog box and pressing the Enter key or the OK button.
Each tool in this KB is given only a very basic overview and usage description. We would suggest that you research each of these in more detail to learn about advanced usage.
The ping command is a very simple connectivity testing tool. Ping verifies connectivity by sending Internet Control Message Protocol (ICMP) echo packets to a host and listening for an echo reply.
The ping command waits for each packet sent and prints the number of packets transmitted and received. Each received packet is validated against the sent packet. The default setting will send four echo packets containing 64 bytes of data. You can use the ping utility to test both the host name and IP address of the host for DNS resolution. A successful IP ping and failed host name ping could indicate name resolution issues.
In a command prompt window, enter Ping followed by the Fully Qualified Domain Name (FQDN) or IP address of the server you want to test. You may wish to use the –t command line switch to send continuous echo requests to a host.
Common usage examples might be to test for a server to be restarted and start responding again. You may wish to use the –t command line switch to send continuous echo requests:
Ping 126.96.36.199 –t
Another example may be to test what IP address is returned by a specific record or service lookup:
Telnet comes from the combination of the words telephone and network. It was originally designed to allow for command line remote management over slower connection types. RFC 854 states: “ The purpose of the TELNET Protocol is to provide a fairly general, bi-directional, eight-bit byte orientated communications facility. “
It is a TCP based protocol that can also be used to test a variety of services for connectivity. You can use it to test for SMTP, SQL or Remote Desktop connectivity. This is a good test to use for service or port blocks resulting from a firewall configuration.
In a command prompt, enter TELNET, followed by the Fully Qualified Domain Name (FQDN) or IP address of the server you want to connect to - and then the port that the service uses.
TELNET 188.8.131.52 5678
The following is a list of common protocols and ports of interest:
The response of a successful connection will be different for each service, but a failed connection will always respond with a variation of the following message: "Could not open connection to the host, on port n: Connect failed"
When testing your mail connection with Telnet, you will want to reference the mail record for the domain:
TELNET mail.yourdomain.com 25
Tracert is the Windows implementation of the traceroute tool that originated on UNIX and Cisco systems. Tracert is a Windows command-line tool that displays the path a packet takes to reach a destination from the machine that it is executed on. It does this by sending Internet Control Message Protocol (ICMP) echo request messages to the destination. It does this by incrementally increasing the Time To Live (TTL) values to find the path taken to the destination address. The path is displayed as a list in the order of which it heard back from each node that it passed through on its way to the destination.
When you run tracert, the top line shows the destination of the trace. It also lets us know that it stops if it reaches a maximum of 30 hops. Next you will see each hop it takes to reach the destination. The number of hops will go in order numerically from 1 to 30 depending on the path to the destination. Following this tracert will normally include at least 4 pieces of information for each hop; the number of the hop, the Round Trip Time (RTT is displayed in milliseconds or ms) it takes to get from the interface of the current hop and then back again to your machine, the IP address of the interface for that hop and the hostname corresponding to the IP address of the hop. The default is to send out 3 packets to each hop. This is done in case a packet is lost and allows you to get an idea of whether or not there is a variance in the time for a specific hop.
A high number on the first external hop from you machine is a good indication of possible Local Area Network (LAN) issues.
An asterisk (*) indicates an echo request that was lost. These can be the result of security implementations of firewalls or Access Control List (ACL’s). Additionally, routers may be configured not to respond to this type of traffic. You may see a row of three asterisks with no IP address or hostname. The trace may then continue responding normally again and display the destination results.
In a command prompt window, enter TRACERT followed by the Fully Qualified Domain Name (FQDN) or IP address of the server you want to test. You may wish to use the –d command line switch to prevent Tracert from resolving the name of the nodes from the IP address in the trace route.
You can see the output results in the following example:
Tracing route to 184.108.40.206 over a maximum of 30 hops:
1 <1 ms <1 ms <1 ms 220.127.116.11
2 <1 ms <1 ms <1 ms 18.104.22.168
3 1 ms 1 ms 1 ms 22.214.171.124
4 1 ms 1 ms 12 ms 126.96.36.199
5 * * * Request timed out.
6 14 ms 13 ms 13 ms 188.8.131.52
Additionally, you can use external tools such as www.traceroute.org or other ‘looking glass’ type sites to verify traces from different geographic locations throughout the world. You may want to select multiple sites to test connectivity to your server.
PathPing is a utility that combines many of the features of Ping and Tracert into one tool. You can use it to verify connectivity to a host as well as see if you are taking an optimal path to a remote host or suffering from a bottleneck somewhere in the connection route. The final output provides statistics on the latency (packet loss) by sending multiple echo requests over a period of time to each node between the local and remote host.
Initially, PathPing will produce results are similar to Tracert; you will see the hop number followed by the IP address or node name. PathPing will then compute the statistics (the time this takes depends on the number of hops) for each node in the connection route. After the computation is complete, the window will display the following information for each node: Hop number, Round Trip Time (RTT), percent of packets Lost and Sent for Source to Here, the Address of the node at that hop and the percent of packets Lost and Sent from This Node/Link to the next node. You can see the output results in the following example:
Source to Here This Node/Link
Hop RTT Lost/Sent = Pct Lost/Sent = Pct Address (Node)
0/100 = 0% |
1 30ms 0/100 = 0% 0/100 = 0% 184.108.40.206/
0/100 = 0% |
2 30ms 0/100 = 0% 0/100 = 0% 220.127.116.11/
33/100 = 33% |
3 30ms 0/100 = 0% 0/100 = 0% 18.104.22.168/
0/100 = 0% |
0 30ms 0/100 = 0% 0/100 = 0% 22.214.171.124
The “Source to Here” – is the first set of statistic after the hop number is equivalent to if you pinged the node directly.
The “This Node/Link” is the set of statistic before the pipe and is the column you want to pay the most attention to. This will show you the statistics for the links between the nodes.
In the above example, the link between 126.96.36.199 and 188.8.131.52 is dropping 33 percent of the packets. The router at hop 3 is dropping packets addressed to it, but this loss does not affect their ability to forward traffic.
A 0/100 = 0% means that out of 100 packets, none were lost. A low single digit loss 1% or 2% is common, but anything higher is an indication of
In a command prompt window, enter PathPing followed by the Fully Qualified Domain Name (FQDN) or IP address of the server you want to test. You may wish to use the –n command line switch to prevent PathPing from resolving name from the IP address of the nodes in the connection route.
PATHPING –n 184.108.40.206
PathPing offers slightly more accurate output over Tracert because it provides averages based on multiple echo requests. One disadvantage to PathPing is that it can take longer to return results.
All of these Windows utilities are based on ICMP echo request over TCP/IP - otherwise known as ping packets. Many firewalls block ICMP traffic - so you may not get the response although the site is up and responsive. Access rules can cause false negatives with the reporting of from these network tools.
Article ID: 445, Created On: 7/16/2006, Modified: 5/26/2009