home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / n / netdate / ManPage < prev    next >
Encoding:
Text File  |  1996-11-17  |  5.6 KB  |  119 lines

  1.  
  2.  
  3.  
  4. NETDATE(8L)                          NETDATE(8L)
  5.  
  6.  
  7. NAME
  8.        netdate - set date and time by ARPA Internet RFC 868
  9.  
  10. SYNOPSIS
  11.        netdate [ -v ] [ -l limit ] [ protocol ] hostname...
  12.  
  13. DESCRIPTION
  14.        Netdate    takes  a list of names of Internet hosts as argu-
  15.        ments, selects the one which supplies the best  time,  and
  16.        sets the system time accordingly.  The invoker must be the
  17.        super-user for the time to be set.  Protocol names (either
  18.        udp  or    tcp) may be interspersed with the host names, and
  19.        determine the protocol which will be used  to  connect  to
  20.        the hosts whose names follow, up to the next protocol name
  21.        or the end of the arguments.  The default protocol is udp.
  22.  
  23.        The  ``best''  time  is    chosen by polling the named hosts
  24.        once each to find their times and taking their differences
  25.        from the local host's time.  These differences are used to
  26.        find the largest group of hosts    whose  times  agree  with
  27.        each  other within a certain limit.  The first host in the
  28.        largest group is picked as the best host.  (The assumption
  29.        is  that the hosts which are usually most accurate will be
  30.        named first.)  That host is polled  again  and  the  local
  31.        host's  time is set to the result.  The chosen host's time
  32.        is checked on this second poll to insure that its  differ-
  33.        ence  from  the local host's time has not varied more than
  34.        the limit from its difference at the first poll.
  35.  
  36.        The default limit is five seconds.  It may be set with the
  37.        -l  option.   The -v option causes the groups to be shown.
  38.        The host name localhost is recognized as a synonym for the
  39.        name  of the local host, no network connection is made for
  40.        it, and its time difference is always zero.  If    localhost
  41.        is  chosen  as  having the best time, the system time will
  42.        not be set.  Hosts which do not respond are not counted in
  43.        the  groups.  If the limit is set to zero, the time is set
  44.        to that of the first host to respond and no other checking
  45.        is  done.  Supplying only one host name argument also sets
  46.        the limit to zero.
  47.  
  48.        While the RFC868 protocol only returns  32 bits    of  data,
  49.        containing  the    time  in  seconds, netdate will accept an
  50.        extra 32 bits, containing  microseconds    (expected  to  be
  51.        accurate     to  no     more than milliseconds).  Delays on long
  52.        haul networks may make this extra precision  useless,  but
  53.        it  is useful on local area networks.  The extra precision
  54.        is not used on the first poll of a host, but it is used on
  55.        the  second poll of the chosen host, if that host supplies
  56.        it.
  57.  
  58. EXAMPLE
  59.        The most accurate hosts are named first in  each     example.
  60.        Some  such  call     on  netdate  should be put at the end of
  61.        /etc/rc.d/rc.local, so that the time will be set     properly
  62.        on  system  startup.   It  is  also useful to have a shell
  63.        script, e.g., /sbin/timehosts, which contains  a     call  on
  64.        netdate with arguments appropriate to the local system, so
  65.        that it is easy to set the time manually.
  66.  
  67. netdate -l 30 udp dcn-gate tcp neighbor
  68.        Dcn-gate is a hypothetical host which usually  keeps  time
  69.        accurate     to  within milliseconds of Coordinated Universal
  70.        Time, but may occasionally be eight hours  off.     Neighbor
  71.        is a neighbor of the local host which keeps time with mod-
  72.        erate accuracy.    The time will be set to that of     dcn-gate
  73.        if  that and neighbor agree to within thirty seconds, else
  74.        it will not be set at all.  This is almost good enough for
  75.        most  circumstances,  but  won't     do when the local host's
  76.        time is known to be wrong (e.g., after a long downtime  or
  77.        a  bad crash) and must be set to something.  If one of the
  78.        hosts named is inaccurate or not responding,  there  is    a
  79.        problem.
  80.  
  81. netdate -l 30 udp dcn-gate tcp neighbor neighbor2
  82.        Only  two of the three hosts named must agree on the time.
  83.        The time will still be set (to that of  the  first  neigh-
  84.        bor),  even  if    dcn-gate  is  far  off as long as the two
  85.        neighbors agree.     This is probably good    enough    for  most
  86.        cases.    One can arbitrarily gerrymander the vote for more
  87.        insurance (and less clarity), as in the following example.
  88.  
  89. netdate udp dcn-gate dcn1 tcp bbn-unix localhost neighbor
  90.        Here dcn1 and bbn-unix are more hypothetical very accurate
  91.        timekeepers, at least one of  which  keeps  time     indepen-
  92.        dently  from  dcn-gate, one hopes.  It is very likely that
  93.        the time will be set to that one of those three very accu-
  94.        rate  hosts,  as long as at least two of them agree, or at
  95.        least one of them agrees with the neighbor  or  the  local
  96.        host's  time.  If all the foreign hosts disagree, the time
  97.        will not be set, since localhost will be chosen as best.
  98.  
  99. netdate -l 3 localhost localhost udp dcn-gate dcn1 tcp bbn-unix
  100.        This example gives localhost two votes and declares it  to
  101.        usually    have  the  most accurate time.    All three foreign
  102.        hosts must agree within three seconds and also differ from
  103.        localhosts  by  more than three seconds for the time to be
  104.        set.  Thus the time will be set only if it really needs to
  105.        be.
  106.  
  107. FILES
  108.        /etc/services  for the time service port number
  109.        /etc/protocols for the protocol numbers
  110.        /var/adm/wtmp  to record time-setting
  111.  
  112. SEE ALSO
  113.        ARPANET     Request   for     Comments  868,     gettimeofday(2),
  114.        date(1), WWV (USA): 2.5,5,10,15    MHz  AM     for  Coordinated
  115.        Universal Time (UCT).
  116.  
  117. DIAGNOSTICS
  118.                  85/08/21                3
  119.