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

unruh unruh at invalid.ca
Wed Mar 27 21:24:01 UTC 2013


On 2013-03-27, Robert Scott <no-one at 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
>



More information about the questions mailing list