Re: [ntp:questions] Order of servers in ntp.conf

2013-08-14 Thread unruh
On 2013-08-13, Nils Brubaker  wrote:
> For ntpd 4.2.4p6 running on Linux, is there any significance to the order 
> of servers in the ntp.conf file?  Will ntpd synchronize with the first 
> available/good time server in the list?

No, no.
ntp gets the data from all the servers. It then looks at the times it
gets from each server, and groups them into "classes" according to its
estimate of the max time error from the server-- ie whether the error
intervals overlap or not. It then looks for the largest group of servers
all of whose error intervals overlap and uses the average of those times
as the time to send on the the ntp engine. The others are "false
tickers". It estimates the error by looking at the round trip time and
the other machine's estimate of its own max error.


>
> Thanks,
> Nils Brubaker

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


Re: [ntp:questions] Order of servers in ntp.conf

2013-08-14 Thread Nils Brubaker
Thank you, un...@invalid.ca, for your response to my question.

Couple follow-up questions.  My ntp.conf running on Linux has 4 servers 
defined:

server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org

These are public servers from the NTP pool project.  In my 
/var/log/diag-log file, I see messages indicating that my ntpd is synching 
with individual servers, for example:

Aug  7 09:53:58 yellowstone ntpd[3272]: synchronized to 69.50.219.51, 
stratum 2
Aug  7 10:04:52 yellowstone ntpd[3272]: synchronized to 184.82.112.110, 
stratum 2
Aug  7 10:39:05 yellowstone ntpd[3272]: synchronized to 69.50.219.51, 
stratum 2
Aug  7 11:28:17 yellowstone ntpd[3272]: synchronized to 184.82.112.110, 
stratum 2
Aug  7 12:47:06 yellowstone ntpd[3272]: synchronized to 128.10.19.24, 
stratum 1
...
Aug  8 11:37:43 yellowstone ntpd[3254]: synchronized to 50.116.55.65, 
stratum 2
Aug  8 12:18:46 yellowstone ntpd[3254]: synchronized to 50.116.55.161, 
stratum 2
Aug  8 13:01:27 yellowstone ntpd[3254]: synchronized to 38.101.77.21, 
stratum 2
Aug  8 15:01:00 yellowstone ntpd[3254]: synchronized to 50.116.55.161, 
stratum 2
Aug  8 16:09:20 yellowstone ntpd[3254]: synchronized to 38.101.77.21, 
stratum 2

These log messages suggest that ntpd is synchronizing with one and only 
one NTP server.  Is that the correct interpretation?  Is this single 
server selected for synchronization only after performing all the 
calculations described below?

Also, I see long time periods in the diag-log where there is no 
synchronization message.   What does that signify?  No agreement between 
the servers on the correct time?  No need to adjust system clock because 
it is already in sync?

Thanks,
 Nils Brubaker


On 2013-08-13, Nils Brubaker  wrote:
> For ntpd 4.2.4p6 running on Linux, is there any significance to the 
order 
> of servers in the ntp.conf file?  Will ntpd synchronize with the first 
> available/good time server in the list?

No, no.
ntp gets the data from all the servers. It then looks at the times it
gets from each server, and groups them into "classes" according to its
estimate of the max time error from the server-- ie whether the error
intervals overlap or not. It then looks for the largest group of servers
all of whose error intervals overlap and uses the average of those times
as the time to send on the the ntp engine. The others are "false
tickers". It estimates the error by looking at the round trip time and
the other machine's estimate of its own max error.


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


Re: [ntp:questions] Order of servers in ntp.conf

2013-08-14 Thread David Taylor

On 13/08/2013 20:52, Nils Brubaker wrote:

For ntpd 4.2.4p6 running on Linux, is there any significance to the order
of servers in the ntp.conf file?  Will ntpd synchronize with the first
available/good time server in the list?

Thanks,
Nils Brubaker


The order you list likely determines the order shown in an "ntpq -p" 
results billboard.  That's the command you should use to check the sync 
status.  See the section "Tally Codes" in:


  http://doc.ntp.org/4.2.4/ntpq.html

Why run such an old version?

The "synchronized to" messages relate to a switch of servers.  If the 
servers are all of a similar quality, this is sometimes referred to as 
"clock hopping", but otherwise it may indicate that the data from server 
A is now worse than that from server B (perhaps because of Internet 
loading), so NTP switches from A to B.

