
By
Kevin Stottler
How Modern Devices Keep Perfect Timing: Understanding NTP and PTP Synchronization
With the increasing connectivity of everyday devices such as phones, cars, and televisions, manually setting clocks is becoming a thing of the past. Have you ever wondered how this technology works? This post will explain and compare Network Time Protocol and Precision Time Protocol, two methods for automatically synchronizing devices over IP networks, and provide some historical context.
Carrying out activities at coordinated times applies to activities as simple as meeting a friend for coffee or as complex as military operations. In earlier decades, radio systems like NIST’s WWVB broadcast were used, phone modems dialed time references, and clocks were set by hand. As computer networks grew to hundreds or thousands of nodes, it became less practical for each node to use one of these methods. This historical context is crucial to understanding the evolution of time synchronization methods.
What is Network Time Protocol (NTP)? How it Works and When It’s Accurate Enough
The development of the Network Time Protocol solved this problem. In a network with a thousand nodes, only a few now had to synchronize themselves directly to primary references such as radio broadcasts, satellites, or atomic clocks. NTP is hierarchical, with servers connected to primary references considered “Stratum 1.”
Additional servers can synchronize with Stratum 1 servers, becoming Stratum 2, and so on. This allows more capacity to be added and the network to scale up without adding more satellite receivers or atomic clocks. Some networks also use Anycast, which directs traffic to the nearest server, or Round Robin or pooling, where DNS is used to direct clients to one of many servers.
These methods distribute requests evenly among a group of servers to balance load or provide redundancy.
Like many other protocols, NTP works by a client sending a request to a server and receiving a response. With NTP, the client keeps track of the time at which the request was sent (t1), the server responds with the times the request was received (t2), and the reply sent (t3) to account for processing time. The client records when the response is received (t4).

Using these four timestamps, the client can estimate how long the response took from the server (path delay) and calculate the difference between its own clock and the server’s. Without this delay compensation mechanism, the client’s clock would be offset by the path delay, which can be around 50ms on the Internet.
This relatively simple technique, requiring only software on most nodes, can often synchronize machines to within 10ms over the Internet, and within 1ms over local networks where routing is more predictable. The primary source of error is if the delay is not symmetrical, such as on congested networks. However, this technique is plenty accurate enough for many use cases, such as timestamping log events or messages.
Public vs. Private NTP Servers: Should You Rely on Public NTP Servers?
There are many public servers on the Internet that can provide accurate time for free, operated by various software vendors, telecom providers, universities, and governments. This is usually fine for synchronizing workstations. However, these services are not guaranteed, and network conditions outside local control may affect accuracy or availability.
Consider deploying a dedicated local NTP server such as the Safran SecureSync to provide resilient network synchronization for use cases needing greater accuracy, availability, or control.
What is Precision Time Protocol (PTP)? High Accuracy Time Sync for Critical Systems
For many general use cases, NTP is plenty accurate and cost-effective. For synchronizing humans, NTP works well. However, if you’re synchronizing machines, especially fast-moving ones, you may need the Precision Time Protocol (PTP).
Precision Time Protocol (PTP) is defined in IEEE 1588 and is designed to enable tighter synchronization within a local network. PTP can usually synchronize two nodes to within microseconds, and with hardware timestamping, even sub-microsecond accuracy is possible.
These are orders of magnitude better than NTP. The trade-off is greater complexity and cost to implement. There are no public servers like with NTP, so each network requires its own grandmaster to be configured at the top of the hierarchy.
How PTP works: Sync Messages, Hardware Timestamps, and Network Aware Devices
The protocol functions very similarly to NTP, with the timeTransmitter and timeReceiver nodes exchanging messages to calculate both the network delay and the offset of their clocks. However, the timeTransmitter initiates the exchange by sending a sync message, often as a multicast to all timeReceivers. Network interfaces designed to support PTP are also capable of hardware timestamping, recording the time when a packet is received or sent on the wire rather than relying on the operating system.
Another significant difference is the behavior of the protocol when traversing routers or switches. In a PTP network, most intermediate devices like routers and switches must be PTP-aware. They should account for queuing or processing delays in passing PTP messages. These devices, referred to as either boundary clocks or transparent clocks, play a vital role in the seamless operation of the PTP network. Transparent clocks update the timestamps in the PTP messages and “transparently” pass them along. Boundary clocks act as timeReceivers to upstream devices and then act as timeTransmitters to downstream devices.

Sectors where PTP is common are generally those where specialized networks are used, and increased accuracy is required. This includes telecom and other utilities, such as coordinating cellular handoffs or grid switching, high-frequency trading, and industrial automation, to ensure that separate machines can make coordinated movements.
Safran offers several products, including SecureSync, that can provide PTP time, NTP and other outputs such as IRIG. For enhanced resilience, M-Code can be supported.
PTP vs NTP: Key Differences in Accuracy, Use Cases, Complexity, and Cost

Example Use Cases

Choosing Between NTP and PTP: What’s Right for Your Application?
The problem of synchronizing time to coordinate action is not just an old one, but a crucial one in our modern interconnected world. NTP and PTP, two common approaches, play a significant role in solving this problem. While NTP can synchronize humans, PTP is often needed to synchronize machines. The trade-off for the higher performance of PTP is its increased cost and complexity. Beyond PTP, a technology called White Rabbit is capable of nanosecond-level synchronization but requires dedicated hardware and infrastructure.
Poor time synchronization can lead to out-of-order actions or event logs when designing a system, which can be challenging to troubleshoot. However, by considering this need earlier in the design process, scheduled tasks execute at the correct time, and logs reflect the actual time of events. This proactive approach can significantly enhance the efficiency of your system. Talk to us about NTP or PTP for your application by emailing sales@safranfs.com or filling out our inquiry form here.