skip navigation

Timing Knowledge Centre

How NTP Synchronises Your PC

Learn about NTP and how the Network Time Protocol is used to ensure your PC maintains accurate time.

Estimated reading time: 4 minutes

Introduction

Every time you glance at your computer's clock, you're seeing the result of a sophisticated synchronisation process that happens silently in the background. Network Time Protocol (NTP) ensures your PC maintains accurate time by connecting to a global network of time servers, keeping your system aligned with Coordinated Universal Time (UTC) to within milliseconds.

What is NTP?

Network Time Protocol is a networking protocol designed to synchronise clocks across computer networks. Developed in the 1980s, NTP has become the standard method for time synchronisation on the internet. It operates using a hierarchical system of time servers, organised into different "stratum" levels that indicate their distance from the primary time source.

The Stratum Hierarchy

NTP's architecture resembles a pyramid. At the top sit Stratum 0 devices: atomic clocks, GPS satellites, and other highly accurate timekeeping sources. These feed into Stratum 1 servers, which directly connect to the primary time sources. Stratum 2 servers synchronise with Stratum 1 servers, and so forth.

If your PC is on a company network, it may synchronise with an in-house Stratum 1 server that the organisation operates for improved accuracy and security. Otherwise, your PC typically operates at Stratum 3 or 4, synchronising with public NTP servers managed by organisations like the National Physical Laboratory or universities.

How NTP Synchronisation Works

When your computer needs to synchronise its clock, it sends a request to an NTP server containing a timestamp. The server responds with its own timestamp, and your system calculates the round-trip delay. Using this information, along with the server's timestamp, your system can determine both the accurate time and the network delay involved in the communication.

The process involves four timestamps:

  • T1: When your PC sends the request
  • T2: When the server receives the request
  • T3: When the server sends the response
  • T4: When your PC receives the response

Your computer uses these timestamps to calculate the clock offset and network delay, allowing it to adjust its system clock accordingly.

Dealing with Network Delays

Network latency poses a significant challenge for time synchronisation. NTP addresses this by assuming that network delays are symmetrical (that packets take roughly the same time to travel in both directions). While this isn't always accurate, it provides a reasonable approximation for most networks.

NTP also employs sophisticated algorithms to filter out irregular network delays and identify the most reliable time sources. It continuously monitors multiple servers and selects the best candidates based on factors like stability, accuracy, and network proximity.

Maintaining Accuracy

Rather than making abrupt time changes that could disrupt running applications, NTP typically adjusts your system clock gradually. This process, called "slewing," speeds up or slows down the clock slightly until it reaches the correct time. Only when the time difference exceeds a certain threshold (usually 128 milliseconds) will NTP step the clock immediately.

Your system also maintains a frequency adjustment to compensate for the natural drift of your computer's internal crystal oscillator. Every quartz crystal runs at a slightly different rate, and environmental factors like temperature can affect this frequency. NTP learns your system's particular drift rate and continuously adjusts for it.

Different Implementations

It's important to note that not all systems implement NTP in the same way. Windows Time service (W32Time), for example, uses Simple Network Time Protocol (SNTP), which is a more basic version that lacks the complex filtering and error management systems found in full NTP implementations like ntpd on Linux and Unix systems. This results in lower accuracy compared to proper NTP daemons.

Security Considerations

Modern NTP implementations include security measures to prevent malicious time servers from disrupting your system. NTP version 4 supports authentication mechanisms and can detect servers that provide inconsistent time information. Many organisations run their own internal NTP servers, often at Stratum 1 level, to reduce dependence on external sources and improve both security and accuracy.

Conclusion

NTP provides an elegant solution to time synchronisation, keeping millions of computers worldwide running in harmony. By understanding how this protocol works, IT professionals can better appreciate the complexity behind something as seemingly simple as checking the time. Whether you're managing server farms or troubleshooting network issues, NTP's reliable timekeeping remains fundamental to modern computing infrastructure.