Re: [ntp:questions] Question on ntpd -g -q option and Step Threshold

2010-11-18 Thread Hal Murray
In article 0a89d263-0355-4dee-8c9c-b4912076d...@w38g2000pri.googlegroups.com,
 SteveW qsw...@email.mot.com writes:
I wanted to confirm that my understanding of the step threshold and
how it applies to ntpd used with -g -q options (similar to ntpdate) is
correct.

With the default step threshold of 128 ms, if a machine's time is
within 128 ms of the ntp server's time, when it syncs with the server,
will it exit from ntpd -g -q without stepping the clock?

This appears to be the behavior I am seeing.  I tried setting the
clock on my machine off by 110 msec from the ntp server and it didn't
step the clock.  When I set it off by 220 msec it did step it.

There are two ways to adjust the time.  One is to step it by just
smashing the desired time into the clock register.

The other is to slew it by slightly adjusting the rate the local clock
ticks until it has gained/lost the right amount of time.

ntpd normally steps for changes over 128 ms and slews for changes under.

In your 110 ms test, I expect it to slew the clock rather than step it.
It may exit before the slew has finished.  You can check by waiting
a few minutes and then running it again.

-- 
These are my opinions, not necessarily my employer's.  I hate spam.

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Question on ntpd -g -q option and Step Threshold

2010-11-15 Thread Chuck Swiger
On Nov 15, 2010, at 12:29 PM, SteveW wrote:
 With the default step threshold of 128 ms, if a machine's time is
 within 128 ms of the ntp server's time, when it syncs with the server,
 will it exit from ntpd -g -q without stepping the clock?

That should be the case.  If the offset is less than 128ms, it should invoke 
adjtime() to slew the clock instead of stepping it via settimeofday() / 
clock_settime().

 This appears to be the behavior I am seeing.  I tried setting the
 clock on my machine off by 110 msec from the ntp server and it didn't
 step the clock.  When I set it off by 220 msec it did step it.

That sounds right.

Regards,
-- 
-Chuck

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions