A common time base for distributed events

NTP vs. PTP: When Distributed Devices Need the Same Time Base

A scale records 10:14:32.220, a camera 10:14:32.185, and the confirmation at the terminal follows at 10:14:33. Two weeks later, someone needs to determine what happened first. If the device clocks are not sufficiently aligned, three precise-looking timestamps still do not establish a reliable sequence.

NTP vs. PTP therefore becomes a process question: How closely must the time information from different sources agree so that sequence, context, and later analysis remain reliable? NTP and PTP matter not because devices should display the same clock time. The required synchronization quality follows from the process—not from the name of the protocol.

System KnowledgeAuthor: Published: Last updated:

Time synchronization aligns device clocks with a common source; the two standard approaches are the Network Time Protocol (NTP) and the Precision Time Protocol (PTP) under IEEE 1588.

An external NTP or PTP time base synchronizes device clocks; device events are then ordered in time and recorded in the ledger

Matching timestamps are not yet a common time base

A timestamp initially describes what a particular clock showed at a particular moment. When events from several devices are brought together, a second question arises: How do those clocks relate to one another?

This becomes relevant as soon as several technical sources describe the same operation. A scale records a mass, a camera documents the state at the workstation, a scanner assigns a container, and a terminal records a confirmation. Each system can provide its own time. That alone does not establish whether those timestamps may be sorted directly against one another.

For later reconstruction, several points therefore have to remain distinct: Which clock produced a timestamp? Where does that clock obtain its time? How far may it deviate from the other clocks involved? And what temporal distinction does the process actually require?

NTP vs. PTP: The difference is not only accuracy

NTP and PTP are used to relate clocks in a network to a common time base. For process architecture, however, they differ not only in how closely two clocks can be aligned. Another decisive factor is how deeply the network itself is involved in synchronization.

QuestionNTPPTP
Time sourceHierarchy of primary and secondary time servers down to the clientGrandmaster as the common time source of a PTP hierarchy
Clock alignmentOffset, delay, dispersion, and jitter are derived from exchanges with time serversTimestamped Sync and Delay messages are used to determine offset and path delay
Time-source selectionNTP can evaluate several candidates and reject faulty sourcesPTP can use a Best Master Clock algorithm to select a master clock
Network involvementOperates across packet-switched networks; achievable quality depends on network characteristicsPTP can include PTP-capable network components as well as Boundary and Transparent Clocks in time distribution
Hardware involvementSpecialized hardware is not a prerequisiteHardware timestamping close to the physical interface can improve achievable accuracy
Process questionIs the temporal comparability actually achieved sufficient for the operation?Does the infrastructure itself need to be involved more closely in the temporal correlation of events?

A review article in IEEE Access by Idrees et al. describes the PTP side of this difference primarily in architectural terms: grandmaster, different clock types, hardware timestamping, and compensation for network delays work together.[3]

The comparison therefore does not answer which protocol is generally better.

How NTP aligns clocks

The Network Time Protocol is designed to synchronize computer clocks over networks. RFC 5905 describes a hierarchical structure: primary time servers sit at the root, while secondary servers and clients obtain time through additional levels. This hierarchy is expressed as a stratum; the RFC identifies stratum 16 as unsynchronized.[1]

Assessing a time source therefore involves more than the clock value most recently set. RFC 5905 distinguishes, among other things, offset, delay, dispersion, and jitter. Offset describes the determined time difference between the server clock and the system clock; delay is the round-trip communication time. Dispersion represents an error bound of the measurement, while jitter describes variation between successive offset values.[1]

NTP can also evaluate several possible sources against one another. The selection algorithm rejects candidates regarded as faulty and continues with the remaining suitable sources. Synchronization therefore involves not only adopting a time value but also evaluating the sources from which that time is derived.[1]

One limit remains the transmission path itself. Calculating the time offset assumes that network delay is approximately symmetric in both directions.[2]

How PTP distributes time across a network under IEEE 1588

