ping

8 iputils-&snapshot;

ping, ping6

send ICMP ECHO_REQUEST to network hosts

    ping
    -LRUbdfnqrvVaAB
    -c
    -i
    -l
    -p
    -s
    -t
    -w
    -F
    -I
    -M
    -Q
    -S
    -T
    -W

## DESCRIPTION

``

## OPTIONS

``

- Audible ping.

``

- Adaptive ping. Interpacket interval adapts to round-trip time, so that effectively not more than one (or more, if preload is set) unanswered probes present in the network. Minimal interval is 200msec for not super-user. On networks with low rtt this mode is essentially equivalent to flood mode.

``

- Allow pinging a broadcast address.

``

- Do not allow ``

`-c ```

- Stop after sending ``option, ````

``

- Set the ``

`-F ```

- Allocate and set 20 bit flow label on echo request packets. (Only ``

``

- Flood ping. For every ECHO_REQUEST sent a period ``.'' is printed, while for ever ECHO_REPLY received a backspace is printed. This provides a rapid display of how many packets are being dropped. If interval is not given, it sets interval to zero and outputs packets as fast as they come back or one hundred times per second, whichever is more. Only the super-user may use this option with zero interval.

`-i ```

- Wait ``

`-I ```

- Set source address to specified interface address. Argument may be numeric IP address or name of device. When pinging IPv6 link-local address this option is required.

`-l ```

- If ``

``

- Suppress loopback of multicast packets. This flag only applies if the ping destination is a multicast address.

``

- Numeric output only. No attempt will be made to lookup symbolic names for host addresses.

`-p ```

- You may specify up to 16 ``pad'' bytes to fill out the packet you send. This is useful for diagnosing data-dependent problems in a network. For example, `-p ff` will cause the sent packet to be filled with all ones.

`-Q ```

- Set Quality of Service -related bits in ICMP datagrams. ``

``

- Quiet output. Nothing is displayed except the summary lines at startup time and when finished.

``

- Record route. Includes the RECORD_ROUTE option in the ECHO_REQUEST packet and displays the route buffer on returned packets. Note that the IP header is only large enough for nine such routes. Many hosts ignore or discard this option.

``

- Bypass the normal routing tables and send directly to a host on an attached interface. If the host is not on a directly-attached network, an error is returned. This option can be used to ping a local host through an interface that has no route through it provided the option ``

`-s ```

- Specifies the number of data bytes to be sent. The default is 56, which translates into 64 ICMP data bytes when combined with the 8 bytes of ICMP header data.

`-S ```

- Set socket sndbuf. If not specified, it is selected to buffer not more than one packet.

`-t ```

- Set the IP Time to Live.

`-T ```

- Set special IP timestamp options. ``

`-M ```

- Select Path MTU Discovery strategy. ``

``

- Print full user-to-user latency (the old behaviour). Normally ``

``

- Verbose output.

``

- Show version and exit.

`-w ```

- Specify a timeout, in seconds, before ``packet are sent, it waits either for `expire or until `probes are answered or for some error notification from network.````

`-W ```

- Time to wait for a response, in seconds. The option affects only timeout in absense of any responses, otherwise ``

When using ``

If ``and `are both specified, and fewer than `packets are received by the time the `has arrived, it will also exit with code 1. On other error it exits with code 2. Otherwise it exits with code 0. This makes it possible to use the exit code to see if a host is alive or not.`````

This program is intended for use in network testing, measurement and management. Because of the load it can impose on the network, it is unwise to use ``

## ICMP PACKET DETAILS

An IP header without options is 20 bytes. An ICMP ECHO_REQUEST packet contains an additional 8 bytes worth of ICMP header followed by an arbitrary amount of data. When a ``

If the data space is at least of size of

## DUPLICATE AND DAMAGED PACKETS

``

Damaged packets are obviously serious cause for alarm and often indicate broken hardware somewhere in the ``

## TRYING DIFFERENT DATA PATTERNS

The (inter)network layer should never treat packets differently depending on the data contained in the data portion. Unfortunately, data-dependent problems have been known to sneak into networks and remain undetected for long periods of time. In many cases the particular pattern that will have problems is something that doesn't have sufficient ``transitions'', such as all ones or all zeros, or a pattern right at the edge, such as almost all zeros. It isn't necessarily enough to specify a data pattern of all zeros (for example) on the command line because the pattern that is of interest is at the data link level, and the relationship between what you type and what the controllers transmit can be complicated.

This means that if you have a data-dependent problem you will probably have to do a lot of testing to find it. If you are lucky, you may manage to find a file that either can't be sent across your network or that takes much longer to transfer than other similar length files. You can then examine this file for repeated patterns that you can test using the ``

## TTL DETAILS

The TTL value of an IP packet represents the maximum number of IP routers that the packet can go through before being thrown away. In current practice you can expect each router in the Internet to decrement the TTL field by exactly one.

The TCP/IP specification states that the TTL field for TCP packets should be set to 60, but many systems use smaller values (4.3 BSD uses 30, 4.2 used 15).

The maximum possible value of this field is 255, and most Unix systems set the TTL field of ICMP ECHO_REQUEST packets to 255. This is why you will find you can ``ping'' some hosts, but not reach them with

or

.

In normal operation ping prints the ttl value from the packet it receives. When a remote system receives a ping packet, it can do one of three things with the TTL field in its response:

- Not change it; this is what Berkeley Unix systems did before the 4.3BSD Tahoe release. In this case the TTL value in the received packet will be 255 minus the number of routers in the round-trip path.

- Set it to 255; this is what current Berkeley Unix systems do. In this case the TTL value in the received packet will be 255 minus the number of routers in the path

- Set it to some other value. Some machines use the same value for ICMP packets that they use for TCP packets, for example either 30 or 60. Others may use completely wild values.

## BUGS

- Many Hosts and Gateways ignore the RECORD_ROUTE option.

- The maximum IP header length is too small for options like RECORD_ROUTE to be completely useful. There's not much that that can be done about this, however.

- Flood pinging is not recommended in general, and flood pinging the broadcast address should only be done under very controlled conditions.

## SEE ALSO

,

.

## HISTORY

The ``

The version described here is its descendant specific to Linux.

## SECURITY

``

## AVAILABILITY

`http://www.skbuff.net/iputils/iputils-current.tar.bz2.`

# COPYING

    Copyright (c) 1989 The Regents of the University of California.
    All rights reserved.

    This code is derived from software contributed to Berkeley by
    Mike Muuss.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
    1. Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.
    3. All advertising materials mentioning features or use of this software
       must display the following acknowledgement:
    	This product includes software developed by the University of
    	California, Berkeley and its contributors.
    4. Neither the name of the University nor the names of its contributors
       may be used to endorse or promote products derived from this software
       without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    SUCH DAMAGE.

]]>