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