Windows Time Server
Synchronising Your Network With NTP
Nearly all a computers activity involves time whether logging a timestamp for when a network was accessed to sending an email, knowing the time is crucial for computer applications.
All computers have an on-board clock that provides time and date information. These Real Time Clock (RTC) chips are battery backed so that even when off they can maintain time, however these RTC chips are mass produced and cannot maintain accurate time and tend to drift.
For many applications this can be quite adequate, however if a computer is on a network and needs to talk to other machines, failing to be synchonised to the correct time can mean many time-sensitive transactions can not be completed and can even leave the network open to security threats.
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, it is also included in most Windows operating systems but more recent versions have the full NTP already installed, which is also free to download via the Internet.
All versions of Windows Server since 2000 have included a time synchronization facility, called Windows Time Service (w32time.exe), built into the operating system. This can be configured to operate as a network time server synchronizing all machines to a specific time source.
Windows Time Service uses a version of NTP (Network Time Protocol), normally a simplified version, of the Internet protocol which is designed to synchronise machines on a network, NTP is also the standard for which most computer networks across the global use to synchronise with.
Choosing the correct time source is vitally important. Most networks are synchronized to UTC (Coordinated Universal Time) source. UTC is a global standardized time based on atomic clocks which are the most accurate time sources.
UTC can be obtained over the Internet from such places as time.nist.gov (us Naval Observatory) or time.windows.com (Microsoft) but it must be noted that internet time sources can not be authenticated which can leave a system open to abuse and Microsoft and others advise using an external hardware source as a reference clock such as a specialized NTP server.
NTP servers receive their time source from either a specialist radio transmission from national physics laboratories which broadcast UTC time taken from an atomic clock source or by the GPS network which also relays UTC as a consequence of needing it to pin point locations.
NTP can maintain time over the public Internet to within 1/100th of a second (10 milliseconds) and can perform even better over LANs.
To configure Windows Time Service to use an external time source simply follow these instructions:
- Locate the registry subkey.
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeParameters
- Right click type then Modify the Value by inserting NTP in the Value Data box.
- Right click ReliableTimeSource, then Modify the Edit DWORD Value box, by inserting 0 (zero).
- Right-click NtpServer then Modify the Edit Value by typing the Domain Name System (DNS), (note each DNS must be unique).
- Now locate the original subkey and right-click Period Modify the Edit DWORD Value box with the poll interval (how often a NTP server polls the time), under Value Data (recommended 24)
- Run the following command line, Net stop w32time && net start w32time.
- Now enable NTP by locating the subkey, HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProvidersNtpServer
- Right click Enabled and modify the Value data box by typing 1.
- Right Click SpecialPollInterval in the right pain of the subkey HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProvidersNtpClientSpecialPollInterval. Edit the DWORD value box the time you want for each poll (900 will poll every 15 minutes)
- Locate HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32Timeconfig
- To configure the time correction settings right click MaxPosPhaseCorrection, then modify the DWORD Value box with a time in seconds such (select decimal under base first, 3600 = one hour)
- Now do the same for MaxNegPhaseCorrection the restart windows time service by running (or alternatively use the command prompt facility) net stop w32time && net start w32time.
- To synchronise each machine simply type W32tm/ -s in the command prompt and the time server should now be working correctly (note it may take several polls before the correct time is displayed).