--
Cheers,
David
Web: http://www.satsignal.eu

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


Re: [ntp:questions] Order of servers in ntp.conf

2013-08-14 Thread Brian Utterback
I don't understand how you get the idea that your system is 
synchronizing with only one server when the messages you posted show it 
synchronizing with 6 servers. Do you mean that it is synchronizing with 
one server at a time? That is what it is supposed to do. There is a 
combining step in the algorithms that can adjust the actual offset used 
by combining with offsets from others in a selected group, but there is 
always a single primary sync source.


On 8/14/2013 11:03 AM, Nils Brubaker wrote:

Thank you, un...@invalid.ca, for your response to my question.

Couple follow-up questions.  My ntp.conf running on Linux has 4 servers
defined:

server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org

These are public servers from the NTP pool project.  In my
/var/log/diag-log file, I see messages indicating that my ntpd is synching
with individual servers, for example:

Aug  7 09:53:58 yellowstone ntpd[3272]: synchronized to 69.50.219.51,
stratum 2
Aug  7 10:04:52 yellowstone ntpd[3272]: synchronized to 184.82.112.110,
stratum 2
Aug  7 10:39:05 yellowstone ntpd[3272]: synchronized to 69.50.219.51,
stratum 2
Aug  7 11:28:17 yellowstone ntpd[3272]: synchronized to 184.82.112.110,
stratum 2
Aug  7 12:47:06 yellowstone ntpd[3272]: synchronized to 128.10.19.24,
stratum 1
...
Aug  8 11:37:43 yellowstone ntpd[3254]: synchronized to 50.116.55.65,
stratum 2
Aug  8 12:18:46 yellowstone ntpd[3254]: synchronized to 50.116.55.161,
stratum 2
Aug  8 13:01:27 yellowstone ntpd[3254]: synchronized to 38.101.77.21,
stratum 2
Aug  8 15:01:00 yellowstone ntpd[3254]: synchronized to 50.116.55.161,
stratum 2
Aug  8 16:09:20 yellowstone ntpd[3254]: synchronized to 38.101.77.21,
stratum 2

These log messages suggest that ntpd is synchronizing with one and only
one NTP server.  Is that the correct interpretation?  Is this single
server selected for synchronization only after performing all the
calculations described below?

Also, I see long time periods in the diag-log where there is no
synchronization message.   What does that signify?  No agreement between
the servers on the correct time?  No need to adjust system clock because
it is already in sync?

Thanks,
  Nils Brubaker


On 2013-08-13, Nils Brubaker  wrote:

For ntpd 4.2.4p6 running on Linux, is there any significance to the

order

of servers in the ntp.conf file?  Will ntpd synchronize with the first
available/good time server in the list?

No, no.
ntp gets the data from all the servers. It then looks at the times it
gets from each server, and groups them into "classes" according to its
estimate of the max time error from the server-- ie whether the error
intervals overlap or not. It then looks for the largest group of servers
all of whose error intervals overlap and uses the average of those times
as the time to send on the the ntp engine. The others are "false
tickers". It estimates the error by looking at the round trip time and
the other machine's estimate of its own max error.


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


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


Re: [ntp:questions] Order of servers in ntp.conf

2013-08-14 Thread unruh
On 2013-08-14, Nils Brubaker  wrote:
> Thank you, un...@invalid.ca, for your response to my question.
>
> Couple follow-up questions.  My ntp.conf running on Linux has 4 servers 
> defined:
>
> server 0.rhel.pool.ntp.org
> server 1.rhel.pool.ntp.org
> server 2.rhel.pool.ntp.org
>
> These are public servers from the NTP pool project.  In my 
> /var/log/diag-log file, I see messages indicating that my ntpd is synching 
> with individual servers, for example:
>
> Aug  7 09:53:58 yellowstone ntpd[3272]: synchronized to 69.50.219.51, 
> stratum 2
> Aug  7 10:04:52 yellowstone ntpd[3272]: synchronized to 184.82.112.110, 
> stratum 2
> Aug  7 10:39:05 yellowstone ntpd[3272]: synchronized to 69.50.219.51, 
> stratum 2
> Aug  7 11:28:17 yellowstone ntpd[3272]: synchronized to 184.82.112.110, 
> stratum 2
> Aug  7 12:47:06 yellowstone ntpd[3272]: synchronized to 128.10.19.24, 
> stratum 1
> ...
> Aug  8 11:37:43 yellowstone ntpd[3254]: synchronized to 50.116.55.65, 
> stratum 2
> Aug  8 12:18:46 yellowstone ntpd[3254]: synchronized to 50.116.55.161, 
> stratum 2
> Aug  8 13:01:27 yellowstone ntpd[3254]: synchronized to 38.101.77.21, 
> stratum 2
> Aug  8 15:01:00 yellowstone ntpd[3254]: synchronized to 50.116.55.161, 
> stratum 2
> Aug  8 16:09:20 yellowstone ntpd[3254]: synchronized to 38.101.77.21, 
> stratum 2
>
> These log messages suggest that ntpd is synchronizing with one and only 
> one NTP server.  Is that the correct interpretation?  Is this single 
> server selected for synchronization only after performing all the 
> calculations described below?

