[ntp:questions] Routers and NTP Timing loops

2010-06-16 Thread Jacobs, Kevin J.
I  had an interesting experience with a Cisco router as ntp master 9 using 
itself as an NTP source and it's neighboring switch as the only other  NTP 
source.
The switch had the exact same configuration right back at the router!. So what 
happens? Is NTP smart enough to know that this is a bad idea? If not, what 
goofy things happen if you establish an NTP timing loop? I know that if this 
were frequency references and stratum 3 clocks,  they would ultimately peg at 
the end of their frequency range (not good) but I don't know what happens from 
a time perspective. I had some interesting date-time issues and this is a 
potential root cause. Just looking to see if anyone has had similar experience 
and have done some in-depth research in this area.

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


Re: [ntp:questions] Reference clock driver for /dev/rtc

2010-06-16 Thread Krejci, Pavel
Hi,

 -Original Message-
 From: unruh [mailto:un...@wormhole.physics.ubc.ca]
 Sent: Tuesday, June 15, 2010 7:15 PM
 To: questions@lists.ntp.org
 Subject: Re: [ntp:questions] Reference clock driver for /dev/rtc

 On 2010-06-15, Krejci, Pavel
 pavel.kre...@siemens-enterprise.com wrote:
  Hi,
 
  since I cannot use kvm-clock as the clock source (older
 guest kernel) I am using pit as the clock source. According
 to my tests this is the most stable clock source among
 tsc,hpet but still can drift. Since the qemu keeps the
 /dev/rtc perfectly synchronized with the Host's system time
 it is a good time source for the ntpd on the guest. The host
 itself is then sychronized via NTP with the external time
 server. I don't know any other way how to read the system
 time from the Host, please offer if you have some.
 

 I do not understand. If you driver can read the rtc, it can
 read the system clock instead.
I am not reading the Host's /dev/rtc. I am reading the Guest's /dev/rtc, which 
is synchronized with the Host's system clock.

 And virtual systems are terrible things to use ntpd on. ntpd
 cannot control something where the clock varies by more than
 500PPM, and virtual systems, since they are shut down for
 variable lengths of time by the host, tend to have terrible clocks.
Yes the clocks like hpet or tsc are drifting very very much and the ntpd cannot 
improve the resulting stability. But the pit keeps quite well. With additional 
ntpd the resulting long period clock stability is good - no exact measures done 
yet...

 The rtc can only be read in one second chunks.
This does not matter, some radio clocks allow the same.


  The only disadvantage is that when the step time back must
 be done on the Host, the /dev/rtc gets stuck (it is a
 monotonic clock) and the qemu must be restarted.

 rtc is not a monotonic clock. It can be set to whatever time
 you want.
 Unless your hardware is different than what I am imagining.
This comes from the implementation of the /dev/rtc by the qemu. I haven't 
investigated why.

Regards
Pavel


 
  Regards
  Pavel
 
  -Original Message-
  From: unruh [mailto:un...@wormhole.physics.ubc.ca]
  Sent: Tuesday, June 15, 2010 2:23 AM
  To: questions@lists.ntp.org
  Subject: Re: [ntp:questions] Reference clock driver for /dev/rtc
 
  On 2010-06-14, Krejci, Pavel
  pavel.kre...@siemens-enterprise.com wrote:
   Hello,
  
   I have written the reference clock driver for /dev/rtc on
  Linux. We use it to synchronize the guest Linux system
 running in the
  qemu with the Host clock. If this is useful to someone
 else I would
  like to contribute to the NTP project.
  How should I proceed?
  
 
  Why would you want to do that? The rtc is almost certainly
 worse than
  the system clock. Why not have the guest just read the
 host's system
  clock, rather than the rtc.
 
 
 
 



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


Re: [ntp:questions] Routers and NTP Timing loops

2010-06-16 Thread Maarten Wiltink
Jacobs, Kevin J. kjac...@mitre.org wrote in message
news:70189427bd8ce046b781f28d29c21aee0c9bd78...@imcmbx4.mitre.org...

 I  had an interesting experience with a Cisco router as ntp master 9
 using itself as an NTP source and it's neighboring switch as the only
 other  NTP source.

 The switch had the exact same configuration right back at the router!.
 So what happens? Is NTP smart enough to know that this is a bad idea?
 If not, what goofy things happen if you establish an NTP timing loop?
 I know that if this were frequency references and stratum 3 clocks,
 they would ultimately peg at the end of their frequency range (not good)
 but I don't know what happens from a time perspective. I had some
 interesting date-time issues and this is a potential root cause. Just
 looking to see if anyone has had similar experience and have done some
 in-depth research in this area.

The reference implementation gets a refid with every association to
prevent exactly this. If the refid of a server is recognised as that of
the client itself, the server is not considered a viable time source.

I don't think it breaks cycles of three or more machines.

Groetjes,
Maarten Wiltink


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


Re: [ntp:questions] SNTP with 1ms of precision?

