[ntp:questions] Re: Time set backward

Brian Utterback brian.utterback at sun.removeme.com
Fri Jan 6 20:31:26 UTC 2006

David L. Mills wrote:
> Sivakumar,
> In the reference implementation that leaves here, packets are sent 
> regardless of whether the time has been set forward or backward. In the 
> kernel implementation that leaves here, time is always monotonically 
> increasing except when explicitly set backward more than two seconds. 
> This may not account for various modifications by folks after the code 
> has left here.

Right, and as the poster said, the clock was inadvertently set back
a hour.

This is an unfortunate side effect of the fact that POSIX timers are
used both for strict interval timing and synchronized to a clock
timing, and that POSIX is silent about what to do when the clock
is set backwards.

There is no clear "right thing" to do. If you are using interval
timing, you will likely want one thing, and if you are using
synchronized timing, then you will want the other.

The ntpd daemon actually handles this by resetting the timers
when it steps the clock backwards, but it is in a unique
position to know about backwards steps, and then only when
it does them itself.

So, the only way for ntpd to proctect itself against this kind
of problem is the time honored rule: Only ntpd may adjust the
clock. Really, we mean it.


"Having them stolen may become our distribution model..."
Nicolas Negroponte on the Hundred Dollar Laptop.
Brian Utterback - OP/N1 RPE, Sun Microsystems, Inc.
Ph:877-259-7345, Em:brian.utterback-at-ess-you-enn-dot-kom

More information about the questions mailing list