Network Time Synchronization Explained: NTP, PTP, Clock Drift and Accuracy
A practical guide to how computers agree on time, why clocks drift, when NTP is enough, and what a PTP timing network needs to deliver high-accuracy synchronization.

Time is a hidden dependency in almost every networked system. Authentication, event logs, distributed databases, telecom equipment and industrial controls all depend on clocks that are sufficiently aligned. This guide explains the protocols and engineering decisions behind reliable network time.
Why accurate time matters on a network
A network can deliver packets quickly and still produce confusing failures when the clocks on its devices disagree. A server may record a login before the request that triggered it. Logs from two firewalls may appear to show events in the wrong order. A database replica may reject a certificate or struggle to reconcile records. Industrial controllers, telecom equipment, power systems, financial platforms, and measurement devices may need clocks aligned far more tightly than ordinary office computers.
Time synchronization is the process of bringing clocks on different devices into agreement with a reference. Network Time Protocol (NTP) is the widely deployed Internet protocol for synchronizing computer clocks. Precision Time Protocol (PTP), standardised as IEEE 1588, is designed for applications that need tighter synchronization, often within a managed local network with suitable hardware support.
These protocols do not make every clock perfect. They estimate differences, compensate for network delay, adjust local clocks, and continue tracking oscillator behaviour. The achievable result depends on the source, the network path, timestamping hardware, configuration, and the definition of accuracy required by the application.
The most useful starting point is to distinguish three ideas: the correct time of day, the frequency at which a clock runs, and the phase or offset between two clocks. An application may need the correct UTC time, a stable frequency, close phase alignment, or all three. NTP and PTP deployments should be designed around that requirement rather than a vague promise of millisecond or microsecond accuracy.
Clock time, frequency, phase, offset and drift
A clock has an oscillator that advances its local counter. The oscillator is never perfectly identical to an ideal reference. Its rate can vary with temperature, voltage, ageing, vibration, manufacturing tolerance, and power conditions. A clock that runs slightly fast accumulates positive error; one that runs slowly accumulates negative error.
Offset is the difference between a local clock and a reference at a particular instant. Frequency error describes how quickly that difference changes. Drift is often used informally for accumulated timing error or a changing clock rate, so technical reports should state exactly which quantity is being measured. Phase describes the position of a periodic signal relative to another signal. In telecom and industrial systems, phase alignment can be critical even when the time-of-day display looks correct.
Resolution is not accuracy. A clock may display nanoseconds while being wrong by milliseconds. Precision describes repeatability or spread of measurements; accuracy describes closeness to the reference. A system with stable but biased timestamps may be precise and inaccurate. A system with noisy measurements may sometimes be accurate but lack repeatability.
Time synchronisation software usually disciplines the local clock rather than simply setting it once. It estimates offset and frequency error over repeated exchanges, filters noisy observations, and adjusts the clock rate. A large correction may be stepped in some circumstances, but stepping time backwards can confuse applications. Slewing gradually changes the clock rate to converge without an abrupt jump. Implementations and operating systems make different choices during startup, large offsets, and exceptional events.
How NTP measures network time
NTP commonly uses a four-timestamp exchange. The client records when it sends a request (T1). The server records when it receives the request (T2), when it sends the response (T3), and the client records when the response arrives (T4). With these values, the client estimates round-trip delay and clock offset.
The classic offset estimate is θ = [(T2 − T1) + (T3 − T4)] / 2. The round-trip delay estimate is δ = (T4 − T1) − (T3 − T2). Here, θ is the estimated server-minus-client clock offset and δ is the network round-trip delay after subtracting server processing time. These calculations assume that the forward and reverse path delays are sufficiently symmetric. If the outbound and inbound paths have different delays, the offset estimate can be biased. Queueing, route changes, congestion, wireless contention, and asymmetric routing can all influence the result.
NTP does not simply trust the most recent response. Implementations collect samples, reject implausible measurements, filter jitter, compare sources, and discipline the local clock. Multiple independent sources help a client detect a server that is wrong or unreachable. The protocol's algorithms and data structures are specified in IETF RFC 5905, with later updates and extensions.
NTP normally uses UDP port 123. Firewalls, NAT, captive networks, and enterprise security policies can block or alter the traffic. A device may show that a time server is configured even when no valid samples are being accepted. Monitoring must therefore distinguish configured peers from selected, synchronised sources.
Stratum: distance in the NTP hierarchy
NTP uses the term stratum to describe the hierarchy of time sources. A stratum 1 server is directly connected to a reference clock such as a GNSS receiver, radio clock, or other authoritative timing source. A stratum 2 server synchronizes from one or more stratum 1 servers. A stratum 3 server synchronizes from stratum 2, and the hierarchy can continue.
A lower stratum number does not automatically mean a more accurate server. It describes the source's position in the hierarchy, not a complete quality score. A well-engineered stratum 2 server with stable sources and a good network path may provide a better measurement to a particular client than a poorly configured stratum 1 server reached over a congested or asymmetric path.
NTP also uses quality information such as root delay, root dispersion, reachability, and peer-selection behaviour. Administrators should assess the source's traceability, stability, independence, and network path, not select a source based only on its stratum label. Public time services should be used according to their published policies; high-volume clients should generally use an organisation's approved service or a suitable pool arrangement.
An NTP hierarchy is useful because it reduces the number of clients that need to reach external sources and gives an organisation control over its internal timing policy. Internal servers can obtain time from multiple upstream sources and serve local devices. Redundancy must be genuine: several names that resolve to the same upstream provider or the same physical reference do not provide independent failure protection.
NTP, SNTP and operating-system time services
Simple Network Time Protocol (SNTP) is a simplified subset of NTP intended for devices that do not need the full selection and discipline capabilities of a complete NTP implementation. A small embedded device may use SNTP to obtain time periodically. A general-purpose server, router, or enterprise time service usually benefits from a full implementation with source selection, filtering, and robust clock discipline.
The operating system often provides a time service that combines protocol clients, kernel clock discipline, hardware clock management, and administrative policy. Windows, Linux, macOS, network appliances, and embedded systems expose different configuration tools. A command that displays a configured server is not necessarily evidence of synchronization. Look for the selected source, last successful update, offset, dispersion or uncertainty, and service health.
A computer typically has a real-time clock that continues keeping time while the system is powered off, often using a battery. At boot, the operating system may read that clock and then correct it using network time. Virtual machines can have additional interactions with hypervisor time synchronization. If two agents continually adjust the same guest clock, they may fight each other. Choose one clear authority for each environment and document how the guest obtains time.
Mobile devices may synchronize through carrier or platform mechanisms that are not directly exposed as a configurable NTP client. A phone's displayed time can be correct without the user choosing a public NTP server manually. For troubleshooting, separate automatic time-zone selection from network time synchronization: a correct clock value with the wrong time zone is not necessarily an NTP fault.
What PTP is designed to solve
PTP, defined by IEEE 1588, is intended for applications where ordinary software-based network time exchange is not accurate enough. Examples include telecom networks, industrial automation, measurement systems, broadcast infrastructure, and power utility environments. PTP can achieve very tight alignment when the whole timing path is engineered to support it.
A major difference is timestamp placement. A software NTP or PTP client may timestamp a packet after it has passed through parts of the operating system and network stack. Variable processing and queueing delay add uncertainty. Hardware timestamping can capture packet events closer to the physical interface and reduce uncertainty from software scheduling. PTP deployments often use timestamp-capable network interface cards and, where the chosen profile and accuracy target require them, boundary or transparent clocks. Software timestamping is possible, but its achievable accuracy is generally more sensitive to host load and packet-processing variation.
PTP also defines network clock roles and mechanisms for measuring link or path delay. The network can include ordinary clocks, boundary clocks, and transparent clocks. Correct deployment requires compatible devices, a suitable PTP profile, configured domains, and a network topology that supports the intended timing performance. Merely enabling a PTP option on an endpoint does not guarantee precision.
PTP is not simply a faster version of NTP. It has a different architecture, message model, operational requirements, and security considerations. NTP is often the practical choice for general IT systems. PTP is appropriate when the application has a measurable requirement for phase or time accuracy and the network can support it.
How a PTP exchange works
A PTP grandmaster distributes time information to clocks in its domain. A common two-step exchange sends a Sync message and then a Follow_Up message containing a precise origin timestamp. The receiving clock records its ingress timestamp. Depending on the delay mechanism, it also exchanges delay request and response messages or peer-delay messages to estimate the path delay.
With the measured timestamps and delay, the receiving clock estimates its offset from the master and adjusts its local clock. One-step clocks may include the timestamp directly in the Sync message, while two-step clocks send a separate Follow_Up. Hardware support and the chosen PTP profile determine which modes are available and interoperable.
PTP domains separate timing systems that may coexist on the same network. A domain number and profile help define which messages a clock participates in and which behaviour it expects. Devices must agree on the profile, transport, delay mechanism, domain, and relevant configuration. Mismatches can result in a clock that sees PTP packets but never becomes synchronised.
The Best Master Clock Algorithm (BMCA) helps select the best available master according to clock quality and dataset attributes. The exact decision process depends on the PTP edition and profile. A backup grandmaster can take over when the current master fails, but failover time and phase continuity depend on the network and devices. Redundant timing design should be tested under actual failure conditions rather than assumed from the presence of two configured clocks.
Grandmasters, boundary clocks and transparent clocks
An ordinary clock has a single PTP port and participates as a time receiver or time transmitter. A grandmaster is the selected source at the top of a PTP domain. It may derive time from GNSS, a primary reference, or another traceable source. If the grandmaster loses its reference, it may continue operating in a holdover state, but its uncertainty grows over time.
A boundary clock has multiple PTP ports. It synchronizes one or more downstream segments to an upstream reference and acts as a time transmitter on those downstream links. This divides a large timing network into sections and can reduce the load on the grandmaster. Boundary clocks must be configured and qualified for the required profile and performance.
A transparent clock forwards PTP messages while measuring the time they spend traversing the device. It updates the correction information so downstream clocks can account for residence time. An end-to-end transparent clock measures the delay across the path; a peer-to-peer transparent clock uses link-by-link peer delay. The chosen mechanism must be supported consistently by the devices involved.
Ordinary Ethernet switches may forward PTP packets without providing the timing corrections or deterministic performance expected by a high-accuracy design. Congestion, variable queueing, asymmetric paths, and non-PTP-aware devices can degrade results. A timing-aware switch is not automatically a transparent clock; check the exact model, software, feature licence, profile, and timestamping capabilities.
Accuracy: what affects real-world results
Accuracy depends on the quality of the reference, the oscillator in the client, timestamp placement, packet delay variation, path asymmetry, switch behaviour, network load, and the clock discipline algorithm. GNSS reception can be affected by antenna placement, sky visibility, multipath, interference, jamming, and spoofing. A reference that is advertised as satellite-synchronised still needs monitoring and holdover planning.
In NTP, a client on a stable wired LAN with a well-managed server may achieve very good synchronization for ordinary computing, but results vary. Internet paths add variable delay and asymmetry. A Wi-Fi client may see contention and power-saving effects. A virtual machine may experience scheduling pauses. A client behind a busy firewall may have variable packet handling. It is misleading to promise a fixed accuracy number without defining the measurement method and operating conditions.
PTP can deliver much tighter results when endpoints and the network provide suitable timestamping and clock support for the selected profile. Hardware timestamping is common in precision deployments, but it is not a universal prerequisite for every PTP implementation; software-based implementations may work with lower or less predictable accuracy. Validate the actual timing path against the application requirement. The timing requirement should be written as a measurable limit, such as maximum time error at the application interface, required holdover duration, and allowed recovery after a grandmaster change.
Use a calibrated measurement method to verify the result. Compare independent references, inspect offset and frequency metrics, measure time error at the endpoint, and test under normal and peak traffic. A dashboard showing that the protocol state is "locked" is useful but does not by itself prove that the application receives time within its tolerance.
Clock drift, holdover and oscillator quality
When a device loses its time source, its local oscillator continues to run. The clock enters holdover: it estimates time using the best available frequency information until synchronization returns. The quality of holdover depends on oscillator stability, temperature, elapsed time, and the device's calibration history.
A low-cost oscillator may drift noticeably during a long outage. A temperature-compensated crystal oscillator can be more stable. Telecom and metrology systems may use oven-controlled crystal oscillators or other high-stability references. Rubidium and cesium standards are used where long-term stability and traceability justify their cost and operational complexity. No oscillator should be described as perfect; every reference has an uncertainty and operating envelope.
A holdover specification should say how long the system must maintain time within a stated error. "Keeps time during an outage" is not a useful engineering requirement. The acceptable error may be different for event logs, mobile network synchronization, industrial motion control, and financial timestamping.
After the reference returns, the clock must reacquire synchronization. A large correction can be stepped or slewed depending on the application and system policy. Some systems need monotonic time for measuring elapsed durations even if civil time is corrected. Applications should use appropriate monotonic clocks for timers and elapsed intervals rather than assuming the wall clock never changes.
Time zones, UTC, leap seconds and timestamps
Network synchronization normally distributes a common timescale, commonly UTC or a timescale related to UTC. Time zones are a presentation and policy layer applied by the operating system or application. A server should generally store event timestamps in a consistent form and convert them for display, rather than treating local wall-clock time as a globally unambiguous value.
UTC and local civil time are not interchangeable. Daylight-saving transitions can create local times that occur twice or do not occur at all. A log that records only a local time without an offset or zone identifier can be difficult to interpret during a transition. Use UTC timestamps or include an explicit offset and sufficient time-zone context.
Leap seconds have historically been used to keep UTC close to Earth's rotation, but their handling has created operational complexity. Systems may step, repeat, smear, or otherwise manage the adjustment according to their time service and policy. Different smear policies can temporarily cause two systems to disagree even when both are behaving as configured. Administrators should know the policy of their time sources and avoid mixing incompatible smear behaviours in systems that require tight agreement.
For distributed applications, timestamps alone do not establish causality. Two events may be recorded with nearly identical or imperfectly synchronized wall clocks. Use transaction identifiers, sequence numbers, logical clocks, or tracing context when ordering matters. Time synchronization improves observability; it does not replace application-level ordering design.
Security: spoofing, delay attacks and trusted sources
Time is security-sensitive. A malicious or compromised time source can shift clocks, make certificates appear expired or not yet valid, distort log timelines, interfere with authentication, or complicate incident response. Attackers may try to spoof responses, alter packets, delay synchronization messages, or exploit weak network boundaries.
NTP has security mechanisms and operational guidance. Network Time Security (NTS), specified in RFC 8915, uses TLS-based key establishment and authenticated NTP extension fields to protect client-server exchanges. Support depends on the client and server implementation. NTS does not eliminate every timing attack: an attacker who can delay packets may still influence measurement quality, and a compromised trusted server remains a serious risk.
PTP security is more complicated in some deployments because the timing messages are often distributed and may not follow the same request-response pattern as NTP. PTP networks should be isolated or segmented appropriately, restrict which devices can become grandmasters, protect management access, monitor clock selection and quality, and use security features supported by the chosen profile and equipment.
Do not allow arbitrary endpoints to advertise themselves as trusted timing sources. Use source allowlists, authenticated mechanisms where available, network access controls, and monitoring for unexpected master changes or large time steps. Protect GNSS antennas, timing appliances, and the physical infrastructure that feeds them. A resilient design considers both cyber threats and loss or manipulation of the physical reference.
NTP or PTP: choosing the right approach
For ordinary laptops, servers, routers, business applications, and cloud workloads, NTP is usually the appropriate default. It is widely supported, can use multiple servers, works across routed networks, and does not require every intermediate switch to understand PTP. A well-managed internal NTP hierarchy is easier to operate than a precision timing network for general IT needs.
Choose PTP when the application has a genuine requirement for much tighter time or phase alignment and the devices support IEEE 1588-compatible hardware timestamping. Examples may include telecom radio access networks, industrial control, power utility protection and measurement, professional media, and high-resolution distributed measurement. Confirm the required profile, delay mechanism, transport, grandmaster, and on-path clock capabilities before procurement.
Hybrid environments are common. A facility may use PTP for equipment that requires precise phase alignment while using NTP for servers, workstations, logging platforms, and management systems. The timing architecture must define how sources relate, whether clocks are disciplined independently, and which systems are permitted to bridge or distribute time between domains.
A recent IETF specification, RFC 10030, defines a way to transport NTP messages over PTP for certain environments where hardware can timestamp PTP packets but not ordinary NTP packets. This is a specialised interoperability development, not a reason to assume that all NTP and PTP devices are automatically interchangeable. Check the implementations and constraints before adopting it.
Planning and deploying a reliable time service
Begin by defining the application requirement. Specify the time scale, maximum offset or time error, frequency stability, number of clients, holdover duration, recovery behaviour, and audit or traceability needs. A desktop login server and a telecom radio unit do not need the same timing architecture.
Select independent reference sources. Consider GNSS, national metrology services, upstream time providers, and local reference clocks according to availability and risk. Avoid depending on a single source, network path, power feed, or physical site. Decide how internal servers will distribute time to clients and how they will behave when upstream connectivity is lost.
For NTP, configure a supported implementation with multiple appropriate sources, secure access policy, monitoring, and a documented hierarchy. For PTP, validate the IEEE 1588 profile, domain, grandmaster quality, boundary or transparent clock support, hardware timestamping, delay mechanism, and topology. Do not mix incompatible profile assumptions.
Test normal operation, source loss, path failure, grandmaster failover, network congestion, device reboot, and restoration. Record offset, jitter, frequency correction, root distance or PTP quality indicators, and endpoint time error. Confirm that alarms detect loss of lock, unexpected source changes, holdover expiry, and large corrections.
Finally, document ownership and maintenance. Time appliances need firmware updates, GNSS antenna inspection, battery or oscillator lifecycle planning, access-control review, and periodic performance verification. Include the timing service in disaster recovery exercises. Accurate time is infrastructure, not a cosmetic setting.
Troubleshooting common synchronization problems
If a device shows the wrong time, first distinguish a wrong time zone from a wrong clock. Check whether automatic time-zone selection is enabled, whether the operating system has the correct region, and whether the UTC time itself is inaccurate. Then inspect the configured time service and whether it has selected a valid source.
If NTP is configured but unsynchronised, check UDP port 123 reachability, DNS resolution of server names, firewall policy, source reachability, server response, local clock offset, and service logs. Verify that the server is not being rejected as falseticker or because its quality metrics are outside selection limits. Check whether the device is using a virtualisation host or another agent to adjust its clock.
If offsets vary widely, examine packet delay variation, route asymmetry, Wi-Fi contention, CPU scheduling, virtual machine pauses, and overloaded network devices. Compare wired and wireless results. Inspect more than one time source and compare paths. A single successful packet exchange does not prove stable synchronization.
If PTP does not lock, confirm that the devices use compatible profiles, domains, transports, and delay mechanisms. Check multicast or unicast reachability, PTP event and general message handling, VLAN and QoS treatment, hardware timestamping status, and whether intermediate switches provide the expected clock functions. Review BMCA results and the selected grandmaster identity. A device can receive PTP packets but still reject them because of profile or dataset mismatch.
If time becomes incorrect after an outage, examine holdover duration, oscillator health, source reacquisition, leap-second or smear policy, and whether multiple agents are disciplining the same clock. Collect logs before manually stepping time, because a manual correction can hide the evidence needed to identify the original failure.
Conclusion: measure the requirement, then engineer the clock path
NTP and PTP both solve the problem of synchronizing clocks, but they serve different operational needs. NTP is the practical foundation for most Internet-connected and enterprise computing systems. PTP is designed for much tighter synchronization when hardware timestamping and a suitable network are available. Neither protocol can overcome a poor reference, unstable oscillator, unmeasured path asymmetry, or careless security policy.
A reliable time service begins with a measurable requirement. Choose appropriate sources, design redundancy, monitor offset and uncertainty, understand holdover, and test failover. Keep time zones and display rules separate from UTC synchronization. Use monotonic clocks for elapsed-time measurement and application-level identifiers when event ordering must be unambiguous.
When the application needs only ordinary system time, a robust NTP hierarchy is usually the right solution. When microsecond or tighter alignment is genuinely required, evaluate PTP as an end-to-end timing system—not just a checkbox on a switch. The goal is not to claim that every clock is exact. It is to know how close each clock is, how that estimate was obtained, and how the system behaves when the reference disappears.
Quick deployment checklist
- Write down the required time error, frequency stability, holdover duration and recovery time.
- Use independent reference sources and avoid a single power, site or network dependency.
- Build a monitored internal NTP hierarchy for general IT clients.
- For PTP, verify profile, domain, delay mechanism, transport, grandmaster and hardware timestamp support.
- Measure endpoint time error under normal load and peak traffic.
- Test source loss, path failure, grandmaster failover, reboot and restoration.
- Secure timing sources, restrict master eligibility and monitor unexpected clock changes.
- Document leap-second or smear policy and avoid competing clock-discipline agents.
Frequently asked questions
What is NTP in networking?
Network Time Protocol (NTP) synchronizes computer clocks over IP networks by exchanging timestamped messages and estimating clock offset and network delay.
What is the difference between NTP and PTP?
NTP is widely used for general computer time synchronization across routed networks. PTP, defined by IEEE 1588, targets tighter synchronization and commonly relies on hardware timestamping and timing-aware network devices.
What does NTP stratum mean?
Stratum describes a server's position in the NTP synchronization hierarchy relative to a reference clock. It is not, by itself, a complete measure of accuracy.
What is clock drift?
Clock drift is the change in a clock's error over time, usually because its oscillator runs slightly faster or slower than the reference frequency.
Can NTP achieve microsecond accuracy?
Some carefully engineered systems can achieve very good accuracy, but ordinary Internet NTP performance varies with hardware, software timestamping, network delay and path asymmetry. Do not assume a universal accuracy guarantee.
Why does PTP need special switches or network cards?
Hardware timestamping captures packet timing closer to the physical interface and reduces variable software and queueing delays. Boundary or transparent clocks can also account for time spent in network devices.
What is a PTP grandmaster clock?
A grandmaster is the selected top-level time source in a PTP domain. Other clocks synchronize directly or indirectly to it.
What happens when an NTP or PTP source fails?
A client may select another source or enter holdover using its local oscillator. Accuracy during an outage depends on redundancy, oscillator stability, and the system's holdover design.
Is NTP secure?
NTP can be secured with measures such as Network Time Security (NTS), restricted source policies, network controls and monitoring. Security depends on implementation and configuration.
Should a business use NTP or PTP?
Most business IT systems use NTP. PTP is appropriate when applications have a defined need for much tighter time or phase alignment and the network and endpoints support a suitable IEEE 1588 design.
Standards and further reading
This original guide is based on the following protocol specifications and technical references. Device behaviour and supported profiles vary by vendor and model; consult the implementation documentation before deployment.
- IETF RFC 5905: Network Time Protocol Version 4
- IETF RFC 8633 (BCP 223): Network Time Protocol Best Current Practices
- IETF RFC 8915: Network Time Security for NTP
- IETF RFC 10030: NTP over PTP
- IETF RFC 9760: Enterprise Profile for PTP
- ITU-T Recommendation G.8261: Timing and Synchronization Aspects in Packet Networks
- NTP Project: IEEE 1588 Precision Time Protocol