[ntp:questions] peers with high offset on Intel Quad Core running Windows 2003

Martin Burnicki martin.burnicki at meinberg.de
Fri Aug 22 14:00:34 UTC 2008


Terje Mathisen wrote:
> David Woolley wrote:
>> Also, I believe that the zero point of the interpolation is rather
>> sensitive to scheduling delays on loaded systems.

Yes. However, the results are better than without any interpolation.
> If you think about it, you'll realize that the NTP sw clock, based on
> RDTSC or other high-res timer not locked to the OS clock, is another
> I.e. to do it right you cannot simply extrapolate from the last timer
> tick, you should instead weigh those TSC samples that have the least
> latency behind the actual timer tick.

Yes this is also correct.

> The real problem is that you can very easily end up with two sw locked
> loops on top of each other, and from what little I remember from my Uni
> control theory classes, this is an easy way to destroy stability, unless
> at least one of those loops are very simple.

I don't think the TSC stuff is really an own control loop. What the
interpolation or extrapolation ;-) routine currently does is pick up the
current PerformanceCounter value as close as possible after a timer tick
(of course delayed by a certain variable latency). 

Interpolated time is then computed based on how many PerfCnt increments have
occurred after the latest system time/PerfCnt pair has been picked up.
AFAICS there is no feedback to the TSC clock source here.

As you've already mentioned a possible improvement would be indeed to try to
determine the TSC sample with the lowest latency in order to decrease the
interpolation jitter between several tick intervals. 

However, there's still the frequency of the PerformanceCounter which is used
as returned by the OS. The real frequency is also off the nominal frequency
which results in an system dependent estimation error proportional to the
length of the estimation interval. This could be avoided if the real
frequency of the PerformanceCounter would be computed and the computed
frequency be used for the estimated system time.

Martin Burnicki

Meinberg Funkuhren
Bad Pyrmont

More information about the questions mailing list