home *** CD-ROM | disk | FTP | other *** search
- Author
- ======
- Silvano Maffeis, maffeis@ifi.unizh.ch, Oct 1992
-
- This directory contains two daemons: synclockd, a simple but pretty accurate
- clock synchronization daemon and synservd, the server-daemon for
- synclockd. I think they work sufficiently exact to synchronize many
- client clocks in a LAN.
-
- synclockd
- =========
- synopsis: synclockd [serverhost timeinterval]
- invoked without arguments, synclockd reads its parameters from
- /usr/local/etc/synservd.conf
- (or whatever path you specified in the Makefile)
-
- The underlying time-synchronization method is based upon the
- assumption that the roundtrip delay of a UDP data packet in a LAN is made
- up by two almost identical parts.
-
- This is known as the basic Cristian's algorithm. One enhancement we make:
- When the measured roundtrip delay is higher than the smallest one
- encountered so far, we discard the measured value and don't alterate
- the local clock.
- The smallest roundtrip value is corrected using a factor containing
- the maximal amount two clocks can drift away from each other,
- which is 2*DRIFT. (If we would not make this correction, then no more
- clock adjustments would be performed when the minimal roundtrip delay is
- reached.)
-
- Synclockd adjusts the local clock using adjtime(), hence
- guaranteeing an always monotonically increasing local time.
- adjtime() just speeds up, resp. slows down the local
- clock by a few percents until the time value computed by our algorithm
- is reached. Therefore it initially can take some time till
- clocks are synchronized.
-
- synservd
- ========
- Since services like time, daytime, rdate(), rtime() are not accurate
- enough (these services usually provide a granularity of one second), the time
- server daemon synservd is also provided.
- synservd listens on a udp socket for incoming synclockd requests and
- returns the local time as obtained from gettimeofday(2).
-
- A possible way for synchronizing several clients is to choose
- one host in the LAN known for his high availability and exact
- local time clock as time-server. A synclockd is started on every client.
- A synservd is started only on the time-server host. (The time-server
- itself needs no synclockd in this case).
-
- Multiple LANs can be synchronized by realizing a hierarchy of
- time-servers and time-clients.
-
- synmon
- ======
- synmon is a simple monitor which helps in finding out how exact
- a client clock is synchronized with the server.
-
- synmon servername 5
-
- Displays information about the synchronization process every 5
- seconds.
-
-
- EXACTNESS
- =========
- The maximal accurateness af the synchronization depends on the true
- exactness of gettimeofday(). For SPARCS running sunos 4, the logical
- tick value is
- 1/100 of a second, and therefore you cannot believe the microsecond values
- returned by gettimeofday().
- Thus, the difference of local to remote can be up to
- 1/99.999 seconds even when the daemons would provide for a 100%
- exact synchronization, which is impossible to achieve anyway.
-
-
- INSTALLATION
- ============
- Inspect the Makefile and make changes if needed.
- Compile the daemons by typing ``make''.
-
- You then need an entry for the synchronization service in
- /etc/services:
-
- utime 8500/udp # time synch daemon
-
- synclockd must run under root privileges since you must be superuser to
- use adjtime(). The best way to start it
- is from the /etc/rc.local file of the client using something like:
-
- # synchronize local clock with host.foo.bar.edu every hour:
- /usr/etc/synclockd host.foo.bar.edu 3600 &
-
- or just
- /usr/etc/synclockd &
-
- In the latter case, the two parameters are read from a configuration file.
- (something like /usr/local/etc/synclockd.conf. This filename is
- specified in the Makefile).
- host.foo.bar.edu is the name of the time-server on which synservd runs.
-
-
- SUGGESTED READING
- =================
-
- A.S. Tanenbaum, "Modern Operating Systems", Chapter 11.1
- D. Mills, Net Time Protocol (ntp), Articles on louie.udel.edu: pub/ntp/doc
-
-
- BUGS:
- =====
-
- The daemons are used since a while over here to synchronize around
- 30 clients (Sparcs, Silicon Graphics, RS6000, DecStation,...) in a LAN.
- A client clock normally differs by only
- a few 0.001 sec from the server clock. We work with a synchronization
- interval of 1800 sec.
-
- Nevertheless, some bugs surely exist. If you find some, please report them.
- Please inform me of useful enhancements you make to the daemons.
-
- Silvano Maffeis, maffeis@ifi.unizh.ch
-
-