As I understand it, once it has done all of the calculations, it picks
one of the servers in the accepted bunch of servers and uses it as a
proxy for all of them. Ie, the above is shorthand for 
synchronized to a pool of servers which includes 38.101.77.21


>
> Also, I see long time periods in the diag-log where there is no 
> synchronization message.   What does that signify?  No agreement between 

No change.

> the servers on the correct time?  No need to adjust system clock because 
> it is already in sync?

Neither. You can look at the loopstats file to see what is actually
happening. 
Remember also that once  ntpd drops to poll interval 10, that means 1024
seconds between polls (that is about 20 min) and it then chooses 1 of
about 8 of those polls to actually use. So, the time between effective
polls is about 3 hours. Nothing changes in that three hours since there
is no new data. 

I am sure that someone will correct me if I have some of the details of
the selection algorithm wrong.



>
> Thanks,
>  Nils Brubaker
>
>
> On 2013-08-13, Nils Brubaker  wrote:
>> For ntpd 4.2.4p6 running on Linux, is there any significance to the 
> order 
>> of servers in the ntp.conf file?  Will ntpd synchronize with the first 
>> available/good time server in the list?
>
> No, no.
> ntp gets the data from all the servers. It then looks at the times it
> gets from each server, and groups them into "classes" according to its
> estimate of the max time error from the server-- ie whether the error
> intervals overlap or not. It then looks for the largest group of servers
> all of whose error intervals overlap and uses the average of those times
> as the time to send on the the ntp engine. The others are "false
> tickers". It estimates the error by looking at the round trip time and
> the other machine's estimate of its own max error.

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


Re: [ntp:questions] Order of servers in ntp.conf

2013-08-14 Thread Steve Kostecke
On 2013-08-14, unruh  wrote:

> On 2013-08-14, Nils Brubaker  wrote:
>
>> Aug  8 15:01:00 yellowstone ntpd[3254]: synchronized to 50.116.55.161, 
>> stratum 2
>> Aug  8 16:09:20 yellowstone ntpd[3254]: synchronized to 38.101.77.21, 
>> stratum 2
>>
>> These log messages suggest that ntpd is synchronizing with one and only 
>> one NTP server.  Is that the correct interpretation?  Is this single 
>> server selected for synchronization only after performing all the 
>> calculations described below?
>
> As I understand it, once it has done all of the calculations, it picks
> one of the servers in the accepted bunch of servers and uses it as a
> proxy for all of them. Ie, the above is shorthand for 
> synchronized to a pool of servers which includes 38.101.77.21

The time server specified in each of those lines is the one which is
currently selected as the "sys_peer".

-- 
Steve Kostecke 
NTP Public Services Project - http://support.ntp.org/

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


Re: [ntp:questions] Order of servers in ntp.conf

2013-08-14 Thread unruh
On 2013-08-14, Steve Kostecke  wrote:
> On 2013-08-14, unruh  wrote:
>
>> On 2013-08-14, Nils Brubaker  wrote:
>>
>>> Aug  8 15:01:00 yellowstone ntpd[3254]: synchronized to 50.116.55.161, 
>>> stratum 2
>>> Aug  8 16:09:20 yellowstone ntpd[3254]: synchronized to 38.101.77.21, 
>>> stratum 2
>>>
>>> These log messages suggest that ntpd is synchronizing with one and only 
>>> one NTP server.  Is that the correct interpretation?  Is this single 
>>> server selected for synchronization only after performing all the 
>>> calculations described below?
>>
>> As I understand it, once it has done all of the calculations, it picks
>> one of the servers in the accepted bunch of servers and uses it as a
>> proxy for all of them. Ie, the above is shorthand for 
>> synchronized to a pool of servers which includes 38.101.77.21
>
> The time server specified in each of those lines is the one which is
> currently selected as the "sys_peer".

