f



Laptop

ntpd seems to require a constant internet connection (although as far  
as  I can see this is never explicitly stated).

But what about a computer, which is only occasionally (on average  
once a day) connected to the internet, and for a few minutes (5  
minutes on average)?

Can ntpd be used in this case?
If yes, what paramters have to be set in ntp.conf?
If no, are there any programs available to handle this?

In case it is relevant, here some more details:

iBook G4 with Mac OS X 10.4.5

ntpd -f /var/run/ntp.drift -p /var/run/ntpd.pid

/etc/ntp.conf = "server time.asia.apple.com minpoll 12 maxpoll 17"
(Created automatically by Date & Time Preferences)

/var/run/ntp.drift = "0.00"

 > ntpq
ntpq> version
ntpq 4.1.1@1.786 Sun Mar 20 15:41:22 PST 2005 (1)

  8 Mar 08:58:14 ntpdate[1591]: step time server 17.82.254.7 offset  
-3.921606 sec
Mar  8 12:33:12 Quitte ntpd[342]: sendto(17.83.254.7): Can't assign  
requested address

Gerriet.

_______________________________________________
questions mailing list
questions@lists.ntp.isc.org
https://lists.ntp.isc.org/mailman/listinfo/questions

0
gerriet (1)
3/8/2006 6:52:17 AM
comp.protocols.time.ntp 4867 articles. 2 followers. Post Follow

14 Replies
418 Views

Similar Articles

[PageSpeed] 2

I have often done what you describe.

Run ntpd with a local refclock (at stratum 10).

As part of the ppp-up script, use ntpdc to bring up an (iburst) association
with the servers you want to talk to.

As part of the ppp-down script, use ntpdc to tear down those remote
associations.

And when I have had a static IP, I have simply left the associations running
and I did not cause ntp traffic to either cause a connection or to keep a
connection alive.

H
0
Harlan
3/11/2006 12:24:32 AM
Gerriet M. Denkmann wrote:
> ntpd seems to require a constant internet connection (although as far
> as  I can see this is never explicitly stated).
> 
> But what about a computer, which is only occasionally (on average once a
> day) connected to the internet, and for a few minutes (5 minutes on
> average)?
> 

ntpd was designed at a time that Internet access was unreliable and you
would be dialing the NIST number in Colorado, US, to get an accurate
time source. So yes, this is actually normal.

> Can ntpd be used in this case?

Yes.

> If yes, what paramters have to be set in ntp.conf?

Set up your server with iburst options and don't use any restrict lines.
in the startup line add -g which will allow it to reset you clock even
if the clock is way off.

> If no, are there any programs available to handle this?
> 

ntpd works fine. Just restart ntpd every time you connect as the IP
address of your local system will change and ntpd does not yet handle
dynamic address changes on the local machine.

> In case it is relevant, here some more details:
> 
> iBook G4 with Mac OS X 10.4.5
> 
> ntpd -f /var/run/ntp.drift -p /var/run/ntpd.pid
> 
> /etc/ntp.conf = "server time.asia.apple.com minpoll 12 maxpoll 17"
> (Created automatically by Date & Time Preferences)
> 
> /var/run/ntp.drift = "0.00"
> 
>> ntpq
> ntpq> version
> ntpq 4.1.1@1.786 Sun Mar 20 15:41:22 PST 2005 (1)
> 
>  8 Mar 08:58:14 ntpdate[1591]: step time server 17.82.254.7 offset
> -3.921606 sec
> Mar  8 12:33:12 Quitte ntpd[342]: sendto(17.83.254.7): Can't assign
> requested address
> 

That just indicates that the local IP address changed. This will be
fixed in the next release as soon as 4.2.1 is released.

Danny

> Gerriet.
> 
> _______________________________________________
> questions mailing list
> questions@lists.ntp.isc.org
> https://lists.ntp.isc.org/mailman/listinfo/questions
> 

_______________________________________________
questions mailing list
questions@lists.ntp.isc.org
https://lists.ntp.isc.org/mailman/listinfo/questions

0
mayer
3/13/2006 1:50:40 AM
Harlan Stenn wrote:
> I have often done what you describe.
> 
> Run ntpd with a local refclock (at stratum 10).
> 
No, you only do this is there are other systems dependant on this one.
If it's standalone don't do this.
> As part of the ppp-up script, use ntpdc to bring up an (iburst) association
> with the servers you want to talk to.
> 
> As part of the ppp-down script, use ntpdc to tear down those remote
> associations.

