DistributedNetworks DistributedNetworks


Network Monitoring  «Prev  Next»
Lesson 2The ping command
ObjectiveUse the ping command to check network status.

ping command (check network status)

Undoubtedly the single most useful command for checking network status is ping. The ping command uses the Internet Control Message Protocol (ICMP). This protocol, which operates at the network layer of the TCP/IP protocol stack, is used to pass error information among machines on the Internet.
In its simplest form, ping generates a series of ICMP echo-request packets directed at a particular machine. Upon receipt of such a packet, the target machine is required to generate an ICMP echo-reply packet directed at the sender. If these packets can be successfully exchanged, a network connection between the two machines exists. View the Slide Show below to see how ping can be used to test network connectivity.
1) The buyer (consumer) buys the digital equivalent of money from
2) A digitized check is encrypted (we will discuss security in a later
3) A consumer enters credit card information on a Web order form

Using ping when the network is broken

You will often use ping when your network is broken. In particular, name service may not be available. In this case, you should use IP addresses instead of host names, and you should use the appropriate option to ping (usually -n) to tell the ping not to try to look up host names, but rather to report only numbers.

Useful options for the ping command

The table below lists useful options for the Linux version of the ping command.

Linux version of ping command.

Option Purpose
-n Do not try to look up IP names; just use numbers. Use this option if name service is broken.
-c count Stop after sending count packets.
-i interval Wait interval seconds between packets.
-r Ignore the routing table; assume the host is on the local network. Useful if default route is messed up, or with other routing problems.
-s size Send a packet of given size (default is 64 bytes total).

Solaris
The Solaris version of ping is set up a little differently. The Solaris equivalent of Linux ping is ping -s hostname, which enables you to receive a report on each packet sent to the specified machine. (If you do not include the -s option with Solaris ping, the report you receive will simply state whether the machine you ping is alive or not.) Other useful Solaris ping options include:

Solaris version of ping command.

Option Purpose
-n Do not try to look up IP names; just use numbers. Use this option if name service is broken.
-r Ignore the routing table; assume the host is on the local network. Useful if default route is messed up, or with other routing problems.
-s size Send a packet of given size.
-c number Send specified number of packets.

Internet control message protocol (ICMP)" A protocol used to communicate errors or other conditions at the IP layer

TCP/IP: TCP/IP is the network protocol suite used by the Internet and most local area networks.