PTP is an international standard specified in IEEE1588 and revised in 2008 with version 2. The Precision Time Protocol (PTPv2) is a network-based time synchronization communication protocol that can be used to synchronize clocks of different device types, providing time accuracy in the sub-microsecond range. PTPv2 is based on Ethernet. Compared to NTP, PTPv2 is embedded in the physical layer and thus we talk about true hardware-based time stamping for precise time synchronization of all participants in an Ethernet network.
PTPv2 is a relative time sync mechanism. One participant is selected to work as the master clock, which delivers time sync messages to all slaves. The sync process starts with a time sync telegram to the network. All participants (slaves) calculate the time difference (delay) between their local time and the given master clock and adapt step by step to a time difference less than 2 µs. For example, assume that the PTP source sends a PTP message advertising a time of 1:00:00 pm. The problem is that this message will take time to reach its destination. If the PTP packet took 1 second to reach its source, it would be 1:00:01 pm, when the source receives a PTP packet indicating 1:00:00 pm. So the network latency needs to be compensated, which is achieved through a series of messages exchanged between master and slave clocks, as shown in the next Figure.