Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-31 Thread Hans Jørgen Jakobsen
On Thu, 28 Mar 2013 21:21:55 GMT, Harlan Stenn wrote:
 On Thu, Mar 28, 2013 at 5:57 AM, Rob nom...@example.com wrote:
 so you will need to write an adaptive
 algorithm that recognizes what is happening here, and send the queries
 quickly enough (I would say at least two per second, maybe 4) to force
 the active user algorithm to kick in.

 Sending at a rate of more than 1 packet every 2 seconds or more than 8
 packets per 64 seconds will trigger KOD responses.


Use sufficiently many servers so the rate to each is below radar.
Keep list of latest servers and their roundtip time.
Sort list by roundtrip time.
Use them in descending order(Use worst to kick link up in speed)
Hope there are some good measurements in the last measurements.
Update list.

/hjj

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-29 Thread Rob
Robert Scott no-one@notreal.invalid wrote:
 On Thu, 28 Mar 2013 21:21:55 GMT, Harlan Stenn st...@ntp.org wrote:

On Thu, Mar 28, 2013 at 5:57 AM, Rob nom...@example.com wrote:
 so you will need to write an adaptive
 algorithm that recognizes what is happening here, and send the queries
 quickly enough (I would say at least two per second, maybe 4) to force
 the active user algorithm to kick in.

Sending at a rate of more than 1 packet every 2 seconds or more than 8
packets per 64 seconds will trigger KOD responses.


 Perhaps these wake-up packets could be some other UDP packet, like a
 Ping, and not to some time server, but to some other internet address,
 like www.microsoft.com (not really!).  If I understand Rob's
 suggestion, all that is needed is some kind of activity to wake up the
 radio/internet channel, not necessarily NTP activity.

That is right, you can just use ping to an address that you know responds
to pings (the NTP server might block pings), or you could fetch the
homepage of your website via TCP, whatever action that causes a quick
packet exchange of more than typically 4 packets will do it.

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-29 Thread Charles Elliott
In the US, the stratum 2 time servers are much less used than the stratum 1
servers, and they dispense fairly accurate time.  The stratum 1 time servers
frequently have erratic and lengthy processing delays.  You can find time
servers here http://support.ntp.org/bin/view/Servers/WebHome
and finding ones near you is well worth the effort.  Nothing will help
though if your neighbor decides to download a movie or two.

Charles Elliott

 -Original Message-
 From: questions-bounces+elliott.ch=verizon@lists.ntp.org
 [mailto:questions-bounces+elliott.ch=verizon@lists.ntp.org] On
 Behalf Of Magnus Danielson
 Sent: Thursday, March 28, 2013 8:32 AM
 To: questions@lists.ntp.org
 Subject: Re: [ntp:questions] NIST vs. pool.ntp.org ?
 
 Hi again Robert,
 
 On 03/28/2013 04:22 AM, Robert Scott wrote:
  On Thu, 28 Mar 2013 02:50:17 GMT, unruhun...@invalid.ca  wrote:
  You really should read my posts before responding.  No, I do not
  intend to hard-code NIST or any other server.  I never said I wanted
  to.  No, the app is not intended for all musicians.  It is intended
  for professional piano tuners only.  I sell about one per day.  And I
  never said the pool would not be good enough for my needs.  I only
  asked about the relative benefits of the pool vs. NIST, which E-mail
  sent...Blacklists answered very nicely.
 
 There is no real benefit in using either, rather you should use the mix
 of servers which gives you good confidence in removing false-tickers as
 well as good precision due to use of short distances.
 
 Look at the NTP code and book, as many of the filtering steps aims at
 removing noise which polute the time and frequency errors. Do the to-
 way
 time-transfer.
 
 Cheers,
 Magnus
 ___
 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] NIST vs. pool.ntp.org ?

2013-03-29 Thread Richard B. Gilbert

On 3/28/2013 8:22 AM, Magnus Danielson wrote:

On 03/27/2013 10:45 PM, David Woolley wrote:

Robert Scott wrote:

I am confused about the proper usage of pool.ntp.org and NIST.
pool.ntp.org seems to be a collection of private sector time servers
offered for all to use, but with registration expected for regular


The pool system has no provision for enforcing registration. It wouldn't
make sense to hand out a random server address if most of them then
refused to serve you because you hadn't registered.


users. And NIST has a government run set of time servers. Neither
group (NIST or pool.ntp.org) seems to include or referece the other.


I would hope all the pool servers ultimately reference their national
equivalent of NIST and therefore what becomes, after the fact, UTC.

I think you will find that Navstar (GPS) and WWV times are traceable to
NIST.


Yes and no.

GPS is traceable to USNO. USNO and NIST have traceability between each
other within the BIPM framework.


MSF times are traceable to NPL.


NPL is traceable to both USNO and NIST within the BIPM framework.


Are they in competition? Who normally uses the NIST servers and who
uses pool.ntp.org?


The open NIST servers are heavily overloaded, so probably don't serve
the highest quality time, but they are likely to be around for a long
time.


I would setup a local server under your control. It will help both from
debugging and noise perspective.

Cheers,
Magnus


If you really want the best time, consider a GPS Timing Receiver.  The 
GPS Timing Receiver should give you a tick that's +- 50 nanoseconds. 
If you need better, you will need your own atomic clock!  It also 
gives you the value of that tick; e.g. 4:03:32. . . . .


