home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sources / misc / 4248 / README < prev    next >
Encoding:
Text File  |  1993-01-10  |  4.3 KB  |  125 lines

  1. Author
  2. ======
  3. Silvano Maffeis, maffeis@ifi.unizh.ch, Oct 1992
  4.  
  5. This directory contains two daemons: synclockd, a simple but pretty accurate 
  6. clock synchronization daemon and synservd, the server-daemon for
  7. synclockd. I think they work sufficiently exact to synchronize many 
  8. client clocks in a LAN. 
  9.  
  10. synclockd
  11. =========
  12. synopsis: synclockd [serverhost timeinterval]
  13. invoked without arguments, synclockd reads its parameters from
  14. /usr/local/etc/synservd.conf 
  15. (or whatever path you specified in the Makefile)
  16.  
  17. The underlying time-synchronization method is based upon the
  18. assumption that the roundtrip delay of a UDP data packet in a LAN is made
  19. up by two almost identical parts. 
  20.  
  21. This is known as the basic Cristian's algorithm. One enhancement we make:
  22. When the measured roundtrip delay is higher than the smallest one
  23. encountered so far, we discard the measured value and don't alterate 
  24. the local clock.
  25. The smallest roundtrip value is corrected using a factor containing
  26. the maximal amount two clocks can drift away from each other,
  27. which is 2*DRIFT. (If we would not make this correction, then no more 
  28. clock adjustments would be performed when the minimal roundtrip delay is
  29. reached.)
  30.  
  31. Synclockd adjusts the local clock using adjtime(), hence
  32. guaranteeing an always monotonically increasing local time. 
  33. adjtime() just speeds up, resp. slows down the local
  34. clock by a few percents until the time value computed by our algorithm
  35. is reached. Therefore it initially can take some time till 
  36. clocks are synchronized.
  37.  
  38. synservd
  39. ========
  40. Since services like time, daytime, rdate(), rtime() are not accurate
  41. enough (these services usually provide a granularity of one second), the time 
  42. server daemon synservd is also provided.
  43. synservd listens on a udp socket for incoming synclockd requests and 
  44. returns the local time as obtained from gettimeofday(2).
  45.  
  46. A possible way for synchronizing several clients is to choose
  47. one host in the LAN known for his high availability and exact
  48. local time clock as time-server. A synclockd is started on every client.
  49. A synservd is started only on the time-server host. (The time-server
  50. itself needs no synclockd in this case).
  51.  
  52. Multiple LANs can be synchronized by realizing a hierarchy of
  53. time-servers and time-clients.
  54.  
  55. synmon
  56. ======
  57. synmon is a simple monitor which helps in finding out how exact
  58. a client clock is synchronized with the server.
  59.  
  60. synmon servername 5
  61.  
  62. Displays information about the synchronization process every 5
  63. seconds.
  64.  
  65.  
  66. EXACTNESS
  67. =========
  68. The maximal accurateness af the synchronization depends on the true
  69. exactness of gettimeofday(). For SPARCS running sunos 4, the logical 
  70. tick value is
  71. 1/100 of a second, and therefore you cannot believe the microsecond values
  72. returned by gettimeofday(). 
  73. Thus, the difference of local to remote can be up to
  74. 1/99.999 seconds even when the daemons would provide for a 100%
  75. exact synchronization, which is impossible to achieve anyway.
  76.  
  77.  
  78. INSTALLATION
  79. ============
  80. Inspect the Makefile and make changes if needed.
  81. Compile the daemons by typing ``make''.
  82.  
  83. You then need an entry for the synchronization service in 
  84. /etc/services:
  85.  
  86. utime           8500/udp                        # time synch daemon
  87.  
  88. synclockd must run under root privileges since you must be superuser to
  89. use adjtime(). The best way to start it
  90. is from the /etc/rc.local file of the client using something like:
  91.  
  92. # synchronize local clock with host.foo.bar.edu every hour:
  93. /usr/etc/synclockd host.foo.bar.edu 3600 &
  94.  
  95. or just
  96. /usr/etc/synclockd &
  97.  
  98. In the latter case, the two parameters are read from a configuration file.
  99. (something like /usr/local/etc/synclockd.conf. This filename is
  100.  specified in the Makefile). 
  101. host.foo.bar.edu is the name of the time-server on which synservd runs.
  102.  
  103.  
  104. SUGGESTED READING
  105. =================
  106.  
  107. A.S. Tanenbaum, "Modern Operating Systems", Chapter 11.1
  108. D. Mills, Net Time Protocol (ntp), Articles on louie.udel.edu: pub/ntp/doc
  109.  
  110.  
  111. BUGS:
  112. =====
  113.  
  114. The daemons are used since a while over here to synchronize around
  115. 30 clients (Sparcs, Silicon Graphics, RS6000, DecStation,...) in a LAN. 
  116. A client clock normally differs by only
  117. a few 0.001 sec from the server clock. We work with a synchronization
  118. interval of 1800 sec.
  119.  
  120. Nevertheless, some bugs surely exist. If you find some, please report them.
  121. Please inform me of useful enhancements you make to the daemons.
  122.  
  123. Silvano Maffeis, maffeis@ifi.unizh.ch
  124.  
  125.