h1

The Ping Command

December 23, 2007

The Ping command is a good place to begin your network troubleshooting. The utility is used to test connectivity between two systems on the network. Ping uses the ICMP protocol to exchange packets with the remote system. It uses the ICMP protocol to send UDP messages to an address (ECHO REQUEST) and waits to hear for a reply (ECHO REPLY). The remote system sends the reply packets back to their source, and the round trip is determined.

The Ping command has a much different syntax when used with the Windows operating system (both servers and clients). The options include the following:

-t: Continues pinging until explicitly halted by using CTRL+C. Statistics are displayed after you halt the command.

-a: Resolves addresses to hostnames.

-n count: Specifies the number of ICMP ECHO REQUEST packets to send.

-l size: Sends buffer size.

-f: Sets the don’t fragment flag in the packet. This is useful to determine a device is changing the packet size between nodes.

-i TTL: Time to Live value.

-v TOS: Type of Service.

-r count: Displays route for count hops.

-s count: Displays a timestamp for each hop.

-j host-list: Loose source route along host-list.

-k host-list: Strict source route along host-list.

-w timeout: Timeout value to wait for each reply (in milliseconds).

Using Ping on Linux systems, the basic syntax is defined as follows:

-q: Quiet output; nothing is displayed except summary lines at startup and completion.

-v: Verbose output; Lists ICMP packets that are received in addition to echo responses.

-R: Record route option; includes the RECORD_ROUTE option in the ECHO REQUEST packet and displays the route buffer on returned packets.

-c Count: Specifies the number of ECHO REQUESTs to be sent before the concluding test (default is to run until interrupted with a CTRL+C).

-i Wait: Indicates the number of seconds to wait between sending each packet (default=1).

-s PacketSize: Specifies the number of data bytes to be sent; the total ICMP packet size will be PacketSize  + 8 bytes due to ICMP header (default=56 or a64-byte packet).

Host: Host IP address or hostname of a target system.

The syntax for using Ping on a Unix system is as follows:

-c number: Specifies the number of ICMP ECHO_REQUESTs that are sent out.

-d: Causes ping to send packets as fast as they are echoed back from the remote system, or up to 100 times per second. Exercise caution when using this option regularly, to avoid generating high volumes of traffic on a busy network.

-I seconds: Enables you to specify the number of seconds between each packet sent; the default is 1 second. This option cannot be used with the -R option.

-R: Records the route taken by the packet.

Troubleshooting a Network Connection Using the Ping Command:

1. Ping the local system’s own numeric IP address.
2. Ping the system’s hostname.
3. Ping another system that you know is on the local subnet.
4. Ping the default gateway (also called the default route).
5. Ping a system on a remote subnet.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: