[ntp:questions] Re: HowTo calibrate system clock frequency using NTP

David L. Mills mills at udel.edu
Fri Jan 27 18:54:58 UTC 2006


Daniel,

Plan A

1. Run ntptime -f 0 to remove any leftover kernel bias.

2. Configure for a reliable server over a quiet network link.

3. Remove the frequency file ntp.drift.

4. Start the daemon and wait for at least 15 minutes until the state 
shows 4. Record the frequency offset shown with the ntpq rv command. It 
should be within 1 PPM of the actual frequency offset. For enhanced 
confidence, wait until the first frequency file update after one hour or so.

Plan B

1. Run ntptime -f 0 to remove any leftover kernel bias.

2. Configure for a reliable server over a quiet network link.

3. Start the daemon with disable ntp in the configuration file.

4. Record the offset over a period of hours. Do a least-squares fit; the 
regression line slope is the frequency.

Dave

Daniel Kabs wrote:
> Hi,
> 
> I like to measure the system clock drift and use the resulting value to 
> correct the system clock using the "adjtimex" tool (-t and -f option).
> 
> I can think of at least two ways to measure the drift and I'd like to 
> ask you whether this is the correct way to do it.
> 
> Plan A)
> 
> Run ntpd using a reliable time server. ntpd will measure and record the 
> intrinsic clock frequency offset in the so called "drift file".
> 
> Depending on the computer clock oscillator's frequency error this may 
> take some hours (or even days?) to stabilize. When the value has 
> converged, the "drift file" contains the frequency offset measured in 
> parts-per-million (PPM).
> 
> Plan B)
> 
> Run ntpd using local clock (127.127.1.0) as server. Execute "ntpdate -q"
> on a synchronized system against the system you want to measure. ntpdate 
> will output the precise time offset in seconds. If you record the offset 
> (and time) periodically, you can fit a straight line to the data points. 
> The slope * 86400 will give the estimated offset in seconds per day. 
> This can be converte into ppm (100 ppm == 8.64 sec/day). Measuring for 
> one hour will be enough to get a reasonable accurate value.
> 
> 
> 
> Now use adjtimex to correct the system clock for systematic drift as 
> described in the example of the man page.
> 
> I tried B) and will now run plan A) over the weekend to record a drift 
> file. I hope this will give a similar result.
> 
> Cheers
> Daniel




More information about the questions mailing list