Brief PTP Basics
Precision Time Protocol (PTP) uses a simple process that allows the Slave Clock to calculate the difference in time between the Grandmaster (reference) and the Slave. It is based on the assumption that the link is symmetrical, and the packet delay is the same in both directions of communications, and that it remains fairly constant. The left side shows the simplified process (concept) used to calculate the Offset (error) and correct it.
In reality, there are some constant delays and asymmetry caused by the medium, as well as noise generated by active elements (switches, buffers), traffic and temperature changes, among others, that cause packet jitter and PDV, which are a bit more difficult to work with.
T1 is the Sync message departure timestamp, from the GM port. In one-step clocks the timestamp is carried by the Sync Message itself. In two-step clocks the time stamp is carried by a FollowUp message.
T2 is the Sync message arrival timestamp at the test equipment or SC port.
T3 is the DelayRequest departure timestamp, from the test equipment or SC port.
T4 is the DelayRequest arrival timestamp at the GM port. Its value is sent back to the test equipment or SC in the DelayResponse messages.
Offset calculations are used to correct any Time Error at the SC, so it stays in sync with the GM, with the assumption that forward and reverse delays are symmetrical.
Offset = [(T2-T1)-(T4-T3)]/2