home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / mod.std.unix.v5 / text0016.txt < prev    next >
Encoding:
Text File  |  1987-06-30  |  9.2 KB  |  232 lines

  1. A wheel that frequently gets reinvented is how to tell the time over networks.
  2. Much work has been done on this subject in the ARPA Internet from back when
  3. there was only the ARPANET up to a few months ago.  This article is a brief
  4. summary of the existing methods.
  5.  
  6. Herein GMT and UT are used as synonyms for Coordinated Universal Time.
  7.  
  8. Here is a list of references in (mostly) chronological order, to be followed
  9. by abstracts of or comments on each.  Probably the most widely used protocol
  10. is RFC868.  Possibly the best for what it tries to do is RFC958.  For use
  11. in synchronizing clocks of machines on a local area network, TSP will likely
  12. become increasingly important, because it will come with 4.3BSD.  Several
  13. higher-level schemes employ RFC792.
  14.  
  15. If there is sufficient interest, I will post the relevant RFCs to mod.sources.
  16.  
  17. (RFC792) Sep 81    (Postel)      Internet Control Message Protocol  
  18. (RFC778) 18 Apr 81 (Mills)       DCNet Internet Clock Service
  19. (RFC867) May 83    (Postel)      Daytime Protocol
  20. (RFC868) May 83    (Postel)      Time Protocol
  21. (RFC956) Sep 85    (Mills)       Algorithms for Synchronizing Network Clocks  
  22. (RFC957) Sep 85    (Mills)       Experiments in Network Clock Synchronization  
  23. (RFC958) Sep 85    (Mills)       Network Time Protocol  
  24. TSP: The Time Synchronization Protocol for UNIX 4.3BSD, R. Gusella and S. Zatti
  25.  
  26.  
  27. (RFC792) Sep 81    (Postel)      Internet Control Message Protocol
  28.  
  29. This is one of the basic protocols of the TCP/IP suite.  It sits on top
  30. of IP and is mostly used for inter-network routing.  However, it also has
  31. a Timestamp message, which is used by several later time applications.
  32. This message allows exchanging time in milliseconds since midnight UT.
  33.  
  34. (RFC778) 18 Apr 81 (Mills)       DCNet Internet Clock Service
  35.  
  36. An early use of the ICMP Timestamp messages of RFC792 to synchronize
  37. clocks of machines on a more or less local network.  Superseded by RFC958.
  38.  
  39. (RFC867) May 83    (Postel)      Daytime Protocol
  40.  
  41. Allows connecting to a foreign host and receiving the time as an ASCII
  42. character string.  Seldom implemented and little used because there is
  43. no standard for what the character string should be (much less for what
  44. time zone it should be in).
  45.  
  46.  
  47. (RFC868) May 83    (Postel)      Time Protocol
  48.  
  49. The basic Internet time of day protocol for many years.  Quoting:
  50.  
  51.     This protocol provides a site-independent, machine readable date and
  52.     time.  The Time service sends back to the originating source the time in
  53.     seconds since midnight on January first 1900.
  54.  
  55. The choice of seconds was deliberate because this protocol was intended to
  56. be used between systems on long-haul networks on which greater precision
  57. would only give an illusion of accuracy.  Sometimes used in conjunction
  58. with ICMP Timestamp messages when communicating with hosts from which
  59. greater accuracy is available.  Best used to poll several hosts and compare
  60. their time before setting the local host's time.
  61.  
  62. It may be used on top of either TCP or UDP:  UDP is better because of
  63. lessened load on machines running the servers and because of lessened
  64. round trip times.
  65.  
  66. At least four implementations of this protocol for 4.2BSD exist:
  67.  
  68. name    author                    anonymous ftp source
  69.  
  70. rdate    Sun Microsystems Incorporated        none
  71.     Polls one host and believes it if it responds.
  72.     Uses inetd.  Only uses TCP.
  73.  
  74. ndate    Christopher Kent <chris@merlin.purdue.edu> merlin.purdue.edu:dated.flar
  75.     Tries many hosts in succession, believes the first to respond.
  76.     Tries for accuracy by taking round trip delay into account.
  77.     Does not use inetd.  Uses UDP.
  78.  
  79. nettime    Richard Johnson <raj@UCI.EDU>        uci.edu:pub/nettime.c
  80.     Polls many hosts, even broadcasts a request over ethernet.
  81.     Does some averaging and rejection to pick a best time.  Uses UDP.
  82.  
  83. netdate    John Quarterman <jsq@sally.utexas.edu> sally.utexas.edu:pub/netdate.shar
  84.     Polls many hosts, picks the largest group with similar times,
  85.     and believes the first of those.  (The intervals and hosts can
  86.     be specified on the command line for various effects.)
  87.     Uses inetd, with TCP or UDP.
  88.  
  89.  
  90. (RFC956) Sep 85    (Mills)       Algorithms for Synchronizing Network Clocks  
  91.  
  92. Covers most of the issues involved.  Here is the first page:
  93.  
  94. Status of this Memo
  95.  
  96.    This RFC discussed clock synchronization algorithms for the
  97.    ARPA-Internet community, and requests discussion and suggestions for
  98.    improvements.  Distribution of this memo is unlimited.
  99.  
  100. Table of Contents
  101.  
  102.    1.      Introduction
  103.    2.      Majority-Subset Algorithms
  104.    3.      Clustering Algorithms
  105.    4.      Application to Time-Synchronization Data
  106.    5.      Summary and Conclusions
  107.    6.      References
  108.    Appendix
  109.    A.      Experimental Determination of Internet Host Clock Accuracies
  110.    A1.     UDP Time Protocol Experiment
  111.    A2.     ICMP Timestamp Message Experiment
  112.    A3.     Comparison of UDP and ICMP Time
  113.  
  114. List of Tables
  115.  
  116.    Table 1.  C(n,k) for n from 2 to 20
  117.    Table 2.  Majority Subsets for n = 3,4,5
  118.    Table 3.  Clustering Algorithm using UDP Time Protocol Data
  119.    Table 4.  Clustering Algorithm using ICMP Timestamp Data
  120.    Table 5.  ISI-MCON-GW Majority-Subset Algorithm
  121.    Table 6.  ISI-MCON-GW Clustering Algorithm
  122.    Table 7.  LL-GW (a) Majority-Subset Algorithm
  123.    Table 8.  LL-GW (a) Clustering Algorithm
  124.    Table 9.  LL-GW (b) Majority-Subset Algorithm
  125.    Table 10. LL-GW (b) Clustering Algorithm
  126.    Table A1. UDP Host Clock Offsets for Various Internet Hosts
  127.    Table A2. UDP Offset Distribution < 9 sec
  128.    Table A3. UDP Offset Distribution < 270 sec
  129.    Table A4. ICMP Offset Distribution < 9 hours
  130.    Table A5. ICMP Offset Distribution < 270 sec
  131.    Table A6. ICMP Offset Distribution < 27 sec
  132.    Table A7. ICMP Offset Distribution < .9 sec
  133.    Table A8. Comparison of UDP and ICMP Host Clock Offsets
  134.  
  135.  
  136. (RFC957) Sep 85    (Mills)       Experiments in Network Clock Synchronization  
  137.  
  138. Similar to RFC956, but more about how you get the accurate time in the
  139. first place, before you try to distribute it over the network.
  140. Everything you ever wanted to know about WWV and GOES clocks.
  141.  
  142. Table of Contents
  143.  
  144.    1.      Introduction
  145.    2.      Design of the Synchronization Algorithm
  146.    2.1.    The Logical Clock
  147.    2.2.    Linear Phase Adjustments
  148.    2.3.    Nonlinear Phase Adjustments
  149.    3.      Synchronizing Network Clocks
  150.    3.1.    Reference Clocks and Reference Hosts
  151.    3.2.    Distribution of Timing Information
  152.    4.      Experimental Validation of the Design
  153.    4.1.    Experiment Design
  154.    4.2.    Experiment Execution
  155.    4.3.    Discussion of Results
  156.    4.3.1.  On Power-Grid Clocks
  157.    4.3.2.  On Clocks Synchronized via Network Links
  158.    4.3.3.  On the Accuracy of Radio Clocks
  159.    4.3.3.1. The Spectracom 8170 WWVB Radio Clock
  160.    4.3.3.2. The True Time 468-DC GOES Radio Clock
  161.    4.3.3.3. The Heath GC-1000 WWV Radio Clock
  162.    4.3.4.  On Handling Disruptions
  163.    4.4.    Additional Experiments
  164.    5.      Summary and Conclusions
  165.    6.      References
  166.  
  167. List of Figures
  168.  
  169.    Figure 1. Clock Registers
  170.    Figure 2. Network Configuration
  171.  
  172.  
  173. (RFC958) Sep 85    (Mills)       Network Time Protocol  
  174.  
  175. Not yet a standard but it probably will be.  At least one 4.2BSD implementation
  176. is said to exist but I don't have access information for it offhand.
  177. Quoting from the beginning of the RFC:
  178.  
  179. Status of this Memo
  180.  
  181.    This RFC suggests a proposed protocol for the ARPA-Internet
  182.    community, and requests discussion and suggestions for improvements.
  183.    Distribution of this memo is unlimited.
  184.  
  185. Table of Contents
  186.  
  187.    1.      Introduction
  188.    2.      Service Model
  189.    3.      Protocol Overview
  190.    4.      State Variables and Formats
  191.    5.      Protocol Operation
  192.    5.1.    Protocol Modes
  193.    5.2.    Message Processing
  194.    5.3.    Network Considerations
  195.    5.4.    Leap Seconds
  196.    6.      References
  197.    Appendix A. UDP Header Format
  198.    Appendix B. NTP Data Format
  199.  
  200. 1.  Introduction
  201.  
  202.    This document describes the Network Time Protocol (NTP), a protocol
  203.    for synchronizing a set of network clocks using a set of distributed
  204.    clients and servers.  NTP is built on the User Datagram Protocol
  205.    (UDP) [13], which provides a connectionless transport mechanism.  It
  206.    is evolved from the Time Protocol [7] and the ICMP Timestamp message
  207.    [6] and is a suitable replacement for both.
  208.  
  209.    NTP provides the protocol mechanisms to synchronize time in principle
  210.    to precisions in the order of nanoseconds while preserving a
  211.    non-ambiguous date, at least for this century.  The protocol includes
  212.    provisions to specify the precision and estimated error of the local
  213.    clock and the characteristics of the reference clock to which it may
  214.    be synchronized.  However, the protocol itself specifies only the
  215.    data representation and message formats and does not specify the
  216.    synchronizing algorithms or filtering mechanisms.
  217.  
  218.  
  219. TSP: The Time Synchronization Protocol for UNIX 4.3BSD, R. Gusella and S. Zatti
  220.  
  221. I've not been able to locate a copy of this paper.  But it's a method
  222. of using ICMP Timestamp messages to synchronize the clocks of machines
  223. on a local area network to a high degree of accuracy.  Time is always
  224. monotonic on all the machines:  adjustments are done by slowing or
  225. speeding the clocks; never by running them backwards.  Does not address
  226. the problem of how you get the original time, but that can be dealt
  227. with by using a radio clock or getting the original time over a network
  228. from some machine which has one.
  229.  
  230. Volume-Number: Volume 5, Number 17
  231.  
  232.