use herror
[unix-history] / usr / src / sbin / ping / ping.8
CommitLineData
d1e77920
KB
1.\" Copyright (c) 1985 The Regents of the University of California.
2.\" All rights reserved.
9aecb40e 3.\"
d1e77920
KB
4.\" Redistribution and use in source and binary forms are permitted
5.\" provided that the above copyright notice and this paragraph are
6.\" duplicated in all such forms and that any documentation,
7.\" advertising materials, and other materials related to such
8.\" distribution and use acknowledge that the software was developed
9.\" by the University of California, Berkeley. The name of the
10.\" University may not be used to endorse or promote products derived
11.\" from this software without specific prior written permission.
12.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14.\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15.\"
16.\" @(#)ping.8 6.3 (Berkeley) %G%
9aecb40e
KM
17.\"
18.TH PING 8 ""
19.UC 6
20.SH NAME
21ping \- send ICMP ECHO_REQUEST packets to network hosts
22.SH SYNOPSIS
23.B /etc/ping
9aecb40e 24[
d53739b5
MK
25.B \-r
26] [
27.B \-v
28]
29.I host
30[
31.I packetsize
32] [
33.I count
9aecb40e
KM
34]
35.SH DESCRIPTION
d53739b5 36The DARPA Internet is a large and complex aggregation of
9aecb40e
KM
37network hardware, connected together by gateways.
38Tracking a single-point hardware or software failure
39can often be difficult.
40.I Ping
d53739b5
MK
41utilizes the
42ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an
43ICMP ECHO_RESPONSE from a host or gateway.
9aecb40e
KM
44ECHO_REQUEST datagrams (``pings'') have an IP and ICMP header,
45followed by a \fBstruct timeval\fR, and then an arbitrary number
46of ``pad'' bytes used to fill out the packet.
47Default datagram length is 64 bytes, but this may be changed
48using the command-line option.
d53739b5
MK
49Other options are:
50.TP
51.B \-r
52Bypass the normal routing tables and send directly to a host on an attached
53network.
54If the host is not on a directly-attached network,
55an error is returned.
56This option can be used to ping a local host through an interface
57that has no route through it (e.g., after the interface was dropped by
58.IR routed (8C)).
59.TP
60.B \-v
61Verbose output. ICMP packets other than ECHO RESPONSE that are received
62are listed.
9aecb40e
KM
63.PP
64When using \fIping\fR for fault isolation,
65it should first be run on the local
66host, to verify that the local network interface is up and
d53739b5
MK
67running.
68Then, hosts and gateways further and further away
69should be ``pinged''.
70\fIPing\fR sends one datagram per second, and
9aecb40e 71prints one line of output for every ECHO_RESPONSE returned.
d53739b5
MK
72No output is produced if there is no response.
73If an optional
74.I count
75is given, only that number of requests is sent.
9aecb40e 76Round-trip times and packet loss statistics are computed.
d53739b5
MK
77When all responses have been received or the program times out (with a
78.I count
79specified),
80or if the program is terminated with a SIGINT, a brief
9aecb40e 81summary is displayed.
d53739b5
MK
82.PP
83This program is intended for use in network testing, measurement
84and management.
85It should be used primarily for manual fault isolation.
86Because of the load it could impose on the network,
87it is unwise to use
88.I ping
89during normal operations or from automated scripts.
9aecb40e
KM
90.SH AUTHOR
91Mike Muuss
92.SH SEE ALSO
d1e77920 93netstat(1), ifconfig(8)