Who's down with NTP?

Interested in time?A friend of mine is quite interested in accurate time keeping, particular with reference to NTP. You probably know that we got an extra "leap second" added between 31-Dec-2005 and 1-Jan-2006 and he has written a detailed assessment of how the leap second propagated through the NTP network.
The short answer is "not as well as it should have", but I recommend that you look at the lovely graphs.
Your sort of thing right :)
While it would greatly disappoint Tufte, I am and probably always will be a sucker for a pretty graph. So cool, and not just because seeing someone stalk a second with such verve makes me feel better about my own obsessive tendencies...
If you're all confused, NTP stands for Network Time Protocol. General computer clocks have a habit of drifting, due to the frequencies they operate under and how the computer creates the illusion that it has a clue what time and day it is. Long ago, a hierarchal system of servers was created so the correct time could trickle down.
Servers on the second level (Strata Two) derive their time from servers on the first level (Strata One). Strata One servers are generally plugged into the real deal -- special clocks which derive their time via timestamps from a satellite which in turn is deriving its info from something akin to an atomic clock.
In other words, if you have your Mac set to automatically keep itself up to date, it pings time.apple.com, which is a (I believe) second-strata server, which has been keeping itself up to date from a server up the chain. The computer you are using to ping Apple's time server would be part of stratum 3. If you wanted and knew how, you could easily suck down the time from a different server(s) (like time.windows.com or clock2.redhat.com -- do a $man ntpdate) or fire up ntpd daemon and set all the computers on your subnet to derive their time from it.
I'm not going to get into the whole "did the NTP network and possibly the protocol fail us in our leap second of need" deally, because it's way above my pay grade. I primarily just find it amusing how much of the infrastructure in my computing experience I take for granted at this point, and it's probably too easy to view the computer as a magic box so long as it's working.
NTP is something I'm aware of and use, and the leap second has been splashed across every news show I've seen lately, yet it never occurred to me that the protocol had to take it into account, let alone that it might have problems doing so. Yay for reminders our technology is not yet indistinguishable from magic.
Comments (15)
Posted by: Mac-arena the Bored Zo at January 2, 2006 09:58 AM
a couple of links to that manpage: on Apple's website, and locally on your OS X computer.
also, it's 'Who's'.
Posted by: Arden at January 2, 2006 01:35 PM
Hum, did I dream or the nav links that were at the top of each post are no longer here?
In the space of a leap second, you must have blinked, causing them all to jump around like a Mexican jumping bean festival at Starbucks. :D
Posted by: Patrick at January 2, 2006 03:46 PM
You know, I honestly can't say I cared about that one second (on anything more than an academic level). I wonder if my machines will eventually figure it out. I guess when the stratum 1 machines figured it out then other machines were a second out and should've just corrected themselves.
On a side note, here in NZ we have msltime.irl.cri.nz (the CRI means Crown Research Institute, iirc, which means goverment funded or something) which is attached to an atomic clock. It must be a geek thing to be happy about having your own stratum 2 server.
Posted by: Abhi Beckert at January 2, 2006 06:00 PM
"If you wanted and knew how, you could easily suck down the time from a different server(s) (like time.windows.com or clock2.redhat.com -- do a $man ntpdate)"
Um, you just go into system prefs > date & time, and type in a different url in the combo box.
Posted by: drunkenbatman at January 2, 2006 09:05 PM
Hum, did I dream or the nav links that were at the top of each post are no longer here?
They're gone, but you can still get around -- the date archives now work in case you've missed a post.
Um, you just go into system prefs > date & time, and type in a different url in the combo box.
You're correct, and weirdly enough it seems to fire up the ntp daemon. Perhaps I'm just not used to being able to edit a drop-down, as I never even saw it.
Posted by: Troy P at January 2, 2006 11:11 PM
Hey DB, thanks for posting this - I got a kick out of it. When I showed it to Nathanael (author of the article) he hadn't heard of the blog before. I don't think that he had meet many bible salesman who could grok internet time synchronisation previously.
He also wasn't sure if the Tufte reference meant that he needed some more work on his graphs :)
Posted by: Rafe at January 2, 2006 11:49 PM
Shouldn't the plot have a legend? I am seeing two data sets, right?
Posted by: iamboringandproud at January 3, 2006 01:43 AM
on a sidenote, http://ntp.isc.org/ is one of the few sites that doesn't work as intended in safari.
Posted by: Other_Matt at January 3, 2006 01:49 AM
There are some public ntp servers available,
pool.ntp.org should direct you to the nearest local server.
In AU the CSIRO used to have a couple of public ntp servers, but they started moving them around as they were being hammered by too much of the public, and the new addresses they gave seemed to work on and off.
ntp.optus.net.au seems to work from everywhere, but I tend to recommend people not on the Optus network try to find a local one, as is polite.
Posted by: Beat Bolli at January 3, 2006 10:34 AM
Strange, my server log just shows the line
Jan 1 00:59:59 gw kernel: Clock: inserting leap second 23:59:60 UTC
Nothing else. Are the scripts for generating the graphs available, so I could check myself?
Posted by: Doctor Memory at January 3, 2006 11:21 AM
NTP's weird behavior around leap seconds has actually been known for a long time now. The arguments around it are sufficiently abstruse as to be difficult to follow even by reasonably well-informed laymen, but the upshot appears to be that the POSIX standard for handling leap-seconds is ill-defined, and that the ad-hoc solutions for the problem are mired in personality disputes between their various advocates.
(For some reason, DB's comments system is rejecting references to, of all places, g**gle.com as "questionable content". For context on what the actual arguments are, search g**gle groups for "clockspeed vs ntp".)
Posted by: Troy at January 4, 2006 10:24 PM
In case anyone is interested, I spoke to the author and he used the following script to log the data:
He then used a perl script to clean it up, and used excel to make the graphs.
#!/bin/sh
while [ 1 ]; do \
echo -n `date "+%Y-%m-%d %H:%M:%S,` >> /opt/ntp/var/monitor.log; \
ntpq -c rv | tail -n 1 | sed 's/offset=//; s/ frequency=//; s/ jitter=//; s/ stability=//' >> /opt/ntp/var/monitor.log; \
sleep 300
done
Posted by: Michael Madsen at January 5, 2006 01:57 PM
On a strictly unrelated note ....
Remember to vote : http://2006.bloggies.com/
You know who to put on the list ...
Posted by: Hello at January 7, 2006 07:33 AM
From Bris-bane:)
www.its.uq.edu.au/?page=28067&pid=0
www.eecis.udel.edu/~mills/ntp/html/manyopt.html








Hum, did I dream or the nav links that were at the top of each post are no longer here?