ping(1M)
NAME
ping − send ICMP ECHO_REQUEST packets to network hosts
SYNOPSIS
ping [-r] [-v] [-o] host [packetsize] [count]
DESCRIPTION
ping sends an ICMP echo (ECHO_REQUEST) packet to host once per second. Each packet that is echoed back (via an ECHO_RESPONSE packet) is reported on the screen, including round-trip time.
ECHO_REQUEST datagrams (“pings”) have an IP and ICMP header, followed by a struct timeval, and an arbitrary number of “pad” bytes used to fill out the packet. Default datagram length is 64 bytes, but this can be changed by using the command-line option.
Other options and parameters are:
-r Bypass the normal routing tables and send directly to a host on an attached network. If the host is not on a directly-attached network, an error is returned. This option can be used to ping a local host through an interface that has no route through it (such as after the interface was dropped by gated (see gated(1M)).
-v Verbose output. ICMP packets other than ECHO_RESPONSE that are received are listed.
-o Insert “record route” IP option in outgoing packets, summarizing routes taken when the program exits. It may not be possible to get the round-trip path if all hosts on the route taken do not implement the “record route” IP option. A maximum of nine Internet addresses can be displayed due to the maximum length of the IP option area.
host host can be a hostname or an Internet address. All symbolic names specified for a host are looked up using gethostbyname() (see gethostbyname(3N)). If host is an Internet address, it must be in “dot” notation (see inet_addr(3N)).
packetsize By default (when packetsize is not specified), the size of transmitted packets is 64 bytes. The minimum value allowed for packetsize is eight bytes, and the maximum is 4096 bytes. Also, if packetsize is smaller than 16 bytes, there is not enough room for timing information. In this case the round-trip times are not displayed.
count The number of packets ping will transmit before terminating. Range: 1 to (2∗∗31 −1), decimal. Default: ping sends packets until interrupted.
When using ping for fault isolation, it should first be run on the local host to verify that the local network interface is working correctly, then hosts and gateways further and further away should be pinged. ping sends one datagram per second, and prints one line of output for every ECHO_RESPONSE returned. No output is produced if there is no response. If an optional count is given, only the specified number of requests is sent. Round-trip times and packet loss statistics are computed. When all responses have been received or the program times out (with a count specified), or if the program is terminated with a SIGINT, a brief summary is displayed.
This program is intended for use in testing, managing, and measuring network performance. It should be used primarily for manual fault isolation. Because of the load it could impose on the network, it is considered discourteous to use ping unnecessarily during normal operations, or from automated scripts.
AUTHOR
ping was developed in the Public Domain.
FILES
/etc/hosts
SEE ALSO
gethostbyname(3N), rlb(1M), inet(3N).
Hewlett-Packard Company — HP-UX Release 9.0: August 1992