News for hackers. Stuff that matters.
Re:One second per second is harder than it sounds by kijin on Tuesday July 22, 2014 @12:19AM (#8067369)
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.

Is there an expansion card or USB device that can get the time from GPS and feed it to something like ntpd (and adjust for leap seconds from data downloded from other networks)? Or would that be impractical because of all the walls and metal cages that surround the typical server? What about an antenna on the roof of the datacenter that supplies GPS time to every server in the building?

Re:One second per second is harder than it sounds by rachelbythebay on Tuesday July 22, 2014 @12:38AM (#8067413)
Datacenter GPS-backed time sources exist. You can get little boxes which sit in a rack and hook to an antenna and feed nice time to the rest of the place. Those other machines pick it up with ntpd.

The problem is when your system clock is so far out of whack (and/or unpredictable) that even ntpd won't help you. Get enough supposedly-identical machines running and this will probably bite you too.

Re:One second per second is harder than it sounds by kastnerkyle on Tuesday July 22, 2014 @02:36AM (#8067626)
This is 100% true. If you have ever watched ntpd ignore a stratum 0 clock (and every other time source) because some stratum 6 device reports the wrong time, you know the pain. Yes, this isn't supposed to happen, and yes it has happened to me many times.
Re:One second per second is harder than it sounds by feld on Tuesday July 22, 2014 @05:41PM (#8071729)
well, you can override ntpd to always sync no matter how far out of whack but it's not recommended

tinker panic 0

Re:One second per second is harder than it sounds by cnvogel on Tuesday July 22, 2014 @09:53AM (#8068961)
While most smartphones, theoretically, could get their time from GPS... do any use this method? As far as I know, my Android handsets get their time via NTP.

Ironically, often a misconfigured NTP server screws up GPS fixes (it somehow seems to be necessary for assisted GPS, which relies on the cooperation of the mobile network or Internet to faster acquire a GPS fix).

http://stackoverflow.com/questions/8308412/gps-how-ntp-time-...

Re:One second per second is harder than it sounds by sp332 on Tuesday July 22, 2014 @12:02PM (#8069662)
I think cell phones get their time from the tower, since they have to sync clocks with the tower to talk to it anyway, and the towers get time from GPS.
Re:One second per second is harder than it sounds by x1798DE on Tuesday July 22, 2014 @03:12AM (#8067688)
>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.

Re:One second per second is harder than it sounds by kijin on Tuesday July 22, 2014 @04:03AM (#8067813)
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.

Re:One second per second is harder than it sounds by adrianb on Tuesday July 22, 2014 @03:38AM (#8067754)
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.

Re:One second per second is harder than it sounds by easytiger on Tuesday July 22, 2014 @04:02AM (#8067811)
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

Re:One second per second is harder than it sounds by pjc50 on Tuesday July 22, 2014 @04:56AM (#8067926)
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.
Re:One second per second is harder than it sounds by easytiger on Tuesday July 22, 2014 @05:50AM (#8068092)
Yes modern smartphones often hardcode ntp servers and prob do ineffective hard resetting. Would be good to know more how they do it.
Re:One second per second is harder than it sounds by enf on Tuesday July 22, 2014 @11:52AM (#8069607)
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.

Re:One second per second is harder than it sounds by pjc50 on Tuesday July 22, 2014 @04:54AM (#8067922)
Yeah, GPS doesn't really work indoors. You can certainly get such devices, or even do it with consumer GPS, but then you have to account for the latency of USB.