2010-06-16 Thread Marcelo Pimenta
2010/6/15 unruh un...@wormhole.physics.ubc.ca

 On 2010-06-14, Marcelo Pimenta marcelopiment...@gmail.com wrote:
  Hi everybody!!
 
  My question is about Time Accuracy of NTP/SNTP protocol. I want to know
 if
  is possible to have precision of 1ms(could be  1 ms?) using SNTP in a
  network with 50 hosts(is the same with 100 hosts?) using only swithes, no
  routing. All these hosts are syncronized with a Meinberg GPS. The traffic
 is
  low(~25%). Is it possible to have the same time accuracy of IRIG-B for
  example?

 I think you mean accuracy of 1ms. Yes. it can. On a local network,
 100usec is easily possible ( and depending on the routers, it can be
 better than that).


Yes, you are right, accuracy of 1ms. On a local network 100usec?? Even if we
use only switches(no routers), how is that possible if I have 4 types of
Latency increasing about 80us? Algorithms to compensate the delay? Even in
SNTP?

Anyway, the question is about 1 ms. To get 100usec I'll use PTP.



 
  The internal clock in my devices(hosts) starts with the crystal
 frequence. A
  typical offset or frequence tolerance of the crystal is less then
  1ms/minute. The resolution is about 0.9ms and the devices acts as unicast
  clients, asking GPS every minute.

 Why?  The whole purpose of ntp is to discipline your clock so that it
 keeps time much better than that.


The idea to have this is not overload the network asking time every second
to keep my accurancy in 1ms in 100% of time. And the second reason is about
how many ms your clock will be wrong in 59 sec without a frame to discipline
my clock again? PCs clock for example is not good, that's why I need a very
good crystal.


 Not sure what you mean by the resolution is about .9ms What is your
 device?


I mean that my device can show me variations of 0.9ms, is the smallest
possible increase of time the clock model allows. I work with protection
IED(intelligent electronic device), is a term used in the electric power
industry to describe microprocessor-based controllers of power system
equipment.

If something happens in 458ms, I will get exacly 458ms. Some equipment have
 so I can trust in variation that I can capture.


  Is it enough? The Time Accurancy could be better if I could ask GPS twice
 a
  minute? A broadcast implementation with GPS sending time every minute
 could
  help?

 It depends on what you want the time for.


I need accurancy at least of 1ms in 100% of time.


 
  I know that these kind of issue have many variables but the main question
  is: Is possible to have precision of 1ms(could be 1ms) with SNTP?

 Yes, depending on the competence of the writer of the SNTP software.


So, the problem is not in the standard but into implementation of SNTP to
not loose time to correct the clock and something like that?


 
  Thank you very much

 ___
 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] SNTP with 1ms of precision?

2010-06-16 Thread Rob
Marcelo Pimenta marcelopiment...@gmail.com wrote:
 The idea to have this is not overload the network asking time every second
 to keep my accurancy in 1ms in 100% of time. And the second reason is about
 how many ms your clock will be wrong in 59 sec without a frame to discipline
 my clock again? PCs clock for example is not good, that's why I need a very
 good crystal.

Why are you causing your own problems by sticking to SNTP instead of
using NTP which was designed to overcome the problems you fear?

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


Re: [ntp:questions] SNTP with 1ms of precision?

2010-06-16 Thread Marcelo Pimenta
2010/6/16 Rob nom...@example.com

 Marcelo Pimenta marcelopiment...@gmail.com wrote:
  The idea to have this is not overload the network asking time every
 second
  to keep my accurancy in 1ms in 100% of time. And the second reason is
 about
  how many ms your clock will be wrong in 59 sec without a frame to
 discipline
  my clock again? PCs clock for example is not good, that's why I need a
 very
  good crystal.

 Why are you causing your own problems by sticking to SNTP instead of
 using NTP which was designed to overcome the problems you fear?



Rob, my understading about the use of SNTP and NTP is: while SNTP provides
time synchronization within *one *network, NTP allows a global time
synchronization on the internet. SNTP provides the current time, the current
number of leap seconds and the warning flags marking the intriduction of a
leap second correction.

The NTP algorithm is much more complicated than the SNTP algorithm. NTP
normally uses multiple time servers to verify the time and then controls the
slew rate of the device. The algorithm determines if the values are accurate
using several methods including fudge factors and identifying time servers
that don't agree with the other time servers. It then speeds up or slows
down the device drift rate so device time is always correct and there won't
be any subsequent time jumps after the initial correction.

SNTP usually uses just one Ethernet Time Server to calculate the time and
then it jumps the system time to the calculated time. It can, however,
have back-up Ethernet Time Servers in case one is not avaiable(not two at
the same time).

In my case, I have* only one* network. My Time Server is not a machine, is a
meinberg GPS. In my point of view, if my source time were machines, maybe
NTP could be better to find a middle line between all these machines used as
time servers. But if I am using a very good and reliable GPS(Meinberg) with
a lot of satellites giving it the correct time, and it's pluged directly in
my switch, I think that in this case, NTP will not make any difference.



 ___
 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] Routers and NTP Timing loops

