[ntp:questions] simple nt.conf cases for ntp-client

ardi peter.knezel at gmail.com
Thu Jan 23 10:00:25 UTC 2014


On Thursday, January 23, 2014 9:36:35 AM UTC+1, Marco Marongiu wrote:
> Hi Peter
> 
> 
> 
> In your questions, you are showing configuration snippets as they were
> 
> taken from some "authoritative" source. Would you mind sharing that source?
> 
> 
Hello Marco,

Well, I have come across almost all of the pages, you are mentioning below,
but it seems, i have "combined" the info wrongly for my example...:-)
> 
> As for me, I consider the following to be *the* authoritative sources
> 
> for anything NTP:
> 
> 
> 
> http://www.eecis.udel.edu/~mills/ntp/html/index.html
> 
> http://doc.ntp.org/
> 
> http://support.ntp.org
> 
> http://www.ntp.org/ntpfaq/NTP-a-faq.htm
> 
> 
> 
> That said, let's see.
> 
> 
> 
> On 01/23/2014 08:29 AM, ardi wrote:
> 
> > Below are described some basic cases for ntp.conf on ntp-client:
> 
> > 
> 
> > a)
> 
> > In the simplest case of ntp-client the following ntp.conf is defined:
> 
> > 
> 
> > restrict default noquery nomodify notrap
> 
> > restrict 127.0.0.1
> 
> > driftfile /var/lib/ntp/ntp.drift
> 
> > server xx.xx.xx.xx minpoll 4 maxpoll 4 
> 
> > restrict xx.xx.xx.xx
> 
> > 
> 
> > Why should i need the restrict line xx.xx.xx.xx?
> 
> > What does the first restrict line means?
> 
> 
> 
> First things first: why minpoll and maxpoll? The defaults are generally
> 
> OK -- I had to change that manually only in special cases, and I can
> 
> count them on one hand.
> 
> 
Does it mean these minpoll, maxpoll parameters are not needed in most of the cases?

According to book Expert
Network Time Protocol from PETER RYBACZYK:
"The minpoll and maxpoll parameters represent minimum and maximum polling intervals for reference clock messages in seconds to the power of 2. For example, if minpoll=3 and maxpoll=4, the minimum polling interval would be 8 seconds, and the maximum polling interval would be 16 seconds."

What does "minimum and maximum polling intervals for reference clock messages"
mean? 
polling = messaging with NTP servers to estimate the offset ???
> 
> Regarding restrict, everything you need to know about noquery, nomodify,
> 
> notrap is here, along with all the information about that directive:
> 
> http://doc.ntp.org/4.2.6p5/accopt.html
> 
> 
> 
> If you need some guidance to select the right restrictions that work for
> 
> you, please see
> 
> http://support.ntp.org/bin/view/Support/AccessRestrictions
> 
> 
> 
> 
> 
> > b1)In case using 2 ntp-servers from which my ntp-client can get time,
> 
> > is my ntp-client taking time from xx.xx.xx.xx
> 
> > and if this server is not reachable then from xx.xx.xx.yy?
> 
> 
> 
> First: don't use two servers, it's the worst possible configuration.

Why not? what if one of the servers fail? then the client can get time from the other ntp-server.

Doesn't the real setup consist of 
some stratum 1 time servers, then at least two stratum 2 ntp servers
which are in peer with each other (and takin time form one or more stratum 1 time servers) and clients are taking time from these
stratum 2 servers?

see: http://www.ntp.org/ntpfaq/NTP-s-config-adv.htm 6.2.1.3, Figure 5.




> 
> 
> 
> The server selection algorithm and why you should use four servers
> 
> whenever possible is sketched here:
> 
> 
> 
> http://www.ntp.org/ntpfaq/NTP-s-algo-real.htm#Q-NTP-ALGO
> 
> 
> 
> 
> 
> > What does prefer do in this case b2)?
> 
> 
> 
> See this page, section "The prefer Peer", after reading the reference
> 
> above. In short: if the server marked with "prefer" is selected as a
> 
> survivor, it will be preferred among all other survivors -- it will be
> 
> used when the algorithm would otherwise have selected another server.
> 
> http://doc.ntp.org/4.2.6p5/prefer.html
> 
> 
> 
> 
> 
> > Is there any difference between b1) and b2) case?
> 
> 
> 
> This is left as an exercise to the reader :)
> 
> 
According to http://doc.ntp.org/4.2.6p5/prefer.html
section: The prefer Peer

"While the rules do not forbid it, it is usually not useful to designate more than one source as preferred; however, if more than one source is so designated, they are used in the order specified in the configuration file; that is, if the first one becomes unselectable, the second one is considered and so forth."

i understand from this that only in case if more than one servers or peers
have parameter prefer, then they are used in the order specified in the configuration file; that is, if the first one becomes unselectable, the second one is considered.

Is that true?
> 
> 
> 
> > b3)
> 
> > what about this case b3) below?
> 
> > Is time taken for the ntp-client according to order of lines - i mean the xx.xx.xx.xx is taken as time source?
> 
> > or the 2nd server xx.xx.xx.yy is preferred?
> 
> 
> 
> This should be fairly clear now, if you took the time to check the
> 
> references I've mentioned.
> 
> 
Hmm, server xx.xx.xx.yy minpoll 4 maxpoll 4 prefer will be selected?

> 
> I'd be really curious to check the source of your snippets. Is it a web
> 
> page we can take a peep at?
> 
> 
> 
> Ciao!
> 
> -- bronto



More information about the questions mailing list