|
Sunday, August 31, 2008
NTP Pool Project
By the way, if you're looking for a good place to sync time, check out NTP Pool Project. They discuss being a time server, as well as being a client. I am using us.pool.ntp.org for my clock sync client experiments.
1:11 pm pdt
Windows Time Sync Experiment -- Update
The registry settings I published in my first post on this subject are working beautifully. The system clock smoothly
"chases" the time standard, and w32time is so confident that it increased the polling interval to nine hours on my "always
on" weather server.
The polling interval on various other computers that I turn off at night hovers between two and four hours. W32time retains
some of the clock heuristics when turned off. However, the large temperature changes that occur when I turn the computers
on and off has a deleterious effect on the accuracy of the system clock, requiring more frequent updates to keep the clock
accurate. Still, network traffic is negligible, and the clock does not require stepwise corrections.
12:51 pm pdt
Thursday, August 28, 2008
Windows Time Sync Experiment Part III
I have received some feedback on my earlier posts, suggesting that I use other time sources, or a time sync program
other than w32time.
Since my 1-Wire Weather Service for Java is a cross-platform program, I would have to write interfaces to whatever other
time source might be available on any platform that I want to support. If this were a Windows-only program, I would definitely
consider using the timer interrupt instead of the system clock. However, the system clock is universally available on all
platforms through Java (in other words, Sun Microsystems already did the platform-specific work in the Java VM).
I realize that programs other than w32time are available for synchronizing the system clock. However, part of my interest
here is better understanding how to work with the native Windows features. Although w32time is not as convenient to configure
as one might like (you have to edit the registry -- Microsoft doesn't expose all of the w32time features in any UI), it does
seem to provide everything someone might need to make a reliable time source. It is a full implementation of RFC1305. I am
toying with the idea of writing my own GUI configuration utility for w32time.
10:44 pm pdt
Wednesday, August 27, 2008
Windows Time Sync Experiment Part II
Windows Time implements RFC1305 - Network Time Protocol (pdf). Fascinating reading for anyone who is interested in electronic timekeeping technology, especially over TCP/IP.
I am attempting to map the parameters in the Windows registry used by w32time to the parameters discussed in the NTP protocol.
Too bad Microsoft decided to use different names. Keeping them the same would have simplified analysis, and made obvious which
ones were part of NTP and which ones were specific to Windows features. I have been watching my w32time internet
time server polling interval. It started out at around 15 minutes, and has gradually increased to about four and a half hours,
as the system clock becomes increasingly accurate. W32time is "dialing in" the clock frequency. If all goes as planned, this
configuration should eliminate the need for stepwise corrections to the system clock.
9:27 pm pdt
Tuesday, August 26, 2008
Windows Time Sync Experiment
I am experimenting with configuring the Windows Time Service (w32time) so that it doesn't upset my anemometer data when
Windows synchronizes with Internet time. The anemometer, and most real-time applications, requires a smooth, continuous timebase.
Jumps and discontinuities in the time sequence cause huge errors in rate calculations such as wind speed. Windows
computers can run as domain controllers, domain members, or stand-alone. I will not concern myself with domain computers.
If your computer is part of a domain, you probably won't have this problem. Most home computers operate as stand-alone machines,
even if you have several on a network. You can identify a stand-alone computer because it has an "Internet Time" tab on the
Date and Time Properties dialog that you use to set Windows date and time. This gives you the option to "Automatically synchronize
with an Internet time server". W32time actually has a very good algorithm for synchronizing Windows time, if
it is properly configured. Unfortunately, when you check "Automatically synchronize with an Internet time server", it is optimized
for intermittent network access. This is not appropriate for real-time operation. Fortunately, you can edit two Windows registry
settings to configure w32time to be real-time friendly. Standard disclaimer: it is dangerous to edit the Windows registry,
blah, blah, blah. Be careful. Changing the following two settings should allow w32time to "dial in" the clock
rate gradually, and to then be able to poll only as frequently as needed to keep the clock running "on time", all without
any discontinuities. HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config
MaxAllowedPhaseOffset
Domain members are 300 milliseconds by default. The default for stand-alone
machines is 1 millisecond. If the system clock differs from the Internet time server by more than the specified amount, w32time
will set the clock, instead of adjusting the rate. No PC can maintain millisecond accuracy for the default seven-day polling
interval. Set this value to 300 milliseconds to allow w32time to "dial in" the clock rate, instead of setting the clock directly.
HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters
NtpServer
This value contains the name of the NTP server you want to synchronize with, followed by the value 0x1. The 0x1 tells
w32time to use a fixed polling interval (seven days) to synchronize the system time, instead of adaptive mode. Delete ",0x1"
from the NTP server name so w32time will use the adaptive polling interval. If my experiments are successful,
I will post this as on the tech note page.
8:38 pm pdt
|
|
Contact Us
Use the form below to send comments about this site.
|
![](/imagelib/sitebuilder/layout/spacer.gif) |
|
|
![](/imagelib/sitebuilder/layout/spacer.gif) |
Welcome!
This site is dedicated to my interest in engineering. I use it as a place to just put stuff "out there" for anyone who
might be interested, as well as a job search tool. This page contains my engineering web log (to your left). Anything that
seems timeless enough, or too involved for a log entry may get it's own page as a full-blown article. And, of course, my resume
is here for anyone who might be considering hiring me to do something. Email me.
About Me
I have worked as a broadcast engineer, electronics designer (analog and digital) and software developer. I especially
enjoy audio engineering, although I've been writing software for the last several years, since that's where the opportunities
are in the Pacific Northwest (this is Microsoft country after all). I'm currently working as a Senior Staff Engineer -- Resume at another large independent software vendor in Washington State.
I majored in mathematics and physics in college. Other interests include music appreciation (baroque, classical and early
romantic, ragtime, and 60's and 70's rock & roll), high fidelity audio electronics, meteorology and of course, computing
hardware and software. I tend to think a lot like this guy.
|
![](/imagelib/sitebuilder/layout/spacer.gif) |
|
|