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