Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>In the age of mobile phones that can get the time directly from GPS satellites with sub-100ns accuracy, the isolated hardware clock of a typical server strikes me as an arcane method of keeping time.

Genuinely curious, is it actually true that you can get sub-100ns time accuracy on a mobile phone? Is this because you have a direct connection with the satellite, which is calculating where you are? I would have assumed that the uncertainty on the latency of any such connection would be higher than 100 ns.



GPS satellites don't do any calculating for you, and there is no "direct connection" between the satellite and your phone. The GPS receiver in your phone is purely passive. It uses latency (usually a few dozen milliseconds) to calculate its distance from each satellite.

As long as you have access to at least 4 satellites, triangulation (quadri-angulation?) allows you to determine your precise location in all 4 dimensions, three of space and one of time.


From https://en.wikipedia.org/wiki/GPS#Timekeeping :

GPS time is theoretically accurate to about 14 nanoseconds. However, most receivers lose accuracy in the interpretation of the signals and are only accurate to 100 nanoseconds.


For phones to achieve that the GPS would have to be turned on & synced near constantly. Also the accuracy goes down with mobile devices and new strategies have to be applied given the change in altitude and greater temperature flux. It also depends on the phone's internall oscillator & the gps recv unit used.

Mobile phones use CDMA stuff to sync their clocks, not GPS


GSM phones are supposed to be able to pick up "NITZ" (network information and time zone") messages, but these aren't reliably sent by most networks. In practice, smartphones get it over NTP like everyone else and dumbphones have user-set time that may, if you're lucky, be synced by counting the base station's time slot intervals.


Yes modern smartphones often hardcode ntp servers and prob do ineffective hard resetting. Would be good to know more how they do it.


Things have changed a bit since the last time I had anything to with it, but you can read the Android source code: https://github.com/android/platform_frameworks_base/blob/mas...

NITZ is terrible. You only get one-second accuracy, a GMT offset, and a DST flag, and they can all be wrong at the whim of someone at the phone company.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: