Posts by: Richard N Williams

Configuring Windows 2003 to run as a NTP Network Time Server

  |   By

This article explains how to configure Windows 2003 to run as a Network Time Server.

Time synchronisation in modern computer networks is essential, all computers need to know the time as many applications, from sending an email to storing information are reliant on the PC knowing when the event took place.

Microsoft Windows Server from 2000 onwards has a time synchronisation utility built into the operating system called Windows Time (w32time.exe) which can be configured to operate as a network time server.

Windows 2003 Server can easily set the system clock to use UTC (Coordinated Universal Time, the World’s time standard) by accessing an Internet source (either: time.windows.com or time.nist.gov). To achieve this, a user merely has to double click the clock on their desktop and adjust the settings in the Internet Time tab.

It must be noted however, that Microsoft and other operating system manufacturers strongly advise that external timing references should be used as Internet sources can’t be authenticated.

To configure the Windows Time service to use an external time source, click Start, Run and type regedit then click OK.
Locate the following subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\Type

In the right pane, right-click Type then click Modify, in edit Value type NTP in the Value data box then click OK.

Locate the following subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\AnnounceFlags.

In the right pane, right-click AnnounceFlags and click Modify. The ‘AnnounceFlags’ registry entry indicates whether the server is a trusted time reference, 5 indicates a trusted source so in the Edit DWORD Value box, under Value Data, type 5, then click OK.

Network Time Protocol (NTP) is an Internet protocol used for the transfer of accurate time, providing time information along so that a precise time can be obtained.

To enable the Network Time Protocol; NTPserver, locate and click:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer\

In the right pane, right-click Enabled, then click Modify.

In the Edit DWord Value box, type 1 under Value data, then click OK.

Now go back and click on

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\NtpServer

In the right pane, right-click NtpServer, then Modify, in the Edit DWORD Value under Value Data type In the right pane, right-click NtpServer, then Modify, in the Edit DWORD Value under Value Data type the Domain Name System (DNS), each DNS must be unique and you must append 0x1 to the end of each DNS name otherwise changes will not take effect.

Now click Ok.

Locate and click the following

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient\SpecialPollInterval

In the right pane, right-click SpecialPollInterval, then click Modify.

In the Edit DWORD Value box, under Value Data, type the number of seconds you want for each poll, ie 900 will poll every 15 minutes, then click OK.

To configure the time correction settings, locate:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\config

In the right pane, right-click MaxPosPhaseCorrection, then Modify, in the Edit DWORD Value box, under Base, click Decimal, under Value Data, type a time in seconds such as 3600 (an hour) then click OK.

Now go back and click:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\config

In the right pane, right-click MaxNegPhaseCorrection, then Modify.

In the Edit DWORD box under base, click Decimal, under value data type the time in seconds you want to poll such as 3600 (polls in one hour)

Exit Registry Editor

Now, to restart windows time service, click Start, Run (or alternatively use the command prompt facility) and type:

net stop w32time && net start w32time

And that’s it your time server should be now up and running.

Technology and the Importance of Time

  |   By

Technology and the Importance of Time

This article explores the concept of time, how it is measured and how our technologies have required more and more accurate ways of measuring time.

It is a question that has perplexed philosophers and scientists since the dawn of man, ‘what exactly is time?’ and it has only been in our recent history that we have started to discover answers, thanks to Einstein and his work on special and general relativity.

We now know time is not the abstract concept we first thought it was, we also know it is not constant and is relative to different observers throughout the universe with the speed of light being the only constant in the universe.

In other words if the speed of light has to be the same for everybody then someone travelling at close to such a speed would find time slow down.

Fortunately as all humans live within the boundaries of the planet Earth it means the passing of time is very similar for us all (or so minutely different as to be impossible to measure). However, technologies such as satellites and GPS systems have to take into account this altering state of time otherwise they would become wholly inacurate.

As humans have progressed, telling the time with ever increasing accuracy has become more and more important. Historically, knowing the time was not so imperative. People needed to know the correct day to plant crops or when sunrise and sunset happened but accuracy was not a preoccupation.

However, since the invention of the mechanical clock followed at the turn of the twentieth century by electronic clocks, humans have started to rely on more and more accuracy for their technologies.

Seafaring, aviation and now space travel mean that humans have sought more and more accuarte ways of keeping time.

In the 1950’s atomic clocks were developed which were so accurate it was discovered that the revolution of the Earth, something we had based our timescale on for centuries, was no where near as accurate as these new clocks.

