Horse Sense #63
 

In this issue:
  • Y2K Returns:  It is About Time!
     
Y2K Returns:  It is About Time!
 
Welcome to the new and improved Daylight Savings Time! Are your computers giving you the correct time? Now is the time to check. Any Pre-Windows XP system is likely to have the wrong time, for example. It would also be a good idea to check your fax machines. Send an e mail to yourself. Check the headers. Are the times correct? If you need help with time, call Iron Horse!
 
Computers are very dependent upon time. The rollover from 1999 to 2000 was especially troublesome as any program or operating system using two digit years would cause a real problem. Would 00 be 1900, 2000, or some other number when the rollover happened? Would an "invalid" number shut down the system, cause it to run in reverse, or cause some other unpredictable action? It took a massive effort worldwide to identify vulnerable systems and correct them. Now, the US and other countries are changing how they implement daylight savings time. In case you haven't reset your clock yet, it happened earlier this year and will end later. If you want to read more about time in the US, go to www.time.gov. Not only will you see the current time, but you will also be able to read all about issues like Daylight Savings Time and how to fix time issues.
 
There are other time related issues that will be coming up. Some systems count time from January 1, 1970 in seconds. For those systems that do so and use a standard 4 byte integer to do the counting, that means they can count up to 2 to the power of 31 seconds (there is one bit reserved for a sign). That means that on Tuesday, January 19 at 03:14:07 of the year 2038 equipment prone to this bug will give the time as Friday, December 13 20:45:52, 1901. Some programs that calculate dates are already giving incorrect values. Any date calculation using seconds since 1/1/1970 will give an incorrect result if the number exceeds 31 bits. If you averaged two dates together, for example, you would start getting errors if your dates were after January of 2004.
 
One of the most important components of any computing device is its timing crystal. Think of this as the drummer counting out time for the computer. Every part of computer performs its actions relative to that beat, like other instruments in a band playing their part of a piece of music. The timing crystal also counts actual time in very small increments. So, in theory, your computer is a very precise time keeping device. Unfortunately, while your computer may be precise, it often is not accurate. Besides issues like the 2038 bug, Y2K, and Daylight Savings Time, a computer will slowly drift off of the correct time because of small differences between the change in true time and the time counted in the machine. For example, over 30 days, a 1 second error in a day is 30 seconds. This represents a 0.001% error. As it turns out, many computing devices will not keep time that accurately.
 
Clocks do not know what time it is unless you first set them. Even if you could set multiple clocks to the same exact time, they will drift away from the true value at varying rates. This can cause huge problems as time can really be money. For example, you sell one million shares of stock at 10:17:22 AM by your computer clock, but by your broker’s clock it was 10:18:27 AM and on the exchange it was 10:18:13 AM. What if the price changed in that time frame? Who is right? You also want your time to be correct so that you can tell when something happened or will happen. It could be very difficult to fix a mail problem when a message you sent seems to arrive 5 minutes before you sent it.
 
To maintain accurate time, the entire world agrees on a reference time called Coordinated Universal Time (previously called Greenwich Mean Time). Devices like atomic clocks are used to deliver very precise reference Coordinated Universal Time. Computers throughout the world access servers synchronized to these time sources through Network Time Protocol (NTP). NTP gets the correct Coordinated Universal Time from a reference time server. NTP also calculates how much time it takes to get that answer and corrects for problem as well. Reference time servers are graded on their ability to provide "true" time. A stratum 1 NTP server would be the closest to true time and is directly tied to a very accurate timing device. These servers tend to be very busy and their operators do not want just anyone asking them for the correct time. Many stratum 1 and even stratum 2 servers are not publicly available. In general, most of us should be using stratum 3 or higher time servers as our reference sources simply because we don’t need that high a degree of time precision. A few thousandths of a second will be just fine. It is not necessary for every machine on your network to get its time directly from a reference time server on the Internet. Once you synchronize one machine on your network to an external time source, you can then have all the other machines on your network match this internal time server. In addition, since clients of the internal time server are most likely in the same time zone, they can pick up that information from the server as well.
 
If you think about it, time zones are only useful to humans. Computers don't care what time of day it is. On very large networks, one might use Coordinated Universal Time for all the devices, even if they are in different time zones. That way, you could synchronize all your logging and graphing so that events matched up around the world. Most of us, however, want our devices on local time so that when someone reports "This happened at 3 pm today," the technician can look at graphs or logs in local time and see what they are talking about.
 
If you want to know more about time or need help using time on your network, call Iron Horse.


©2007 Tony Stirk, Iron Horse tstirk@ih-online.com