You want to keep ntpd running when it's not connected to ensure that the
clock stays disciplined.

Danny
_______________________________________________
questions mailing list
questions@lists.ntp.isc.org
https://lists.ntp.isc.org/mailman/listinfo/questions

0
mayer
3/13/2006 2:05:54 AM
> Gerriet M. Denkmann wrote:
[]
>> /etc/ntp.conf = "server time.asia.apple.com minpoll 12 maxpoll 17"
>> (Created automatically by Date & Time Preferences)

Normally, minpoll would be 6 and maxpoll 10, the default values.

Why are you using 12 and 17?

David 


0
David
3/13/2006 7:55:02 AM
In article <4414CFF0.7030900@ntp.isc.org>,
mayer@ntp.isc.org (Danny Mayer) wrote:
> Gerriet M. Denkmann wrote:

> ntpd was designed at a time that Internet access was unreliable and you
> would be dialing the NIST number in Colorado, US, to get an accurate
> time source. So yes, this is actually normal.

I seem to remember that version 3 handled dialup servers specially and 
didn't use the normal phase locked loop.  (Maybe it was just that the
clock driver did its own projections.)

> Set up your server with iburst options and don't use any restrict lines.
> in the startup line add -g which will allow it to reset you clock even
> if the clock is way off.

This is going to give him a very poor frequency estimate.  With infrequent
polling it tends to be best to lock in the frequency and then periodically
just correct the phase.  The dialup server code used the whole period 
between polls as its frequency baseline.  (The only way I know of locking
in the frequency is to use ntpdate for the updates.)

> ntpd works fine. Just restart ntpd every time you connect as the IP
> address of your local system will change and ntpd does not yet handle
> dynamic address changes on the local machine.

It's by no means certain that the address will change.  If he is using
broadband and DHCP is being operated correctly, it shouldn't change
(reportedly many cheap ISPs break this deliberately).  He could also
have a static address, and, he may be connecting the office network
using ethernet, with properly operating DHCP.  So, whilst one can say
the address will probably change, we don't know this for certain.

> > iBook G4 with Mac OS X 10.4.5

Laptops can also go into suspend states, in which the CPU clock is not
being used at all and the real time clock is used to interpolate - this
can cause havoc for ntpd.  I don't know if OS X goes to a full suspend.

> > /etc/ntp.conf = "server time.asia.apple.com minpoll 12 maxpoll 17"

This will probably never acquire lock, and if it ever does, will soon
lose it.  If it does acquire, you will need to be connected for more
than four hours continuously before it does acquire, even if the 
frequency and phase are dead centre.

> > /var/run/ntp.drift = "0.00"

To stand any chance of acquiring lock with the above minpoll, you will
need to have this correct to rather better than 10 ppm.  Having it 
present, but with the wrong value is about the worst thing you can
do here.
0
david
3/13/2006 9:34:21 PM
David J Taylor wrote:
> 
> > Gerriet M. Denkmann wrote:
> []
> >> /etc/ntp.conf = "server time.asia.apple.com minpoll 12 maxpoll 17"
> >> (Created automatically by Date & Time Preferences)
> 
> Normally, minpoll would be 6 and maxpoll 10, the default values.
> 
> Why are you using 12 and 17?

The correct question is why did Apple's MacOSX coders see fit to tack "minpoll
12 maxpoll 17" to *every* line in ntp.conf, whenever you look at the date & time
preferences GUI.  Part of it might be to spare some of the load on the default
NTP servers they supply in apple.com.  But the code ought not to mess with
non-apple servers and other non-server options.

-Jed
0
Jed
3/14/2006 3:38:38 AM
Jed Clear wrote:
> David J Taylor wrote:
>>
>>> Gerriet M. Denkmann wrote:
>> []
>>>> /etc/ntp.conf = "server time.asia.apple.com minpoll 12 maxpoll 17"
>>>> (Created automatically by Date & Time Preferences)
>>
>> Normally, minpoll would be 6 and maxpoll 10, the default values.
>>
>> Why are you using 12 and 17?
>
> The correct question is why did Apple's MacOSX coders see fit to tack
> "minpoll 12 maxpoll 17" to *every* line in ntp.conf, whenever you
> look at the date & time preferences GUI.  Part of it might be to
> spare some of the load on the default NTP servers they supply in
> apple.com.  But the code ought not to mess with non-apple servers and
> other non-server options.
>
> -Jed

Jed,

Thanks for that information.  I would have described such an 
implementation as "broken".

David 


0
David
3/14/2006 8:01:55 AM
Gerriet M. Denkmann wrote:
> 
> On 13 Mar 2006, at 08:50, Danny Mayer wrote:
> 
>> Gerriet M. Denkmann wrote:
>>> ntpd seems to require a constant internet connection (although as far
>>> as  I can see this is never explicitly stated).
>>>
>>> But what about a computer, which is only occasionally (on average once a
>>> day) connected to the internet, and for a few minutes (5 minutes on
>>> average)?
>>>
>>
>> ntpd was designed at a time that Internet access was unreliable and you
>> would be dialing the NIST number in Colorado, US, to get an accurate
>> time source. So yes, this is actually normal.
>>
>>> Can ntpd be used in this case?
>>
>> Yes.
>>
>>> If yes, what paramters have to be set in ntp.conf?
>>
>> Set up your server with iburst options and don't use any restrict lines.
>> in the startup line add -g which will allow it to reset you clock even
>> if the clock is way off.
>>
>>> If no, are there any programs available to handle this?
>>>
>>
>> ntpd works fine. Just restart ntpd every time you connect as the IP
>> address of your local system will change and ntpd does not yet handle
>> dynamic address changes on the local machine.
> 
> This is what I currently do.
> 
> But the man page says: "After one hour the frequency file is created and
> the current frequency offset written to it." 
> And: "It may take some hours for the frequency and offset to settle down."
> 
> As the laptop is almost never connected to the internet for 1 hour, the
> drift file exists, but just contains 0.00.
> 
> And so every day, when the computer connects to the internet and ntpd is
> started, the clock jumps back by 2.2 seconds.
> 
> I would much prefer a more continous operation.
> 

Someone had supplied a patch to change the default drift file write
frequency to a configurable value. This sounds like just what you need
for your case.

I'll have to look to see where that stands.

Danny

> Gerriet.
> 

_______________________________________________
questions mailing list
questions@lists.ntp.isc.org
https://lists.ntp.isc.org/mailman/listinfo/questions

0
mayer
3/14/2006 1:18:48 PM
Danny Mayer wrote:
> Gerriet M. Denkmann wrote:
>> On 13 Mar 2006, at 08:50, Danny Mayer wrote:
>>
>>> Gerriet M. Denkmann wrote:
>>>> ntpd seems to require a constant internet connection (although as far
>>>> as  I can see this is never explicitly stated).
>>>>
>>>> But what about a computer, which is only occasionally (on average once a
>>>> day) connected to the internet, and for a few minutes (5 minutes on
>>>> average)?
>>>>
>>> ntpd was designed at a time that Internet access was unreliable and you
>>> would be dialing the NIST number in Colorado, US, to get an accurate
>>> time source. So yes, this is actually normal.
>>>
>>>> Can ntpd be used in this case?
>>> Yes.
>>>
>>>> If yes, what paramters have to be set in ntp.conf?
>>> Set up your server with iburst options and don't use any restrict lines.
>>> in the startup line add -g which will allow it to reset you clock even
>>> if the clock is way off.
>>>
>>>> If no, are there any programs available to handle this?
>>>>
>>> ntpd works fine. Just restart ntpd every time you connect as the IP
>>> address of your local system will change and ntpd does not yet handle
>>> dynamic address changes on the local machine.
>> This is what I currently do.
>>
>> But the man page says: "After one hour the frequency file is created and
>> the current frequency offset written to it." 
>> And: "It may take some hours for the frequency and offset to settle down."
>>
>> As the laptop is almost never connected to the internet for 1 hour, the
>> drift file exists, but just contains 0.00.
>>
>> And so every day, when the computer connects to the internet and ntpd is
>> started, the clock jumps back by 2.2 seconds.
>>
>> I would much prefer a more continous operation.
>>
> 
> Someone had supplied a patch to change the default drift file write
> frequency to a configurable value. This sounds like just what you need
> for your case.
> 
> I'll have to look to see where that stands.
> 
It's bug #472 but it didn't make it into RC1 for some reason. Harlan?

Danny
_______________________________________________
questions mailing list
questions@lists.ntp.isc.org
https://lists.ntp.isc.org/mailman/listinfo/questions

0
mayer
3/14/2006 1:27:56 PM
> It's bug #472 but it didn't make it into RC1 for some reason. Harlan?

Because nobody asked that it be blocking 4.2.1 and 4.2.1 has been running
late.

