Computers Showing Different Times: Fixing Time Synchronization with NTP

Networking · Last updated · About 7 min read

Why computers, gateways and network devices drift apart on the clock, what breaks when they do, and how to set up and check NTP time synchronization on Windows, Linux and radio systems.

One of the most common support calls on any network that carries radio traffic is "these computers do not agree on what time it is." The cause is almost always the same: nothing is keeping the clocks synchronized, or something is stopping the synchronization that is configured. This article explains what goes wrong, why it matters, and how to check and fix it. For the protocol itself (stratum levels, how the timestamps are exchanged) see NTP (Network Time Protocol).

Why a few minutes of difference matters

Every computer has its own clock, and every clock drifts. An ordinary PC clock can be off by seconds per week; a computer that has been powered off, or a virtual machine that was paused, can be off by minutes or hours. On a radio or dispatch network that causes real problems:

  • Logs and recordings do not line up. When a call is recorded by one system, logged by a dispatch history log and reported by a gateway, the three timestamps are only comparable if the clocks agree. A five-minute gap turns "what happened at 14:02?" into guesswork.
  • GPS and event data look wrong. The RadioPro installation guide singles out audio logging and GPS tracking as the features most sensitive to bad time.
  • Logins and certificates fail. Windows domain logins (Kerberos) reject a computer whose clock is more than about five minutes away from the domain controller by default, and secure web connections fail when the clock puts the current date outside a certificate's validity period. A "can't log in" or "certificate is not valid" error is often really a clock problem.
  • Licenses and scheduled jobs misfire. Time-limited licenses, scheduled tasks and backups all trust the local clock.

What the RadioPro documentation says

The RadioPro IP Gateway installation guide states that the system time must be accurate "to prevent logging errors and operational glitches". Its rules are simple:

  • The gateway should carry the same time as the PC the client runs on, and when a system has several gateways they must all be synchronized with each other.
  • The best way to do that is a time server, which can be a time server on a local-area-network PC, one managed by the Windows domain, or a public NTP server on the Internet.
  • During gateway installation the time server's address is entered in the NTP Server field of the IP Configuration Utility (ICU) and saved. All gateways must reference the same time server.
  • If the NTP server is entered as a host name instead of an IP address, the gateway also needs a DNS server address (networking-dns). If an IP address is used, the DNS field can stay blank.
  • If no time server can be reached, a custom local time can be entered instead. That is a fallback only: it does not keep the clock correct over time.

The step-by-step gateway procedure is in radiopro-ip-gateway-installation-and-configuration.

How computers normally get the time

Device Default behaviour
Windows PC joined to a domain Takes time from the domain controller. Domain controllers take it from the one holding the primary domain controller role, which should be set to an outside source or a hardware clock.
Windows PC not in a domain Uses the Windows Time service with a public server, but contacts it infrequently (by default about once a week), so a PC can drift visibly in between.
Linux server Runs a time service such as chrony, systemd-timesyncd or ntpd, pointed at the servers listed in its configuration.
Router, switch, gateway, appliance Often has no battery-backed clock of its own. It needs an NTP server address configured, or its time can be wrong from the moment it restarts.
Virtual machine May take time from the host through the hypervisor's tools, from NTP, or from both. Two sources fighting each other is a classic cause of a clock that jumps.

The usual causes of mismatched clocks

  1. No time source configured. The device is simply using its own drifting clock.
  2. UDP port 123 is blocked. NTP uses UDP port 123. A firewall or router rule that blocks it, in either direction, stops synchronization with no obvious error. See networking-udp and firewall-types-stateful-vs-stateless.
  3. The server name cannot be resolved. A host name such as a public pool name only works if DNS works. Try the IP address.
  4. Isolated network. A radio network deliberately kept off the Internet cannot reach a public server. Give it a local time source: a domain controller, a server running an NTP service, or a GPS-based NTP appliance.
  5. Different devices point at different servers. Each one may be right, but they are not right together. Choose one source and point everything at it.
  6. Two sources fighting. For example a virtual machine that takes time from both the host and NTP, or a PC with a manual time setting and a domain.
  7. Time zone or daylight-saving mismatch. A difference of exactly one hour, or of a whole number of hours, is a time-zone or daylight-saving setting, not a drift problem. NTP delivers UTC; the time zone is set on each device. Check that every device uses the same zone setting. See also the note below on UTC in logs.
  8. A large initial error. Many time services will not make a big correction slowly: if the clock is hours or days off, set it close by hand first, then let NTP take over.
  9. Dead clock battery. A PC that resets to an old date at every power-up has a failed motherboard battery. NTP will correct the time after boot, but only if the network is up at that point.

A sound design

  • Pick one authoritative time source for the site and point every PC, server, gateway, router and recorder at it.
  • Prefer a local source (domain controller, server, or GPS-based appliance) that itself synchronizes upstream. That keeps working when the Internet is down and keeps all internal devices consistent with each other, which matters more than being exactly right to the millisecond.
  • If devices use the public Internet directly, use more than one server name and keep the list identical across devices.
  • Document the time source and time zone for every site, the same way the IP addresses are documented (dhcp-vs-static-ip-addressing).

Checking and fixing the time on Windows

Open a Command Prompt as administrator.

w32tm /query /status
w32tm /query /source
w32tm /query /peers

The first shows when the clock last synchronized and from which source. If the source says "Local CMOS Clock" or "Free-running System Clock", the PC is not synchronizing with anything. To see how far off the PC is from a particular server, without changing anything:

w32tm /stripchart /computer:time.server.address /samples:5 /dataonly

To point a PC that is not in a domain at a server of your choice, and sync now:

w32tm /config /manualpeerlist:"time.server.address" /syncfromflags:manual /update
net stop w32time
net start w32time
w32tm /resync

To make a PC that is in a domain use the domain hierarchy again:

w32tm /config /syncfromflags:domhier /update
w32tm /resync

Replace time.server.address with the IP address or name of your time source. See network-troubleshooting-commands for other tools that help prove whether the server can be reached.

Checking the time on Linux

On a system using chrony, chronyc tracking shows the current offset and chronyc sources -v shows which servers are in use and whether they are reachable. On systems using systemd-timesyncd, timedatectl status shows whether the clock is synchronized and the active time zone.

A note on UTC in logs

Many systems keep logs in UTC while others use local time. When two logs seem to be a fixed number of hours apart even though both clocks are right, check whether one of them is recording UTC before changing any clock.

NTP is not the same as simulcast timing

NTP keeps computer clocks within milliseconds of each other. The timing that keeps simulcast transmitters in step is a much tighter, separate system disciplined by GPS at each transmitter site. A radio network normally has both, and fixing one does not fix the other. See simulcast and gps-global-positioning-system.

Quick checklist

  • All devices point at the same time source?
  • UDP 123 allowed between the devices and the source?
  • Host name resolves (DNS configured), or an IP address used instead?
  • Same time zone and daylight-saving setting everywhere?
  • No second source (hypervisor tools, manual setting) overriding NTP?
  • For isolated networks: is there a local time source?

Source documents

This article summarizes the following published CTI Products manuals. They are the authoritative reference.

This article is part of the CTI Products Knowledge Base. Questions about RadioPro or MCN products? Call +1 (513) 595-5900 or email info@ctiproducts.com.

Informational only. This article is general background and is not engineering, safety, legal or regulatory advice. Verify requirements with the equipment manufacturer and the applicable authority before relying on it. Product names and trademarks belong to their respective owners.