From what I understand, the crystals on PC's are notorious for clock skew. If clocks are always skewing, what is the best way to synchronize clocks between machines with millisecond accuracy and precision? From what I've found, NTP and PTP are possible solutions, but I was wondering if anybody had any experience on stackoverflow.com!
I understand NTP is the popular choice, but am wondering if anybody has had any experience with PTP (IEEE1588)
Just run the standard NTP daemon.
It does have options to take input from several GPS devices as well as talking to network servers.
Edit: I was referring to http://www.ntp.org/, not the one that comes with Windows.
I don't have any suggestion as to what NTP clients are best for windows, but for Unix machines there's no real reason to not run NTP.
NTP is definitely the way to go. Basically fire-and-forget, as long as you let it out the firewall on your local master (which is typically the firewall or router machine.)
Keep in mind as well, that the hardware system clock (i.e. the inaccurate one) is only read when the machine starts up - if you're talking about server machines, you're not going to lose time because of them.
I've researched (read Googled) on this topic lately and here is what I have learn so far:
To get millisecond-accuracy (or better) you need hardware support. GPS source or hardware time-stamping (and a good time source) in PTP.
Hardware time-stamping in PTP is done with supported NIC - Intel has them.
Without hardware time-stamping the accuracy between NTP and PTP are similar.
(Not used PTP before) I read that NTP is easier to setup.
My limited experience with GPS time source (over serial) varies. It works great if you can get it to work but there is a device that we have in a data center that I never managed to get it to work...
If your machines are in colo ask your DC what they can provide - so you don't have to decide. :D
HTH
Solutions based on NTP or SNTP can work very well, but it strongly depends on how well the client is implemented.
Certainly, the answer to this question is not to use the default Windows time service if you want sub second precision. It is notoriously poor at maintaining a stable time base on a machine and will typically overshoot corrections and is almost unstable even, especially when machines have fairly inaccurate timebases to start with - which is common. Assume the standard built in Window's tools can hold accuracies reliably there to typically only several seconds between all machines and I typically see swings of as much as 30 seconds between machines - even if you tweak the registry settings.
The freeware tool Achron is a pretty good solution to get down into the plus/minus 500 millisecond kind of range. Doing better than that will require a more industrial strength solution such as something from Greyware
Here's some 10-year-old software that syncs to within a hundredth of a millisecond. (My team wrote it when NTP wasn't good enough for our lab.)
From the abstract: "A distributed clock for networked commodity PC's. With no extra hardware, this clock correlates sensor data from multiple PC's with latency and jitter under 10 microseconds average, 100 microseconds worst case."
Description: http://scholar.google.com/citations?view_op=view_citation&citation_for_view=QmbeOvsAAAAJ:5nxA0vEk-isC
Source code: http://zx81.isl.uiuc.edu/clockkit/