Now technologies such as the Internet, the Global Positioning System and satellite communication requires absolute precision as light can travel 300,000 km every second meaning accuracies of a split second could mean our satellite navigation systems could be out by thousands of miles and computer trading would be nigh on impossible.

Fortunately a global time scale, UTC (Coordinated Universal Time), has been developed and is based on the time told by atomic clocks. This allows systems all over the world to be synchronised to the exact same time.

Computer networks use the NTP protocol (Network Time Protocol) to receive a UTC timing reference and synchronise all machines on a network to that time.

NTP servers can receive a time reference over the Internet (although not very secure) from a national radio transmission (as long as the receiver is within range of a suitable transmission) or from the GPS network (via a rooftop GPS antenna).

Keeping Accurate Time on Linux when Running a NTP Time Server

  |   By

Linux operating systems are becoming increasingly popular partly due to the many advantages they have over commercial systems like Windows or OS X. Linux offers increased security (as there are only a handful of viruses that can infect a Linux based system), better stability and in most cases it is free.

It is no wonder more and more home and business users alike are opting to switch to a Linux based operating systems and whether it is Redhat, Mandrake, Ubuntu or the myriad of other UNIX and LINUX based systems, keeping accurate time is relatively straight forward.

Time synchronisation is vital in many time-sensitive applications and most business users find it would be impossible to conduct any online transactions without a synchronized network. Even home-users find an advantage in ensuring their system is running accurate time, emails no longer arrive before they are sent and security is increased.

Most Linux based operating systems contain a version of Network Time Protocol (NTP) an Internet protocol designed to synchronise time on a network. For those that do not contain a pre-packed version, NTP is open source and freely available at ‘ntp.org’.

While NTP is available for most versions of Windows; Linux users have the advantage in that it has traditionally been the primary development platform for NTP. It works by using a timing source either from the Internet or via a dedicated network time server.
These reference clocks run UTC time (coordinated universal time) a global timescale which is relayed to them from atomic clocks that are accurate to a few nanoseconds (a nanosecond is a billionth of a second).

Put simply, the NTP daemon (a service program that runs in the background) compares the time on the computer with the timing source at regular intervals and adjusts it depending on any drift.

The NTP daemon is configured using the ‘ntp.conf’ file. The configuration file is where the location of the NTP timing servers are stored. If attempting to use a public internet timing source it is advised to visit https://www.pool.ntp.org which has a collection of over 200 servers.

However Microsoft and Novell, strongly advise that internet based timing sources are not used as they are unauthenticated and can leave a gateway open for malicious attacks.

Alternatively and most preferably, dedicated NTP time servers are available which provide better accuracy and are far more secure. These time servers receive a timing source from either a national radio broadcast (such as WWVB in the US or MSF in the UK) or via the GPS system.

Once installed these systems continually check the time on all the network computers’ clocks and adjusts them for any drift. A typical GPS receiver can provide timing information to within a few nanoseconds of UTC while national time and frequency transmissions are accurate to 1 – 20 milliseconds (a millisecond is 1/1000 of a second).

Using WWVB as a Timing Reference for NTP Servers

  |   By

