[ntp:questions] ARRGH!!! I woke up to a 50 SECOND clock error.

unruh unruh at invalid.ca
Thu Mar 15 15:42:15 UTC 2012


On 2012-03-14, Ron Frazier (NTP) <timekeepingntplist at c3energy.com> wrote:
> On 3/14/2012 5:04 PM, Ron Frazier (NTP) wrote:
>> On 3/14/2012 4:00 PM, David J Taylor wrote:
>>>> Hi David T,
>>>>
>>>> NOW .... you understand.
>>>>
>>>> I have 4 PC's connected to the LAN, plus my wife's work computer 3 
>>>> days / week, and on rare occasions my son's computer.  All are 
>>>> connected by wifi.  All do pretty mundane things: web browser, 
>>>> email, sometimes downloading patches, sometimes doing online 
>>>> backup.  My 4 are running NTPD.  3 run windows most of the time and 
>>>> dual boot into linux.  My 4th machine runs linux all the time.  When 
>>>> my wife is here, she does a remote desktop type of thing into her 
>>>> work system.  Two of my PC's are running Vista, one is running 
>>>> Windows 7.  Those three dual boot into Ubuntu 11.04 and the always 
>>>> linux machine runs Ubuntu 11.04.  Almost all the discussions I've 
>>>> had on this mailing list are for my Windows 7 machine.
>>>>
>>>> The path out of my house is:
>>>>
>>>> PC Wifi --> Wifi router --> wired router --> cable modem --> ISP --  
>>>> internet
>>>>
>>>>> - is this PC connected over wireless or wired?
>>>>>
>>>>
>>>> Wifi G
>>>>
>>>>> - what else is going through the router?  Someone else downloading 
>>>>> large files or using streaming audio or video?
>>>>>
>>>>
>>>> See above.  Normally, no huge data hogs.
>>>>
>>>>> - who else might be sharing your connection?
>>>>>
>>>>
>>>> It's cable.  Who knows?  I also get cable TV and telephone through 
>>>> the same wire.
>>>>
>>>>> - what type of service do you have?  Presumably not dial-up!  But 
>>>>> what speed?
>>>>>
>>>>
>>>> Comcast Cable
>>>>
>>>> Just tested it with speedtest.net
>>>>      Ping to near city: 91 ms, Download: 29.63 Mbps, Upload: 5.3 Mbps
>>>>
>>>>> - having checked you speed, would you describe your connection as 
>>>>> "stable"?
>>>>>
>>>>
>>>> See above for speed.  Generally, it's very stable.  However, for the 
>>>> purposes we're discussing, I think it's latencies and delays that 
>>>> are the problem.
>>>>
>>>> As I mentioned in my reply to David L, I'm not concerned over trying 
>>>> to get stellar performance from internet servers.  I just want to 
>>>> get a good GPS server system running and use the internet servers as 
>>>> a backup.
>>>>
>>>> Sincerely,
>>>>
>>>> Ron
>>>
>>> Ron,
>>>
>>> Thanks for that clarification.  I think you should be getting /very 
>>> much/ better performance from your Internet servers.  That ping is 
>>> poor as well. Here I have 30 Mb/s down, just 1 Mb/s up, and NTP 
>>> delays show as 18-34 ms (most in 22-30 ms).
>>>
>>> To that end, if your cable modem has multiple ports, connect one of 
>>> the PCs direct to the CM and run it as your local NTP server.  Wi-Fi 
>>> doesn't help NTP.  Later, you can add GPS/PPS to that PC as well.  At 
>>> the very least, connect your timekeeping PC direct to the wired 
>>> router.  No Wi-Fi! For my main NTP server, I got a low-powered and 
>>> fan-less Intel Atom system, and it runs FreeBSD.  It /only/ runs NTP, 
>>> no interactive stuff at all.
>>>
>>> You might also consider getting rid of the two routers and just using 
>>> the wireless one.  You might also see whether you can run NTP on your 
>>> router - perhaps it's a model which can run the DD-WRT firmware.  I 
>>> think some variants of DD-WRT can run NTP, but please check.  I have 
>>> a WRT 54GL in my system where I run the DD-WRT firmware.
>>>
>>>  http://www.dd-wrt.com/site/index
>>>
>>> Online backup could well affect the performance of the connection for 
>>> timekeeping, and your imminent Sure GPS/PPS will help enormously.
>>>
>>> Just some thoughts which may help you along the way.
>>>
>>> Cheers,
>>> David
>>>
>>
>> Hi David,
>>
>> I really appreciate all these suggestions you shared, as well as past 
>> ones.  If I decide to revamp my network, I'll probably put some of 
>> them into use.  However, that's not really practical right now.  All 
>> the networking gear is in the basement and all the PC's are upstairs.  
>> I've already spent 2 months working on this GPS stuff and ignoring 
>> some other things I need to be doing.  I think I'm just going to focus 
>> on getting the Sure board up and running on a time server when it 
>> comes and, perhaps, use my BU-353 as a backup time source, and use the 
>> internet servers as a third level backup source.  Most of the time, I 
>> won't care what they're doing  Hopefully, I can spend less time 
>> thinking about time and just know that my PC's clocks are right.  
>> Regardless, I'm going to continue to have an interest in the topic and 
>> have enjoyed all the discussions and learning that have occurred.  
>> It's just that I have to do at least a few other things besides this.
>>
>> Sincerely,
>>
>> Ron
>>
>>
>
> PS to my prior message.
>
> I don't think the problem so much is the delay to the internet servers, 
> or even to get out of my house.  NTPD is supposed to take care of that 
> as long as it's pretty much symmetrical.  I think the problem is that 
> the Windows clock is like a wild tiger that doesn't want to be tamed and 
> which is running every which way.  For whatever reason, cpu load, heat, 
> cosmic vibrations, whatever, the intrinsic frequency of the windows 
> clock is always changing.  In order to avoid beating up on the internet 
> servers too much, I have to poll them at least every 4 minutes apart.  
> If you let it, NTPD will extend that out to 16 minutes or more.  So, 

