xref: /aosp_15_r20/external/iputils/doc/ping.sgml (revision bd1f8aeb6080fa6544ec30aeca3eb4da100f359f)
1*bd1f8aebSAndroid Build Coastguard Worker<refentry id="ping">
2*bd1f8aebSAndroid Build Coastguard Worker
3*bd1f8aebSAndroid Build Coastguard Worker<refmeta>
4*bd1f8aebSAndroid Build Coastguard Worker<refentrytitle>ping</refentrytitle>
5*bd1f8aebSAndroid Build Coastguard Worker<manvolnum>8</manvolnum>
6*bd1f8aebSAndroid Build Coastguard Worker<refmiscinfo>iputils-&snapshot;</refmiscinfo>
7*bd1f8aebSAndroid Build Coastguard Worker</refmeta>
8*bd1f8aebSAndroid Build Coastguard Worker
9*bd1f8aebSAndroid Build Coastguard Worker<refnamediv>
10*bd1f8aebSAndroid Build Coastguard Worker<refname>ping, ping6</refname>
11*bd1f8aebSAndroid Build Coastguard Worker<refpurpose>send ICMP ECHO_REQUEST to network hosts</refpurpose>
12*bd1f8aebSAndroid Build Coastguard Worker</refnamediv>
13*bd1f8aebSAndroid Build Coastguard Worker
14*bd1f8aebSAndroid Build Coastguard Worker<refsynopsisdiv>
15*bd1f8aebSAndroid Build Coastguard Worker<cmdsynopsis>
16*bd1f8aebSAndroid Build Coastguard Worker<command>ping</command>
17*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt"><option>-aAbBdDfhLnOqrRUvV</option></arg>
18*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-c <replaceable/count/</arg>
19*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-F <replaceable/flowlabel/</arg>
20*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-i <replaceable/interval/</arg>
21*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-I <replaceable/interface/</arg>
22*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-l <replaceable/preload/</arg>
23*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-m <replaceable/mark/</arg>
24*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-M <replaceable/pmtudisc_option/</arg>
25*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-N <replaceable/nodeinfo_option/</arg>
26*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-w <replaceable/deadline/</arg>
27*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-W <replaceable/timeout/</arg>
28*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-p <replaceable/pattern/</arg>
29*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-Q <replaceable/tos/</arg>
30*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-s <replaceable/packetsize/</arg>
31*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-S <replaceable/sndbuf/</arg>
32*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-t <replaceable/ttl/</arg>
33*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt">-T <replaceable/timestamp option/</arg>
34*bd1f8aebSAndroid Build Coastguard Worker<arg choice="opt" rep="repeat"><replaceable/hop/</arg>
35*bd1f8aebSAndroid Build Coastguard Worker<arg choice="req"><replaceable/destination/</arg>
36*bd1f8aebSAndroid Build Coastguard Worker</cmdsynopsis>
37*bd1f8aebSAndroid Build Coastguard Worker</refsynopsisdiv>
38*bd1f8aebSAndroid Build Coastguard Worker
39*bd1f8aebSAndroid Build Coastguard Worker<refsect1><title>DESCRIPTION</title>
40*bd1f8aebSAndroid Build Coastguard Worker<para>
41*bd1f8aebSAndroid Build Coastguard Worker<command/ping/ uses the ICMP protocol's mandatory ECHO_REQUEST
42*bd1f8aebSAndroid Build Coastguard Workerdatagram to elicit an ICMP ECHO_RESPONSE from a host or gateway.
43*bd1f8aebSAndroid Build Coastguard WorkerECHO_REQUEST datagrams (``pings'') have an IP and ICMP
44*bd1f8aebSAndroid Build Coastguard Workerheader, followed by a <structname/struct timeval/ and then an arbitrary
45*bd1f8aebSAndroid Build Coastguard Workernumber of ``pad'' bytes used to fill out the packet.
46*bd1f8aebSAndroid Build Coastguard Worker</para>
47*bd1f8aebSAndroid Build Coastguard Worker<para>
48*bd1f8aebSAndroid Build Coastguard Worker<command/ping6/ is IPv6 version of <command/ping/, and can also send Node Information Queries (RFC4620).
49*bd1f8aebSAndroid Build Coastguard WorkerIntermediate <replaceable/hop/s may not be allowed, because IPv6 source routing was deprecated (RFC5095).
50*bd1f8aebSAndroid Build Coastguard Worker</para>
51*bd1f8aebSAndroid Build Coastguard Worker</refsect1>
52*bd1f8aebSAndroid Build Coastguard Worker
53*bd1f8aebSAndroid Build Coastguard Worker<refsect1><title>OPTIONS</title>
54*bd1f8aebSAndroid Build Coastguard Worker
55*bd1f8aebSAndroid Build Coastguard Worker<variablelist>
56*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
57*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-a/</term>
58*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
59*bd1f8aebSAndroid Build Coastguard WorkerAudible ping.
60*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
61*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
62*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
63*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-A/</term>
64*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
65*bd1f8aebSAndroid Build Coastguard WorkerAdaptive ping. Interpacket interval adapts to round-trip time, so that
66*bd1f8aebSAndroid Build Coastguard Workereffectively not more than one (or more, if preload is set) unanswered probe
67*bd1f8aebSAndroid Build Coastguard Workeris present in the network. Minimal interval is 200msec for not super-user.
68*bd1f8aebSAndroid Build Coastguard WorkerOn networks with low rtt this mode is essentially equivalent to flood mode.
69*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
70*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
71*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
72*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-b/</term>
73*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
74*bd1f8aebSAndroid Build Coastguard WorkerAllow pinging a broadcast address.
75*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
76*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
77*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
78*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-B/</term>
79*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
80*bd1f8aebSAndroid Build Coastguard WorkerDo not allow <command/ping/ to change source address of probes.
81*bd1f8aebSAndroid Build Coastguard WorkerThe address is bound to one selected when <command/ping/ starts.
82*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
83*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
84*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
85*bd1f8aebSAndroid Build Coastguard Worker  <term><option><anchor id="ping.count">-c <replaceable/count/</option></term>
86*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
87*bd1f8aebSAndroid Build Coastguard WorkerStop after sending <replaceable/count/ ECHO_REQUEST
88*bd1f8aebSAndroid Build Coastguard Workerpackets. With
89*bd1f8aebSAndroid Build Coastguard Worker<link linkend="ping.deadline"><replaceable/deadline/</link>
90*bd1f8aebSAndroid Build Coastguard Workeroption, <command/ping/ waits for
91*bd1f8aebSAndroid Build Coastguard Worker<replaceable/count/ ECHO_REPLY packets, until the timeout expires.
92*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
93*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
94*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
95*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-d/</term>
96*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
97*bd1f8aebSAndroid Build Coastguard WorkerSet the <constant/SO_DEBUG/ option on the socket being used.
98*bd1f8aebSAndroid Build Coastguard WorkerEssentially, this socket option is not used by Linux kernel.
99*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
100*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
101*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
102*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-D/</term>
103*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
104*bd1f8aebSAndroid Build Coastguard WorkerPrint timestamp (unix time + microseconds as in gettimeofday) before
105*bd1f8aebSAndroid Build Coastguard Workereach line.
106*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
107*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
108*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
109*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-f/</term>
110*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
111*bd1f8aebSAndroid Build Coastguard WorkerFlood ping. For every ECHO_REQUEST sent a period ``.'' is printed,
112*bd1f8aebSAndroid Build Coastguard Workerwhile for ever ECHO_REPLY received a backspace is printed.
113*bd1f8aebSAndroid Build Coastguard WorkerThis provides a rapid display of how many packets are being dropped.
114*bd1f8aebSAndroid Build Coastguard WorkerIf interval is not given, it sets interval to zero and
115*bd1f8aebSAndroid Build Coastguard Workeroutputs packets as fast as they come back or one hundred times per second,
116*bd1f8aebSAndroid Build Coastguard Workerwhichever is more.
117*bd1f8aebSAndroid Build Coastguard WorkerOnly the super-user may use this option with zero interval.
118*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
119*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
120*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
121*bd1f8aebSAndroid Build Coastguard Worker  <term><option>-F <replaceable/flow label/</option></term>
122*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
123*bd1f8aebSAndroid Build Coastguard Worker<command/ping6/ only.
124*bd1f8aebSAndroid Build Coastguard WorkerAllocate and set 20 bit flow label (in hex) on echo request packets.
125*bd1f8aebSAndroid Build Coastguard WorkerIf value is zero, kernel allocates random flow label.
126*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
127*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
128*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
129*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-h/</term>
130*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
131*bd1f8aebSAndroid Build Coastguard WorkerShow help.
132*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
133*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
134*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
135*bd1f8aebSAndroid Build Coastguard Worker  <term><option>-i <replaceable/interval/</option></term>
136*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
137*bd1f8aebSAndroid Build Coastguard WorkerWait <replaceable/interval/ seconds between sending each packet.
138*bd1f8aebSAndroid Build Coastguard WorkerThe default is to wait for one second between each packet normally,
139*bd1f8aebSAndroid Build Coastguard Workeror not to wait in flood mode. Only super-user may set interval
140*bd1f8aebSAndroid Build Coastguard Workerto values less 0.2 seconds.
141*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
142*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
143*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
144*bd1f8aebSAndroid Build Coastguard Worker  <term><option>-I <replaceable/interface/</option></term>
145*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
146*bd1f8aebSAndroid Build Coastguard Worker<replaceable/interface/ is either an address, or an interface name.
147*bd1f8aebSAndroid Build Coastguard WorkerIf <replaceable/interface/ is an address, it sets source address
148*bd1f8aebSAndroid Build Coastguard Workerto specified interface address.
149*bd1f8aebSAndroid Build Coastguard WorkerIf <replaceable/interface/ in an interface name, it sets
150*bd1f8aebSAndroid Build Coastguard Workersource interface to specified interface.
151*bd1f8aebSAndroid Build Coastguard WorkerFor <command/ping6/, when doing ping to a link-local scope
152*bd1f8aebSAndroid Build Coastguard Workeraddress, link specification (by the '%'-notation in
153*bd1f8aebSAndroid Build Coastguard Worker<replaceable/destination/, or by this option) is required.
154*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
155*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
156*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
157*bd1f8aebSAndroid Build Coastguard Worker  <term><option>-l <replaceable/preload/</option></term>
158*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
159*bd1f8aebSAndroid Build Coastguard WorkerIf <replaceable/preload/ is specified,
160*bd1f8aebSAndroid Build Coastguard Worker<command/ping/ sends that many packets not waiting for reply.
161*bd1f8aebSAndroid Build Coastguard WorkerOnly the super-user may select preload more than 3.
162*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
163*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
164*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
165*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-L/</term>
166*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
167*bd1f8aebSAndroid Build Coastguard WorkerSuppress loopback of multicast packets.  This flag only applies if the ping
168*bd1f8aebSAndroid Build Coastguard Workerdestination is a multicast address.
169*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
170*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
171*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
172*bd1f8aebSAndroid Build Coastguard Worker  <term><option>-m <replaceable/mark/</option></term>
173*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
174*bd1f8aebSAndroid Build Coastguard Workeruse <replaceable/mark/ to tag the packets going out. This is useful
175*bd1f8aebSAndroid Build Coastguard Workerfor variety of reasons within the kernel such as using policy
176*bd1f8aebSAndroid Build Coastguard Workerrouting to select specific outbound processing.
177*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
178*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
179*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
180*bd1f8aebSAndroid Build Coastguard Worker  <term><option>-M <replaceable/pmtudisc_opt/</option></term>
181*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
182*bd1f8aebSAndroid Build Coastguard WorkerSelect Path MTU Discovery strategy.
183*bd1f8aebSAndroid Build Coastguard Worker<replaceable/pmtudisc_option/ may be either <replaceable/do/
184*bd1f8aebSAndroid Build Coastguard Worker(prohibit fragmentation, even local one),
185*bd1f8aebSAndroid Build Coastguard Worker<replaceable/want/ (do PMTU discovery, fragment locally when packet size
186*bd1f8aebSAndroid Build Coastguard Workeris large), or <replaceable/dont/ (do not set DF flag).
187*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
188*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
189*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
190*bd1f8aebSAndroid Build Coastguard Worker  <term><option>-N <replaceable/nodeinfo_option/</option></term>
191*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
192*bd1f8aebSAndroid Build Coastguard Worker<command/ping6/ only.
193*bd1f8aebSAndroid Build Coastguard WorkerSend ICMPv6 Node Information Queries (RFC4620), instead of Echo Request.
194*bd1f8aebSAndroid Build Coastguard Worker   <variablelist>
195*bd1f8aebSAndroid Build Coastguard Worker    <varlistentry>
196*bd1f8aebSAndroid Build Coastguard Worker     <term><option>help</option></term>
197*bd1f8aebSAndroid Build Coastguard Worker     <listitem><para>Show help for NI support.</para></listitem>
198*bd1f8aebSAndroid Build Coastguard Worker    </varlistentry>
199*bd1f8aebSAndroid Build Coastguard Worker   </variablelist>
200*bd1f8aebSAndroid Build Coastguard Worker   <variablelist>
201*bd1f8aebSAndroid Build Coastguard Worker    <varlistentry>
202*bd1f8aebSAndroid Build Coastguard Worker     <term><option>name</option></term>
203*bd1f8aebSAndroid Build Coastguard Worker     <listitem><para>Queries for Node Names.</para></listitem>
204*bd1f8aebSAndroid Build Coastguard Worker    </varlistentry>
205*bd1f8aebSAndroid Build Coastguard Worker   </variablelist>
206*bd1f8aebSAndroid Build Coastguard Worker   <variablelist>
207*bd1f8aebSAndroid Build Coastguard Worker    <varlistentry>
208*bd1f8aebSAndroid Build Coastguard Worker     <term><option>ipv6</option></term>
209*bd1f8aebSAndroid Build Coastguard Worker     <listitem><para>Queries for IPv6 Addresses. There are several IPv6 specific flags.
210*bd1f8aebSAndroid Build Coastguard Worker      <variablelist>
211*bd1f8aebSAndroid Build Coastguard Worker       <varlistentry>
212*bd1f8aebSAndroid Build Coastguard Worker        <term><option>ipv6-global</option></term>
213*bd1f8aebSAndroid Build Coastguard Worker        <listitem><para>Request IPv6 global-scope addresses.</para></listitem>
214*bd1f8aebSAndroid Build Coastguard Worker       </varlistentry>
215*bd1f8aebSAndroid Build Coastguard Worker      </variablelist>
216*bd1f8aebSAndroid Build Coastguard Worker      <variablelist>
217*bd1f8aebSAndroid Build Coastguard Worker       <varlistentry>
218*bd1f8aebSAndroid Build Coastguard Worker        <term><option>ipv6-sitelocal</option></term>
219*bd1f8aebSAndroid Build Coastguard Worker        <listitem><para>Request IPv6 site-local addresses.</para></listitem>
220*bd1f8aebSAndroid Build Coastguard Worker       </varlistentry>
221*bd1f8aebSAndroid Build Coastguard Worker      </variablelist>
222*bd1f8aebSAndroid Build Coastguard Worker      <variablelist>
223*bd1f8aebSAndroid Build Coastguard Worker       <varlistentry>
224*bd1f8aebSAndroid Build Coastguard Worker        <term><option>ipv6-linklocal</option></term>
225*bd1f8aebSAndroid Build Coastguard Worker        <listitem><para>Request IPv6 link-local addresses.</para></listitem>
226*bd1f8aebSAndroid Build Coastguard Worker       </varlistentry>
227*bd1f8aebSAndroid Build Coastguard Worker      </variablelist>
228*bd1f8aebSAndroid Build Coastguard Worker      <variablelist>
229*bd1f8aebSAndroid Build Coastguard Worker       <varlistentry>
230*bd1f8aebSAndroid Build Coastguard Worker        <term><option>ipv6-all</option></term>
231*bd1f8aebSAndroid Build Coastguard Worker        <listitem><para>Request IPv6 addresses on other interfaces.</para></listitem>
232*bd1f8aebSAndroid Build Coastguard Worker       </varlistentry>
233*bd1f8aebSAndroid Build Coastguard Worker      </variablelist>
234*bd1f8aebSAndroid Build Coastguard Worker     </para></listitem>
235*bd1f8aebSAndroid Build Coastguard Worker    </varlistentry>
236*bd1f8aebSAndroid Build Coastguard Worker   </variablelist>
237*bd1f8aebSAndroid Build Coastguard Worker   <variablelist>
238*bd1f8aebSAndroid Build Coastguard Worker    <varlistentry>
239*bd1f8aebSAndroid Build Coastguard Worker     <term><option>ipv4</option></term>
240*bd1f8aebSAndroid Build Coastguard Worker     <listitem><para>Queries for IPv4 Addresses.  There is one IPv4 specific flag.
241*bd1f8aebSAndroid Build Coastguard Worker      <variablelist>
242*bd1f8aebSAndroid Build Coastguard Worker       <varlistentry>
243*bd1f8aebSAndroid Build Coastguard Worker        <term><option>ipv4-all</option></term>
244*bd1f8aebSAndroid Build Coastguard Worker        <listitem><para>Request IPv4 addresses on other interfaces.</para></listitem>
245*bd1f8aebSAndroid Build Coastguard Worker       </varlistentry>
246*bd1f8aebSAndroid Build Coastguard Worker      </variablelist>
247*bd1f8aebSAndroid Build Coastguard Worker     </para></listitem>
248*bd1f8aebSAndroid Build Coastguard Worker    </varlistentry>
249*bd1f8aebSAndroid Build Coastguard Worker   </variablelist>
250*bd1f8aebSAndroid Build Coastguard Worker   <variablelist>
251*bd1f8aebSAndroid Build Coastguard Worker    <varlistentry>
252*bd1f8aebSAndroid Build Coastguard Worker     <term><option>subject-ipv6=<replaceable/ipv6addr/</option></term>
253*bd1f8aebSAndroid Build Coastguard Worker     <listitem><para>IPv6 subject address.</para></listitem>
254*bd1f8aebSAndroid Build Coastguard Worker    </varlistentry>
255*bd1f8aebSAndroid Build Coastguard Worker   </variablelist>
256*bd1f8aebSAndroid Build Coastguard Worker   <variablelist>
257*bd1f8aebSAndroid Build Coastguard Worker    <varlistentry>
258*bd1f8aebSAndroid Build Coastguard Worker     <term><option>subject-ipv4=<replaceable/ipv4addr/</option></term>
259*bd1f8aebSAndroid Build Coastguard Worker     <listitem><para>IPv4 subject address.</para></listitem>
260*bd1f8aebSAndroid Build Coastguard Worker    </varlistentry>
261*bd1f8aebSAndroid Build Coastguard Worker   </variablelist>
262*bd1f8aebSAndroid Build Coastguard Worker   <variablelist>
263*bd1f8aebSAndroid Build Coastguard Worker    <varlistentry>
264*bd1f8aebSAndroid Build Coastguard Worker     <term><option>subject-name=<replaceable/nodename/</option></term>
265*bd1f8aebSAndroid Build Coastguard Worker     <listitem><para>Subject name.  If it contains more than one dot,
266*bd1f8aebSAndroid Build Coastguard Worker	fully-qualified domain name is assumed.</para></listitem>
267*bd1f8aebSAndroid Build Coastguard Worker    </varlistentry>
268*bd1f8aebSAndroid Build Coastguard Worker   </variablelist>
269*bd1f8aebSAndroid Build Coastguard Worker   <variablelist>
270*bd1f8aebSAndroid Build Coastguard Worker    <varlistentry>
271*bd1f8aebSAndroid Build Coastguard Worker     <term><option>subject-fqdn=<replaceable/nodename/</option></term>
272*bd1f8aebSAndroid Build Coastguard Worker     <listitem><para>Subject name.  Fully-qualified domain name is
273*bd1f8aebSAndroid Build Coastguard Worker	always assumed.</para></listitem>
274*bd1f8aebSAndroid Build Coastguard Worker    </varlistentry>
275*bd1f8aebSAndroid Build Coastguard Worker   </variablelist>
276*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
277*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
278*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
279*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-n/</term>
280*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
281*bd1f8aebSAndroid Build Coastguard WorkerNumeric output only.
282*bd1f8aebSAndroid Build Coastguard WorkerNo attempt will be made to lookup symbolic names for host addresses.
283*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
284*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
285*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
286*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-O/</term>
287*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
288*bd1f8aebSAndroid Build Coastguard WorkerReport outstanding ICMP ECHO reply before sending next packet.
289*bd1f8aebSAndroid Build Coastguard WorkerThis is useful together with the timestamp <option>-D</option> to
290*bd1f8aebSAndroid Build Coastguard Workerlog output to a diagnostic file and search for missing answers.
291*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
292*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
293*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
294*bd1f8aebSAndroid Build Coastguard Worker  <term><option>-p <replaceable/pattern/</option></term>
295*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
296*bd1f8aebSAndroid Build Coastguard WorkerYou may specify up to 16 ``pad'' bytes to fill out the packet you send.
297*bd1f8aebSAndroid Build Coastguard WorkerThis is useful for diagnosing data-dependent problems in a network.
298*bd1f8aebSAndroid Build Coastguard WorkerFor example, <option>-p ff</option> will cause the sent packet
299*bd1f8aebSAndroid Build Coastguard Workerto be filled with all ones.
300*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
301*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
302*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
303*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-q/</term>
304*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
305*bd1f8aebSAndroid Build Coastguard WorkerQuiet output.
306*bd1f8aebSAndroid Build Coastguard WorkerNothing is displayed except the summary lines at startup time and
307*bd1f8aebSAndroid Build Coastguard Workerwhen finished.
308*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
309*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
310*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
311*bd1f8aebSAndroid Build Coastguard Worker  <term><option>-Q <replaceable/tos/</option></term>
312*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
313*bd1f8aebSAndroid Build Coastguard Worker	Set Quality of Service -related bits in ICMP datagrams.
314*bd1f8aebSAndroid Build Coastguard Worker	<replaceable/tos/ can be decimal (<command/ping/ only) or hex number.
315*bd1f8aebSAndroid Build Coastguard Worker	</para>
316*bd1f8aebSAndroid Build Coastguard Worker	<para>
317*bd1f8aebSAndroid Build Coastguard Worker	In RFC2474, these fields are interpreted as 8-bit Differentiated
318*bd1f8aebSAndroid Build Coastguard Worker	Services (DS), consisting of: bits 0-1 (2 lowest bits) of separate
319*bd1f8aebSAndroid Build Coastguard Worker	data, and bits 2-7 (highest 6 bits) of Differentiated Services
320*bd1f8aebSAndroid Build Coastguard Worker	Codepoint (DSCP).  In RFC2481 and RFC3168, bits 0-1 are used for ECN.
321*bd1f8aebSAndroid Build Coastguard Worker	</para>
322*bd1f8aebSAndroid Build Coastguard Worker	<para>
323*bd1f8aebSAndroid Build Coastguard Worker	Historically (RFC1349, obsoleted by RFC2474), these were interpreted
324*bd1f8aebSAndroid Build Coastguard Worker	as: bit 0 (lowest bit) for reserved (currently being redefined as
325*bd1f8aebSAndroid Build Coastguard Worker	congestion control), 1-4 for Type of Service and bits 5-7
326*bd1f8aebSAndroid Build Coastguard Worker	(highest bits) for Precedence.
327*bd1f8aebSAndroid Build Coastguard Worker   </para>
328*bd1f8aebSAndroid Build Coastguard Worker  </listitem>
329*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
330*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
331*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-r/</term>
332*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
333*bd1f8aebSAndroid Build Coastguard WorkerBypass the normal routing tables and send directly to a host on an attached
334*bd1f8aebSAndroid Build Coastguard Workerinterface.
335*bd1f8aebSAndroid Build Coastguard WorkerIf the host is not on a directly-attached network, an error is returned.
336*bd1f8aebSAndroid Build Coastguard WorkerThis option can be used to ping a local host through an interface
337*bd1f8aebSAndroid Build Coastguard Workerthat has no route through it provided the option <option/-I/ is also
338*bd1f8aebSAndroid Build Coastguard Workerused.
339*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
340*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
341*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
342*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-R/</term>
343*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
344*bd1f8aebSAndroid Build Coastguard Worker<command/ping/ only.
345*bd1f8aebSAndroid Build Coastguard WorkerRecord route.
346*bd1f8aebSAndroid Build Coastguard WorkerIncludes the RECORD_ROUTE option in the ECHO_REQUEST
347*bd1f8aebSAndroid Build Coastguard Workerpacket and displays the route buffer on returned packets.
348*bd1f8aebSAndroid Build Coastguard WorkerNote that the IP header is only large enough for nine such routes.
349*bd1f8aebSAndroid Build Coastguard WorkerMany hosts ignore or discard this option.
350*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
351*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
352*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
353*bd1f8aebSAndroid Build Coastguard Worker  <term><option>-s <replaceable/packetsize/</option></term>
354*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
355*bd1f8aebSAndroid Build Coastguard WorkerSpecifies the number of data bytes to be sent.
356*bd1f8aebSAndroid Build Coastguard WorkerThe default is 56, which translates into 64 ICMP
357*bd1f8aebSAndroid Build Coastguard Workerdata bytes when combined with the 8 bytes of ICMP header data.
358*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
359*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
360*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
361*bd1f8aebSAndroid Build Coastguard Worker  <term><option>-S <replaceable/sndbuf/</option></term>
362*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
363*bd1f8aebSAndroid Build Coastguard WorkerSet socket sndbuf. If not specified, it is selected to buffer
364*bd1f8aebSAndroid Build Coastguard Workernot more than one packet.
365*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
366*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
367*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
368*bd1f8aebSAndroid Build Coastguard Worker  <term><option>-t <replaceable/ttl/</option></term>
369*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
370*bd1f8aebSAndroid Build Coastguard Worker<command/ping/ only.
371*bd1f8aebSAndroid Build Coastguard WorkerSet the IP Time to Live.
372*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
373*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
374*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
375*bd1f8aebSAndroid Build Coastguard Worker  <term><option>-T <replaceable/timestamp option/</option></term>
376*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
377*bd1f8aebSAndroid Build Coastguard WorkerSet special IP timestamp options.
378*bd1f8aebSAndroid Build Coastguard Worker<replaceable/timestamp option/ may be either
379*bd1f8aebSAndroid Build Coastguard Worker<replaceable/tsonly/ (only timestamps),
380*bd1f8aebSAndroid Build Coastguard Worker<replaceable/tsandaddr/ (timestamps and addresses) or
381*bd1f8aebSAndroid Build Coastguard Worker<replaceable/tsprespec host1 [host2 [host3 [host4]]]/
382*bd1f8aebSAndroid Build Coastguard Worker(timestamp prespecified hops).
383*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
384*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
385*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
386*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-U/</term>
387*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
388*bd1f8aebSAndroid Build Coastguard WorkerPrint full user-to-user latency (the old behaviour). Normally
389*bd1f8aebSAndroid Build Coastguard Worker<command/ping/
390*bd1f8aebSAndroid Build Coastguard Workerprints network round trip time, which can be different
391*bd1f8aebSAndroid Build Coastguard Workerf.e. due to DNS failures.
392*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
393*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
394*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
395*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-v/</term>
396*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
397*bd1f8aebSAndroid Build Coastguard WorkerVerbose output.
398*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
399*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
400*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
401*bd1f8aebSAndroid Build Coastguard Worker  <term><option/-V/</term>
402*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
403*bd1f8aebSAndroid Build Coastguard WorkerShow version and exit.
404*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
405*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
406*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
407*bd1f8aebSAndroid Build Coastguard Worker  <term><option><anchor id="ping.deadline">-w <replaceable/deadline/</option></term>
408*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
409*bd1f8aebSAndroid Build Coastguard WorkerSpecify a timeout, in seconds, before
410*bd1f8aebSAndroid Build Coastguard Worker<command/ping/
411*bd1f8aebSAndroid Build Coastguard Workerexits regardless of how many
412*bd1f8aebSAndroid Build Coastguard Workerpackets have been sent or received. In this case
413*bd1f8aebSAndroid Build Coastguard Worker<command/ping/
414*bd1f8aebSAndroid Build Coastguard Workerdoes not stop after
415*bd1f8aebSAndroid Build Coastguard Worker<link linkend="ping.count"><replaceable/count/</link>
416*bd1f8aebSAndroid Build Coastguard Workerpacket are sent, it waits either for
417*bd1f8aebSAndroid Build Coastguard Worker<link linkend="ping.deadline"><replaceable/deadline/</link>
418*bd1f8aebSAndroid Build Coastguard Workerexpire or until
419*bd1f8aebSAndroid Build Coastguard Worker<link linkend="ping.count"><replaceable/count/</link>
420*bd1f8aebSAndroid Build Coastguard Workerprobes are answered or for some error notification from network.
421*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
422*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
423*bd1f8aebSAndroid Build Coastguard Worker <varlistentry>
424*bd1f8aebSAndroid Build Coastguard Worker  <term><option>-W <replaceable/timeout/</option></term>
425*bd1f8aebSAndroid Build Coastguard Worker  <listitem><para>
426*bd1f8aebSAndroid Build Coastguard WorkerTime to wait for a response, in seconds. The option affects only timeout
427*bd1f8aebSAndroid Build Coastguard Workerin absence of any responses, otherwise <command/ping/ waits for two RTTs.
428*bd1f8aebSAndroid Build Coastguard Worker  </para></listitem>
429*bd1f8aebSAndroid Build Coastguard Worker </varlistentry>
430*bd1f8aebSAndroid Build Coastguard Worker</variablelist>
431*bd1f8aebSAndroid Build Coastguard Worker
432*bd1f8aebSAndroid Build Coastguard Worker<para>
433*bd1f8aebSAndroid Build Coastguard WorkerWhen using <command/ping/ for fault isolation, it should first be run
434*bd1f8aebSAndroid Build Coastguard Workeron the local host, to verify that the local network interface is up
435*bd1f8aebSAndroid Build Coastguard Workerand running. Then, hosts and gateways further and further away should be
436*bd1f8aebSAndroid Build Coastguard Worker``pinged''. Round-trip times and packet loss statistics are computed.
437*bd1f8aebSAndroid Build Coastguard WorkerIf duplicate packets are received, they are not included in the packet
438*bd1f8aebSAndroid Build Coastguard Workerloss calculation, although the round trip time of these packets is used
439*bd1f8aebSAndroid Build Coastguard Workerin calculating the minimum/average/maximum round-trip time numbers.
440*bd1f8aebSAndroid Build Coastguard WorkerWhen the specified number of packets have been sent (and received) or
441*bd1f8aebSAndroid Build Coastguard Workerif the program is terminated with a
442*bd1f8aebSAndroid Build Coastguard Worker<constant/SIGINT/, a brief summary is displayed. Shorter current statistics
443*bd1f8aebSAndroid Build Coastguard Workercan be obtained without termination of process with signal
444*bd1f8aebSAndroid Build Coastguard Worker<constant/SIGQUIT/.
445*bd1f8aebSAndroid Build Coastguard Worker</para>
446*bd1f8aebSAndroid Build Coastguard Worker
447*bd1f8aebSAndroid Build Coastguard Worker<para>
448*bd1f8aebSAndroid Build Coastguard WorkerIf <command/ping/ does not receive any reply packets at all it will
449*bd1f8aebSAndroid Build Coastguard Workerexit with code 1. If a packet
450*bd1f8aebSAndroid Build Coastguard Worker<link linkend="ping.count"><replaceable/count/</link>
451*bd1f8aebSAndroid Build Coastguard Workerand
452*bd1f8aebSAndroid Build Coastguard Worker<link linkend="ping.deadline"><replaceable/deadline/</link>
453*bd1f8aebSAndroid Build Coastguard Workerare both specified, and fewer than
454*bd1f8aebSAndroid Build Coastguard Worker<link linkend="ping.count"><replaceable/count/</link>
455*bd1f8aebSAndroid Build Coastguard Workerpackets are received by the time the
456*bd1f8aebSAndroid Build Coastguard Worker<link linkend="ping.deadline"><replaceable/deadline/</link>
457*bd1f8aebSAndroid Build Coastguard Workerhas arrived, it will also exit with code 1.
458*bd1f8aebSAndroid Build Coastguard WorkerOn other error it exits with code 2. Otherwise it exits with code 0. This
459*bd1f8aebSAndroid Build Coastguard Workermakes it possible to use the exit code to see if a host is alive or
460*bd1f8aebSAndroid Build Coastguard Workernot.
461*bd1f8aebSAndroid Build Coastguard Worker</para>
462*bd1f8aebSAndroid Build Coastguard Worker
463*bd1f8aebSAndroid Build Coastguard Worker
464*bd1f8aebSAndroid Build Coastguard Worker<para>
465*bd1f8aebSAndroid Build Coastguard WorkerThis program is intended for use in network testing, measurement and
466*bd1f8aebSAndroid Build Coastguard Workermanagement.
467*bd1f8aebSAndroid Build Coastguard WorkerBecause of the load it can impose on the network, it is unwise to use
468*bd1f8aebSAndroid Build Coastguard Worker<command/ping/ during normal operations or from automated scripts.
469*bd1f8aebSAndroid Build Coastguard Worker</para>
470*bd1f8aebSAndroid Build Coastguard Worker
471*bd1f8aebSAndroid Build Coastguard Worker</refsect1>
472*bd1f8aebSAndroid Build Coastguard Worker
473*bd1f8aebSAndroid Build Coastguard Worker
474*bd1f8aebSAndroid Build Coastguard Worker<refsect1><title>ICMP PACKET DETAILS</title>
475*bd1f8aebSAndroid Build Coastguard Worker
476*bd1f8aebSAndroid Build Coastguard Worker<para>
477*bd1f8aebSAndroid Build Coastguard WorkerAn IP header without options is 20 bytes.
478*bd1f8aebSAndroid Build Coastguard WorkerAn ICMP ECHO_REQUEST packet contains an additional 8 bytes worth
479*bd1f8aebSAndroid Build Coastguard Workerof ICMP header followed by an arbitrary amount of data.
480*bd1f8aebSAndroid Build Coastguard WorkerWhen a <replaceable/packetsize/ is given, this indicated the size of this
481*bd1f8aebSAndroid Build Coastguard Workerextra piece of data (the default is 56). Thus the amount of data received
482*bd1f8aebSAndroid Build Coastguard Workerinside of an IP packet of type ICMP ECHO_REPLY will always be 8 bytes
483*bd1f8aebSAndroid Build Coastguard Workermore than the requested data space (the ICMP header).
484*bd1f8aebSAndroid Build Coastguard Worker</para>
485*bd1f8aebSAndroid Build Coastguard Worker
486*bd1f8aebSAndroid Build Coastguard Worker<para>
487*bd1f8aebSAndroid Build Coastguard WorkerIf the data space is at least of size of <structname/struct timeval/
488*bd1f8aebSAndroid Build Coastguard Worker<command/ping/ uses the beginning bytes of this space to include
489*bd1f8aebSAndroid Build Coastguard Workera timestamp which it uses in the computation of round trip times.
490*bd1f8aebSAndroid Build Coastguard WorkerIf the data space is shorter, no round trip times are given.
491*bd1f8aebSAndroid Build Coastguard Worker</para>
492*bd1f8aebSAndroid Build Coastguard Worker
493*bd1f8aebSAndroid Build Coastguard Worker</refsect1>
494*bd1f8aebSAndroid Build Coastguard Worker
495*bd1f8aebSAndroid Build Coastguard Worker<refsect1><title>DUPLICATE AND DAMAGED PACKETS</title>
496*bd1f8aebSAndroid Build Coastguard Worker
497*bd1f8aebSAndroid Build Coastguard Worker<para>
498*bd1f8aebSAndroid Build Coastguard Worker<command/ping/ will report duplicate and damaged packets.
499*bd1f8aebSAndroid Build Coastguard WorkerDuplicate packets should never occur, and seem to be caused by
500*bd1f8aebSAndroid Build Coastguard Workerinappropriate link-level retransmissions.
501*bd1f8aebSAndroid Build Coastguard WorkerDuplicates may occur in many situations and are rarely (if ever) a
502*bd1f8aebSAndroid Build Coastguard Workergood sign, although the presence of low levels of duplicates may not
503*bd1f8aebSAndroid Build Coastguard Workeralways be cause for alarm.
504*bd1f8aebSAndroid Build Coastguard Worker</para>
505*bd1f8aebSAndroid Build Coastguard Worker
506*bd1f8aebSAndroid Build Coastguard Worker<para>
507*bd1f8aebSAndroid Build Coastguard WorkerDamaged packets are obviously serious cause for alarm and often
508*bd1f8aebSAndroid Build Coastguard Workerindicate broken hardware somewhere in the
509*bd1f8aebSAndroid Build Coastguard Worker<command/ping/ packet's path (in the network or in the hosts).
510*bd1f8aebSAndroid Build Coastguard Worker</para>
511*bd1f8aebSAndroid Build Coastguard Worker
512*bd1f8aebSAndroid Build Coastguard Worker</refsect1>
513*bd1f8aebSAndroid Build Coastguard Worker
514*bd1f8aebSAndroid Build Coastguard Worker<refsect1><title>TRYING DIFFERENT DATA PATTERNS</title>
515*bd1f8aebSAndroid Build Coastguard Worker
516*bd1f8aebSAndroid Build Coastguard Worker<para>
517*bd1f8aebSAndroid Build Coastguard WorkerThe (inter)network layer should never treat packets differently depending
518*bd1f8aebSAndroid Build Coastguard Workeron the data contained in the data portion.
519*bd1f8aebSAndroid Build Coastguard WorkerUnfortunately, data-dependent problems have been known to sneak into
520*bd1f8aebSAndroid Build Coastguard Workernetworks and remain undetected for long periods of time.
521*bd1f8aebSAndroid Build Coastguard WorkerIn many cases the particular pattern that will have problems is something
522*bd1f8aebSAndroid Build Coastguard Workerthat doesn't have sufficient ``transitions'', such as all ones or all
523*bd1f8aebSAndroid Build Coastguard Workerzeros, or a pattern right at the edge, such as almost all zeros.
524*bd1f8aebSAndroid Build Coastguard WorkerIt isn't necessarily enough to specify a data pattern of all zeros (for
525*bd1f8aebSAndroid Build Coastguard Workerexample) on the command line because the pattern that is of interest is
526*bd1f8aebSAndroid Build Coastguard Workerat the data link level, and the relationship between what you type and
527*bd1f8aebSAndroid Build Coastguard Workerwhat the controllers transmit can be complicated.
528*bd1f8aebSAndroid Build Coastguard Worker</para>
529*bd1f8aebSAndroid Build Coastguard Worker
530*bd1f8aebSAndroid Build Coastguard Worker<para>
531*bd1f8aebSAndroid Build Coastguard WorkerThis means that if you have a data-dependent problem you will probably
532*bd1f8aebSAndroid Build Coastguard Workerhave to do a lot of testing to find it.
533*bd1f8aebSAndroid Build Coastguard WorkerIf you are lucky, you may manage to find a file that either can't be sent
534*bd1f8aebSAndroid Build Coastguard Workeracross your network or that takes much longer to transfer than other
535*bd1f8aebSAndroid Build Coastguard Workersimilar length files.
536*bd1f8aebSAndroid Build Coastguard WorkerYou can then examine this file for repeated patterns that you can test
537*bd1f8aebSAndroid Build Coastguard Workerusing the <option/-p/ option of <command/ping/.
538*bd1f8aebSAndroid Build Coastguard Worker</para>
539*bd1f8aebSAndroid Build Coastguard Worker
540*bd1f8aebSAndroid Build Coastguard Worker</refsect1>
541*bd1f8aebSAndroid Build Coastguard Worker
542*bd1f8aebSAndroid Build Coastguard Worker<refsect1><title>TTL DETAILS</title>
543*bd1f8aebSAndroid Build Coastguard Worker
544*bd1f8aebSAndroid Build Coastguard Worker<para>
545*bd1f8aebSAndroid Build Coastguard WorkerThe TTL value of an IP packet represents the maximum number of IP routers
546*bd1f8aebSAndroid Build Coastguard Workerthat the packet can go through before being thrown away.
547*bd1f8aebSAndroid Build Coastguard WorkerIn current practice you can expect each router in the Internet to decrement
548*bd1f8aebSAndroid Build Coastguard Workerthe TTL field by exactly one.
549*bd1f8aebSAndroid Build Coastguard Worker</para>
550*bd1f8aebSAndroid Build Coastguard Worker
551*bd1f8aebSAndroid Build Coastguard Worker<para>
552*bd1f8aebSAndroid Build Coastguard WorkerThe TCP/IP specification states that the TTL field for TCP
553*bd1f8aebSAndroid Build Coastguard Workerpackets should be set to 60, but many systems use smaller values
554*bd1f8aebSAndroid Build Coastguard Worker(4.3 BSD uses 30, 4.2 used 15).
555*bd1f8aebSAndroid Build Coastguard Worker</para>
556*bd1f8aebSAndroid Build Coastguard Worker
557*bd1f8aebSAndroid Build Coastguard Worker<para>
558*bd1f8aebSAndroid Build Coastguard WorkerThe maximum possible value of this field is 255, and most Unix systems set
559*bd1f8aebSAndroid Build Coastguard Workerthe TTL field of ICMP ECHO_REQUEST packets to 255.
560*bd1f8aebSAndroid Build Coastguard WorkerThis is why you will find you can ``ping'' some hosts, but not reach them
561*bd1f8aebSAndroid Build Coastguard Workerwith
562*bd1f8aebSAndroid Build Coastguard Worker<citerefentry><refentrytitle/telnet/<manvolnum/1/</citerefentry>
563*bd1f8aebSAndroid Build Coastguard Workeror
564*bd1f8aebSAndroid Build Coastguard Worker<citerefentry><refentrytitle/ftp/<manvolnum/1/</citerefentry>.
565*bd1f8aebSAndroid Build Coastguard Worker</para>
566*bd1f8aebSAndroid Build Coastguard Worker
567*bd1f8aebSAndroid Build Coastguard Worker<para>
568*bd1f8aebSAndroid Build Coastguard WorkerIn normal operation ping prints the TTL value from the packet it receives.
569*bd1f8aebSAndroid Build Coastguard WorkerWhen a remote system receives a ping packet, it can do one of three things
570*bd1f8aebSAndroid Build Coastguard Workerwith the TTL field in its response:
571*bd1f8aebSAndroid Build Coastguard Worker</para>
572*bd1f8aebSAndroid Build Coastguard Worker
573*bd1f8aebSAndroid Build Coastguard Worker<itemizedlist>
574*bd1f8aebSAndroid Build Coastguard Worker <listitem><para>
575*bd1f8aebSAndroid Build Coastguard WorkerNot change it; this is what Berkeley Unix systems did before the
576*bd1f8aebSAndroid Build Coastguard Worker4.3BSD Tahoe release. In this case the TTL value in the received packet
577*bd1f8aebSAndroid Build Coastguard Workerwill be 255 minus the number of routers in the round-trip path.
578*bd1f8aebSAndroid Build Coastguard Worker </para></listitem>
579*bd1f8aebSAndroid Build Coastguard Worker <listitem><para>
580*bd1f8aebSAndroid Build Coastguard WorkerSet it to 255; this is what current Berkeley Unix systems do.
581*bd1f8aebSAndroid Build Coastguard WorkerIn this case the TTL value in the received packet will be 255 minus the
582*bd1f8aebSAndroid Build Coastguard Workernumber of routers in the path <emphasis/from/
583*bd1f8aebSAndroid Build Coastguard Workerthe remote system <emphasis/to/ the <command/ping/ing host.
584*bd1f8aebSAndroid Build Coastguard Worker </para></listitem>
585*bd1f8aebSAndroid Build Coastguard Worker <listitem><para>
586*bd1f8aebSAndroid Build Coastguard WorkerSet it to some other value. Some machines use the same value for
587*bd1f8aebSAndroid Build Coastguard WorkerICMP packets that they use for TCP packets, for example either 30 or 60.
588*bd1f8aebSAndroid Build Coastguard WorkerOthers may use completely wild values.
589*bd1f8aebSAndroid Build Coastguard Worker </para></listitem>
590*bd1f8aebSAndroid Build Coastguard Worker</itemizedlist>
591*bd1f8aebSAndroid Build Coastguard Worker
592*bd1f8aebSAndroid Build Coastguard Worker</refsect1>
593*bd1f8aebSAndroid Build Coastguard Worker
594*bd1f8aebSAndroid Build Coastguard Worker<refsect1><title>BUGS</title>
595*bd1f8aebSAndroid Build Coastguard Worker
596*bd1f8aebSAndroid Build Coastguard Worker<itemizedlist>
597*bd1f8aebSAndroid Build Coastguard Worker <listitem><para>
598*bd1f8aebSAndroid Build Coastguard WorkerMany Hosts and Gateways ignore the RECORD_ROUTE option.
599*bd1f8aebSAndroid Build Coastguard Worker </para></listitem>
600*bd1f8aebSAndroid Build Coastguard Worker <listitem><para>
601*bd1f8aebSAndroid Build Coastguard WorkerThe maximum IP header length is too small for options like
602*bd1f8aebSAndroid Build Coastguard WorkerRECORD_ROUTE to be completely useful.
603*bd1f8aebSAndroid Build Coastguard WorkerThere's not much that can be done about this, however.
604*bd1f8aebSAndroid Build Coastguard Worker </para></listitem>
605*bd1f8aebSAndroid Build Coastguard Worker <listitem><para>
606*bd1f8aebSAndroid Build Coastguard WorkerFlood pinging is not recommended in general, and flood pinging the
607*bd1f8aebSAndroid Build Coastguard Workerbroadcast address should only be done under very controlled conditions.
608*bd1f8aebSAndroid Build Coastguard Worker </para></listitem>
609*bd1f8aebSAndroid Build Coastguard Worker</itemizedlist>
610*bd1f8aebSAndroid Build Coastguard Worker
611*bd1f8aebSAndroid Build Coastguard Worker</refsect1>
612*bd1f8aebSAndroid Build Coastguard Worker
613*bd1f8aebSAndroid Build Coastguard Worker<refsect1><title>SEE ALSO</title>
614*bd1f8aebSAndroid Build Coastguard Worker<para>
615*bd1f8aebSAndroid Build Coastguard Worker<citerefentry><refentrytitle/netstat/<manvolnum/1/</citerefentry>,
616*bd1f8aebSAndroid Build Coastguard Worker<citerefentry><refentrytitle/ifconfig/<manvolnum/8/</citerefentry>.
617*bd1f8aebSAndroid Build Coastguard Worker</para>
618*bd1f8aebSAndroid Build Coastguard Worker</refsect1>
619*bd1f8aebSAndroid Build Coastguard Worker
620*bd1f8aebSAndroid Build Coastguard Worker<refsect1><title>HISTORY</title>
621*bd1f8aebSAndroid Build Coastguard Worker<para>
622*bd1f8aebSAndroid Build Coastguard WorkerThe <command/ping/ command appeared in 4.3BSD.
623*bd1f8aebSAndroid Build Coastguard Worker</para>
624*bd1f8aebSAndroid Build Coastguard Worker<para>
625*bd1f8aebSAndroid Build Coastguard WorkerThe version described here is its descendant specific to Linux.
626*bd1f8aebSAndroid Build Coastguard Worker</para>
627*bd1f8aebSAndroid Build Coastguard Worker</refsect1>
628*bd1f8aebSAndroid Build Coastguard Worker
629*bd1f8aebSAndroid Build Coastguard Worker<refsect1><title>SECURITY</title>
630*bd1f8aebSAndroid Build Coastguard Worker<para>
631*bd1f8aebSAndroid Build Coastguard Worker<command/ping/ requires <constant/CAP_NET_RAW/ capability
632*bd1f8aebSAndroid Build Coastguard Workerto be executed. It may be used as set-uid root.
633*bd1f8aebSAndroid Build Coastguard Worker</para>
634*bd1f8aebSAndroid Build Coastguard Worker</refsect1>
635*bd1f8aebSAndroid Build Coastguard Worker
636*bd1f8aebSAndroid Build Coastguard Worker<refsect1><title>AVAILABILITY</title>
637*bd1f8aebSAndroid Build Coastguard Worker<para>
638*bd1f8aebSAndroid Build Coastguard Worker<command/ping/ is part of <filename/iputils/ package
639*bd1f8aebSAndroid Build Coastguard Workerand the latest versions are  available in source form at
640*bd1f8aebSAndroid Build Coastguard Worker<ulink url="http://www.skbuff.net/iputils/iputils-current.tar.bz2">
641*bd1f8aebSAndroid Build Coastguard Workerhttp://www.skbuff.net/iputils/iputils-current.tar.bz2</ulink>.
642*bd1f8aebSAndroid Build Coastguard Worker</para>
643*bd1f8aebSAndroid Build Coastguard Worker</refsect1>
644*bd1f8aebSAndroid Build Coastguard Worker
645*bd1f8aebSAndroid Build Coastguard Worker<![IGNORE[
646*bd1f8aebSAndroid Build Coastguard Worker<refsect1><title>COPYING</title>
647*bd1f8aebSAndroid Build Coastguard Worker<para>
648*bd1f8aebSAndroid Build Coastguard Worker<literallayout>
649*bd1f8aebSAndroid Build Coastguard WorkerCopyright (c) 1989 The Regents of the University of California.
650*bd1f8aebSAndroid Build Coastguard WorkerAll rights reserved.
651*bd1f8aebSAndroid Build Coastguard Worker
652*bd1f8aebSAndroid Build Coastguard WorkerThis code is derived from software contributed to Berkeley by
653*bd1f8aebSAndroid Build Coastguard WorkerMike Muuss.
654*bd1f8aebSAndroid Build Coastguard Worker
655*bd1f8aebSAndroid Build Coastguard WorkerRedistribution and use in source and binary forms, with or without
656*bd1f8aebSAndroid Build Coastguard Workermodification, are permitted provided that the following conditions
657*bd1f8aebSAndroid Build Coastguard Workerare met:
658*bd1f8aebSAndroid Build Coastguard Worker1. Redistributions of source code must retain the above copyright
659*bd1f8aebSAndroid Build Coastguard Worker   notice, this list of conditions and the following disclaimer.
660*bd1f8aebSAndroid Build Coastguard Worker2. Redistributions in binary form must reproduce the above copyright
661*bd1f8aebSAndroid Build Coastguard Worker   notice, this list of conditions and the following disclaimer in the
662*bd1f8aebSAndroid Build Coastguard Worker   documentation and/or other materials provided with the distribution.
663*bd1f8aebSAndroid Build Coastguard Worker3. All advertising materials mentioning features or use of this software
664*bd1f8aebSAndroid Build Coastguard Worker   must display the following acknowledgement:
665*bd1f8aebSAndroid Build Coastguard Worker	This product includes software developed by the University of
666*bd1f8aebSAndroid Build Coastguard Worker	California, Berkeley and its contributors.
667*bd1f8aebSAndroid Build Coastguard Worker4. Neither the name of the University nor the names of its contributors
668*bd1f8aebSAndroid Build Coastguard Worker   may be used to endorse or promote products derived from this software
669*bd1f8aebSAndroid Build Coastguard Worker   without specific prior written permission.
670*bd1f8aebSAndroid Build Coastguard Worker
671*bd1f8aebSAndroid Build Coastguard WorkerTHIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
672*bd1f8aebSAndroid Build Coastguard WorkerANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
673*bd1f8aebSAndroid Build Coastguard WorkerIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
674*bd1f8aebSAndroid Build Coastguard WorkerARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
675*bd1f8aebSAndroid Build Coastguard WorkerFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
676*bd1f8aebSAndroid Build Coastguard WorkerDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
677*bd1f8aebSAndroid Build Coastguard WorkerOR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
678*bd1f8aebSAndroid Build Coastguard WorkerHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
679*bd1f8aebSAndroid Build Coastguard WorkerLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
680*bd1f8aebSAndroid Build Coastguard WorkerOUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
681*bd1f8aebSAndroid Build Coastguard WorkerSUCH DAMAGE.
682*bd1f8aebSAndroid Build Coastguard Worker</literallayout>
683*bd1f8aebSAndroid Build Coastguard Worker</para>
684*bd1f8aebSAndroid Build Coastguard Worker</refsect1>
685*bd1f8aebSAndroid Build Coastguard Worker]]>
686*bd1f8aebSAndroid Build Coastguard Worker
687*bd1f8aebSAndroid Build Coastguard Worker
688*bd1f8aebSAndroid Build Coastguard Worker</refentry>
689*bd1f8aebSAndroid Build Coastguard Worker
690