[ntp:questions] NTP makes a time jump
snews at lordynet.org
Thu Jul 4 17:43:29 UTC 2013
karpekin at gmail.com wrote:
> I have a problem with NTP configuration when the client loses uplink connection for some time and then re-establishes it.
> tos maxdist 4
> server 10.9.2.80 iburst
> server 10.10.2.101 iburst
> server 10.10.52.111 iburst
> server 127.127.1.0
> fudge 127.127.1.0 stratum 12
> I do the following:
> 1. kill the NTPD process,
> 2. disconnect the uplink to real servers,
> 3. change the local clock time to +3 sec
> 4. reboot the system.
> System comes up and after a while syncs to itself. After it starts to provide my "fake" time reference (+3sec) to clients downstream, I plug in the uplink, so my client is able to see the 3 servers defined in the config above. And as soon as it established the connection and peered to one of them, I see the -3 sec time jump. I was expecting that NTPD will slowly start to correct the time, but it jumps.
> Can you please explain if that behavior is by NTP design? Maybe I have something misconfigured, and if so, how to force NTPD not to make jumps?
> Thank you,
Above is how ntpd normally works, step threshold default being
128ms. It is normal to use "ntpdate" or "ntpd -g -q" to set the
time before starting ntpd. For ntpd to slew the clock 3 seconds
would take too long.
If you only have an intermittent internet connection and no
refclock alternatives you might be better using chrony (if
supported by your OS). Chrony when I used it, many years ago
was able to compensate for system clock drift whilst offline
and in some cases rtc clock drift during power outages.
More information about the questions