Atomic clocks are incredibly expensive and generally they are normally only to be found in large scale physics laboratories such as MIT (Massachusetts Institute of Technology), NIST (National Institute of Standards and Technology (Colorado) or the National Physical Laboratory in the UK.

Fortunately many national laboratories broadcast the UTC (Coordinated Universal Time) time from their atomic clocks via a radio transmission.

In the US the national timing broadcast is called WWVB and is broadcast by NIST (National Institute fro Standards and Time) in Fort Collins, Colorado. The WWVB broadcast is used by millions of people throughout North America to synchronize consumer electronic products like wall clocks, clock radios, and wristwatches. In addition, WWVB is used for high-level applications such as network time synchronization utilizing NTP.

The time code contains the year, day of year, hour, minute, second, and flags that indicate the status of Daylight Saving Time, leap years, and leap seconds.

WWVB broadcasts on 2.5, 5, 10, 15, and 20 MHz and for most users in the United States, the received accuracy should be less than 10 milliseconds (1/100 of a second).

While many NTP servers now use GPS to receive a timing reference, the advantage of using a radio transmission is that a signal can be received indoors (a GPS antenna needs a good view of the sky).

However, the radio signal has a finite range and can be blocked by skyscrapers, mountains and dense conurbations. A radio based NTP server usually consists of a rack-mountable time server, and an antenna, consisting of a ferrite bar inside a plastic enclosure, which receives the radio time and frequency broadcast. The antenna should always be mounted horizontally at a right angle toward the transmission for optimum signal strength.

Similar national timing transmissions are broadcast from other countries in the UK the signal is referred to as MSF and is broadcast by the National Physical Laboratory in Cumbria, other systems are broadcast in Frankfurt, Germany (DCF-77), Japan (JJY) and France (TDF)

Using MSF as a Timing Reference for NTP Servers

  |   By

Atomic clocks are incredibly expensive and generally they are normally only to be found in large scale physics laboratories such as MIT (Massachusetts Institute of Technology), NIST (National Institute of Standards and Technology (Colorado) or the National Physical Laboratory in the UK.

Fortunately many national laboratories broadcast the UTC (Coordinated Universal Time) time from their atomic clocks via a radio broadcast.

In the UK the national timing broadcast is called MSF and is broadcast by NPL (National Physical Laboratory) in Cumbria. The MSF broadcast is used by throughout the UK and parts of Europe to synchronise consumer electronic products like wall clocks, clock radios, and wristwatches. In addition, MSF is used for high-level applications such as network time synchronisation utilising NTP.

The time code contains the year, day of year, hour, minute, second, and flags that indicate the status of Daylight Saving Time, leap years, and leap seconds.

MSF operates on a frequency of 60 kHz and carries a time and date code that can be received and decoded by a wide range of readily available radio-controlled clocks and provides a received accuracy should be less than 10 milliseconds (1/100 of a second).

While many NTP servers now use GPS to receive a timing reference, the advantage of using a radio transmission is that a signal can be received indoors (a GPS antenna needs a good view of the sky).

However, the radio signal has a finite range and can be blocked by skyscrapers, mountains and dense conurbations. A radio based NTP server usually consists of a rack-mountable time server, and an antenna, consisting of a ferrite bar inside a plastic enclosure, which receives the radio time and frequency broadcast. The antenna should always be mounted horizontally at a right angle toward the transmission for optimum signal strength.

Similar national timing transmissions are broadcast from other countries in the US the signal is referred to as WWVB and is broadcast by the NIST (National Institute for Standards and Technology) in Fort Collins, Colorado, other systems are broadcast in Frankfurt, Germany (DCF-77), Japan (JJY) and France (TDF).

Linux and Unix Basic NTP Configuration

  |   By

Network Time Protocol (NTP) is an Internet protocol used for the transfer of accurate time, providing time information so that a precise time can be obtained and maintained on a network

Most UNIX and Linux operating systems provide built-in time synchronisation functionality with its NTP (Network Time Protocol) daemon. If the NTP service is not available on your version of UNIX\Linux, NTP version 4 is open source and can easily be downloaded and configured, compiled and installed from www.ntp.org.

Network Time Protocol is the standard service for time dissemination across TCP/IP networks. It provides accuracies of 1-50 milliseconds, depending on the characteristics of the synchronization source and network paths.

The configuration file fro the NTP daemon is named ntp.conf and contains a list of reference clocks that it can synchronise too. The command ‘server’ specifies the reference clock, any characters after the ‘#’ symbol are comments, example:
server time-a.nist.gov # Public NTP server: NIST
driftfile /var/lib/ntp/ntp.drift

The drift file command identifies the location where the drift is recorded (sometimes referred to as a ‘frequency error). This value can be offset by NTP to ensure of increased accuracy. When configured, NTP can be controlled using the commands ‘ntpd start’ ‘ntpd stop’ ‘ ntpq –p’ (displays status)

NTP can also authenticate timing resources Note: It is strongly recommends that you configure a time server with a hardware source rather than from the internet where there is no authentication. Authentication codes are specified in the ‘ntp.keys’ file.

Specialist NTP servers are available that can receive transmissions from either GPS or national time reference broadcasts. They are relatively cheap and the signal is authenticated providing a secure time reference.

Authentication allows passwords to be specified by the NTP server and its clients. NTP passwords or keys are stored in the ntp.keys file in the following format: number M (The M stands for MD5 encryption), password:

1 M mypassword

3 M my2ndpassword

5 M my3rdpassword

Authentication for NTP has been developed to prevent malicious tampering with system synchronisation just as firewalls have been developed to protect networks from attack but as with any system of security it only works if it is utilised.

Top Ten Facts About Time

  |   By

Time is one of the least understood aspects of our universe. We know it exists yet we have trouble grasping exactly what it is. Time can be viewed in two ways, it is a manmade concept used as a tool to describe to explain the sequence of events, comparing the durations and intervals between them.

Time is one of the fundamental quantities which also includes distance, velocity, mass, momentum, energy, and weight and thanks to the work of Einstein and others we know time also makes up the very fabric of our Universe.

Here are ten facts you may or may not have known about time.

10. Time is not a constant; time is relative to different observers. The only constant in the Universe is the speed of light which means no matter how fast you are travelling the speed of light will remain the same although time will slow down.

9. Time can be described as a dimension and along with the other three dimensions we are aware of (up/down, left/right and forward/backward) forms a four dimensional ‘space-time’.

8. Time always moves forward yet many theoretical physicists believe that backwards time travel could be possible.

7. Gravity can warp space-time making time slow down the stronger the gravitational force. Experiments with atomic clocks show the higher above sea level they are (and therefore under less gravitational influence) the faster they run (although the difference is very small).

6. As the speed of light is the only constant in the Universe no matter how fast you travel, light will always seem to be the same speed, this is because time will slow down. A journey at close to the speed of light may seem like a few seconds for a traveler but to an observer it would have taken thousands of years.

5. Time has not always existed. Time started with the big bang and will end if the Universe does.

4. Time can be perceived differently by our brains depending on our activities. A boring day will ‘drag’ on whilst if we are enjoying ourselves time will seem to ‘fly’, this phenomenon is referred to as ‘temporal illusion’ by psychologists.

3. Time appears to accelerate the older we get. Some (including Stephen Hawking) suggest the reason for this is that when we are ten years old a year is a tenth of our whole life and seems a long time, yet for a sixty-year-old a year is just a 60th of their life and therefore perceived as a shorter period.

2. Some modern atomic clocks are so accurate they can lose less than a second in 400 million years.

1. A universal time scale has been developed called UTC (Coordinated Universal Time) which is based on the time told by atomic clocks but compensates for the minute slowing of the Earth’s rotation (caused by the gravity of the Moon) by adding Leap Seconds every year to prevent day from creeping into night (albeit in a millennia or two).

Thanks to atomic clocks and UTC time computer networks all over the world can receive a UTC time source over the Internet, via a national radio transmission or through the GPS network. A NTP server (Network Time Protocol) can synchronise all devices on a network to that time.

Keeping Time with Network Synchronisation

  |   By

The worst part of a power cut is running around the house setting all the clocks and timers back to the correct time, it can take ages and you will always forget one, however, as long as you have a wrist watch it should be quite easy to get your clocks all telling the same time. But what time is your wrist watch set too and who regulates that time?

Complete precision and accuracy in time telling is not essential for our day-to-day lives and neither is synchronisation, our computer may be a few minutes slower than our wall clock but it will make little difference when we send an email.

However, what if the person we sent the email to has a computer clock that is even slower? They may end up sending a reply before they have technically received it. Computers are easily fooled if timestamps run backwards – remember the millennium bug!

For this reason it is important for computers, particularly those that deal with time sensitive or financial applications, to be telling the same time; otherwise global stocks could be bought whilst already sold-out or an airline seat, already purchased could be bought again by a buyer with a slower computer clock.

The regulation of time didn’t start until after the development of atomic clocks when the oscillation of the caesium atom became the standard definition of a second (9,192,631,770 a second).

The time told by these atomic clocks was so accurate a new timescale was developed called International Atomic Time (TAI). However, it was discovered that the traditional method of telling time, based on the revolution of the Earth (ie 24 hours in a day) and this new timescale soon became out of sync with each other as the gravity from the moon alters the revolution of the Earth, slowing it down.

This difference in the Earths spin is only minute but enough people argued (mainly astronomers) that if it was not compensated for, night would eventually creep into day (albeit in many thousands of years) and it would be difficult to keep track of the celestial bodies.

A compromise was called for and the new timescale, Universal Coordinated Time (UTC) was developed that accounted for the slowing of the Earth’s spin by adding leap seconds every year or so.

UTC has meant that modern technologies and applications such as the Global Positioning System, satellite communication, live television broadcasts and global trading have become possible.

Computer networks can receive UTC time and keep all their devices synchronised to it by using a NTP server (Network Time Protocol). NTP servers can receive UTC time from an atomic clock source via the Internet, a national radio transmission or through the GPS network.

Atomic Clocks History and Development

  |   By

This article discusses the development of atomic clocks, why accuracy is so important, how they developed and the next generation of atomic clocks that offer increased accuracy.

Atomic clocks have been with us for over fifty years now and most people have heard of them and know they are very accurate, but how accurate are they and why do we need such accurate clocks?

Atomic clocks are used by many of us even if we are not aware of it. The time they tell is relayed around the world and picked up by time servers using the protocol NTP to synchronise networks, they are vital for lots of technologies, such as global satellite navigation, and TV signal timings.

Before the development of the atomic clock the most precise timekeeping devices were electronic clocks which would lose a second or two every week. These had largely replaced mechanical clocks which were less accurate still.

Mankind has always had a fascination for keeping track of the time but knowing the precise time has never been too important. A second or even a minute’s difference does not affect our day-to-day lives.

However, as technology has advanced the need for more precise timekeeping has increased. Satellites that have to be navigated and communicate with the Earth from hundred, thousands and even millions of miles away require exact timing. Light and therefore radio waves can travel 300,000 km every second so slight inaccuracies in time can have massive differences.

The first accurate atomic clock was built y Britain’s National Physical Laboratory in 1955 by Dr Louis Essen who based his clock around the oscillation of the caesium -133 atom. The idea was actually first conceived as far back as 1879 when Lord Kelvin proposed that time-keeping based on how atoms behaved would be a better way to count time intervals than anything else.

The first generation of atomic clocks (also known as caesium oscillators) used the frequency of this atom which oscillates 9,192,631,770 times every second. Essen’s model was accurate to a second every 300 years but developments of the caesium oscillator mean they can now achieve accuracies of one second every 80 million years.

Yet as technologies get more advanced, scientists strive to make better and more accurate clocks. Rubidium standard clocks offer no better accuracy than caesium models but are smaller and cost less (caesium oscillators are generally only to be found in large-scale physics laboratories).

Clocks using just a single atom have been developed that offer even more accuracy. A clock based on a single mercury atom has achieved accuracies of one second in 400 million years and it is expected that a new type of strontium clock that uses light will go even better.

The future for atomic clocks is ever increasing accuracy combined with scaling down the size and cost of them. The American National Institute of Standards and Technology (NIST) have unveiled a chip-sized atomic clock that boasts millisecond accuracy.

Atomic clocks are now part and parcel of our lives without the time signals they transmit to the world that are picked up by NTP servers modern communication from Internet shopping and GPS and technological advances such as satellite navigation would become impossible.

Configuring a LINUX based NTP Time Server

  |   By

Summary: This article gives a step-by-step guide in configuring LINUX to act as an authoritative time server using NTP (Network Time Protocol).

Computer time synchronisation is highly important in modern computer networks, precision and time synchronization is critical in many applications, particularly time sensitive transactions. Just imagine buying an airline seat only to be told at the airport that the ticket was sold twice because it was purchased afterwards on a computer that had a slower clock!

Modern computers do have internal clocks called Real Time Clock chips (RTC) that provide time and date information. These chips are battery backed so that even during power outages, they can maintain time but personal computers are not designed to be perfect clocks. Their design has been optimized for mass production and low-cost rather than maintaining accurate time.

For many applications, this is can be quite adequate, although, quite often machines need time to be synchronised with other PC’s on a network and when computers are out of sync with each other problems can arise such as sharing network files or in some environments even fraud!

Network Time Protocol (NTP) is an Internet protocol used for the transfer of accurate time, providing time information along so that a precise time can be obtained. As NTP was originally written for LINUX many LINUX based operating systems already have a version of NTP installed. However the source code is free to download from the NTP website (ntp.org) the most recent version being v 4.2.4.

NTP (version 4) can maintain time over the public Internet to within 10 milliseconds (1/100th of a second) and can perform even better over LANs with accuracies of 200 microseconds (1/5000th of a second) under ideal conditions.

NTP works within the TCP/IP suite and relies on UDP, a less complex form of NTP exists called Simple Network Time Protocol (SNTP) that does not require the storing of information about previous communications, needed by NTP. It is used in some devices and applications where high accuracy timing is not as important.

The NTP background program is configured with the file ‘ntp.conf’. this may contain a list of public NTP server references that can be used to synchronise time. NTP time servers are specified using the ‘server’ command, any characters after the ‘#’ symbol are comments:

Example
server time-a.nist.gov # Public NTP server: Maryland
When configured, NTP can be controlled using the commands ‘ntpd start’ ‘ntpd stop’ ‘ ntpq –p’ (displays status)

NTP can also authenticate timing resources Note: It is strongly recommends that you configure a time server with a hardware source rather than from the internet where there is no authentication. Authentication codes are specified in the ‘ntp.keys’ file.

Specialist NTP servers are available that can receive transmissions from either GPS or national time reference broadcasts. They are relatively cheap and the signal is authenticated providing a secure time reference.

Authentication for NTP has been developed to prevent malicious tampering with system synchronisation just as firewalls have been developed to protect networks from attack but as with any system of security it only works if it is utilised.