On Fri, 1 Jun 2012 08:25:05 -0700 (PDT), bob wrote:
> Let's say I have one computer that is synchronized to an atomic clock.
>
> Then I have, say 5 other computers, that need the correct time and will
> attempt to get it by talking to the timekeeper computer. Those 5
> computers are all connected to the timekeeper by Wifi, so there can be a
> bit of latency (although the latency tends to vary).
>
> What is the best way to get the 5 computers synced to the timekeeper?
>
> I am thinking Marzullo's Algorithm is a good way.
Maybe, however you have only one time source. There are other ways.
> Simply have each computer ask for the time from the timekeeper 100 times
> or so. Then use the time that came back with the lowest Round Trip Time
> (RTT).
The real problem is clock deviation, which could be about 5us/s. So, you
do have to synchronize clocks all the time.
Instead of sorting time measures you just use weighted running averaging of
the time skew, where the weight is decreases when RTT increases and also
decreases with the time.
There could be further requirements, like monotonic changes, which may
apply in your case. Then you would add a layer on top of that, which would
prevent backward jumps. Same, when clock acceleration must be limited from
above, etc.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de