I am developing a GPRS enabled embedded device.To synchronize time with the network I have to use NTP protocol. The nature of the product is such that I have to Hardcode the NTP server address inside the firmware and I cannot change it in future by any means. The estimated quantity of the devices to be sold is in thousand and location is India.

After googling about NTP servers I am not able to figure out which server should I use. The given link mentions about some incidents caused due to wrong NTP client configurations.

NTP Server misuse and abuse

I don't want fall into such trouble please help me choosing correct NTP server Address.

  • 1
    \$\begingroup\$ ntp.[your domain here]. \$\endgroup\$ – Ignacio Vazquez-Abrams Oct 8 '14 at 5:07
  • 6
    \$\begingroup\$ They invented DNS to solve this issue. If you can run NTP, why can't you resolve an address for an NTP server from pool.ntp.org? NTP servers change over time, probably nobody will guarantee their availability at the same IP address over time as DNS is also the common strategy to seamlessly migrate a server to new hardware. \$\endgroup\$ – jippie Oct 8 '14 at 5:32
  • \$\begingroup\$ @jippie - FWIW, I agree, but if you're doing raw TCP stuff, and don't have much program space, hard-coding an IP may be dramatically easier. It's not a good solution, but it is a quick one. \$\endgroup\$ – Connor Wolf Oct 8 '14 at 9:02
  • \$\begingroup\$ Don't know if this applies to your product, but if the time doesn't have to be especially precise (say 10 seconds is OK) every time it connects to the server to transfer data you could just send back the current time and run NTP on the server so the server time doesn't drift too far. \$\endgroup\$ – PeterJ Oct 8 '14 at 10:57
  • \$\begingroup\$ @ConnorWolf perfect solution for addresses in RFC1918 ranges, but not for addresses on the public Internet. Remember that you are a guest user of a public server, a server and Internet uplink that someone else pays good money for and may decide to change it purpose entirely. You should behave accordingly. It is unfair if a hardware developer can spare a few bucks, but a server owner needs to upgrade his data bundle as a result. Remember that many NTP servers are run by volunteers. \$\endgroup\$ – jippie Oct 8 '14 at 20:27

I'd contact ntp.org. They have a pool of public NTP servers with DNS anycast for geographic proximity and are generally able to give good suggestions.

You might be asked to use a subdomain (e.g. Debian uses "debian.pool.ntp.org") so if a malfunction in your devices causes a traffic storm this can be reflected without affecting the rest of the pool.

| improve this answer | |
  • \$\begingroup\$ When located overseas, would 0.us.pool.ntp.org still give accurate results? Does it identify that I'm located far away and adjust accordingly‏‏‏ ? Or must I use the locale version 0.sg.pool.ntp.org? \$\endgroup\$ – Pacerier Jul 28 '15 at 7:27
  • \$\begingroup\$ Network latency is expected to be symmetrical -- ntp will compensate arbitrary delays, but it can only guess by halving the round-trip time. Any jitter on latency is not going to be symmetrical, and ends up being part of the calculation. \$\endgroup\$ – Simon Richter Jul 28 '15 at 12:22

Rolling your own NTP server is quite easy, You can install NTPD on almost any modern computer running Linux. Add a domain name and you are done.

An alternate solution would be to use your cellular provider's timing servers, via the cellular network's control plane messages. This is a bit more complicated solution, but also more accurate.

| improve this answer | |
  • 2
    \$\begingroup\$ But your own NTP server would still need to rely on another NTP server in order for it to be accurate........ \$\endgroup\$ – Pacerier Jul 28 '15 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.