What PTP is
Precision Time Protocol (PTP) is a network protocol that keeps the clocks in many devices locked to one reference. It is defined in IEEE 1588, first published in 2002. The 2008 revision, PTP version 2, is what almost all equipment runs today, and the 2019 revision (sometimes called v2.1) added security and management features while staying compatible with it.
PTP exists because many systems need to agree on time far more closely than the Network Time Protocol (NTP) can manage. NTP typically keeps computers within a millisecond or so of each other on a local network. PTP, with timestamping done in hardware at the network interface, typically reaches sub-microsecond accuracy, and specialised profiles go to tens of nanoseconds. That is tight enough to trigger cameras at the same instant, time-stamp electrical faults across a substation or line up motion axes on separate controllers.
In conversation it is usually just PTP, IEEE 1588 or 1588v2. Its automotive and TSN variant, gPTP, is covered below.
How PTP synchronises clocks
PTP measures two things: how far a device’s clock is from the reference (the offset), and how long messages take to cross the network (the path delay). A short exchange of timestamped messages gives both. The master sends a Sync message and notes the exact send time, t1, which it delivers in the Sync itself or in a Follow_Up message. The slave notes when Sync arrived, t2. The slave then sends a Delay_Req at t3, and the master replies with the arrival time, t4, in a Delay_Resp.
From those four times the slave works out the mean path delay, ((t2 − t1) + (t4 − t3)) ÷ 2, and its offset, ((t2 − t1) − (t4 − t3)) ÷ 2, then steers its clock to remove the offset. The exchange repeats, typically once a second or faster. The maths assumes the path takes the same time in both directions, which is why asymmetric links and software timestamping limit accuracy.
Before any of this, the best master clock algorithm (BMCA) compares the Announce messages from every candidate clock, using priority, clock class and accuracy, and elects the grandmaster. If the grandmaster fails, the next best clock takes over automatically.
PTP clock types
The standard defines several roles. Which ones your switches support decides how accurate the network can be.
-
//
Grandmaster clock. The reference for the whole PTP domain, usually a dedicated appliance or a switch locked to GNSS satellite time, so it also tracks UTC.
-
//
Ordinary clock. A device with one PTP port, such as a camera, controller, data logger or industrial PC. Most end devices are ordinary clocks in the slave state.
-
//
Boundary clock. A switch that is a slave on its upstream port and a master on its other ports. It re-times the signal at each hop, which stops errors building up across a large network.
-
//
Transparent clock. A switch that measures how long each PTP message spent inside it and adds that time to a correction field. End-to-end transparent clocks work with the Delay_Req mechanism; peer-to-peer ones measure each link separately.
-
//
Ordinary switch with no PTP. Still forwards the messages, but its variable queuing delay reduces accuracy, sometimes to tens of microseconds or worse under load.
PTP profiles and gPTP
IEEE 1588 is a toolkit. Industries pick a profile that fixes the options, message rates and transport for their use, and devices must support the same profile to work together.
| Profile | Defined by | Transport | Typical use |
|---|---|---|---|
| Default profiles | IEEE 1588 itself | UDP over IP or Layer 2 | General industrial and test systems |
| gPTP | IEEE 802.1AS | Layer 2 only, peer delay | Time-sensitive networking, automotive, audio-video bridging |
| Power profile | IEEE C37.238 / IEC 61850-9-3 | Layer 2, peer delay | Substations and protection relays |
| Telecom phase profile | ITU-T G.8275.1 | Layer 2, full on-path support | 5G and mobile backhaul phase timing |
| Telecom frequency profile | ITU-T G.8265.1 | UDP over IP | Frequency distribution over packet networks |
| Broadcast profile | SMPTE ST 2059-2 | UDP over IP | IP video production (SMPTE ST 2110) |
gPTP, the generalised PTP of IEEE 802.1AS, is the one most often asked about. It is a tightly defined subset: every device in the path must be time-aware, only peer-to-peer delay measurement is used and it runs directly over Ethernet. That makes behaviour predictable, which is why it is the clock beneath time-sensitive networking. Our guide to time-sensitive networking covers the rest of the TSN family.
Where PTP is used in industrial systems
PTP is now built into much industrial hardware, often without being noticed. Multi-camera machine vision and robot guidance use it to capture frames from several cameras at the same instant; our white paper on synchronising machine vision with IEEE 1588 walks through that case. Substations time-stamp sampled values and fault records with the power profile. Motion control, test rigs, broadcast and mobile networks rely on it too.
Accuracy depends on every link in the chain, so the hardware matters. In our range, the multi-port PoE LAN cards among our Ethernet and PoE frame grabbers list IEEE 1588 PTP, and several add IEEE 802.1AS, so an industrial PC can time-stamp camera traffic in hardware. Selected managed industrial switches list IEEE 1588 v2 PTP with the 1588 default, ITU-T G.8265.1 and G.8275.1 profiles, and IEEE 1588 builds of our board-level embedded Ethernet switches carry PTP inside vehicles and sensor rigs.
Quick answers on PTP
Precision Time Protocol: common questions
Is PTP better than NTP?
For precision, yes. PTP typically reaches sub-microsecond accuracy with hardware support, where NTP manages around a millisecond. NTP is simpler and fine for logs and general IT.
What is the difference between gPTP and PTP?
gPTP is a strict profile of PTP. IEEE 802.1AS requires every device in the path to take part, uses peer delay only and runs over Ethernet, which TSN depends on.
What are the disadvantages of PTP?
It needs support in the hardware. Full accuracy needs hardware timestamping in each device and PTP-aware switches, and asymmetric links or busy ordinary switches reduce it.
What ports does PTP use?
UDP 319 and 320. Event messages such as Sync use port 319 and general messages port 320. Layer 2 profiles use EtherType 0x88F7 instead.
What is a PTP grandmaster clock?
The domain’s reference clock. It is elected by the best master clock algorithm and usually takes its time from GNSS, so the whole network follows UTC.
We supply PTP-capable network cards and switches inside complete industrial systems, and as standard we configure the PTP profile, clock roles and timestamping before the system ships.