NTP 4.x for Windows NT
Do not try to compile NTP-4.0.99i under WINNT, it will not work.
Fixed NTP-4.0.99i; look for next release to be functional.
Sven - May 11 2000
Download NTP-4.0.99g for the last stable WINNT port.
I am working on adapting the major changes starting with 99i
and getting things running again. Sven - April 25 2000
The NTP 4 distribution runs as service on (i386) Windows NT 4.0 and Windows
2000. The binaries work on dual processor systems. This port has not been
tested on the Alpha platform.
Refer to System Requirements and Instructions for how to compile the
Refernce clock support under Windows NT is tricky because the IO functions
are so much different. The following reference clocks are supported by
Type 1 Undisciplined Local Clock (LOCAL)
Type 29 Trimble Navigation Palisade GPS
All NTP functions are supported with some constraints. See the TODO list
Greg Brackley has implemented a fantastic interpolation scheme that improves
the precision of the NTP clock using a realtime thread (is that poetic
or what!) which captures a tick count from the 8253 counter after each
OS tick. The count is used to interpolate the time between operating system
On a typical 200+ MHz system NTP achieves a precision of about 5 microseconds
and synchronizes the clock to +/-500 microseconds using the Trimble
Palisade as UTC reference. This allows distributed applications to
use the 10 milliseconds ticks available to them with high confidence.
Recent InstallShield based executable versions of NTP for Windows NT (i386)
are available from:
MD5 authentication causes problems with DNS. If you use encryption/authentication,
you have to use IP numbers in ntp.conf.
NMEA refclock support is in development.
See if precision can be improved by using CPU cycle counter for tick interpolation.
Make precision time available to applications using NTP_GETTIME API
Windows NT 4.0 or 5.0 (2000)
Microsoft Visual C++ 6.0
Some version of the archiving program ZIP.
Unpack the NTP-4.x.tar.gz
Open the .\ports\winnt\ntp.dsw Visual C workspace
Batch build all projects
The default NTP configuration file path is %SystemRoot%\system32\drivers\etc\.
is an environmental variable that can be determined by typing "set" at
the "Command Prompt" or from the "System" icon in the "Control Panel").
Refer to your system environment and create your ntp.conf
file in the directory corresponding to your system installation.
The older <WINDIR>\ntp.conf is still supported but you
will get a log entry reporting that the first file wasn't found.
The instsrv program in the instsrv subdirectory of the distribution
can be used to install 'ntpd' as a service and start automatically at boot
time. Instsrv is automatically compiled with the rest of the distribution
if you followed the steps above.
You can change the start mode (automatic/manual) and other startup parameters
correponding to the NTP service (eg. location of conf file) also in the
"Services" dialog box if you wish.
Start a command prompt and enter "instsrv.exe <pathname_for_ntpd.exe>"
Clicking on the "Services" icon in the "Control Panel" will display the
list of currently installed services in a dialog box. The NetworkTimeProtocol
service should show up in this list. Select it in the list and hit the
"Start" button in the dialog box. The NTP service should start.
View the event log by clicking on the "Event Viewer" icon in the "Administrative
Tools" group, there should be several successful startup messages from
NTP. NTP will keep running and restart automatically when the machine is
You can also use instsrv to delete the NTP service by entering:
Command Line Parameters and Registry Entries
Unlike the Unix environment, there is no clean way to run 'ntpdate' and
reset the clock before starting 'ntpd' at boot time.
NTP will step the clock up to 1000 seconds by default. While there
is no reason that the system clock should be that much off during bootup
if 'ntpd' was running before, you may wish to override this default and/or
pass other command line directives.
Use the registry editor to edit the value for the ntpd executable under
Add the -g option to the ImagePath key, behind "%INSTALLDIR>\ntpd.exe".
This will force NTP to accept large time errors (including 1.1.1980 00:00)
Send bug reports to news://comp.protocols.time.ntp
Last revision 16 February 1999 Version 4.0.99e.
by Sven Dietrich (email@example.com)
Perl 5 is no longer needed to compile NTP. The configuration script which
creates version.c with the current date and time was modified by Frederick
Czajka [firstname.lastname@example.org] so that Perl is no longer required.
Last revision 15 November 1999 Version 4.0.98f.
by Sven Dietrich (email@example.com)
Known Problems / TODO:
Fixed I/O problem delaying packet responses which resulted in no-replys
to NTPQ and others.
The default configuration file path is <WINDIR>\system32\drivers\etc\ntp.conf.
The old <WINDIR>\ntp.conf is still supported but you will get a
log entry reporting that the first file wasn't found. The NTP 3.x legacy
file is no longer supported.
MD5 and name resolution do not yet get along. If you define MD5, you cannot
use DNS names, only IP numbers.
Last revision 27 July 1999 Version 4.0.95.
This version compiles under WINNT with Visual C 6.0.
Greg Brackley and Sven Dietrich
-Visual Studio v6.0 support
-Winsock 2.0 support
-Use of I/O completion ports for sockets and comm port I/O
-Removed the use of multimedia timers (from ntpd, others need removing)
-Use of waitable timers (with user mode APC) and performance counters
to fake getting a better time
-Trimble Palisade NTP Reference Clock support
-General cleanup, prototyping of functions
-Moved receiver buffer code to a separate module (removed unused members
from the recvbuff struct)
-Moved io signal code to a separate module
Last revision: 20-Oct-1996
This version corrects problems with building the XNTP
version 3.5-86 distribution under Windows NT.
The following files were modified:
html\hints\winnt (this file)
In order to build the entire Windows NT distribution you
need to modify the file scripts\wininstall\build.bat
with the installation directory of the InstallShield
software. Then, simply type "bldrel" for non-debug
or "blddbg" for debug executables.
Last revision: 07-May-1996
This set of changes fixes all known bugs, and it includes
several major enhancements.
Many changes have been made both to the build environment as
well as the code. There is no longer an ntp.mak file, instead
there is a buildntall.bat file that will build the entire
release in one shot. The batch file requires Perl. Perl
is easily available from the NT Resource Kit or on the Net.
The multiple interface support was adapted from Larry Kahn's
work on the BIND NT port. I have not been able to test it
adequately as I only have NT servers with one network
interfaces on which to test.
* Event Logging now works correctly.
* Version numbers now work (requires Perl during build)
* Support for multiple network interface cards (untested)
* NTP.CONF now default, but supports ntp.ini if not found
* Installation procedure automated.
* All paths now allow environment variables such as %windir%
* INSTSRV replaced, works correctly
* Cleaned up many warnings
* Corrected use of an uninitialized variable in XNTPD
* Fixed ntpdate -b option
* Fixed ntpdate to accept names as well as IP addresses
(Winsock WSAStartup was
called after a gethostbyname())
* Fixed problem with "longjmp" in xntpdc/ntpdc.c that
caused a software exception
on doing a Control-C in xntpdc.
A Cntrl-C now terminates the program.
See below for more detail:
Note: SIGINT is not supported for any
Win32 application including
Windows NT and Windows 95. When a CTRL+C
interrupt occurs, Win32
operating systems generate a new thread
to specifically handle that
interrupt. This can cause a single-thread
application such as UNIX,
to become multithreaded, resulting in
Possible enhancements and things left to do:
* Reference clock drivers for NT (at least Local Clock support)
* Control Panel Applet
* InstallShield based installation, like NT BIND has
* Integration with NT Performance Monitor
* SNMP integration
* Fully test multiple interface support
* bug in ntptrace - if no Stratum
1 servers are available,
such as on an IntraNet, the application crashes.
Last revision: 12-Apr-1995
This NTPv3 distribution includes a sample configuration file and the project
makefiles for WindowsNT 3.5 platform using Microsoft Visual C++ 2.0
Also included is a small routine to install the NTP daemon as a "service"
on a WindowsNT box. Besides xntpd, the utilities that have been ported
ntpdate and xntpdc. The port to WindowsNT 3.5 has been tested using
TimeServe2000 GPS receiver clock that acts as a strata 1 NTP server
authentication (it has not been tested with any refclock drivers compiled
Following are the known flaws in this port:
1) currently, I do not know of a way in NT to get information about
network interface cards. The current port uses just one
socket bound to
INADDR_ANY address. Therefore when dealing with a multihomed
NT time server,
clients should point to the default address on the server
reply is not guaranteed to come from the same interface
to which the
request was sent). Working with Microsoft to get this
2) There is some problem with "longjmp" in xntpdc/ntpdc.c that causes
software exception on doing a Control-C in xntpdc. Be
3) The error messages logged by xntpd currently contain only the numerical
error code. Corresponding error message string has to
be looked up in
"Books Online" on Visual C++ 2.0 under the topic "Numerical
List of Error
Last HTML Update: November 17, 1999