PTP, the protocol defined by IEEE 1588, distributes time hierarchically from a common reference to other clocks in the network. The grandmaster acts as the central time source. A Best Master Clock algorithm can determine which clock takes that role.[3]

The literature distinguishes several clock types. An Ordinary Clock is the local clock of an end device. A Boundary Clock sits between the master and downstream clocks and carries synchronization across intermediate nodes. A Transparent Clock, by contrast, measures how long a PTP message remains in an intermediate node and carries that residence time in a correction value.[3]

For synchronization itself, the master and the downstream clock exchange timestamped messages. The master sends a Sync message with its transmission time. In a two-step procedure, a Follow_Up message carries the precise timestamp. The downstream clock records reception, then sends Delay_Req, and the master reports the reception time back in Delay_Resp. These times can be used to determine offset and mean path delay.[3]

For achievable synchronization quality, where the timestamp is created matters. Hardware timestamping can occur closer to the physical interface and thereby reduce the influence of operating-system latency.

PTP does not eliminate uncertainty, however. Its path-delay calculation also assumes that forward and reverse paths are sufficiently symmetric—an assumption that, according to the literature, is generally not exactly true in real networks. Queuing in switches, transmission and processing delays, and drift of local oscillators therefore remain relevant sources of error.

PTP is therefore not simply a more accurate version of NTP. It incorporates parts of the network infrastructure more directly into synchronization.[3]

Industrial control architecture with a modular controller, I/O modules, and wired interfaces.
Illustrative image: In industrial control architectures, different devices and components generate process data. For joint analysis, the reliability of their temporal alignment must be known.

When NTP is sufficient—and when PTP may become necessary

A rule of thumb such as “PTP from one millisecond onward” asks the wrong question. The first issue is which events must later still be distinguished reliably from one another or correlated with one another.

If a scale delivers a value and an approval occurs several seconds later, greater temporal uncertainty may be tolerable than in an operation where a camera image, a measured value, and a machine state belong together within a very narrow time window.

Three questions are therefore particularly important for the selection:

  • How close together can events occur whose sequence still needs to be distinguished reliably?
  • Do the relevant timestamps come from several independent clocks and network paths?
  • What should happen if the required synchronization quality is no longer achieved?

NTP can be sufficient when the synchronization quality actually achieved in the specific network is clearly within what the process requires.

PTP may become relevant when the network path, intermediate components, and timestamping point themselves become part of the required temporal accuracy.

The literature also shows how strongly implementation matters: for hardware-assisted PTP timestamping, deviations down to about 100 nanoseconds are reported; for software-only timestamping, 10 to 100 microseconds. These are reported values from individual implementations, not a guaranteed property of the protocol. The way timestamps are generated alone can therefore change the synchronization quality actually achieved by orders of magnitude.

Network components remain relevant as well. PTP-capable switches and routers may be required for particularly tight synchronization requirements.[3]

The protocol does not determine the time quality a process needs. The process determines which synchronization architecture must deliver that quality.

Timestamps are not synchronized clocks

A device value can carry more than one time reference. In a DataValue, OPC UA can include a SourceTimestamp and a ServerTimestamp alongside the value itself.[4]

The SourceTimestamp identifies the time assigned to the value by the data source. If the value is passed through another OPC UA server, that source timestamp is preserved. The ServerTimestamp, by contrast, describes the time at which the respective server received the value or knew it to be accurate. Two time values can therefore coexist without either being wrong.[4]

For time synchronization, this distinction is important. OPC UA specifies that the SourceTimestamp should be generated as close as possible to the data source and always by the same physical clock. This keeps the provenance of the time reference consistent. It does not yet establish that this clock runs sufficiently close to the clock of a second device.

At the IoT gateway, SourceTimestamp and reception time are available side by side. Keeping them separate creates the basis for later determining which clock produced which time and how that time entered the process.[4]

A complete timestamp therefore answers the question “When, according to this source?” The further question is: How reliably can this time be compared with the times of other sources?

What the system needs to know about its own time

