[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

clock synch on a LAN with TSP?

If one-second precision and reasonable accuracy is good enough for you you
can do what we do: periodically use

(let ((ut (ignore-errors (net:invoke-service-on-host :time host))))
  (when (numberp ut)
    (time:initialize-timebase-internal ut)
    (time:set-calendar-clock ut)))

HOST is a host that uses Network Time Protocol to sync up with an official
time standard.  Most Internet hosts implement TIME UDP TIME-SIMPLE-MSB
and/or TIME TCP TIME-MSB protocol.

I've considered implementing NTP on Lispms, but it's a pretty complex
protocol and I haven't gotten around to it.  If TSP is the protocol
implemented by Unix "timed", I wouldn't bother with it, as it's a pretty
lousy protocol (it chooses a master arbitrarily at times, and if the chosen
master has the wrong time it's pretty difficult to get every host back to
the correct time).  NTP, on the other hand, was designed with quite a bit
of thought by people interested in synchronizing to national time standards
with better than millisecond accuracy.