1 .\" Copyright (c) 2002-2013 Apple Inc. All rights reserved.
3 .\" @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 .\" This file contains Original Code and/or Modifications of Original Code
6 .\" as defined in and that are subject to the Apple Public Source License
7 .\" Version 2.0 (the 'License'). You may not use this file except in
8 .\" compliance with the License. The rights granted to you under the License
9 .\" may not be used to create, or enable the creation or redistribution of,
10 .\" unlawful or unlicensed copies of an Apple operating system, or to
11 .\" circumvent, violate, or enable the circumvention or violation of, any
12 .\" terms of an Apple operating system software license agreement.
14 .\" Please obtain a copy of the License at
15 .\" http://www.opensource.apple.com/apsl/ and read it before using this file.
17 .\" The Original Code and all software distributed under the License are
18 .\" distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
19 .\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
20 .\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
21 .\" FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
22 .\" Please see the License for the specific language governing rights and
23 .\" limitations under the License.
25 .\" @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
28 .\" All rights reserved.
30 .\" Redistribution and use in source and binary forms, with or without
31 .\" modification, are permitted provided that the following conditions
33 .\" 1. Redistributions of source code must retain the above copyright
34 .\" notice, this list of conditions and the following disclaimer.
35 .\" 2. Redistributions in binary form must reproduce the above copyright
36 .\" notice, this list of conditions and the following disclaimer in the
37 .\" documentation and/or other materials provided with the distribution.
38 .\" 3. Neither the name of the project nor the names of its contributors
39 .\" may be used to endorse or promote products derived from this software
40 .\" without specific prior written permission.
42 .\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
43 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
45 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
46 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
47 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
48 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
51 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
61 .Tn ICMPv6 ECHO_REQUEST
62 packets to network hosts
65 .\" without ipsec, or new ipsec
68 .\" .Op Fl ADdEfmnNqRtvwW
82 .Op Fl G Ar sweepmaxsize[,sweepminsize[,sweepincrsize]]
100 .Op Fl k Ar trafficclass
103 .Op Fl K Ar netservicetype
116 .Op Fl S Ar sourceaddr
119 .Op Fl s Ar packetsize
125 .Op Fl Fl apple-connect
142 .Tn ICMP6_ECHO_REQUEST
143 datagram to elicit an
145 from a host or gateway.
146 .Tn ICMP6_ECHO_REQUEST
147 datagrams (``pings'') have an IPv6 header,
150 header formatted as documented in RFC2463.
151 The options are as follows:
155 .\" Enables transport-mode IPsec authentication header
158 Generate ICMPv6 Node Information Node Addresses query, rather than echo-request.
160 must be a string constructed of the following characters.
161 .Bl -tag -width Ds -compact
163 requests unicast addresses from all of the responder's interfaces.
164 If the character is omitted,
165 only those addresses which belong to the interface which has the
166 responder's address are requests.
168 requests responder's IPv4-compatible and IPv4-mapped addresses.
170 requests responder's global-scope addresses.
172 requests responder's site-local addresses.
174 requests responder's link-local addresses.
176 requests responder's anycast addresses.
177 Without this character, the responder will return unicast addresses only.
178 With this character, the responder will return anycast addresses only.
179 Note that the specification does not specify how to get responder's
181 This is an experimental option.
184 Set socket buffer size.
186 Bind the socket to interface
187 This option is an Apple addition.
191 Prohibit the socket from using the cellular network interface.
198 If this option is specified in conjunction with ping sweeps,
199 each sweep will consist of
203 Disable IPv6 fragmentation.
207 option on the socket being used.
209 .\" Enables transport-mode IPsec encapsulated security payload
213 Outputs packets as fast as they come back or one hundred times per second,
219 is printed, while for every
221 received a backspace is printed.
222 This provides a rapid display of how many packets are being dropped.
223 Only the super-user may use this option.
225 This can be very hard on a network and should be used with caution.
227 .It Fl G Ar sweepmaxsize[,sweepminsize[,sweepincrsize]]
229 specifies the maximum size of the payload when sending sweeping
230 pings and is required for sweeps.
232 specifies the size of the payload to start with when sending
233 sweeping pings -- the default value is 0.
235 specifies the number of bytes to increment the size of the payload
236 after each sweep when sending sweeping pings -- the default value
238 This option is an Apple addition.
242 as the next hop to the destination.
243 The gateway must be a neighbor of the sending node.
245 Specifies to try reverse-lookup of IPv6 addresses.
248 utility does not try reverse-lookup unless the option is specified.
250 Set the IPv6 hoplimit.
251 .It Fl I Ar interface
252 Source packets with the given interface address.
253 This flag applies if the ping destination is a multicast address,
254 or link-local/site-local unicast address.
259 .Em between sending each packet .
260 The default is to wait for one second between each packet.
261 The wait time may be fractional, but only the super-user may specify
262 values less than 0.1 second.
263 This option is incompatible with the
266 .It Fl k Ar trafficclass
267 Specifies the traffic class to use for sending ICMPv6 packets.
268 The supported traffic classes are
269 BK_SYS, BK, BE, RD, OAM, AV, RV, VI, VO and CTL.
272 uses the control traffic class (CTL).
273 This option is an Apple addition.
274 .It Fl K Ar netservicetype
275 Specifies the network service type to use for sending ICMPv6 packets.
276 The supported network service type are BK_SYS, BK, BE, RV, AV, RD, OAM, VI, SIG and VO.
277 Note this overrides the default traffic class (-k can still be specified after -K to use both).
278 This option is an Apple addition.
284 sends that many packets as fast as possible before falling into its normal
286 Only the super-user may use this option.
290 asks the kernel to fragment packets to fit into the minimum IPv6 MTU.
294 will suppress the behavior in the following two levels:
295 when the option is specified once, the behavior will be disabled for
297 When the option is more than once, it will be disabled for both
298 unicast and multicast packets.
301 No attempt will be made to lookup symbolic names from addresses in the reply.
303 Probe node information multicast group
304 .Pq Li ff02::2:xxxx:xxxx .
306 must be string hostname of the target
307 (must not be a numeric IPv6 address).
308 Node information multicast group will be computed based on given
310 and will be used as the final destination.
311 Since node information multicast group is a link-local multicast group,
312 outgoing interface needs to be specified by
316 Exit successfully after receiving one reply packet.
318 You may specify up to 16
320 bytes to fill out the packet you send.
321 This is useful for diagnosing data-dependent problems in a network.
324 will cause the sent packet to be filled with all
329 specifies IPsec policy to be used for the probe.
332 Nothing is displayed except the summary lines at startup time and
339 character in the output when any packet is received.
345 character when no packet is received before the next packet
347 To cater for round-trip times that are longer than the interval
348 between transmissions, further missing packets cause a bell only
349 if the maximum number of unreceived packets has increased.
350 .It Fl S Ar sourceaddr
351 Specifies the source address of request packets.
352 The source address must be one of the unicast addresses of the sending node,
354 .It Fl s Ar packetsize
355 Specifies the number of data bytes to be sent.
356 The default is 56, which translates into 64
358 data bytes when combined
362 You may need to specify
364 as well to extend socket buffer size.
366 Generate ICMPv6 Node Information supported query types query,
367 rather than echo-request.
377 that are received are listed.
379 Generate ICMPv6 Node Information DNS Name query, rather than echo-request.
387 but with old packet format based on 03 draft.
388 This option is present for backward compatibility.
394 Use the specified traffic class.
395 .It Fl Fl apple-connect
396 Connects the socket to the destination address.
397 This option is an Apple addition.
399 Prints the time a packet was received.
400 This option is an Apple addition.
402 IPv6 addresses for intermediate nodes,
403 which will be put into type 0 routing header.
405 IPv6 address of the final destination node.
410 for fault isolation, it should first be run on the local host, to verify
411 that the local network interface is up and running.
412 Then, hosts and gateways further and further away should be
414 Round-trip times and packet loss statistics are computed.
415 If duplicate packets are received, they are not included in the packet
416 loss calculation, although the round trip time of these packets is used
417 in calculating the round-trip time statistics.
418 When the specified number of packets have been sent
420 or if the program is terminated with a
422 a brief summary is displayed, showing the number of packets sent and
423 received, and the minimum, mean, maximum, and standard deviation of
424 the round-trip times.
434 signal, the current number of packets sent and received, and the
435 minimum, mean, maximum, and standard deviation of the round-trip times
436 will be written to the standard output in the same format as the
437 standard completion message.
439 This program is intended for use in network testing, measurement and
441 Because of the load it can impose on the network, it is unwise to use
443 during normal operations or from automated scripts.
444 .\" .Sh ICMP PACKET DETAILS
445 .\" An IP header without options is 20 bytes.
449 .\" packet contains an additional 8 bytes worth of
451 .\" header followed by an arbitrary amount of data.
454 .\" is given, this indicated the size of this extra piece of data
455 .\" (the default is 56).
456 .\" Thus the amount of data received inside of an IP packet of type
459 .\" will always be 8 bytes more than the requested data space
464 .\" If the data space is at least eight bytes large,
466 .\" uses the first eight bytes of this space to include a timestamp which
467 .\" it uses in the computation of round trip times.
468 .\" If less than eight bytes of pad are specified, no round trip times are
470 .Sh DUPLICATE AND DAMAGED PACKETS
473 utility will report duplicate and damaged packets.
474 Duplicate packets should never occur when pinging a unicast address,
475 and seem to be caused by
476 inappropriate link-level retransmissions.
477 Duplicates may occur in many situations and are rarely
479 a good sign, although the presence of low levels of duplicates may not
480 always be cause for alarm.
481 Duplicates are expected when pinging a broadcast or multicast address,
482 since they are not really duplicates but replies from different hosts
485 Damaged packets are obviously serious cause for alarm and often
486 indicate broken hardware somewhere in the
489 (in the network or in the hosts).
490 .Sh TRYING DIFFERENT DATA PATTERNS
493 layer should never treat packets differently depending on the data
494 contained in the data portion.
495 Unfortunately, data-dependent problems have been known to sneak into
496 networks and remain undetected for long periods of time.
497 In many cases the particular pattern that will have problems is something
498 that does not have sufficient
500 such as all ones or all zeros, or a pattern right at the edge, such as
503 necessarily enough to specify a data pattern of all zeros (for example)
504 on the command line because the pattern that is of interest is
505 at the data link level, and the relationship between what you type and
506 what the controllers transmit can be complicated.
508 This means that if you have a data-dependent problem you will probably
509 have to do a lot of testing to find it.
510 If you are lucky, you may manage to find a file that either
512 be sent across your network or that takes much longer to transfer than
513 other similar length files.
514 You can then examine this file for repeated patterns that you can test
522 utility returns 0 on success (the host is alive),
523 2 if the transmission was successful but no responses were received,
524 any other non-zero value if the arguments are incorrect or
525 another error has occurred.
531 would work; the following will send ICMPv6 echo request to
533 .Bd -literal -offset indent
537 The following will probe hostnames for all nodes on the network link attached to
542 is named the link-local all-node multicast address, and the packet would
543 reach every node on the network link.
544 .Bd -literal -offset indent
548 The following will probe addresses assigned to the destination node,
550 .Bd -literal -offset indent
551 ping6 -a agl dst.foo.com
566 .%T "Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification"
572 .%T "IPv6 Node Information Queries"
573 .%N draft-ietf-ipngwg-icmp-name-lookups-09.txt
575 .%O work in progress material
584 utility with IPv6 support first appeared in the WIDE Hydrangea IPv6
587 IPv6 and IPsec support based on the KAME Project
588 .Pq Pa http://www.kame.net/
589 stack was initially integrated into
595 is intentionally separate from
598 There have been many discussions on why we separate
602 Some people argued that it would be more convenient to uniform the
603 ping command for both IPv4 and IPv6.
604 The followings are an answer to the request.
606 From a developer's point of view:
607 since the underling raw sockets API is totally different between IPv4
608 and IPv6, we would end up having two types of code base.
609 There would actually be less benefit to uniform the two commands
610 into a single command from the developer's standpoint.
612 From an operator's point of view: unlike ordinary network applications
613 like remote login tools, we are usually aware of address family when using
614 network management tools.
615 We do not just want to know the reachability to the host, but want to know the
616 reachability to the host via a particular network protocol such as
618 Thus, even if we had a unified
620 command for both IPv4 and IPv6, we would usually type a
624 option (or something like those) to specify the particular address family.
625 This essentially means that we have two different commands.