Windows Time Server: Synchronising Your Network with NTP

Jun 26
08:15

2008

Richard N Williams

Richard N Williams

  • Share this article on Facebook
  • Share this article on Twitter
  • Share this article on Linkedin

This article explains how to configure Windows Server to use NTP to synchronise a network.

mediaimage
Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

Nearly all a computers activity involves time whether logging a timestamp for when a network was accessed to sending an email,Windows Time Server: Synchronising Your Network with NTP Articles 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.

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_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters

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_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer\

Right click Enabled and modify the Value data box by typing 1.

Right Click SpecialPollInterval in the right pain of the subkey HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient\SpecialPollInterval. Edit the DWORD value box the time you want for each poll (900 will poll every 15 minutes)

Locate HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\config

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).