It can certainly go in after 4.2.1 is released, and I want the next release
out within 6 months' time after 4.2.1 is out.

H
0
Harlan
3/14/2006 9:42:55 PM
David J Taylor wrote:
> Jed Clear wrote:
> > The correct question is why did Apple's MacOSX coders see fit to tack
> > "minpoll 12 maxpoll 17" to *every* line in ntp.conf, whenever you
> > look at the date & time preferences GUI.  Part of it might be to
> > spare some of the load on the default NTP servers they supply in
> > apple.com.  But the code ought not to mess with non-apple servers and
> > other non-server options.
>
> Thanks for that information.  I would have described such an
> implementation as "broken".

Didn't I say that?  ;-)

It's really fun when one's ntp.conf goes from "broadcastclient yes" to "server
broadcastclient minpoll..." and it adds min and max poll to your auth and keys. 
I keep a backup ntp.conf copy in $HOME for those times I'm poking around the
Prefs GUI and forget to skip the date & time section.  This was in 10.3, I
haven't tried it in 10.4, but OP is running 10.4.  

Hmm, 10.4.5 seems to blow the file out and add back just the server from the GUI
with the minpoll 12 maxpoll 17.  Well that's slightly less broke.

-Jed
0
Jed
3/15/2006 12:49:58 AM
Jed Clear wrote:
> David J Taylor wrote:
>> Jed Clear wrote:
>>> The correct question is why did Apple's MacOSX coders see fit to tack
>>> "minpoll 12 maxpoll 17" to *every* line in ntp.conf, whenever you
>>> look at the date & time preferences GUI.  Part of it might be to
>>> spare some of the load on the default NTP servers they supply in
>>> apple.com.  But the code ought not to mess with non-apple servers and
>>> other non-server options.
>> Thanks for that information.  I would have described such an
>> implementation as "broken".
> 
> Didn't I say that?  ;-)
> 
> It's really fun when one's ntp.conf goes from "broadcastclient yes" to "server
> broadcastclient minpoll..." and it adds min and max poll to your auth and keys. 
> I keep a backup ntp.conf copy in $HOME for those times I'm poking around the
> Prefs GUI and forget to skip the date & time section.  This was in 10.3, I
> haven't tried it in 10.4, but OP is running 10.4.  
> 
> Hmm, 10.4.5 seems to blow the file out and add back just the server from the GUI
> with the minpoll 12 maxpoll 17.  Well that's slightly less broke.
> 
> -Jed
> 
Have you filed a bug report with Apple? If not, why not?

Danny
_______________________________________________
questions mailing list
questions@lists.ntp.isc.org
https://lists.ntp.isc.org/mailman/listinfo/questions

0
mayer
3/15/2006 8:10:09 PM
Danny Mayer wrote:
> Jed Clear wrote:
> > David J Taylor wrote:
> >> Jed Clear wrote:
> >>> The correct question is why did Apple's MacOSX coders see fit to tack
> >>> "minpoll 12 maxpoll 17" to *every* line in ntp.conf, whenever you
> >>> look at the date & time preferences GUI.  Part of it might be to
[snip]

> Have you filed a bug report with Apple? If not, why not?

How about because I'm inherently lazy and already have a workaround?

Actually if someone has a link to a MacOSX "bugzilla" I might.  Or maybe with
the Darwin project, although I'm not sure how much they deal with the GUI.

-Jed
0
Jed
3/15/2006 10:50:22 PM
Jed Clear wrote:
> Danny Mayer wrote:
>> Jed Clear wrote:
>>> David J Taylor wrote:
>>>> Jed Clear wrote:
>>>>> The correct question is why did Apple's MacOSX coders see fit to tack
>>>>> "minpoll 12 maxpoll 17" to *every* line in ntp.conf, whenever you
>>>>> look at the date & time preferences GUI.  Part of it might be to
> [snip]
> 
>> Have you filed a bug report with Apple? If not, why not?
> 
> How about because I'm inherently lazy and already have a workaround?
> 
> Actually if someone has a link to a MacOSX "bugzilla" I might.  Or maybe with
> the Darwin project, although I'm not sure how much they deal with the GUI.
> 

file a bug report at http://bugreport.apple.com

My thanks to Stuart Cheshire for this reference.

Danny

> -Jed
> 
_______________________________________________
questions mailing list
questions@lists.ntp.isc.org
https://lists.ntp.isc.org/mailman/listinfo/questions

0
mayer
3/16/2006 4:23:12 AM
Reply: