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

unruh unruh at invalid.ca
Thu Mar 28 23:30:54 UTC 2013

On 2013-03-28, Robert Scott <no-one at notreal.invalid> wrote:
> On 28 Mar 2013 09:57:37 GMT, Rob <nomail at 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

More information about the questions mailing list