A reliable time base has a state of its own. NTP explicitly defines the state unsynchronized. OPC UA provides for the SourceTimestamp to be set to null when the source that generates that timestamp is unavailable. A missing or uncertain time reference should therefore not silently be replaced by the last known state.[1][4]

There is also the question of whether the time source can be trusted at all. Network Time Security can protect NTP cryptographically. RFC 8915 lists, among other goals, authenticity of synchronization packets and detection of replayed packets.[2]

This protection does not solve every timing problem. In an asymmetric delay attack, an attacker can delay synchronization packets by different amounts. The packet contents need not be modified and their order need not be changed. Because the NTP calculation assumes approximately symmetric network delays, the client can nevertheless calculate an incorrect time offset. RFC 8915 explicitly states that cryptographic means cannot practically eliminate this attack.

The resulting error is limited, however: to at most half the round-trip delay. Multiple time sources or different network paths can further reduce the risk.

Trustworthy transmission and sufficiently accurate time are therefore two different requirements.[2]

What the process architecture must define

The choice of synchronization technology should come at the end of a functional definition, not at its beginning.

The three selection questions lead to concrete requirements: The process must determine what temporal resolution its decisions require, which technical sources are to be compared, and what their time information is based on. It must also be defined how a known deviation or loss of the time source is handled and what information about the time reference remains stored together with an event.

21 CFR 11.10(e) requires time-stamped audit trails.[5] PIC/S PI 041-1 requires that it be possible to identify who performed an activity and when.[6] Neither document specifies the method or accuracy with which the clocks involved must be related to one another. Establishing a reliable temporal classification therefore remains a requirement that the operator has to derive from the process.

A suitable architecture must therefore do more than store a point in time. It must also be designed so that the time base on which that value rests, and the state of that time base, remain identifiable.

Time in the ledger: sequence, context, analysis

420+ records relevant work steps during execution as process events in the process history. Action, time, responsibility, and object remain connected. The process history describes what happened, the audit trail documents the review-relevant course of events, and hash chaining makes subsequent interference with the stored history detectable.

For device events, this means that the ledger can record which information from which source was incorporated into which process context. Device integration keeps SourceTimestamp and reception time separate for that purpose. 420+ does not, however, synchronize the clocks of connected devices.

An append-only history prevents a stored event from silently telling a different story later. But it cannot retroactively correct the fact that two devices relied on clocks that disagreed at the time of capture.

Immutability preserves the information handed down—not automatically the correctness of its time reference.

Time synchronization therefore becomes a prerequisite for later analysis: Only when the time references of the sources involved provide the required comparability can individual events form a reliable timeline. On that timeline, the audit trail and Process Mining can subsequently examine sequences, intervals, and relationships.

The ledger therefore forms the authoritative process history of what was captured and processed. How reliable its temporal sequence is, however, is determined earlier—where the devices involved obtain their time.

Primary sources and further reading

  1. Mills, D. L. et al. (2010): Network Time Protocol Version 4: Protocol and Algorithms Specification. RFC 5905. RFC 5905
  2. Franke, D. et al. (2020): Network Time Security for the Network Time Protocol. RFC 8915, particularly Section 8.6. RFC 8915
  3. Idrees, Z. et al. (2020): IEEE 1588 for Clock Synchronization in Industrial IoT and Related Applications: A Review on Contributing Technologies, Protocols and Enhancement Methodologies. IEEE Access, Vol. 8, pp. 155660–155678. DOI 10.1109/ACCESS.2020.3013669. DOI
  4. OPC Foundation: OPC Unified Architecture – Part 4: Services, v1.05.07, Section 7.11, particularly SourceTimestamp and ServerTimestamp. DataValue
  5. U.S. Food and Drug Administration: 21 CFR 11.10(e), Controls for closed systems – secure, computer-generated, time-stamped audit trails. eCFR
  6. PIC/S (2021): PI 041-1 – Good Practices for Data Management and Integrity in Regulated GMP/GDP Environments, Section 7.5 (ALCOA+). PIC/S PI 041-1