2010-06-16 Thread David Woolley

Maarten Wiltink wrote:



I don't think it breaks cycles of three or more machines.


However, unless you abuse the local clock, which many packagings of ntpd 
do, the stratum mechanism will cut you off.


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


Re: [ntp:questions] SNTP with 1ms of precision?

2010-06-16 Thread David Woolley

Marcelo Pimenta wrote:



Rob, my understading about the use of SNTP and NTP is: while SNTP provides
time synchronization within *one *network, NTP allows a global time


You are confusing it with timed.  SNTP also expects to use global time, 
and NTP can be used with an arbitrary timebase, providing all stratum 0s 
have the same arbitrary time (i.e., typically there is only one).




synchronization on the internet. SNTP provides the current time, the current
number of leap seconds and the warning flags marking the intriduction of a
leap second correction.

The NTP algorithm is much more complicated than the SNTP algorithm. NTP
normally uses multiple time servers to verify the time and then controls the


There is no SNTP algorithm, beyond basic validity checking.  SNTP covers 
any use of NTP wire formats that falls short of being a compliant NTP 
implementation.  SNTP implementations could still use PLL clock 
discipline code, or could use linear regression solutions for offset and 
rate.



slew rate of the device. The algorithm determines if the values are accurate
using several methods including fudge factors and identifying time servers
that don't agree with the other time servers. It then speeds up or slows
down the device drift rate so device time is always correct and there won't
be any subsequent time jumps after the initial correction.

SNTP usually uses just one Ethernet Time Server to calculate the time and
then it jumps the system time to the calculated time. It can, however,


One issue that has maybe not been stressed is that this strategy makes 
you extremely vulnerable to scheduling delays, e.g. you would likely 
never get a 1ms error bound on Windows if you used this strategy.


Early W32Time implementations, and current ones in out of the box 
configurations are SNTP implementations, but often use internet sources. 
 They do violate the specification by allowing multiple SNTP strata.



have back-up Ethernet Time Servers in case one is not avaiable(not two at
the same time).

In my case, I have* only one* network. My Time Server is not a machine, is a
meinberg GPS. In my point of view, if my source time were machines, maybe
NTP could be better to find a middle line between all these machines used as
time servers. But if I am using a very good and reliable GPS(Meinberg) with
a lot of satellites giving it the correct time, and it's pluged directly in
my switch, I think that in this case, NTP will not make any difference.


I think you are being asked why you don't just use a standard ntpd for 
the platform, and also how you know that your total system meets the 
scheduling constraints for 1ms accuracy with SNTP.


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


Re: [ntp:questions] SNTP with 1ms of precision?

2010-06-16 Thread Rob
Marcelo Pimenta marcelopiment...@gmail.com wrote:
 In my case, I have* only one* network. My Time Server is not a machine, is a
 meinberg GPS. In my point of view, if my source time were machines, maybe
 NTP could be better to find a middle line between all these machines used as
 time servers. But if I am using a very good and reliable GPS(Meinberg) with
 a lot of satellites giving it the correct time, and it's pluged directly in
 my switch, I think that in this case, NTP will not make any difference.

If that is your opinion, you should not complain about network latency
and clock rate errors.

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


Re: [ntp:questions] SNTP with 1ms of precision?

2010-06-16 Thread Maarten Wiltink
Marcelo Pimenta marcelopiment...@gmail.com wrote in message
news:aanlktilq6m8apeoasibr-o8mhwifqkfv9xyf6mudr...@mail.gmail.com...

[...]
 The NTP algorithm is much more complicated than the SNTP algorithm.

The short, short version: there is no SNTP algorithm. SNTP is NTP
_without_ the algorithms. Using NTP means continuously adjusting the
speed of your clock so it tracks real time as best you can make it,
while SNTP is simply asking what time [they think] it is.

Groetjes,
Maarten Wiltink


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


Re: [ntp:questions] SNTP with 1ms of precision?

2010-06-16 Thread Maarten Wiltink
Marcelo Pimenta marcelopiment...@gmail.com wrote in message
news:aanlktilaoduniqjgpigohpzvjcv_zmsw_tr7naj6b...@mail.gmail.com...

 [...] accuracy of 1ms. On a local network 100usec?? Even if we use
 only switches(no routers), how is that possible if I have 4 types of
 Latency increasing about 80us?

The latency is corrected for. A query-response cycle is a back-and-forth
exchange. The assumption is that the latency for the response (going
forth) is equal to the latency for the response (going back), and both
are half of the total latency, which you do know. So you estimate that
the response was sent half the total latency time before the moment you
received it.

This often works well, and sometimes not so well. Domestic ADSL with a
saturated upstream and downstream capacity left is one common case where
it works not so well.


[...]
 I need accurancy at least of 1ms in 100% of time.

That's a *very* tall order.

Groetjes,
Maarten Wiltink


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