Category Archives: NTP

What time is it ?

Time is quite important for computers, for some purposes, to be synchronised to within 5  minutes is accurate enough, for other purposes milli, micro, nano or femto seconds are required.

When comparing logs across multiple devices, having devices do not have time synched can make tracing events harder than it needs to be.

One can add a single time standard to get around this, but for NTP to work well, there should be at least 3 standards, one could however configure a GPS time server that takes time from GPS (or to be precise PPS to get sub millsecond accuracy) and also uses external NTP servers to confirm that the GPS output is “sane”, A raspberryPi can do this quite well. https://www.ntpsec.org/white-papers/stratum-1-microserver-howto/

To go “better” than NTP, the next step along the ladder is PTP (Precision Time Protocol), which has a very different way of workign to NTP, in that a GM (Grand Master) clock is the single source of truth in a PTP domain, one can then have that GM clock accessed by secondary level “boundary” clocks to act as a distribution layer. While a raspberryPi can run PTP, the jitter from the raspberryPi is at a level where it can be seen when comparing to dedicated devices, or say a Solarflare card that is fed with a “clean” PPS in, it is however good enough to see the change in one way delay when the path goes over 1, 2 or 3 Ethernet switches.

 

 

Managing time (NTP) on standalone Windows Servers, Domain Controllers, or desktops

On standalone Windows servers (servers not members of a domain) the time service only checks the time against an NTP server on startup as a triggered action. If the server is on hardware with a “reliable” hardware clock, this is usually not a problem as clock drift on most modern hardware is minimal, if however the hardware clock is not reliable, or the Computer is running in a virtual environment, it may take incorrect clock data from the VM host (if the host has an unreliable or “wrong” hardware clock, or it may just drift more than expected.

First of all I like to set the time service to be automatic

sc triggerinfo w32time delete

Start the time service

net start w32tm

Configure a suitable set of NTP servers, I use the pool project.

ww32tm /config /manualpeerlist:"0.uk.pool.ntp.org 1.uk.pool.ntp.org 2.uk.pool.ntp.org 3.uk.pool.ntp.org" /syncfromflags:manual /update

and force the time service to resync against the configured time servers

w32tm /resync