But as I understand it, it is simply one of the systems which is not a
false ticker, and has not real significance other than that. 
Ie, its time is not treated any differently than any of the other
systems regarded as true chimers by the selection algorithm. Or do I
misunderstand something?

>

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


Re: [ntp:questions] Order of servers in ntp.conf

2013-08-15 Thread Steve Kostecke
On 2013-08-15, unruh  wrote:

> On 2013-08-14, Steve Kostecke  wrote:
>
>> The time server specified in each of those lines is the one which is
>> currently selected as the "sys_peer".
>
> But as I understand it, it is simply one of the systems which is
> not a false ticker, and has not real significance other than that.
> Ie, its time is not treated any differently than any of the other
> systems regarded as true chimers by the selection algorithm. Or do I
> misunderstand something?

The sys_peer is chosen after the select[ion] alrorithm scans the
associations for selectable candiates _and_ after the cluster
(combine?) algorithm casts out the outliers.

In the last paragraph at
http://www.eecis.udel.edu/~mills/ntp/html/warp.html we see:

"The algorithms described on the Mitigation Rules and the prefer Keyword
page combine the survivor offsets, designate one of them as the system
peer and produces the final offset used by the algorithm described on
the Clock Discipline Algorithm page to adjust the system clock time and
frequency."

Section 6 of the Mitigation Rules page
(http://www.eecis.udel.edu/~mills/ntp/html/prefer.html) 
clarifies how the process works:

"As previously noted, the cluster algorithm casts out outliers, leaving
the survivor list for later processing. The survivor list is then sorted
by increasing root distance and the first entry temporarily designated
the system peer. At this point the following contributors to the system
clock discipline may be available:

* (potential) system peer, if there are survivors;
* orphan parent, if present;
* local driver, if present;
* modem driver, if present;
* prefer peer, if present;
* PPS driver, if present.

The mitigation algorithm proceeds in three steps in turn.

1. If there are no survivors, the modem driver becomes the only survivor
if there is one. If not, the local driver becomes the only survivor if
there is one. If not, the orphan parent becomes the only survivor if
there is one. If the number of survivors at this point is less than the
minsane option of the tos command, the algorithm is terminated and the
system variables remain unchanged. Note that minsane is by default 1,
but can be set at any value including 0.

2. If the prefer peer is among the survivors, it becomes the system peer
and its offset and jitter are inherited by the corresponding system
variables. Otherwise, the combine algorithm computes these variables
from the survivor population.

3. If there is a PPS driver and the system clock offset at this point is
less than 0.4 s, and if there is a prefer peer among the survivors or
if the PPS peer is designated as a prefer peer, the PPS driver becomes
the system peer and its offset and jitter are inherited by the system
variables, thus overriding any variables already computed. Note that a
PPS driver is present only if PPS signals are actually being received
and enabled by the associated driver.

If none of the above is the case, the data are disregarded and the
system variables remain as they are."

-- 
Steve Kostecke 
NTP Public Services Project - http://support.ntp.org/

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


Re: [ntp:questions] Order of servers in ntp.conf

2013-08-15 Thread unruh
On 2013-08-15, Steve Kostecke  wrote:
> On 2013-08-15, unruh  wrote:
>
>> On 2013-08-14, Steve Kostecke  wrote:
>>
>>> The time server specified in each of those lines is the one which is
>>> currently selected as the "sys_peer".
>>
>> But as I understand it, it is simply one of the systems which is
>> not a false ticker, and has not real significance other than that.
>> Ie, its time is not treated any differently than any of the other
>> systems regarded as true chimers by the selection algorithm. Or do I
>> misunderstand something?
>
> The sys_peer is chosen after the select[ion] alrorithm scans the
> associations for selectable candiates _and_ after the cluster
> (combine?) algorithm casts out the outliers.
>
> In the last paragraph at
> http://www.eecis.udel.edu/~mills/ntp/html/warp.html we see:
>
> "The algorithms described on the Mitigation Rules and the prefer Keyword
> page combine the survivor offsets, designate one of them as the system
> peer and produces the final offset used by the algorithm described on
> the Clock Discipline Algorithm page to adjust the system clock time and
> frequency."
>
> Section 6 of the Mitigation Rules page
> (http://www.eecis.udel.edu/~mills/ntp/html/prefer.html) 
> clarifies how the process works:
>
> "As previously noted, the cluster algorithm casts out outliers, leaving
> the survivor list for later processing. The survivor list is then sorted
> by increasing root distance and the first entry temporarily designated
> the system peer. At this point the following contributors to the system
> clock discipline may be available:
>
> * (potential) system peer, if there are survivors;
> * orphan parent, if present;
> * local driver, if present;
> * modem driver, if present;
> * prefer peer, if present;
> * PPS driver, if present.
>
> The mitigation algorithm proceeds in three steps in turn.
>
> 1. If there are no survivors, the modem driver becomes the only survivor
> if there is one. If not, the local driver becomes the only survivor if
> there is one. If not, the orphan parent becomes the only survivor if
> there is one. If the number of survivors at this point is less than the
> minsane option of the tos command, the algorithm is terminated and the
> system variables remain unchanged. Note that minsane is by default 1,
> but can be set at any value including 0.
]
This is ambiguous. If no survivors-> local/orphan. If suvivors unchanged. 
If I set minsane to 100 and have only 5 peers, what happens? Is
local/orphan used or is nothing changed.



>

> 2. If the prefer peer is among the survivors, it becomes the system peer

In the above, there are survivors, but fewer than minsane. Does this
apply? or does this apply only if survivors>minsane?

> and its offset and jitter are inherited by the corresponding system
> variables. Otherwise, the combine algorithm computes these variables
> from the survivor population.

"Otherwise the combine algorithm computes these variables from the
survivor population" does not say how it does so. 
Is it the ntp offset of the system peer? or is it the offset
from some (weughted?) average of the survivors? Since some of the
survivor's data could be 3 hours old (poll of 10 with the 1/8 selection) 
and others 1 sec old. Does this enter the weighting?



>
s> 3. If there is a PPS driver and the system clock offset at this point is
> less than 0.4 s, and if there is a prefer peer among the survivors or
> if the PPS peer is designated as a prefer peer, the PPS driver becomes
> the system peer and its offset and jitter are inherited by the system
> variables, thus overriding any variables already computed. Note that a
> PPS driver is present only if PPS signals are actually being received
> and enabled by the associated driver.
>
> If none of the above is the case, the data are disregarded and the
> system variables remain as they are."
>

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


Re: [ntp:questions] Order of servers in ntp.conf

2013-08-15 Thread David Woolley

On 14/08/13 16:03, Nils Brubaker wrote:


all of whose error intervals overlap and uses the average of those times
as the time to send on the the ntp engine. The others are "false
tickers". It estimates the error by looking at the round trip time and
the other machine's estimate of its own max error.



I believe the error statistics and stratum, sent downstream, come from 
the system peer.  The actual time is a weighted average of good servers.


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


Re: [ntp:questions] Order of servers in ntp.conf

2013-08-15 Thread Steve Kostecke
On 2013-08-15, unruh  wrote:

> On 2013-08-15, Steve Kostecke  wrote:
> [---=| Quote block shrinked by t-prot: 42 lines snipped |=---]
>
>> The mitigation algorithm proceeds in three steps in turn.
>>
>> 1. If there are no survivors, the modem driver becomes the only
>> survivor if there is one. If not, the local driver becomes the only
>> survivor if there is one. If not, the orphan parent becomes the only
>> survivor if there is one. If the number of survivors at this point
>> is less than the minsane option of the tos command, the algorithm
>> is terminated and the system variables remain unchanged. Note that
>> minsane is by default 1, but can be set at any value including 0.
>
> ] This is ambiguous.

Seems pretty straightforward to me ...

if (survivors == NULL) {
if exists(modem) {
survivors = "modem"
} elseif exists(undisciplined_local_clock) {
survivors = "undisciplined_local_clock"
} elseif exists(orphan_parent) {
survivors = "orphan_parent"
}
}

abort if (count(survivors) < minsane)

> If no survivors-> local/orphan. If suvivors (which is almost always true if no survivors)-> unchanged. 
> If I set minsane to 100 and have only 5 peers, what happens? Is
> local/orphan used or is nothing changed.

You can break almost anything if you grossly misconfigure it.

-- 
Steve Kostecke 
NTP Public Services Project - http://support.ntp.org/

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