18fae3551SRodney W. Grimes.\" Copyright (c) 1985, 1991, 1993 28fae3551SRodney W. Grimes.\" The Regents of the University of California. All rights reserved. 38fae3551SRodney W. Grimes.\" 48fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without 58fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions 68fae3551SRodney W. Grimes.\" are met: 78fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright 88fae3551SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer. 98fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright 108fae3551SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer in the 118fae3551SRodney W. Grimes.\" documentation and/or other materials provided with the distribution. 128fae3551SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software 138fae3551SRodney W. Grimes.\" must display the following acknowledgement: 148fae3551SRodney W. Grimes.\" This product includes software developed by the University of 158fae3551SRodney W. Grimes.\" California, Berkeley and its contributors. 168fae3551SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors 178fae3551SRodney W. Grimes.\" may be used to endorse or promote products derived from this software 188fae3551SRodney W. Grimes.\" without specific prior written permission. 198fae3551SRodney W. Grimes.\" 208fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 218fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 228fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 238fae3551SRodney W. Grimes.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 248fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 258fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 268fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 278fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 288fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 298fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 308fae3551SRodney W. Grimes.\" SUCH DAMAGE. 318fae3551SRodney W. Grimes.\" 328fae3551SRodney W. Grimes.\" @(#)ping.8 8.2 (Berkeley) 12/11/93 337f3dea24SPeter Wemm.\" $FreeBSD$ 348fae3551SRodney W. Grimes.\" 3525107197SIan Dowse.Dd September 25, 2001 368fae3551SRodney W. Grimes.Dt PING 8 379fe48c6eSRuslan Ermilov.Os 388fae3551SRodney W. Grimes.Sh NAME 398fae3551SRodney W. Grimes.Nm ping 408fae3551SRodney W. Grimes.Nd send 418fae3551SRodney W. Grimes.Tn ICMP ECHO_REQUEST 428fae3551SRodney W. Grimespackets to network hosts 438fae3551SRodney W. Grimes.Sh SYNOPSIS 447c7fb079SRuslan Ermilov.Nm 45ca517ad8SPoul-Henning Kamp.Op Fl AQRadfnqrv 468fae3551SRodney W. Grimes.Op Fl c Ar count 478fae3551SRodney W. Grimes.Op Fl i Ar wait 488fae3551SRodney W. Grimes.Op Fl l Ar preload 49211bfbd2SRuslan Ermilov.Op Fl m Ar ttl 508fae3551SRodney W. Grimes.Op Fl p Ar pattern 519a4365d0SYoshinobu Inoue.Op Fl P Ar policy 528fae3551SRodney W. Grimes.Op Fl s Ar packetsize 5399490edeSWarner Losh.Op Fl S Ar src_addr 54bf113f1bSBill Fumerola.Op Fl t Ar timeout 5550ceac88SJohn-Mark Gurney.Bo 5650ceac88SJohn-Mark Gurney.Ar host | 57f78ac61bSWarner Losh.Op Fl L 58f78ac61bSWarner Losh.Op Fl I Ar interface 59f78ac61bSWarner Losh.Op Fl T Ar ttl 60f78ac61bSWarner Losh.Ar mcast-group 6150ceac88SJohn-Mark Gurney.Bc 628fae3551SRodney W. Grimes.Sh DESCRIPTION 638fae3551SRodney W. Grimes.Nm Ping 648fae3551SRodney W. Grimesuses the 658fae3551SRodney W. Grimes.Tn ICMP 6650ceac88SJohn-Mark Gurney.No protocol Ap s mandatory 678fae3551SRodney W. Grimes.Tn ECHO_REQUEST 688fae3551SRodney W. Grimesdatagram to elicit an 698fae3551SRodney W. Grimes.Tn ICMP ECHO_RESPONSE 708fae3551SRodney W. Grimesfrom a host or gateway. 718fae3551SRodney W. Grimes.Tn ECHO_REQUEST 7250ceac88SJohn-Mark Gurneydatagrams 7350ceac88SJohn-Mark Gurney.Pq Dq pings 7450ceac88SJohn-Mark Gurneyhave an IP and 758fae3551SRodney W. Grimes.Tn ICMP 7650ceac88SJohn-Mark Gurneyheader, followed by a 778fae3551SRodney W. Grimes.Dq struct timeval 7850ceac88SJohn-Mark Gurneyand then an arbitrary number of 7950ceac88SJohn-Mark Gurney.Dq pad 8050ceac88SJohn-Mark Gurneybytes used to fill out the packet. The options are as follows: 81e345a80dSPhilippe Charnier.Bl -tag -width indent 82ca517ad8SPoul-Henning Kamp.It Fl A 83ca517ad8SPoul-Henning KampAudible. 8425107197SIan DowseOutput a bell 85c4d9468eSRuslan Ermilov.Tn ( ASCII 86c4d9468eSRuslan Ermilov0x07) 8725107197SIan Dowsecharacter when no packet is received before the next packet 88ca517ad8SPoul-Henning Kampis transmitted. 8925107197SIan DowseTo cater for round-trip times that are longer than the interval 9025107197SIan Dowsebetween transmissions, further missing packets cause a bell only 9125107197SIan Dowseif the maximum number of unreceived packets has increased. 92772dfa72SDaniel O'Callaghan.It Fl a 93ef8f7ac9SSheldon HearnAudible. 94ef8f7ac9SSheldon HearnInclude a bell 95c4d9468eSRuslan Ermilov.Tn ( ASCII 96c4d9468eSRuslan Ermilov0x07) 97ef8f7ac9SSheldon Hearncharacter in the output when any packet is received. 98ef8f7ac9SSheldon HearnThis option is ignored 9950ceac88SJohn-Mark Gurneyif other format options are present. 1008fae3551SRodney W. Grimes.It Fl c Ar count 10150ceac88SJohn-Mark GurneyStop after sending 102c4d9468eSRuslan Ermilov(and receiving) 1038fae3551SRodney W. Grimes.Ar count 1048fae3551SRodney W. Grimes.Tn ECHO_RESPONSE 1050ed77db8SBruce Evanspackets. 1060ed77db8SBruce EvansIf this option is not specified, 1070ed77db8SBruce Evans.Nm 1080ed77db8SBruce Evanswill operate until interrupted. 1098fae3551SRodney W. Grimes.It Fl d 1108fae3551SRodney W. GrimesSet the 1118fae3551SRodney W. Grimes.Dv SO_DEBUG 1128fae3551SRodney W. Grimesoption on the socket being used. 1138fae3551SRodney W. Grimes.It Fl f 1148fae3551SRodney W. GrimesFlood ping. 1158fae3551SRodney W. GrimesOutputs packets as fast as they come back or one hundred times per second, 1168fae3551SRodney W. Grimeswhichever is more. 1178fae3551SRodney W. GrimesFor every 1188fae3551SRodney W. Grimes.Tn ECHO_REQUEST 11950ceac88SJohn-Mark Gurneysent a period 1201252c1bbSRuslan Ermilov.Dq .\& 12150ceac88SJohn-Mark Gurneyis printed, while for every 1228fae3551SRodney W. Grimes.Tn ECHO_REPLY 1230ed77db8SBruce Evansreceived a backspace is printed. 1248fae3551SRodney W. GrimesThis provides a rapid display of how many packets are being dropped. 1258fae3551SRodney W. GrimesOnly the super-user may use this option. 1268fae3551SRodney W. Grimes.Bf -emphasis 1278fae3551SRodney W. GrimesThis can be very hard on a network and should be used with caution. 1288fae3551SRodney W. Grimes.Ef 1298fae3551SRodney W. Grimes.It Fl i Ar wait 1308fae3551SRodney W. GrimesWait 1318fae3551SRodney W. Grimes.Ar wait 1328fae3551SRodney W. Grimesseconds 1338fae3551SRodney W. Grimes.Em between sending each packet . 1340ed77db8SBruce EvansThe default is to wait for one second between each packet. 1350ed77db8SBruce EvansThe wait time may be fractional, but only the super-user may specify 1360ed77db8SBruce Evansvalues less then 1 second. 1370ed77db8SBruce EvansThis option is incompatible with the 1388fae3551SRodney W. Grimes.Fl f 1398fae3551SRodney W. Grimesoption. 14085456935SBill Fenner.It Fl I Ar interface 14185456935SBill FennerSource multicast packets with the given interface address. 14285456935SBill FennerThis flag only applies if the ping destination is a multicast address. 1438fae3551SRodney W. Grimes.It Fl l Ar preload 1448fae3551SRodney W. GrimesIf 1458fae3551SRodney W. Grimes.Ar preload 1468fae3551SRodney W. Grimesis specified, 147e345a80dSPhilippe Charnier.Nm 1488fae3551SRodney W. Grimessends that many packets as fast as possible before falling into its normal 1498fae3551SRodney W. Grimesmode of behavior. 150ee2bf734SWarner LoshOnly the super-user may use this option. 151211bfbd2SRuslan Ermilov.It Fl m Ar ttl 152211bfbd2SRuslan ErmilovSet the IP Time To Live for outgoing packets. 153211bfbd2SRuslan ErmilovIf not specified, the kernel uses the value of the 154211bfbd2SRuslan Ermilov.Va net.inet.ip.ttl 155211bfbd2SRuslan ErmilovMIB variable. 15685456935SBill Fenner.It Fl L 15785456935SBill FennerSuppress loopback of multicast packets. 15885456935SBill FennerThis flag only applies if the ping destination is a multicast address. 1598fae3551SRodney W. Grimes.It Fl n 1608fae3551SRodney W. GrimesNumeric output only. 1618fae3551SRodney W. GrimesNo attempt will be made to lookup symbolic names for host addresses. 1628fae3551SRodney W. Grimes.It Fl p Ar pattern 16350ceac88SJohn-Mark GurneyYou may specify up to 16 16450ceac88SJohn-Mark Gurney.Dq pad 16550ceac88SJohn-Mark Gurneybytes to fill out the packet you send. 1668fae3551SRodney W. GrimesThis is useful for diagnosing data-dependent problems in a network. 1678fae3551SRodney W. GrimesFor example, 1688fae3551SRodney W. Grimes.Dq Li \-p ff 1698fae3551SRodney W. Grimeswill cause the sent packet to be filled with all 1708fae3551SRodney W. Grimesones. 1719a4365d0SYoshinobu Inoue.It Fl P Ar policy 1729a4365d0SYoshinobu Inoue.Ar policy 1739a4365d0SYoshinobu Inouespecifies IPsec policy for the ping session. 1749a4365d0SYoshinobu InoueFor details please refer to 1759a4365d0SYoshinobu Inoue.Xr ipsec 4 1769a4365d0SYoshinobu Inoueand 1779a4365d0SYoshinobu Inoue.Xr ipsec_set_policy 3 . 178ef9e6dc7SBill Fenner.It Fl Q 179ef9e6dc7SBill FennerSomewhat quiet output. 18050ceac88SJohn-Mark Gurney.No Don Ap t 18150ceac88SJohn-Mark Gurneydisplay ICMP error messages that are in response to our query messages. 182ef9e6dc7SBill FennerOriginally, the 183ef9e6dc7SBill Fenner.Fl v 184ef9e6dc7SBill Fennerflag was required to display such errors, but 185ef9e6dc7SBill Fenner.Fl v 186ef9e6dc7SBill Fennerdisplays all ICMP error messages. On a busy machine, this output can 187ef9e6dc7SBill Fennerbe overbearing. Without the 188ef9e6dc7SBill Fenner.Fl Q 189ef9e6dc7SBill Fennerflag, 190ef9e6dc7SBill Fenner.Nm 191ef9e6dc7SBill Fennerprints out any ICMP error messages caused by its own ECHO_REQUEST 192ef9e6dc7SBill Fennermessages. 1938fae3551SRodney W. Grimes.It Fl q 1948fae3551SRodney W. GrimesQuiet output. 1958fae3551SRodney W. GrimesNothing is displayed except the summary lines at startup time and 1968fae3551SRodney W. Grimeswhen finished. 1978fae3551SRodney W. Grimes.It Fl R 1988fae3551SRodney W. GrimesRecord route. 1998fae3551SRodney W. GrimesIncludes the 2008fae3551SRodney W. Grimes.Tn RECORD_ROUTE 2018fae3551SRodney W. Grimesoption in the 2028fae3551SRodney W. Grimes.Tn ECHO_REQUEST 2038fae3551SRodney W. Grimespacket and displays 2048fae3551SRodney W. Grimesthe route buffer on returned packets. 20543470e3bSGarrett WollmanNote that the IP header is only large enough for nine such routes; 20643470e3bSGarrett Wollmanthe 20743470e3bSGarrett Wollman.Xr traceroute 8 20843470e3bSGarrett Wollmancommand is usually better at determining the route packets take to a 20943470e3bSGarrett Wollmanparticular destination. 210c03e877aSWarner LoshIf more routes come back than should, such as due to an illegal spoofed 211c03e877aSWarner Loshpacket, ping will print the route list and then truncate it at the correct 212c03e877aSWarner Loshspot. 21343470e3bSGarrett WollmanMany hosts ignore or discard the 21443470e3bSGarrett Wollman.Tn RECORD_ROUTE 21543470e3bSGarrett Wollmanoption. 2168fae3551SRodney W. Grimes.It Fl r 2178fae3551SRodney W. GrimesBypass the normal routing tables and send directly to a host on an attached 2188fae3551SRodney W. Grimesnetwork. 2198fae3551SRodney W. GrimesIf the host is not on a directly-attached network, an error is returned. 2208fae3551SRodney W. GrimesThis option can be used to ping a local host through an interface 22150ceac88SJohn-Mark Gurneythat has no route through it 222c4d9468eSRuslan Ermilov(e.g., after the interface was dropped by 223c4d9468eSRuslan Ermilov.Xr routed 8 ) . 2248fae3551SRodney W. Grimes.It Fl s Ar packetsize 225e345a80dSPhilippe CharnierSpecify the number of data bytes to be sent. 2268fae3551SRodney W. GrimesThe default is 56, which translates into 64 2278fae3551SRodney W. Grimes.Tn ICMP 2288fae3551SRodney W. Grimesdata bytes when combined 2298fae3551SRodney W. Grimeswith the 8 bytes of 2308fae3551SRodney W. Grimes.Tn ICMP 2310ed77db8SBruce Evansheader data. 2320ed77db8SBruce EvansOnly the super-user may use this option. 2332faab3cdSWarner Losh.It Fl S Ar src_addr 2342faab3cdSWarner LoshUse the following IP address as the source address in outgoing packets. 2352faab3cdSWarner LoshOn hosts with more than one IP address, this option can be used to 2362faab3cdSWarner Loshforce the source address to be something other than the IP address 2372faab3cdSWarner Loshof the interface the probe packet is sent on. If the IP address 2382faab3cdSWarner Loshis not one of this machine's interface addresses, an error is 2392faab3cdSWarner Loshreturned and nothing is sent. 2407237fd94SBill Fumerola.It Fl t Ar timeout 2417237fd94SBill FumerolaSpecify a timeout, in seconds, before ping exits regardless of how 2427237fd94SBill Fumerolamany packets have been recieved. 24385456935SBill Fenner.It Fl T Ar ttl 24485456935SBill FennerSet the IP Time To Live for multicasted packets. 24585456935SBill FennerThis flag only applies if the ping destination is a multicast address. 2468fae3551SRodney W. Grimes.It Fl v 2478fae3551SRodney W. GrimesVerbose output. 2488fae3551SRodney W. Grimes.Tn ICMP 2498fae3551SRodney W. Grimespackets other than 2508fae3551SRodney W. Grimes.Tn ECHO_RESPONSE 2518fae3551SRodney W. Grimesthat are received are listed. 2528fae3551SRodney W. Grimes.El 2538fae3551SRodney W. Grimes.Pp 2548fae3551SRodney W. GrimesWhen using 25550ceac88SJohn-Mark Gurney.Nm 2568fae3551SRodney W. Grimesfor fault isolation, it should first be run on the local host, to verify 2578fae3551SRodney W. Grimesthat the local network interface is up and running. 25850ceac88SJohn-Mark GurneyThen, hosts and gateways further and further away should be 25950ceac88SJohn-Mark Gurney.Dq pinged . 2608fae3551SRodney W. GrimesRound-trip times and packet loss statistics are computed. 2618fae3551SRodney W. GrimesIf duplicate packets are received, they are not included in the packet 2628fae3551SRodney W. Grimesloss calculation, although the round trip time of these packets is used 2633109a910SGarrett Wollmanin calculating the round-trip time statistics. 26450ceac88SJohn-Mark GurneyWhen the specified number of packets have been sent 265c4d9468eSRuslan Ermilov(and received) 26650ceac88SJohn-Mark Gurneyor if the program is terminated with a 2678fae3551SRodney W. Grimes.Dv SIGINT , 2683109a910SGarrett Wollmana brief summary is displayed, showing the number of packets sent and 2693109a910SGarrett Wollmanreceived, and the minimum, maximum, mean, and standard deviation of 2703109a910SGarrett Wollmanthe round-trip times. 2718fae3551SRodney W. Grimes.Pp 2728fae3551SRodney W. GrimesThis program is intended for use in network testing, measurement and 2738fae3551SRodney W. Grimesmanagement. 2748fae3551SRodney W. GrimesBecause of the load it can impose on the network, it is unwise to use 27550ceac88SJohn-Mark Gurney.Nm 2768fae3551SRodney W. Grimesduring normal operations or from automated scripts. 2778fae3551SRodney W. Grimes.Sh ICMP PACKET DETAILS 2788fae3551SRodney W. GrimesAn IP header without options is 20 bytes. 2798fae3551SRodney W. GrimesAn 2808fae3551SRodney W. Grimes.Tn ICMP 2818fae3551SRodney W. Grimes.Tn ECHO_REQUEST 28250ceac88SJohn-Mark Gurneypacket contains an additional 8 bytes worth of 2838fae3551SRodney W. Grimes.Tn ICMP 2848fae3551SRodney W. Grimesheader followed by an arbitrary amount of data. 2858fae3551SRodney W. GrimesWhen a 2868fae3551SRodney W. Grimes.Ar packetsize 28750ceac88SJohn-Mark Gurneyis given, this indicated the size of this extra piece of data 288c4d9468eSRuslan Ermilov(the default is 56). 2898fae3551SRodney W. GrimesThus the amount of data received inside of an IP packet of type 2908fae3551SRodney W. Grimes.Tn ICMP 2918fae3551SRodney W. Grimes.Tn ECHO_REPLY 2928fae3551SRodney W. Grimeswill always be 8 bytes more than the requested data space 293c4d9468eSRuslan Ermilov(the 294c4d9468eSRuslan Ermilov.Tn ICMP 295c4d9468eSRuslan Ermilovheader). 2968fae3551SRodney W. Grimes.Pp 2978fae3551SRodney W. GrimesIf the data space is at least eight bytes large, 29850ceac88SJohn-Mark Gurney.Nm 2998fae3551SRodney W. Grimesuses the first eight bytes of this space to include a timestamp which 3008fae3551SRodney W. Grimesit uses in the computation of round trip times. 3018fae3551SRodney W. GrimesIf less than eight bytes of pad are specified, no round trip times are 3028fae3551SRodney W. Grimesgiven. 3038fae3551SRodney W. Grimes.Sh DUPLICATE AND DAMAGED PACKETS 3048fae3551SRodney W. Grimes.Nm Ping 3058fae3551SRodney W. Grimeswill report duplicate and damaged packets. 30685456935SBill FennerDuplicate packets should never occur when pinging a unicast address, 30785456935SBill Fennerand seem to be caused by 3088fae3551SRodney W. Grimesinappropriate link-level retransmissions. 30950ceac88SJohn-Mark GurneyDuplicates may occur in many situations and are rarely 310c4d9468eSRuslan Ermilov(if ever) 31150ceac88SJohn-Mark Gurneya good sign, although the presence of low levels of duplicates may not 3128fae3551SRodney W. Grimesalways be cause for alarm. 31385456935SBill FennerDuplicates are expected when pinging a broadcast or multicast address, 31485456935SBill Fennersince they are not really duplicates but replies from different hosts 31585456935SBill Fennerto the same request. 3168fae3551SRodney W. Grimes.Pp 3178fae3551SRodney W. GrimesDamaged packets are obviously serious cause for alarm and often 3188fae3551SRodney W. Grimesindicate broken hardware somewhere in the 319e345a80dSPhilippe Charnier.Nm 3203109a910SGarrett Wollmanpacket's path (in the network or in the hosts). 3218fae3551SRodney W. Grimes.Sh TRYING DIFFERENT DATA PATTERNS 32250ceac88SJohn-Mark GurneyThe 3233109a910SGarrett Wollman(inter)network 32450ceac88SJohn-Mark Gurneylayer should never treat packets differently depending on the data 32550ceac88SJohn-Mark Gurneycontained in the data portion. 3268fae3551SRodney W. GrimesUnfortunately, data-dependent problems have been known to sneak into 3278fae3551SRodney W. Grimesnetworks and remain undetected for long periods of time. 3288fae3551SRodney W. GrimesIn many cases the particular pattern that will have problems is something 3293109a910SGarrett Wollmanthat does not have sufficient 33050ceac88SJohn-Mark Gurney.Dq transitions , 33150ceac88SJohn-Mark Gurneysuch as all ones or all zeros, or a pattern right at the edge, such as 33250ceac88SJohn-Mark Gurneyalmost all zeros. 3333109a910SGarrett WollmanIt is not 3343109a910SGarrett Wollmannecessarily enough to specify a data pattern of all zeros (for example) 33550ceac88SJohn-Mark Gurneyon the command line because the pattern that is of interest is 3368fae3551SRodney W. Grimesat the data link level, and the relationship between what you type and 3378fae3551SRodney W. Grimeswhat the controllers transmit can be complicated. 3388fae3551SRodney W. Grimes.Pp 3398fae3551SRodney W. GrimesThis means that if you have a data-dependent problem you will probably 3408fae3551SRodney W. Grimeshave to do a lot of testing to find it. 34150ceac88SJohn-Mark GurneyIf you are lucky, you may manage to find a file that either 3423109a910SGarrett Wollmancannot 34350ceac88SJohn-Mark Gurneybe sent across your network or that takes much longer to transfer than 34450ceac88SJohn-Mark Gurneyother similar length files. 3458fae3551SRodney W. GrimesYou can then examine this file for repeated patterns that you can test 3468fae3551SRodney W. Grimesusing the 3478fae3551SRodney W. Grimes.Fl p 3488fae3551SRodney W. Grimesoption of 3497c7fb079SRuslan Ermilov.Nm . 3508fae3551SRodney W. Grimes.Sh TTL DETAILS 3518fae3551SRodney W. GrimesThe 3528fae3551SRodney W. Grimes.Tn TTL 3538fae3551SRodney W. Grimesvalue of an IP packet represents the maximum number of IP routers 3548fae3551SRodney W. Grimesthat the packet can go through before being thrown away. 3558fae3551SRodney W. GrimesIn current practice you can expect each router in the Internet to decrement 3568fae3551SRodney W. Grimesthe 3578fae3551SRodney W. Grimes.Tn TTL 3588fae3551SRodney W. Grimesfield by exactly one. 3598fae3551SRodney W. Grimes.Pp 3608fae3551SRodney W. GrimesThe 3618fae3551SRodney W. Grimes.Tn TCP/IP 3628fae3551SRodney W. Grimesspecification states that the 3638fae3551SRodney W. Grimes.Tn TTL 3648fae3551SRodney W. Grimesfield for 3658fae3551SRodney W. Grimes.Tn TCP 36650ceac88SJohn-Mark Gurneypackets should be set to 60, but many systems use smaller values 367c4d9468eSRuslan Ermilov.No ( Bx 4.3 3683109a910SGarrett Wollmanuses 30, 3693109a910SGarrett Wollman.Bx 4.2 370c4d9468eSRuslan Ermilovused 15). 3718fae3551SRodney W. Grimes.Pp 372e345a80dSPhilippe CharnierThe maximum possible value of this field is 255, and most 373e345a80dSPhilippe Charnier.Ux 374e345a80dSPhilippe Charniersystems set 3758fae3551SRodney W. Grimesthe 3768fae3551SRodney W. Grimes.Tn TTL 3778fae3551SRodney W. Grimesfield of 3788fae3551SRodney W. Grimes.Tn ICMP ECHO_REQUEST 3798fae3551SRodney W. Grimespackets to 255. 38050ceac88SJohn-Mark GurneyThis is why you will find you can 38150ceac88SJohn-Mark Gurney.Dq ping 38250ceac88SJohn-Mark Gurneysome hosts, but not reach them with 3838fae3551SRodney W. Grimes.Xr telnet 1 3848fae3551SRodney W. Grimesor 3858fae3551SRodney W. Grimes.Xr ftp 1 . 3868fae3551SRodney W. Grimes.Pp 387e345a80dSPhilippe CharnierIn normal operation 388e345a80dSPhilippe Charnier.Nm 389e345a80dSPhilippe Charnierprints the ttl value from the packet it receives. 3908fae3551SRodney W. GrimesWhen a remote system receives a ping packet, it can do one of three things 3918fae3551SRodney W. Grimeswith the 3928fae3551SRodney W. Grimes.Tn TTL 3938fae3551SRodney W. Grimesfield in its response: 3948fae3551SRodney W. Grimes.Bl -bullet 3958fae3551SRodney W. Grimes.It 396e345a80dSPhilippe CharnierNot change it; this is what 397e345a80dSPhilippe Charnier.Bx 398e345a80dSPhilippe Charniersystems did before the 3998fae3551SRodney W. Grimes.Bx 4.3 tahoe 4008fae3551SRodney W. Grimesrelease. 4018fae3551SRodney W. GrimesIn this case the 4028fae3551SRodney W. Grimes.Tn TTL 4038fae3551SRodney W. Grimesvalue in the received packet will be 255 minus the 4048fae3551SRodney W. Grimesnumber of routers in the round-trip path. 4058fae3551SRodney W. Grimes.It 4063109a910SGarrett WollmanSet it to 255; this is what current 407e345a80dSPhilippe Charnier.Bx 4083109a910SGarrett Wollmansystems do. 4098fae3551SRodney W. GrimesIn this case the 4108fae3551SRodney W. Grimes.Tn TTL 4118fae3551SRodney W. Grimesvalue in the received packet will be 255 minus the 4128fae3551SRodney W. Grimesnumber of routers in the path 41350ceac88SJohn-Mark Gurney.Em from 4148fae3551SRodney W. Grimesthe remote system 4158fae3551SRodney W. Grimes.Em to 4168fae3551SRodney W. Grimesthe 41750ceac88SJohn-Mark Gurney.Nm Ns Em ing 4188fae3551SRodney W. Grimeshost. 4198fae3551SRodney W. Grimes.It 4208fae3551SRodney W. GrimesSet it to some other value. 4218fae3551SRodney W. GrimesSome machines use the same value for 4228fae3551SRodney W. Grimes.Tn ICMP 4238fae3551SRodney W. Grimespackets that they use for 4248fae3551SRodney W. Grimes.Tn TCP 4258fae3551SRodney W. Grimespackets, for example either 30 or 60. 4268fae3551SRodney W. GrimesOthers may use completely wild values. 4278fae3551SRodney W. Grimes.El 42843470e3bSGarrett Wollman.Sh RETURN VALUES 42943470e3bSGarrett WollmanThe 43050ceac88SJohn-Mark Gurney.Nm 43143470e3bSGarrett Wollmancommand returns an exit status of zero if at least one response was 43243470e3bSGarrett Wollmanheard from the specified 43343470e3bSGarrett Wollman.Ar host ; 43443470e3bSGarrett Wollmana status of two if the transmission was successful but no responses 43543470e3bSGarrett Wollmanwere received; or another value 436c4d9468eSRuslan Ermilov(from 437c4d9468eSRuslan Ermilov.Aq Pa sysexits.h ) 43843470e3bSGarrett Wollmanif an error occurred. 43943470e3bSGarrett Wollman.Sh SEE ALSO 44043470e3bSGarrett Wollman.Xr netstat 1 , 44143470e3bSGarrett Wollman.Xr ifconfig 8 , 44243470e3bSGarrett Wollman.Xr routed 8 , 44343470e3bSGarrett Wollman.Xr traceroute 8 44443470e3bSGarrett Wollman.Sh HISTORY 44543470e3bSGarrett WollmanThe 44643470e3bSGarrett Wollman.Nm 44743470e3bSGarrett Wollmancommand appeared in 44843470e3bSGarrett Wollman.Bx 4.3 . 44943470e3bSGarrett Wollman.Sh AUTHORS 45043470e3bSGarrett WollmanThe original 45143470e3bSGarrett Wollman.Nm 45268085a0eSPhilippe Charniercommand was written by 45368085a0eSPhilippe Charnier.An Mike Muuss 45468085a0eSPhilippe Charnierwhile at the US Army Ballistics 45543470e3bSGarrett WollmanResearch Laboratory. 4568fae3551SRodney W. Grimes.Sh BUGS 4578fae3551SRodney W. GrimesMany Hosts and Gateways ignore the 4588fae3551SRodney W. Grimes.Tn RECORD_ROUTE 4598fae3551SRodney W. Grimesoption. 4608fae3551SRodney W. Grimes.Pp 4618fae3551SRodney W. GrimesThe maximum IP header length is too small for options like 4628fae3551SRodney W. Grimes.Tn RECORD_ROUTE 46350ceac88SJohn-Mark Gurneyto be completely useful. 46450ceac88SJohn-Mark Gurney.No There Ap s 46550ceac88SJohn-Mark Gurneynot much that can be done about this, however. 4668fae3551SRodney W. Grimes.Pp 4678fae3551SRodney W. GrimesFlood pinging is not recommended in general, and flood pinging the 4688fae3551SRodney W. Grimesbroadcast address should only be done under very controlled conditions. 469ef9e6dc7SBill Fenner.Pp 470ef9e6dc7SBill FennerThe 471ef9e6dc7SBill Fenner.Fl v 472ef9e6dc7SBill Fenneroption is not worth much on busy hosts. 473