[ntp:questions] Getting NTP to correct only the clock skew

Maarten Wiltink maarten at kittensandcats.net
Thu Apr 5 20:49:21 UTC 2007

"Spoon" <root at localhost> wrote in message
news:46153ba6$0$24615$426a34cc at news.free.fr...
> Maarten Wiltink wrote:

>> [...] could you monitor the buffer length and adjust frequency
>> on system B from that? If it's slowly draining, slow down B a little;
>> if it's growing, speed it up ever so slightly. Just like NTP does,
>> really.
> The very hard part (for me) is seeing that B's buffer is in fact slowly
> draining when there is a lot of jitter on the link between A and B.
> I've tried using an exponentially-weighted moving average to filter the
> jitter out, but it didn't work as well as I had hoped. That is when I
> turned to NTP. I'm trying not to reinvent the wheel.
> Are you saying I should use the theory in NTP but not the daemon?

Well, not _all_ the theory. Just the basic idea of slowing down a fast
clock and speeding up a slow one. If it became too much work, I'd say
you're better off just adopting NTP, all of it.

But the jitter problem is (in retrospect) obviously inevitable - if
you didn't have a jitter problem, you wouldn't have _any_ problem.
So you need to filter, and that's the first step towards a full, but
very roundabout, NTP implementation.

Incidentally, IIAMN (and I've been before) NTP uses a median filter
to remove jitter. That throws away more information than a weighted
average, which in this case is a good thing. You might try that
before calling it a day.

Maarten Wiltink

More information about the questions mailing list