Wednesday, March 7, 2012

The Importance Of Computer Network Time Synchronisation

Time synchronisation of networked computers is an extremely important issue. Computers maintain time using relatively low-cost components, which do not keep particularly accurate time. Consequently, each computers time, on a network of computers, will drift away from each other to varying degrees. This may not sound like too much of a problem, but it can lead to real headaches.

Many applications are time critical. Often computers need to know the exact time an event occurs, such as controlling a production line where each individual process needs to be synchronised. Also, transaction-processing applications on a network of computers, synchronisation is required to ensure transactions are processed from computers in an ordered manner. A computerised parking system needs to have entry and exit machines synchronised to ensure accurate calculation of time spent on the car park. There are a large number of applications that utterly rely on the synchronisation of time between multiple computers.

Computer Hardware.
Computers rely on crystal oscillators to maintain time. These components while very low-cost have quite a large margin of error.

A crystal oscillator is an electronic circuit that utilises the mechanical resonance of a vibrating crystal. This creates an electrical signal with a pre-determined frequency. This frequency is used by computers and other clocks to maintain time. The most common type of resonator is quartz, hence, the term "quartz oscillator" or "crystal oscillator". However, the frequency of oscillators have a tendancy to speed up or slow down with temperature variation. This leads to the internal clocks drifting away from the correct time.

Ways of Synchronising Time.
Initially, you may wonder where a source of accurate time for a computer network can be obtained. However, there are atomic clocks available that can maintain time to very high degree of accuracy. Unfortunately, these are large and very expensive pieces of equipment generally located in National Physics Laboratories. However, there are a number of broadcast time references, provided by National Standards Agencies, which are linked to these atomic clocks. Accurate radio time broadcasts are transmitted by a number of countries across Europe and North America, including UK, Germany, France, USA and Canada. The Global Positioning System (GPS) is another source of accurate time. The GPS system consists of a constellation of 24 orbiting satellites, each one with an onboard atomic clock. Primarily used for navigation, the system also provides a very accurate time reference. All of the above references can, and are, used for computer time synchronisation.

The Network Time Protocol.
The Network Time Protocol, or NTP, is a standard Internet protocol for distributing accurate time to servers and workstations. The protocol is widely used to synchronise computers and time critical applications to an accurate reference. NTP servers obtain precise time from hardware clock references, such as radio and GPS time sources, and provide a network with an accurate time resource.

NTP is a client-server based UDP protocol. A NTP server provides clients, on request, with three products: system clock offset, round-trip delay and time dispersion of a specified external reference clock, such as GPS. The clock offset specifies the difference between the local system time and an external reference clock. Round-trip delay measures the network latencies experienced during the transfer of packets of information. Time dispersion specifies the maximum error associated with timing information received from the external reference clock. Using this information, a client can accurately synchronise its system time.

Internet Time Servers.
There are many NTP time servers on the Internet, many are provided by Government standards agencies and Universities. Internet based NTP servers basically fall into two categories: primary and secondary references. A primary reference obtains very precise time from an external source such as radio or GPS. A secondary reference obtains time from a primary reference server. Secondary references are used to disperse load. They provide a further level of servers that take loading away from primary servers. Primary reference time servers are stratum one servers, while secondary servers have a stratum greater than one

Using NTP in Microsoft Windows Environments.
For networked environments, a completely automated time synchronisation service is required to automatically adjust the clocks on each client to that of a master clock or NTP server. The Microsoft Windows operating systems 'Windows Time' service provides such functionality. The service is installed by default on any Windows environment.

On simple peer-to-peer networks the 'Internet Time' tab on the 'Date and Time Properties' applet can be used to specify a time server for synchronisation. The server can be either a local or Internet based NTP server. The service will periodically adjust its system time to match the time supplied by the selected reference.

Windows active directory networks synchronise slightly differently. On power-up, the Windows time service starts automatically and attempts to synchronise time and date information with a domain controller using the NTP protocol. A domain controller can be configured as either a trusted or an un-trusted time reference. A Windows Time Client will always attempt to synchronise time periodically with a trusted domain controller. In this manner networked Windows servers maintain synchronisation with a domain controller and each other.

Linux and NTP.
NTP was originally developed for operation on Linux. The NTP source code is freely downloadable under the GNU public license from the NTP web site. The source code is compiled and configured on the host computer. This process is automated with the installation and configuration scripts supplied with the distribution. Many Linux based operating systems have the NTP package pre-installed. However, it may be prudent to download and install the latest version, which is currently 4.2.4.

No comments:

Post a Comment