Many of us here do not actually need +/- 50 nanoseconds.  What I DID 
want was to have all the clocks in all the clocks in the house in 
agreement! It's not perfect but it's close enough. . . .


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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-28 Thread Marco Marongiu

Il 03/27/2013 10:24 PM, unruh ha scritto:

You do NOT want to hard code anything into your program. That is
extremely bad form, unless that address is one controlled by you.


Indeed. Robert, please see:

http://en.wikipedia.org/wiki/NTP_server_misuse_and_abuse

and in particular:

http://en.wikipedia.org/wiki/NTP_server_misuse_and_abuse#D-Link_and_Poul-Henning_Kamp

a notable case among already notable cases...

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-28 Thread Rob
Robert Scott no-one@notreal.invalid wrote:
 To achieve 11 ppm accuracy in frequency I need to have a calibration
 time interval that is about 90,000 times as long as the timestamp
 uncertainty.  If the timestamp uncertainty is, say, 100 msec., the
 calibration time period needs to be at least 2.5 hours.  That's where
 my figure of 3 hours comes from.

 I don't think it will difficult for a user of my app to perform this
 calibration.  All he has to do is to ensure Internet connectivity is
 turned on (it could be cell or wi-fi), hit the calibrate button in my
 app, and leave the phone on charge and go to bed.

To achieve an uncertainty below 100ms over connections like that you
will need to do some clever programming where you get multiple time
stamps, measure the roundtriptime on each of them, and discard
outliers before you calculate an average.  The kind of thing that ntpd
already does.

Radio protocols often use polling to grant the permission to the mobiles
to send, and adaptive polling intervals depending on the recent traffic.
(or they drop clients from the polling list when there is no traffic,
offering some method for them to join again)

The result is that when you start traffic on an otherwise idle client,
you will observe roundtrip intervals like this:

time=531 ms
time=500 ms
time=540 ms
time=874 ms
time=99.7 ms
time=101 ms
time=96.3 ms
time=97.3 ms
time=101 ms
time=96.9 ms
time=102 ms
time=102 ms
time=97.4 ms
time=102 ms
time=103 ms

in this example, the first four exchanges were with the device still
in idle mode and only then the cell network (UMTS in this case)
decided to step down the polling interval on that client, and from
the fifth one the roundtriptime is pretty consistent.  you will need
to discard those first 4 samples and then calculate an average over
a couple more.
however, that 4 is not a constant!  it depends on parameters and
circumstances beyond your control.  so you will need to write an adaptive
algorithm that recognizes what is happening here, and send the queries
quickly enough (I would say at least two per second, maybe 4) to force
the active user algorithm to kick in.

even then, I have seen links (e.g. over WiFi) where a stable state
is never reached and varying roundtriptimes between nearly zero and
about 200ms are seen no matter how often and how frequently you ping
over them.

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-28 Thread Magnus Danielson

On 03/27/2013 10:45 PM, David Woolley wrote:

Robert Scott wrote:

I am confused about the proper usage of pool.ntp.org and NIST.
pool.ntp.org seems to be a collection of private sector time servers
offered for all to use, but with registration expected for regular


The pool system has no provision for enforcing registration. It wouldn't
make sense to hand out a random server address if most of them then
refused to serve you because you hadn't registered.


users. And NIST has a government run set of time servers. Neither
group (NIST or pool.ntp.org) seems to include or referece the other.


I would hope all the pool servers ultimately reference their national
equivalent of NIST and therefore what becomes, after the fact, UTC.

I think you will find that Navstar (GPS) and WWV times are traceable to
NIST.


Yes and no.

GPS is traceable to USNO. USNO and NIST have traceability between each 
other within the BIPM framework.



MSF times are traceable to NPL.


NPL is traceable to both USNO and NIST within the BIPM framework.


Are they in competition? Who normally uses the NIST servers and who
uses pool.ntp.org?


The open NIST servers are heavily overloaded, so probably don't serve
the highest quality time, but they are likely to be around for a long time.


I would setup a local server under your control. It will help both from 
debugging and noise perspective.


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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-28 Thread Magnus Danielson

Hi again Robert,

On 03/28/2013 04:22 AM, Robert Scott wrote:

On Thu, 28 Mar 2013 02:50:17 GMT, unruhun...@invalid.ca  wrote:
You really should read my posts before responding.  No, I do not
intend to hard-code NIST or any other server.  I never said I wanted
to.  No, the app is not intended for all musicians.  It is intended
for professional piano tuners only.  I sell about one per day.  And I
never said the pool would not be good enough for my needs.  I only
asked about the relative benefits of the pool vs. NIST, which E-mail
sent...Blacklists answered very nicely.


There is no real benefit in using either, rather you should use the mix 
of servers which gives you good confidence in removing false-tickers as 
well as good precision due to use of short distances.


Look at the NTP code and book, as many of the filtering steps aims at 
removing noise which polute the time and frequency errors. Do the to-way 
time-transfer.


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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-28 Thread Robert Scott
On 28 Mar 2013 09:57:37 GMT, Rob nom...@example.com wrote:


To achieve an uncertainty below 100ms over connections like that you
will need to do some clever programming where you get multiple time
stamps, measure the roundtriptime on each of them, and discard
outliers before you calculate an average.  The kind of thing that ntpd
already does.

If I could use a packaged implementation of NTP I would.  But I don't
have that option.  If I understand correctly, packaged implementations
of NTP are designed specifically for setting the system time.  I
cannot impose that effect on users of my app.  My app must be
stand-alone and not attempt to affect the system time.  So I will have
to take the algorithms and basic ideas of NTP and re-implement them in
a stand-along fashion.  In any case the language of implementation
will have to depend on the target: Java for Android devices,
Objective-C for iPhones.


Radio protocols often use polling to grant the permission to the mobiles
to send, and adaptive polling intervals depending on the recent traffic.
(or they drop clients from the polling list when there is no traffic,
offering some method for them to join again)

The result is that when you start traffic on an otherwise idle client,
you will observe roundtrip intervals like this:

time=531 ms
time=500 ms
time=540 ms
time=874 ms
time=99.7 ms
time=101 ms
time=96.3 ms
time=97.3 ms
time=101 ms
time=96.9 ms
time=102 ms
time=102 ms
time=97.4 ms
time=102 ms
time=103 ms

Are these exchanges all with the same Time Server?  I thought good
citizen use of these Time Servers required at least 4 seconds
inbetween queries.  Or does the start-up polling time penalty only
once even if every query is to a different Time Server?


in this example, the first four exchanges were with the device still
in idle mode and only then the cell network (UMTS in this case)
decided to step down the polling interval on that client, and from
the fifth one the roundtriptime is pretty consistent.  you will need
to discard those first 4 samples and then calculate an average over
a couple more.
however, that 4 is not a constant!  it depends on parameters and
circumstances beyond your control.  so you will need to write an adaptive
algorithm that recognizes what is happening here, and send the queries
quickly enough (I would say at least two per second, maybe 4) to force
the active user algorithm to kick in.

even then, I have seen links (e.g. over WiFi) where a stable state
is never reached and varying roundtriptimes between nearly zero and
about 200ms are seen no matter how often and how frequently you ping
over them.

In those cases how asymmetric is the polling delay likely to be if I
just take the midpoint of the polling interval, just like NTP?  I
realize that it is possible to be extremely assymetric, but in
practice?

Robert Scott
Hopkins, MN

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-28 Thread Rob
Robert Scott no-one@notreal.invalid wrote:
 On 28 Mar 2013 09:57:37 GMT, Rob nom...@example.com wrote:


To achieve an uncertainty below 100ms over connections like that you
will need to do some clever programming where you get multiple time
stamps, measure the roundtriptime on each of them, and discard
outliers before you calculate an average.  The kind of thing that ntpd
already does.

 If I could use a packaged implementation of NTP I would.  But I don't
 have that option.

I understand that, I only want you to know that you need to implement a
clever filter just like in ntpd or else you will have a problem.

 Are these exchanges all with the same Time Server?  I thought good
 citizen use of these Time Servers required at least 4 seconds
 inbetween queries.  Or does the start-up polling time penalty only
 once even if every query is to a different Time Server?

That is a complicating factor.   You need to cause some traffic to
kick the link into faster action but you don't want to cause trouble
with the Time Server admin (who may have set an access rule that blocks
you when you send a burst of requests).
You can instead ping something that you know responds to pings, e.g.
send 10 requests at .25 second intervals, and then immediately request
the time from a timeserver.  The link does not look at what system
you communicate with, it only checks if there is a certain number of
packets per second to see if you are active.

even then, I have seen links (e.g. over WiFi) where a stable state
is never reached and varying roundtriptimes between nearly zero and
about 200ms are seen no matter how often and how frequently you ping
over them.

 In those cases how asymmetric is the polling delay likely to be if I
 just take the midpoint of the polling interval, just like NTP?  I
 realize that it is possible to be extremely assymetric, but in
 practice?

Very asymmetric.  The access point can always transmit when it likes,
the clients have to wait for the access point to tell them that they
can have a go.  It varies widely between implementations.  It can be
like the behaviour shown for UMTS, or it can be that the access point
polls at some fixed interval (that you aren't synchronous to) so
you will see variation between 0 and that interval, only in the
direction client-server.

Maybe for your application it would be wise to check the roundtriptime
only to see if it has already fallen from some initial high value,
but not to use it in the calculation of real time (i.e. don't take
a midpoint between request and reply).
That is because excessive and variable delays are more likely to
occur on the uplink than on the downlink.

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-28 Thread Robert Scott
On 28 Mar 2013 13:37:50 GMT, Rob nom...@example.com wrote:



Maybe for your application it would be wise to check the roundtriptime
only to see if it has already fallen from some initial high value,
but not to use it in the calculation of real time (i.e. don't take
a midpoint between request and reply).
That is because excessive and variable delays are more likely to
occur on the uplink than on the downlink.

I think what I may do is make the most conservative assumption about
the assymetry, i.e. that it is as bad as possible.  Then calculate the
precision based on the round-trip time.  If the round-trip time is
small enough then I don't care about the asymmetry.  Since the overall
calibration period is under my control, and is only limited by the
time the user leaves his phone on charge overnight, I could
potentially wait for 7 or 8 hours before taking my final time-stamp
reading.  That will relax the time-stamp precision to something more
like 280 msec.

Robert Scott
Hopkins, MN


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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-28 Thread Trevor Woerner
On Thu, Mar 28, 2013 at 5:57 AM, Rob nom...@example.com wrote:
 so you will need to write an adaptive
 algorithm that recognizes what is happening here, and send the queries
 quickly enough (I would say at least two per second, maybe 4) to force
 the active user algorithm to kick in.

If he sends requests too fast when the latency is so high, isn't there
a chance they'll just get combined due to Nagle which will throw off
his calculations even more?
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-28 Thread Rob
Trevor Woerner twoer...@gmail.com wrote:
 On Thu, Mar 28, 2013 at 5:57 AM, Rob nom...@example.com wrote:
 so you will need to write an adaptive
 algorithm that recognizes what is happening here, and send the queries
 quickly enough (I would say at least two per second, maybe 4) to force
 the active user algorithm to kick in.

 If he sends requests too fast when the latency is so high, isn't there
 a chance they'll just get combined due to Nagle which will throw off
 his calculations even more?

This is UDP, not TCP.

Of course there is not much point in shotgunning requests when there
is no reply.  First attempt could be to send a new request only after
the first reply has been received, but I am not sure this will always
guarantee the radio link goes to active mode.  Maybe send 3 requests
at .25 or .5 second intervals ant then wait until at least one reply
comes back.

With GPRS it sometimes takes several seconds for the first replies to
come back.

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-28 Thread steven Sommars
A report on UTC(NIST) - UTC(USNO) can be found at
http://tf.boulder.nist.gov/general/pdf/2663.pdf



On Thu, Mar 28, 2013 at 7:22 AM, Magnus Danielson 
mag...@rubidium.dyndns.org wrote:

 On 03/27/2013 10:45 PM, David Woolley wrote:

 Robert Scott wrote:

 I am confused about the proper usage of pool.ntp.org and NIST.
 pool.ntp.org seems to be a collection of private sector time servers
 offered for all to use, but with registration expected for regular


 The pool system has no provision for enforcing registration. It wouldn't
 make sense to hand out a random server address if most of them then
 refused to serve you because you hadn't registered.

  users. And NIST has a government run set of time servers. Neither
 group (NIST or pool.ntp.org) seems to include or referece the other.


 I would hope all the pool servers ultimately reference their national
 equivalent of NIST and therefore what becomes, after the fact, UTC.

 I think you will find that Navstar (GPS) and WWV times are traceable to
 NIST.


 Yes and no.

 GPS is traceable to USNO. USNO and NIST have traceability between each
 other within the BIPM framework.


  MSF times are traceable to NPL.


 NPL is traceable to both USNO and NIST within the BIPM framework.


  Are they in competition? Who normally uses the NIST servers and who
 uses pool.ntp.org?


 The open NIST servers are heavily overloaded, so probably don't serve
 the highest quality time, but they are likely to be around for a long
 time.


 I would setup a local server under your control. It will help both from
 debugging and noise perspective.

 Cheers,
 Magnus

 __**_
 questions mailing list
 questions@lists.ntp.org
 http://lists.ntp.org/listinfo/**questionshttp://lists.ntp.org/listinfo/questions

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-28 Thread Harlan Stenn
On Thu, Mar 28, 2013 at 5:57 AM, Rob nom...@example.com wrote:
 so you will need to write an adaptive
 algorithm that recognizes what is happening here, and send the queries
 quickly enough (I would say at least two per second, maybe 4) to force
 the active user algorithm to kick in.

Sending at a rate of more than 1 packet every 2 seconds or more than 8
packets per 64 seconds will trigger KOD responses.

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-28 Thread Robert Scott
On Thu, 28 Mar 2013 21:21:55 GMT, Harlan Stenn st...@ntp.org wrote:

On Thu, Mar 28, 2013 at 5:57 AM, Rob nom...@example.com wrote:
 so you will need to write an adaptive
 algorithm that recognizes what is happening here, and send the queries
 quickly enough (I would say at least two per second, maybe 4) to force
 the active user algorithm to kick in.

Sending at a rate of more than 1 packet every 2 seconds or more than 8
packets per 64 seconds will trigger KOD responses.


Perhaps these wake-up packets could be some other UDP packet, like a
Ping, and not to some time server, but to some other internet address,
like www.microsoft.com (not really!).  If I understand Rob's
suggestion, all that is needed is some kind of activity to wake up the
radio/internet channel, not necessarily NTP activity.

Robert Scott
Hopkins, MN

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-28 Thread David Woolley

Robert Scott wrote:



If I could use a packaged implementation of NTP I would.  But I don't
have that option.  If I understand correctly, packaged implementations
of NTP are designed specifically for setting the system time.  I


The interface to the OS clock is fairly well abstracted for portability 
reasons.  If you forego the kernel time discipline, you should be able 
to modify an offset from system time, rather than the system time 
itself, although the fact that ntpd really controls frequency may be a 
bit of a problem, as you can only really fake offset.


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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-28 Thread unruh
On 2013-03-28, Robert Scott no-one@notreal.invalid wrote:
 On 28 Mar 2013 09:57:37 GMT, Rob nom...@example.com wrote:


To achieve an uncertainty below 100ms over connections like that you
will need to do some clever programming where you get multiple time
stamps, measure the roundtriptime on each of them, and discard
outliers before you calculate an average.  The kind of thing that ntpd
already does.

 If I could use a packaged implementation of NTP I would.  But I don't
 have that option.  If I understand correctly, packaged implementations
 of NTP are designed specifically for setting the system time.  I
 cannot impose that effect on users of my app.  My app must be
 stand-alone and not attempt to affect the system time.  So I will have
 to take the algorithms and basic ideas of NTP and re-implement them in
 a stand-along fashion.  In any case the language of implementation
 will have to depend on the target: Java for Android devices,
 Objective-C for iPhones.

Well, you could always tell ntpd not to use the outside sources to set
the time. 




Radio protocols often use polling to grant the permission to the mobiles
to send, and adaptive polling intervals depending on the recent traffic.
(or they drop clients from the polling list when there is no traffic,
offering some method for them to join again)

The result is that when you start traffic on an otherwise idle client,
you will observe roundtrip intervals like this:

time=531 ms
time=500 ms
time=540 ms
time=874 ms
time=99.7 ms
time=101 ms
time=96.3 ms
time=97.3 ms
time=101 ms
time=96.9 ms
time=102 ms
time=102 ms
time=97.4 ms
time=102 ms
time=103 ms

 Are these exchanges all with the same Time Server?  I thought good
 citizen use of these Time Servers required at least 4 seconds
 inbetween queries.  Or does the start-up polling time penalty only
 once even if every query is to a different Time Server?


in this example, the first four exchanges were with the device still
in idle mode and only then the cell network (UMTS in this case)
decided to step down the polling interval on that client, and from
the fifth one the roundtriptime is pretty consistent.  you will need
to discard those first 4 samples and then calculate an average over
a couple more.
however, that 4 is not a constant!  it depends on parameters and
circumstances beyond your control.  so you will need to write an adaptive
algorithm that recognizes what is happening here, and send the queries
quickly enough (I would say at least two per second, maybe 4) to force
the active user algorithm to kick in.

even then, I have seen links (e.g. over WiFi) where a stable state
is never reached and varying roundtriptimes between nearly zero and
about 200ms are seen no matter how often and how frequently you ping
over them.

 In those cases how asymmetric is the polling delay likely to be if I
 just take the midpoint of the polling interval, just like NTP?  I
 realize that it is possible to be extremely assymetric, but in
 practice?

 Robert Scott
 Hopkins, MN


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


[ntp:questions] NIST vs. pool.ntp.org ?

2013-03-27 Thread Robert Scott
I am confused about the proper usage of pool.ntp.org and NIST.
pool.ntp.org seems to be a collection of private sector time servers
offered for all to use, but with registration expected for regular
users.  And NIST has a government run set of time servers.  Neither
group (NIST or pool.ntp.org) seems to include or referece the other.
Are they in competition?  Who normally uses the NIST servers and who
uses pool.ntp.org?

I posted here several months ago about my specific application.  I
want to use SNTP, not to synchronize a system clock but to make a
frequency measurement on the audio sampling rate in a smartphone.  My
use of time servers will be very occasional - typically a user of my
app would only use the time servers once when the app is first
installed to do a calibration of the audio sampling rate in that
phone.  And my app will have very limited circulation.  So I won't be
hitting the servers very often at all.

Today I found the last bug that prevented me from getting response
from the time servers in my socket code.  I had neglected to set the
port number (123) using htons(123) to put the port number in network
byte order.  When I fixed that I finally started getting responses.

I have gotten responses from pool.ntp.org as well as several of the
NIST time servers listed on their website.  However the round-robin
address of time.nist.gov does not seem to return anything.  The recv()
function just times out.  And I sure don't want to hard-code any of
the other NIST server URLs in my app.  I was going to go with
pool.ntp.org until I saw the NIST servers that did not seem to be part
of the pool.

So I guess my main question is which servers should I use for my very
limited application?

Robert Scott
Hopkins, MN

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-27 Thread Richard B. Gilbert

On 3/27/2013 3:20 PM, Robert Scott wrote:

I am confused about the proper usage of pool.ntp.org and NIST.
pool.ntp.org seems to be a collection of private sector time servers
offered for all to use, but with registration expected for regular
users.  And NIST has a government run set of time servers.  Neither
group (NIST or pool.ntp.org) seems to include or referece the other.
Are they in competition?  Who normally uses the NIST servers and who
uses pool.ntp.org?

I posted here several months ago about my specific application.  I
want to use SNTP, not to synchronize a system clock but to make a
frequency measurement on the audio sampling rate in a smartphone.  My
use of time servers will be very occasional - typically a user of my
app would only use the time servers once when the app is first
installed to do a calibration of the audio sampling rate in that
phone.  And my app will have very limited circulation.  So I won't be
hitting the servers very often at all.

Today I found the last bug that prevented me from getting response
from the time servers in my socket code.  I had neglected to set the
port number (123) using htons(123) to put the port number in network
byte order.  When I fixed that I finally started getting responses.

I have gotten responses from pool.ntp.org as well as several of the
NIST time servers listed on their website.  However the round-robin
address of time.nist.gov does not seem to return anything.  The recv()
function just times out.  And I sure don't want to hard-code any of
the other NIST server URLs in my app.  I was going to go with
pool.ntp.org until I saw the NIST servers that did not seem to be part
of the pool.

So I guess my main question is which servers should I use for my very
limited application?

Robert Scott
Hopkins, MN



I think you need to start by defining the quality of time you need.  Is
4:13 PM Eastern Timegood enough?  Some people just want to Get me to 
the church on time!  OR the bus, or the train or plane.  A radio 
astronomer is almost certainly going to insist on time to the nearest 
nano second.


Most of the range above is probably going to be overkill for most people.

Please try to define your requirements a little more closely! 
Nano-seconds, get me to the church/train/plane . . . . on time!  or 
something else.


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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-27 Thread E-Mail Sent to this address will be added to the BlackLists
Robert Scott wrote:
 I am confused about the proper usage of pool.ntp.org and NIST.

NIST isn't of much value outside the continental US,
 other regional equivalent national time and frequency
 standards closer to the point of usage should have much
 greater value for those that run Stratum One NTP Servers.

 Regional / National / Country time  frequency standard services
  typically have cesium beam atomic clocks, hydrogen maser atomic clocks,
  caesium fountain atomic clocks, rubidium gas cells, ...

 e.g. Places like these http://en.wikipedia.org/wiki/Radio_clock
 CSIRO National Measurement Laboratory, Melbourne  Sydney, Australia
 Canadian Meteorological Centre, Dorval, Québec, Canada
 Integrated Systems Laboratory, Swiss Fed. Inst. of Technology, Zurich, 
Switzerland
 CSTV of National Research Council, Torino, Italy
 New Delhi, National Physical Laboratory of India
 National Institute of Information and Communications Technology, Tokyo, Japan
 SP Swedish National Testing and Research Institute, Boras, Sweden
 NPL Time and Frequency Services National Physical Laboratory Middlesex UK
 NIST National Institute of Standards and Technology US
 ...

NIST (and other national equivilants) are usually used by Stratum One Servers
 {that have Local Stratum Zero Reference clocks, e.g. GPS}
 that provide NTP service to many (hundreds ?) of clients
 e.g. Corporate NTP servers providing service to their LAN clients,
  College NTP servers providing service to classroom and dorm clients,
  ...


 pool.ntp.org seems to be a collection of private sector
  time servers offered for all to use, but with registration
  expected for regular users.

The Vendor Pool? www.pool.ntp.org/en/vendors.html
 That is due to the several vendors   (NetGear, SMC, DLink, Tardis)
  who (unintentionally) had poor implementations / bugs in their
  ntp code that hammered ntp server farms to death.
 e.g. http://en.wikipedia.org/wiki/NTP_server_misuse_and_abuse

It allow them to more easily identify (and hopefully contact)
 a source of abuse, as well as being able to shift or spread
 the source of abuse to prevent it from DDOS taking down
 NTP servers, Networks, ISPs, ...


 the round-robin address of time.nist.gov does not seem to return anything.

Sound like you are not dealing with CNames correctly?

Question:
   Name=time.nist.gov, QTYPE=A, QCLASS=1
Answer Section:
- Name=time.nist.gov
Type=CNAME, Class=1, TTL=1145 (19 Minutes 5 Seconds), RDLENGTH=10
CNAME=ntp.glb.nist.gov
- Name=ntp.glb.nist.gov
Type=A, Class=1, TTL=101 (1 Minute 41 Seconds), RDLENGTH=4
IP Address=216.171.120.36


Question:
   Name=time.nist.gov, QTYPE=A, QCLASS=1
Answer Section:
- Name=time.nist.gov
Type=CNAME, Class=1, TTL=777 (12 Minutes 57 Seconds), RDLENGTH=10
CNAME=ntp.glb.nist.gov
- Name=ntp.glb.nist.gov
Type=A, Class=1, TTL=518 (8 Minutes 38 Seconds), RDLENGTH=4
IP Address=64.236.96.53


Question:
   Name=time.nist.gov, QTYPE=A, QCLASS=1
Answer Section:
- Name=time.nist.gov
Type=CNAME, Class=1, TTL=746 (12 Minutes 26 Seconds), RDLENGTH=10
CNAME=ntp.glb.nist.gov
- Name=ntp.glb.nist.gov
Type=A, Class=1, TTL=598 (9 Minutes 58 Seconds), RDLENGTH=4
IP Address=128.138.141.172


...


 ...I saw the NIST servers that did not seem to be part of the pool.

Many (but not all) are.  {I see them in there all the time.}

For a brief test, set your floor to 1,
 and it will be easier for you to notice them.


-- 
E-Mail Sent to this address blackl...@anitech-systems.com
  will be added to the BlackLists.

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-27 Thread unruh
On 2013-03-27, Robert Scott no-one@notreal.invalid wrote:
 I am confused about the proper usage of pool.ntp.org and NIST.
 pool.ntp.org seems to be a collection of private sector time servers
 offered for all to use, but with registration expected for regular
 users.  And NIST has a government run set of time servers.  Neither
 group (NIST or pool.ntp.org) seems to include or referece the other.
 Are they in competition?  Who normally uses the NIST servers and who
 uses pool.ntp.org?



 I posted here several months ago about my specific application.  I
 want to use SNTP, not to synchronize a system clock but to make a
 frequency measurement on the audio sampling rate in a smartphone.  My
 use of time servers will be very occasional - typically a user of my
 app would only use the time servers once when the app is first
 installed to do a calibration of the audio sampling rate in that
 phone.  And my app will have very limited circulation.  So I won't be
 hitting the servers very often at all.

 Today I found the last bug that prevented me from getting response
 from the time servers in my socket code.  I had neglected to set the
 port number (123) using htons(123) to put the port number in network
 byte order.  When I fixed that I finally started getting responses.

 I have gotten responses from pool.ntp.org as well as several of the
 NIST time servers listed on their website.  However the round-robin
 address of time.nist.gov does not seem to return anything.  The recv()
 function just times out.  And I sure don't want to hard-code any of
 the other NIST server URLs in my app.  I was going to go with
 pool.ntp.org until I saw the NIST servers that did not seem to be part
 of the pool.

You do NOT want to hard code anything into your program. That is
extremely bad form, unless that address is one controlled by you. (Ie,
if you want, you can set up your own ntp server, controlled by a GPS
say, and hard code that IP into your design), but you must not do that
for anyone else. It is far far too easy to have a bug in your system
(sounds likely since it has taken you so long to get your system running
at all-- ie there were already bugs) which will then swamp the server
you are using. If you swamp yourself, that is fine-- you suffer from
your own errors. If you swamp NIST, you are destroying a public
resource. 



 So I guess my main question is which servers should I use for my very
 limited application?

 Robert Scott
 Hopkins, MN


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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-27 Thread David Woolley

Robert Scott wrote:

I am confused about the proper usage of pool.ntp.org and NIST.
pool.ntp.org seems to be a collection of private sector time servers
offered for all to use, but with registration expected for regular


The pool system has no provision for enforcing registration.  It 
wouldn't make sense to hand out a random server address if most of them 
then refused to serve you because you hadn't registered.



users.  And NIST has a government run set of time servers.  Neither
group (NIST or pool.ntp.org) seems to include or referece the other.


I would hope all the pool servers ultimately reference their national 
equivalent of NIST and therefore what becomes, after the fact, UTC.


I think you will find that Navstar (GPS) and WWV times are traceable to 
NIST.


MSF times are traceable to NPL.



Are they in competition?  Who normally uses the NIST servers and who
uses pool.ntp.org?


The open NIST servers are heavily overloaded, so probably don't serve 
the highest quality time, but they are likely to be around for a long time.


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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-27 Thread Robert Scott
On Wed, 27 Mar 2013 13:40:28 -0700, E-Mail Sent to this address will
be added to the BlackLists Null@BlackList.Anitech-Systems.invalid
wrote:

Robert Scott wrote:
 I am confused about the proper usage of pool.ntp.org and NIST.

NIST isn't of much value outside the continental US,


Ah, good point.  I do have international customers.  So I will go with
the pool.

Robert Scott
Hopkins, MN

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-27 Thread Robert Scott
On Wed, 27 Mar 2013 16:14:53 -0400, Richard B. Gilbert
rgilber...@comcast.net wrote:

I think you need to start by defining the quality of time you need.  Is
4:13 PM Eastern Timegood enough?  Some people just want to Get me to 
the church on time!  OR the bus, or the train or plane.  A radio 
astronomer is almost certainly going to insist on time to the nearest 
nano second.

Most of the range above is probably going to be overkill for most people.

Please try to define your requirements a little more closely! 
Nano-seconds, get me to the church/train/plane . . . . on time!  or 
something else.


I did post my requirements a month ago in a thread about calibrating a
piano tuning app using timestamps, and it degenerated into a long
discussion on the accuracy of quartz crystals and the accuracy needed
for piano tuning, which eventually spilled over into comp.dsp.  Please
let's not open that discussion again.  But for those of you that may
have missed it, here are the main points.

I have an app I have been providing to professional piano tuners for
many years.  My competition advertizes an accuracy of 0.02 cents
(which is 11 ppm).  So whether or not you think piano tuning standards
need to be that good, I need to meet that standard to be competitive.
For whatever reason, the manufacturers of smartphones (especially
Android devices) do not hold the audio sample rate of their devices to
that standard.  So I need to provide a way for the user to perform an
initial calibration after the app is installed.  Currently I am doing
that by having the user get a trusted audio frequency source and let
the app listen to it.  One of my competitors actually sends each user
a calibrated tone source/metronome to use in calibrating the app.
This is sometimes difficult for non-tech-savy piano tuners.  I thought
it would be great if I could provide a means to calibrate the app
using network time servers.

The plan is to start up an audio input stream on the smartphone and
timestamp the blocks of data as they are received from the microphone.
The rate of arrival of these blocks of data is tied to the audio
sample rate I wish to determine.  If I timestamp a block of audio
data, then count data blocks for about 3 hours, then timestamp another
block of data I will be able to calculate the audio sample rate.

To achieve 11 ppm accuracy in frequency I need to have a calibration
time interval that is about 90,000 times as long as the timestamp
uncertainty.  If the timestamp uncertainty is, say, 100 msec., the
calibration time period needs to be at least 2.5 hours.  That's where
my figure of 3 hours comes from.

I don't think it will difficult for a user of my app to perform this
calibration.  All he has to do is to ensure Internet connectivity is
turned on (it could be cell or wi-fi), hit the calibrate button in my
app, and leave the phone on charge and go to bed.  The app will only
hit the time servers a couple of times at the beginning of the
calibration period and a couple of times at the end.  In between time
it will just be counting audio data blocks.

Robert Scott
Hopkins, MN

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-27 Thread Jason

On 03/27/13 16:45, David Woolley wrote:

Robert Scott wrote:

I am confused about the proper usage of pool.ntp.org and NIST.

SNIP


I would hope all the pool servers ultimately reference their national
equivalent of NIST and therefore what becomes, after the fact, UTC.

I think you will find that Navstar (GPS) and WWV times are traceable to
NIST.

GPS is traceable to US Naval Observatory, not NIST.

I've not seen a reference that NO and NIST coordinate their time, other 
than that they both contribute to UTC. (Note, according to 
www.time.gov/about.html, USNO and NIST cooperatively provide the 
www.time.gov service.)




MSF times are traceable to NPL.



Are they in competition?  Who normally uses the NIST servers and who
uses pool.ntp.org?


The open NIST servers are heavily overloaded, so probably don't serve
the highest quality time, but they are likely to be around for a long time.


Jason

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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-27 Thread unruh
On 2013-03-27, Richard B. Gilbert rgilber...@comcast.net wrote:
 On 3/27/2013 3:20 PM, Robert Scott wrote:
 I am confused about the proper usage of pool.ntp.org and NIST.
 pool.ntp.org seems to be a collection of private sector time servers
 offered for all to use, but with registration expected for regular
 users.  And NIST has a government run set of time servers.  Neither
 group (NIST or pool.ntp.org) seems to include or referece the other.
 Are they in competition?  Who normally uses the NIST servers and who
 uses pool.ntp.org?

 I posted here several months ago about my specific application.  I
 want to use SNTP, not to synchronize a system clock but to make a
 frequency measurement on the audio sampling rate in a smartphone.  My
 use of time servers will be very occasional - typically a user of my
 app would only use the time servers once when the app is first
 installed to do a calibration of the audio sampling rate in that
 phone.  And my app will have very limited circulation.  So I won't be
 hitting the servers very often at all.

 Today I found the last bug that prevented me from getting response
 from the time servers in my socket code.  I had neglected to set the
 port number (123) using htons(123) to put the port number in network
 byte order.  When I fixed that I finally started getting responses.

 I have gotten responses from pool.ntp.org as well as several of the
 NIST time servers listed on their website.  However the round-robin
 address of time.nist.gov does not seem to return anything.  The recv()
 function just times out.  And I sure don't want to hard-code any of
 the other NIST server URLs in my app.  I was going to go with
 pool.ntp.org until I saw the NIST servers that did not seem to be part
 of the pool.

 So I guess my main question is which servers should I use for my very
 limited application?

 Robert Scott
 Hopkins, MN


 I think you need to start by defining the quality of time you need.  Is
 4:13 PM Eastern Timegood enough?  Some people just want to Get me to 
 the church on time!  OR the bus, or the train or plane.  A radio 
 astronomer is almost certainly going to insist on time to the nearest 
 nano second.

 Most of the range above is probably going to be overkill for most people.

 Please try to define your requirements a little more closely! 
 Nano-seconds, get me to the church/train/plane . . . . on time!  or 
 something else.


He wants to calibrate the onboard clock on a  cellphone/tablet to about
10PPM for an app he is writing to act as a tuner which is supposed to be
better than 1 cent in its tuning ability. He is willing to spend a few
hours on this (ie, the time accuracy needs to be about 10-100 ms), but then let 
the clock freewheel except perhaps an
occasional check that the calibration is still good.
At least that is how I understand it.

This app is to be sold to every musician in the world, and he is
wondering whether he should hard code the NIST IP into the phone to use
as an ntp server. (NONONONONO) or perhaps use the pool. I think he is
worried that since the pool does not apparently use NIST as the source
for the time, that the time in the pool is not good enough. He does not
really understand ntp and the pool, and GPS time and thus is worried
that using the pool might not be good enough for his needs. 



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


Re: [ntp:questions] NIST vs. pool.ntp.org ?

2013-03-27 Thread Robert Scott
On Thu, 28 Mar 2013 02:50:17 GMT, unruh un...@invalid.ca wrote:



He wants to calibrate the onboard clock on a  cellphone/tablet to about
10PPM for an app he is writing to act as a tuner which is supposed to be
better than 1 cent in its tuning ability. He is willing to spend a few
hours on this (ie, the time accuracy needs to be about 10-100 ms), but then 
let the clock freewheel except perhaps an
occasional check that the calibration is still good.
At least that is how I understand it.

This app is to be sold to every musician in the world, and he is
wondering whether he should hard code the NIST IP into the phone to use
as an ntp server. (NONONONONO) or perhaps use the pool. I think he is
worried that since the pool does not apparently use NIST as the source
for the time, that the time in the pool is not good enough. He does not
really understand ntp and the pool, and GPS time and thus is worried
that using the pool might not be good enough for his needs. 

You really should read my posts before responding.  No, I do not
intend to hard-code NIST or any other server.  I never said I wanted
to.  No, the app is not intended for all musicians.  It is intended
for professional piano tuners only.  I sell about one per day.  And I
never said the pool would not be good enough for my needs.  I only
asked about the relative benefits of the pool vs. NIST, which E-mail
sent...Blacklists answered very nicely.

Robert Scott
Hopkins, MN

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