Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / ntp / html / hints / winnt.htm
1 <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2 <html>
3 <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5    <meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; I) [Netscape]">
6    <title>NTP on Windows NT</title>
7 </head>
8 <body>
9
10 <h1>
11 NTP 4.x for Windows NT</h1>
12
13 <h2>
14 Do not try to compile NTP-4.0.99i under WINNT, it will not work.
15 Fixed NTP-4.0.99i; look for next release to be functional.
16 Sven - May 11 2000
17 </h2>
18
19 <h2>
20 Download NTP-4.0.99g for the last stable WINNT port.
21 I am working on adapting the major changes starting with 99i
22 and getting things running again. Sven - April 25 2000
23 </h2>
24
25 <h2>
26 Introduction</h2>
27 The NTP 4 distribution runs as service on (i386) Windows NT 4.0 and Windows
28 2000. The binaries work on dual processor systems. This port has not been
29 tested on the Alpha platform.
30 <p>Refer to System Requirements and Instructions for how to compile the
31 program.
32 <h2>
33 Reference Clocks</h2>
34 Refernce clock support under Windows NT is tricky because the IO functions
35 are so much different. The following reference clocks are supported by
36 Windows NT:
37 <p><a href="../driver1.htm">Type 1</a> Undisciplined Local Clock (LOCAL)
38 <br><a href="../driver29.htm">Type 29</a> Trimble Navigation Palisade GPS
39 (GPS_PALISADE)
40 <h2>
41 Functions Supported</h2>
42 All NTP functions are supported with some constraints. See the TODO list
43 below.
44 <h2>
45 Accuracy</h2>
46 Greg Brackley has implemented a fantastic interpolation scheme that improves
47 the precision of the NTP clock using a realtime thread (is that poetic
48 or what!) which captures a tick count from the 8253 counter after each
49 OS tick. The count is used to interpolate the time between operating system
50 ticks.
51 <p>On a typical 200+ MHz system NTP achieves a precision of about 5 microseconds
52 and synchronizes the clock to +/-500 microseconds using the <a href="http://www.trimble.com/products/ntp">Trimble
53 Palisade</a> as UTC reference. This allows distributed applications to
54 use the 10 milliseconds ticks available to them with high confidence.
55 <h2>
56 Binaries</h2>
57 Recent InstallShield based executable versions of NTP for Windows NT (i386)
58 are available from:
59 <br><a href="http://www.trimble.com/oem/ntp">http://www.trimble.com/oem/ntp</a>
60 and <a href="http://www.five-ten-sg.com/">http://www.five-ten-sg.com/</a>
61 <h2>
62 ToDo</h2>
63
64 <ul>
65 <li>
66 MD5 authentication causes problems with DNS. If you use encryption/authentication,
67 you have to use IP numbers in <tt>ntp.conf.</tt></li>
68
69 <li>
70 NMEA refclock support is in development.</li>
71
72 <li>
73 See if precision can be improved by using CPU cycle counter for tick interpolation.</li>
74
75 <li>
76 Make precision time available to applications using NTP_GETTIME API</li>
77 </ul>
78
79 <h2>
80 Compiling Requirements</h2>
81
82 <ul>
83 <li>
84 <tt>Windows NT 4.0 or 5.0 (2000)</tt></li>
85
86 <li>
87 <tt>Microsoft Visual C++ 6.0</tt></li>
88
89 <li>
90 Some version of the archiving program <tt>ZIP</tt>.</li>
91 </ul>
92
93 <h2>
94 Compiling Instructions</h2>
95
96 <ol>
97 <li>
98 Unpack the NTP-4.x.tar.gz</li>
99
100 <li>
101 Open the .\ports\winnt\ntp.dsw Visual C workspace</li>
102
103 <li>
104 Batch build all projects</li>
105 </ol>
106
107 <h2>
108 Configuration File</h2>
109 The default NTP configuration file path is %SystemRoot%<tt>\system32\drivers\etc\.
110 </tt>(%SystemRoot%
111 is an environmental variable that can be determined by typing "set" at
112 the "Command Prompt" or from the "System" icon in the "Control Panel").
113 <br>Refer to your system environment and <tt>c</tt>reate your<tt> ntp.conf</tt>
114 file in the directory corresponding to your system&nbsp; installation.
115 <br><tt>The older &lt;WINDIR>\ntp.conf </tt>is still supported but you
116 will get a log entry reporting that the first file wasn't found.
117 <h2>
118 Installation Instructions</h2>
119 The <tt>instsrv</tt> program in the instsrv subdirectory of the distribution
120 can be used to install 'ntpd' as a service and start automatically at boot
121 time. Instsrv is automatically compiled with the rest of the distribution
122 if you followed the steps above.
123 <ol>
124 <li>
125 Start a command prompt and enter "instsrv.exe &lt;pathname_for_ntpd.exe>"</li>
126
127 <li>
128 Clicking on the "Services" icon in the "Control Panel" will display the
129 list of currently installed services in a dialog box. The NetworkTimeProtocol
130 service should show up in this list. Select it in the list and hit the
131 "Start" button in the dialog box. The NTP service should start.</li>
132
133 <li>
134 View the event log by clicking on the "Event Viewer" icon in the "Administrative
135 Tools" group, there should be several successful startup messages from
136 NTP. NTP will keep running and restart automatically when the machine is
137 rebooted.</li>
138 </ol>
139 You can change the start mode (automatic/manual) and other startup parameters
140 correponding to the NTP service (eg. location of conf file) also in the
141 "Services" dialog box if you wish.
142 <h2>
143 Removing NTP</h2>
144 You can also use <tt>instsrv</tt> to delete the NTP service by entering:
145 "instsrv.exe remove"
146 <h2>
147 Command Line Parameters and Registry Entries</h2>
148 Unlike the Unix environment, there is no clean way to run 'ntpdate' and
149 reset the clock before starting 'ntpd' at boot time.
150 <br>NTP will step the clock up to 1000 seconds by default. While there
151 is no reason that the system clock should be that much off during bootup
152 if 'ntpd' was running before, you may wish to override this default and/or
153 pass other command line directives.
154 <p>Use the registry editor to edit the value for the ntpd executable under
155 LocalMachine\System\CurrentControlSet\Services\NTP.
156 <p>Add the -g option to the ImagePath key, behind "%INSTALLDIR>\ntpd.exe".
157 This will force NTP to accept large time errors (including 1.1.1980 00:00)
158 <h2>
159 Bug Reports</h2>
160 Send bug reports to <a href="news://comp.protocols.time.ntp">news://comp.protocols.time.ntp</a>
161 and Sven_Dietrich@Trimble.COM
162 <h2>
163 Change Log</h2>
164
165 <h3>
166 Last revision 16 February 1999&nbsp; Version 4.0.99e.</h3>
167 <b>by Sven Dietrich (sven_dietrich@trimble.com)</b>
168 <p><b>Significant Changes:</b>
169 <ul>
170 <li>
171 Perl 5 is no longer needed to compile NTP. The configuration script which
172 creates version.c with the current date and time was modified by Frederick
173 Czajka [w2k@austin.rr.com] so that Perl is no longer required.</li>
174 </ul>
175
176 <h3>
177 Last revision 15 November 1999&nbsp; Version 4.0.98f.</h3>
178 <b>by Sven Dietrich (sven_dietrich@trimble.com)</b>
179 <p><b>Significant Changes:</b>
180 <ul>
181 <li>
182 Fixed I/O problem delaying packet responses which resulted in no-replys
183 to NTPQ and others.</li>
184
185 <li>
186 The default configuration file path is <tt>&lt;WINDIR>\system32\drivers\etc\ntp.conf.
187 The old &lt;WINDIR>\ntp.conf </tt>is still supported but you will get a
188 log entry reporting that the first file wasn't found. The NTP 3.x legacy
189 <tt>ntp.ini</tt>
190 file is no longer supported.</li>
191 </ul>
192 <b>Known Problems / TODO:</b>
193 <ul>
194 <li>
195 MD5 and name resolution do not yet get along. If you define MD5, you cannot
196 use DNS names, only IP numbers.</li>
197 </ul>
198
199 <h3>
200 Last revision 27 July 1999&nbsp; Version 4.0.95.</h3>
201 This version compiles under WINNT with Visual C 6.0.
202 <p>Greg Brackley and Sven Dietrich
203 <p>Significant changes:
204 <br>-Visual Studio v6.0 support
205 <br>-Winsock 2.0 support
206 <br>-Use of I/O completion ports for sockets and comm port I/O
207 <br>-Removed the use of multimedia timers (from ntpd, others need removing)
208 <br>-Use of waitable timers (with user mode APC) and performance counters
209 to fake getting a better time
210 <br>-Trimble Palisade NTP Reference Clock support
211 <br>-General cleanup, prototyping of functions
212 <br>-Moved receiver buffer code to a separate module (removed unused members
213 from the recvbuff struct)
214 <br>-Moved io signal code to a separate module
215 <h3>
216 Last revision:&nbsp; 20-Oct-1996</h3>
217 This version corrects problems with building the XNTP
218 <br>version 3.5-86 distribution under Windows NT.
219 <p>The following files were modified:
220 <br>&nbsp;blddbg.bat
221 <br>&nbsp;bldrel.bat
222 <br>&nbsp;include\ntp_machine.h
223 <br>&nbsp;xntpd\ntp_unixclock.c
224 <br>&nbsp;xntpd\ntp_refclock.c
225 <br>&nbsp;scripts\wininstall\build.bat
226 <br>&nbsp;scripts\wininstall\setup.rul
227 <br>&nbsp;scripts\wininstall\readme.nt
228 <br>&nbsp;scripts\wininstall\distrib\ntpog.wri
229 <br>&nbsp;html\hints\winnt (this file)
230 <p>In order to build the entire Windows NT distribution you
231 <br>need to modify the file scripts\wininstall\build.bat
232 <br>with the installation directory of the InstallShield
233 <br>software.&nbsp; Then, simply type "bldrel" for non-debug
234 <br>or "blddbg" for debug executables.
235 <p>Greg Schueman
236 <br>&nbsp;&nbsp;&nbsp; &lt;schueman@acm.org>
237 <h3>
238 Last revision:&nbsp; 07-May-1996</h3>
239 This set of changes fixes all known bugs, and it includes
240 <br>several major enhancements.
241 <p>Many changes have been made both to the build environment as
242 <br>well as the code.&nbsp; There is no longer an ntp.mak file, instead
243 <br>there is a buildntall.bat file that will build the entire
244 <br>release in one shot.&nbsp; The batch file requires Perl.&nbsp; Perl
245 <br>is easily available from the NT Resource Kit or on the Net.
246 <p>The multiple interface support was adapted from Larry Kahn's
247 <br>work on the BIND NT port.&nbsp; I have not been able to test it
248 <br>adequately as I only have NT servers with one network
249 <br>interfaces on which to test.
250 <p>Enhancements:
251 <br>* Event Logging now works correctly.
252 <br>* Version numbers now work (requires Perl during build)
253 <br>* Support for multiple network interface cards (untested)
254 <br>* NTP.CONF now default, but supports ntp.ini if not found
255 <br>* Installation procedure automated.
256 <br>* All paths now allow environment variables such as %windir%
257 <p>Bug fixes:
258 <br>* INSTSRV replaced, works correctly
259 <br>* Cleaned up many warnings
260 <br>* Corrected use of an uninitialized variable in XNTPD
261 <br>* Fixed ntpdate -b option
262 <br>* Fixed ntpdate to accept names as well as IP addresses
263 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Winsock WSAStartup was
264 called after a gethostbyname())
265 <br>* Fixed problem with "longjmp" in xntpdc/ntpdc.c that
266 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; caused a software exception
267 on doing a Control-C in xntpdc.
268 <br>&nbsp;A Cntrl-C now terminates the program.
269 <p>See below for more detail:
270 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Note: SIGINT is not supported for any
271 Win32 application including
272 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows NT and Windows 95. When a CTRL+C
273 interrupt occurs, Win32
274 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; operating systems generate a new thread
275 to specifically handle that
276 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; interrupt. This can cause a single-thread
277 application such as UNIX,
278 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to become multithreaded, resulting in
279 unexpected behavior.
280 <br>&nbsp;
281 <p>Possible enhancements and things left to do:
282 <br>* Reference clock drivers for NT (at least Local Clock support)
283 <br>* Control Panel Applet
284 <br>* InstallShield based installation, like NT BIND has
285 <br>* Integration with NT Performance Monitor
286 <br>* SNMP integration
287 <br>* Fully test multiple interface support
288 <br>&nbsp;
289 <p>Known problems:
290 <br>*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bug in ntptrace - if no Stratum
291 1 servers are available,
292 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
293 such as on an IntraNet, the application crashes.
294 <h3>
295 Last revision:&nbsp; 12-Apr-1995</h3>
296 This NTPv3 distribution includes a sample configuration file and the project
297 <br>makefiles for WindowsNT 3.5 platform using Microsoft Visual C++ 2.0
298 compiler.
299 <br>Also included is a small routine to install the NTP daemon as a "service"
300 <br>on a WindowsNT box. Besides xntpd, the utilities that have been ported
301 are
302 <br>ntpdate and xntpdc. The port to WindowsNT 3.5 has been tested using
303 a Bancomm
304 <br>TimeServe2000 GPS receiver clock that acts as a strata 1 NTP server
305 with no
306 <br>authentication (it has not been tested with any refclock drivers compiled
307 in).
308 <br>Following are the known flaws in this port:
309 <br>1) currently, I do not know of a way in NT to get information about
310 multiple
311 <br>&nbsp;&nbsp; network interface cards. The current port uses just one
312 socket bound to
313 <br>&nbsp;&nbsp; INADDR_ANY address. Therefore when dealing with a multihomed
314 NT time server,
315 <br>&nbsp;&nbsp; clients should point to the default address on the server
316 (otherwise the
317 <br>&nbsp;&nbsp; reply is not guaranteed to come from the same interface
318 to which the
319 <br>&nbsp;&nbsp; request was sent). Working with Microsoft to get this
320 resolved.
321 <br>2) There is some problem with "longjmp" in xntpdc/ntpdc.c that causes
322 a
323 <br>&nbsp;&nbsp; software exception on doing a Control-C in xntpdc. Be
324 patient!
325 <br>3) The error messages logged by xntpd currently contain only the numerical
326 <br>&nbsp;&nbsp; error code. Corresponding error message string has to
327 be looked up in
328 <br>&nbsp;&nbsp; "Books Online" on Visual C++ 2.0 under the topic "Numerical
329 List of Error
330 <br>&nbsp;&nbsp; Codes".
331 <p>Last HTML Update: November 17, 1999
332 <br><a href="mailto://sven_dietrich@trimble.com">Sven_Dietrich@Trimble.COM</a>
333 </body>
334 </html>