Actually, the effective NTPD poll interval is abotu 8 times the stated
interval. The clock filter throws away about 7 out of 8 poll results in
an attempt to get rid of assmetric polls. Ie, it assumes that the
shortest round trip interval out of the past 8 is the best estimate of
the symmetric roundtrip and throws away the rest. Thus if you have
polling every 4 min  (poll interval 8) the effective interval is about
every half hour.

That is fine if the clock is an even half way reasonable clock (Ie rate does
not change by more than say 2PPM over that time) 

 
> when the clock source is polled, say the PC clock is too fast, so NTPD 
> slows it down.  Then, when you poll the clock source again, say the PC 
> clock is too slow, so NTPD speeds it up.  Because of the varying 
> intrinsic frequency of the clock, you can never find a clock speed that 
> just works, because then the system goes and changes, by changes in the 
> oscillator, how much time passes at those particular settings.  It's a 
> battle you cannot win.  By polling my GPS every 8 seconds, I can keep 
> the clock under control based on it's current needs which are varying 
> second by second.  Of course, when discussing internet servers, 30 ms of 

What are you talking about. There is no evicence either in your data or
in any reports by anyone of 30ms variation is network offsets. 
Even on ADSL, it is in the microsecond range, not millisecond. 


> jitter doesn't help any.
>
> I actually have an analogy from the world of old analog mechanical 
> clocks.  I actually took a week long clock repair class just for fun 
> once.  I thought I'd pursue it as a business, but never did.  Imagine 
> you have an antique clock which is spring driven by a coil spring that 
> you wind up and regulated by a pendulum.  You want to calibrate the 
> clock to keep the correct time.  How do you do it?  A logical answer 
> might be:
>
> a) wind the clock
> b) start the pendulum and let it stabilize
> c) count the number of pendulum swings per minute with some instrument
> d) look at the gear train and determine exactly how many seconds that 
> many pendulum swings would be
> e) determine how many pendulum swings are needed in a minute
> f) adjust the pendulum so it swings the proper number of times in a minute
>
> So, lets say this particular clock needs 100 swings of the pendulum per 
> minute to be on time.  Say, it's measuring at 87, so it's running slow.  
> You tweak the pendulum until it's swinging exactly 100 times per minute 
> and, boom, the clock should be keeping perfect time.
>
> There's one little problem.  A coil spring is a non linear power 
> source.  The torque it puts on the shaft of the clock will vary as it 
> unwinds.  Therefore, making up some numbers, maybe it starts out at full 
> torque and keeps good time.  Then, a week later, maybe the torque is 97 
> percent, so it's going to be running 3 percent slow.  Maybe after 3 
> weeks, maybe the torque is down to 85%, so it might be running 15% 
> slow.  When it's 30 day cycle is up, the time shown will be 
> substantially behind what it should be.  The only way to fix it is to 
> set it to run fast during the first part of its cycle then slower at the 
> end so it averages out.
>
> The point is, that it's a continually moving target.  The windows clock 
> is the same way.  It never runs at the same frequency from minute to 
> minute.  Even if you get it running right one minute, it's wrong the next.

It would of course be interesting for you to be able to document that
the Windows clock varys that much. I doubt it and I do not believe that
other's experienece has been that. 

<removed repetitious rest of post>




More information about the questions mailing list