home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / ping11.zip / pingman.txt < prev    next >
Text File  |  1995-03-03  |  11KB  |  230 lines

  1. PING(8)                                                   PING(8)
  2.  
  3.  
  4. NAME
  5.        ping - send ICMP ECHO_REQUEST packets to network hosts
  6.  
  7. SYNOPSIS
  8.        /etc/ping  [ -dfnqrvR ][ -c count][ -i wait][ -l preload][
  9.        -p pattern][ -s packetsize] [-h] host
  10.  
  11. DESCRIPTION
  12.        The DARPA Internet is a large and complex  aggregation  of
  13.        network  hardware, connected together by gateways.  Track-
  14.        ing a single-point hardware or software failure can  often
  15.        be  difficult.   Ping  uses  the ICMP protocol's mandatory
  16.        ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from
  17.        a  host  or  gateway.   ECHO_REQUEST datagrams (``pings'')
  18.        have an IP and ICMP header, followed by a struct  timeval,
  19.        and then an arbitrary number of ``pad'' bytes used to fill
  20.        out the packet.  Default datagram length is 64 bytes,  but
  21.        this  may  be  changed using the -s option.  Other options
  22.        are:
  23.  
  24.        -d     Set the SO_DEBUG option on the socket being used.
  25.  
  26.        -f     Flood ping.  Outputs packets as fast as  they  come
  27.               back  or one hundred times per second, whichever is
  28.               more.  For every ECHO_REQUEST sent a period '.'  is
  29.               printed,  while  for  ever  ECHO_REPLY  received  a
  30.               backspace is printed.  This provides a  rapid  dis-
  31.               play  of  how many packets are being dropped.  This
  32.               can be very hard on a network and  should  be  used
  33.               with caution.
  34.  
  35.        -h     You may use this flag to specify the host, or leave
  36.               it off if the host is the last token on the command
  37.               line.
  38.  
  39.        -n     Numeric  output  only.   No attempt will be made to
  40.               lookup symbolic names for host addresses.
  41.  
  42.        -q     Quiet output.  Nothing is displayed except the sum-
  43.               mary lines at the beginning and at the end.
  44.  
  45.        -r     Bypass  the normal routing tables and send directly
  46.               to a host on an attached network.  If the  host  is
  47.               not  on  a  directly-attached  network, an error is
  48.               returned.  This option can be used to ping a  local
  49.               host through an interface that has no route through
  50.               it  (e.g.,  after  the  interface  was  dropped  by
  51.               routed(8C) ).
  52.  
  53.        -v     Verbose    output.    ICMP   packets   other   than
  54.               ECHO_RESPONSE that are received are listed.
  55.  
  56.        -R     Record Route.  Includes the RECORD_ROUTE option  in
  57.               the  ECHO_REQUEST  packet  and  displays  the route
  58.               buffer on  returned  packets.   Note  that  the  IP
  59.               header  is  only large enough for nine such routes.
  60.               Many hosts ignore or discard this option.
  61.  
  62.        -c count
  63.               Stop after receiving count ECHO_RESPONSE packets.
  64.  
  65.        -i wait
  66.               Wait wait seconds between sending each packet.  The
  67.               default  is  to  wait  for  one second between each
  68.               packet.  This option is incompatible  with  the  -f
  69.               option.
  70.  
  71.        -l preload
  72.               If  preload  is given, ping sends that many packets
  73.               as fast as possible before falling into its  normal
  74.               mode of behavior.
  75.  
  76.        -p pattern
  77.               You  may  specify  up to 16 "pad" bytes to fill out
  78.               the packet you send.  This is useful for diagnosing
  79.               data-dependent problems in a network.  For example,
  80.               "-p ff" will cause the sent  packet  to  be  filled
  81.               with all ones.
  82.  
  83.        -s packetsize
  84.               Specifies the number of data bytes to be sent.  The
  85.               default is 56, which translates into 64  ICMP  data
  86.               bytes when combined with the 8 bytes of ICMP header
  87.               data.
  88.  
  89.        -w seconds
  90.               Specifies  the  number  of  seconds  to  wait for a
  91.               response, default is 10.
  92.  
  93.        When using ping for fault isolation, it  should  first  be
  94.        run  on  the  local host, to verify that the local network
  95.        interface is up and running.   Then,  hosts  and  gateways
  96.        further and further away should be ``pinged''.  Ping sends
  97.        one datagram per second (or per wait seconds), and  prints
  98.        one  line  of output for every ECHO_RESPONSE returned.  If
  99.        an optional count is given, only that number  of  requests
  100.        is  sent.  Round-trip times and packet loss statistics are
  101.        computed.  If duplicate packets are received, they are not
  102.        included  in  the  packet  loss  calculation, although the
  103.        round trip time of these packets is  used  in  calculating
  104.        the minimun/average/maximum round-trip time numbers.  When
  105.        all responses have been received or the program times  out
  106.        (with  a count specified), or if the program is terminated
  107.        with a SIGINT, a brief summary is displayed.
  108.  
  109.        This program is intended for use in network testing,  mea-
  110.        surement  and management.  It should be used primarily for
  111.        manual fault isolation.  Because  of  the  load  it  could
  112.        impose  on  the  network,  it is unwise to use ping during
  113.        normal operations or from automated scripts.
  114.  
  115.  
  116. ICMP Packet Details
  117.        An IP  header  without  options  is  20  bytes.   An  ICMP
  118.        ECHO_REQUEST  packet  contains an additional 8 bytes worth
  119.        of ICMP header followed by an arbitrary  amount  of  data.
  120.        When  a  packetsize  is  given, this indicated the size of
  121.        this extra blob of data (the default  is  56).   Thus  the
  122.        amount  of  data  received  inside of an IP packet of type
  123.        ICMP ECHO_REPLY will always  be  8  bytes  more  than  the
  124.        requested data space (the ICMP header).
  125.  
  126.        If the data space is at least eight bytes large, ping uses
  127.        the first eight bytes of this space to include a timestamp
  128.        which  it  uses  in  the  computation of round trip times.
  129.        This explains why if less than  eight  bytes  of  pad  are
  130.        requested, no round trip times are given.
  131.  
  132. Duplicate and Damaged packets
  133.        Ping will report duplicate and damaged packets.  Duplicate
  134.        packets should never occur, and seem to be caused by inap-
  135.        propriate link-level retransmissions.  The author has seen
  136.        duplicates in many situations and has never known them  to
  137.        be  a  good  thing, although the presence of low levels of
  138.        duplicates may not always be  cause  for  alarm.   Network
  139.        maintainers  ignore  them  at  their own risk as they have
  140.        been known to be harbingers of severe network problems.
  141.  
  142.        Damaged packets are obviously serious cause for alarm  and
  143.        most likely indicate broken hardware somewhere in the ping
  144.        packet's path (in the network or in the hosts).
  145.  
  146. Trying Different Data Patterns
  147.        It should go without saying that the (inter)network  layer
  148.        should  never  treat  packets differently depending on the
  149.        data contained in the data portion.  Unfortunately,  data-
  150.        dependent  problems have been known to sneak into networks
  151.        and remain undetected for long periods of time.   In  many
  152.        cases  the  particular  pattern that will have problems is
  153.        something that doesn't have "enough" transitions, such  as
  154.        all  ones  or  all  zeros, or a pattern right at the edge,
  155.        such as almost all zeros.  It isn't necessarily enough  to
  156.        specify  a  data pattern of all zeros (for example) on the
  157.        command line (as in -p 00), because the pattern that is of
  158.        interest  is  at the data link level, and the relationship
  159.        between what you type and what  the  controllers  transmit
  160.        can be complicated.
  161.  
  162.        This  means  that if you have a data-dependent problem you
  163.        will have to be prepared to do a lot of  testing  to  find
  164.        it.   If you are lucky, you may manage to find a file that
  165.        either can't be sent across your  network  or  that  takes
  166.        much  longer  to transfer than other similar length files.
  167.        You can then examine this file for repeated patterns  that
  168.        you can test using the -p option of ping.
  169.  
  170.  
  171. TTL Details
  172.        The  TTL value of an IP packet represents the maximum num-
  173.        ber of IP routers that the packet can  go  through  before
  174.        being  thrown  away.   In  current practice you can expect
  175.        each router in the Internet to decrement the TTL field  by
  176.        exactly one.
  177.  
  178.        The  TCP/IP  specification says that the TTL field for TCP
  179.        packets should be set to 60, but many systems use  smaller
  180.        values (4.3 BSD uses 30, 4.2 used 15).
  181.  
  182.        The  maximum possible value of this field is 255, and most
  183.        Unix systems set the TTL field of ICMP ECHO_REQUEST  pack-
  184.        ets to 255.  This is why you will find you can "ping" some
  185.        hosts, but not reach them with telnet or ftp.
  186.  
  187.        In normal operation ping prints the  ttl  value  from  the
  188.        packet  it receives.  When a remote system receives a ping
  189.        packet, it can do one of three things with the  TTL  field
  190.        in its response:
  191.  
  192.        (1)    Not  change  it; this is what Berkeley Unix systems
  193.               did until 4.3 BSD tahoe level  releases.   In  this
  194.               case  the  TTL value in the received packet will be
  195.               255 minus the number of routers in  the  round-trip
  196.               path.
  197.  
  198.        (2)    Set  it  to 255; this is what Berkeley Unix systems
  199.               have done since the 4.3  tahoe  release.   In  this
  200.               case  the  TTL value in the received packet will be
  201.               255 minus the number of routers in  the  path  from
  202.               the remote system to the pinging host.
  203.  
  204.        (3)    Set  it to some other value.  Some machines use the
  205.               same value for ICMP packets that they use  for  TCP
  206.               packets,  for  example either 30 or 60.  Others may
  207.               use completely wild values.
  208.  
  209. BUGS
  210.        Many Hosts and Gateways ignore the RECORD_ROUTE option.
  211.  
  212.        The maximum IP header length is too small for options like
  213.        RECORD_ROUTE  to  be  completely useful.  There's not much
  214.        that we can do about that however.
  215.  
  216.        Flood pinging is not recommended  in  general,  and  flood
  217.        pinging  the  broadcast  address should only be done under
  218.        very controlled conditions.
  219.  
  220. AUTHOR
  221.        Mike Muuss
  222.  
  223. SEE ALSO
  224.        netstat(1), ifconfig(8C)
  225.  
  226.  
  227.  
  228.                            May 25, 1989                         4
  229.  
  230.