prior next up home
Introduction
The True Time
The National Institute of Standards and Technology,
known as NIST, is tasked with keeping and delivering the correct time in the U.S.
Time is an artifice, agreed upon by governing bodies throughout the world.
They agree "this is the correct time",
then carry that time
(using ever more sensitive/accurate/precise devices to carry the time)
home to quality clocks which exhibit miniscule drift over time.
They then use these and other devices to deliver the time around the nation.
By NTP nomencleture, we'd call these "stratum 0" clocks.
Each time transfer step increases the stratum by one level.
Network Time Protocol
- NTP relies on following a standard clock (through one or more levels of indirection)
through a remote server on the Internet
- client sends a time-stamped packet to server
- server adds time-stamp to received packet and returns it
- client analyzes returned packet to determine offset from "better" clock
- client averages/smooths time based on that system
- client chooses to follow "best" clock source
or from local PPS clock which is (somehow) synchronized with a standard clock.
- the client waits for pulse
- it notes the time
- This can be done by a user application which leaves the results in shared memory, or
- by the kernel and the results are accessable to NTP which reads a special device
- NTP on the client figures out offset (where the pulse is at second X.0000000,
and the CPU clock is X.yyyyyyyyy or (X-1).yyyyyyyyy)
- it follows the last two steps noted above to condition the computer's clock.
- local computer's clock is implemented by advancing a clock value every 'tick'
- it adds about a million "nano-seconds" per millisecond
- variation from a million is how it deals with error in local clock tick rate
if the clock ticks too fast, the increment is reduced, or
if the clock ticks too slow, the increment is increased
- this adjustment isn't fixed because the internal crystal isn't stable
- this variation can be tied to the temperature in my office
last edited by
Randolph Bentson,
bentson atsymbol holmsjoen dotsymbol com
on
Tue Jan 10 13:14:39 PST 2012