� Treo 650 - 1st 30 days | Main | G-Men Ballin' �

November 1, 2006

Wonders of NTP

Figured this was timely considering the recent time change. Recently I was asked by a fairly young Linux user if he should be concerned about the upcoming 2007 daylight savings plans recently implemented by congress. Well, I figured that I was now presented with a golden opportunity to explain Network Time Protocol(NTP).

Well, a bit of historical context would be helpful. UNIX and UNIX-like systems (ie Linux, xBSD) have always been capable of networking. In fact, the respective kernels for each of the aforementioned operating systems have relied upon a robust, open TCP/IP stack for quite awhile. I estimate this has been true for at least fifteen-years or more. The NIST serversatomic clocks (no BigBen isn't one of them), are readily accessible via public domain IP addresses.

Though, the Redmond wooly mammoth was slow to reliably network its desktop product. It was widely recognized to have a fairly worthless TCP/IP stack. In fact, all of the products prior to WinXP were very poor in this category(probably many others too). I understand XP was vastly improved due to its 'borrowing' of BSD TCP/IP stack. Gotta love those BSD licenses. I digress.

Some might ask the obvious question, "Why can't I simply rely upon the CMOS battery to keep time on my PC ?" Why indeed.. Well, the computer BIOS is dependent upon your PC CMOS battery. Your battery will never retain the same charge as it did during at time of purchase. As with most batteries, it will eventually lose its floating charge. As the battery weakens, your time will begin to drift and eventually be off several minutes throughout the course of the year.. In some severe cases the degradation is significant and your system could be behind a couple hours.

Well, The reality is that all you must do is point your NTP program at the appropriate server atomic clock. There are thousands of these servers located around the world. These NIST servers clocks _always_ maintain the appropriate time.

Psst. M$ users don't fret, with the advent of XP, you now have access to the same servers atomic clocks too. They've just hidden it from you. If your machine isn't not connected to the internet, it will rely on your CMOS battery and be wrong.. Nothing worse than incorrectly time stamped email ;)

If you're a Linux user you simply need to run NTP server daemon, and manage it in crontab. If you're running any other recent distro(last 10yrs), it probably is already setup.

Bottom Line:
It doesn't matter what daylight savings schedule is presented NTP will solve the problem transparently.

Posted by AG at November 1, 2006 6:28 AM

Trackback Pings

TrackBack URL for this entry:
http://bkaeg.org/cgi-bin/mt/mt-tb.cgi/483

Comments

Good points about NTP. Synchronized time is more and more important across network environments. From the beginning days of TCP/IP on Unix, systems always needed to sync up clocks. NFS was always a problem with this. NFS server has a later time than the client and you go to access files and your system says they were modified in the future! Fun times.

Some things to note. It's daylight saving time, not daylight savings time. :)

Also, the NTP servers are not atomic clocks. They are relayers of official NIST time (well, the NTP servers that pull from NIST are). NIST is maintained as official time in the United States and is guaranteed to be a few nanoseconds off from Coordinated Universal Time.

There is only one atomic clock in the United States. They keep it in Boulder, CO. It's an atomic oscillator. Why? (From the FAQ) Since 1967, the International System of Units (SI) has defined the second as the period equal to 9,192,631,770 cycles of the radiation which corresponds to the transition between two energy levels of the ground state of the Cesium-133 atom. Neat.

The official time you get via NTP will never be equal to the atomic clock because there are loss factors depending on the method of delivery. However, NTP is designed so that your clock can be synchronized with the NTP server's clock and they periodically check each other.

Aside from NTP servers, NIST also distributes time information by shortwave radio. Broadcasting 24 hours a day, 7 days a week from Boulder, CO and Hawaii (radio stations WWV and WWVH). You can pick up the time on 2.5MHz, 5MHz, 10MHz, 15MHz, and 20MHz. You can even buy alarm clocks that set their time this way (I found one for $8 at Target). It's really cool because the alarm clock just changes because the DST signal is broadcast over shortwave.

And if you want to be even more nerdy, you can call one of the radio stations to hear the shortwave broadcast. The Colorado number is 303-499-7111. All you will hear is tick tick tick tick and then a voice says, "AT THE TONE THE TIME WILL BE ______ COORDINATED UNIVERSAL TIME" followed by some whitenoise. The whitenoise is what my alarm clock picks up.

OK, enough about time.

Posted by: David Cantrell at November 1, 2006 5:01 PM

Thx for educating me on the atomic clocks, heck I always thought NIST managed the atomic clocks. Oh well, I stand corrected. I didn't know you could buy alarm clocks that keep time via NIST shortwave. How cool is that? I may have to cop one.

Posted by: AG at November 1, 2006 7:12 PM

No problem. But NIST *does* manage the atomic clock. There is only one for the United States. The NTP network syncs time with the atomic clock, but it's not the atomic clock. Hope that clears things up a bit.

The alarm clock that syncs via shortwave is really cool. You never have to set it! :)

Posted by: David Cantrell at November 2, 2006 12:07 PM