G.8275.1 supports only the delay mechanism.
Figure 1 shows the process of calculating the link delay and time offset between the master and slave devices using the delay mechanism.
The master device sends a Sync message at t1. If the master device works in one-step mode, t1 is sent to the slave device through the Sync message. If the master device works in two-step mode, t1 is sent to the slave device through the subsequent Follow_Up message.
The slave device receives the Sync message at t2 and obtains t1 from the Sync message in one-step mode or from the Follow_Up message in two-step mode.
The slave device sends a Delay_Req message to the master device at t3.
The master device receives the Delay_Req message at t4.
The master device sends a Delay_Resp message containing t4 to the slave device.
In the preceding process, the timestamps of when the messages are sent or received are generated based on the system clock of the devices. PTP defines the timestamp length as 80 bits in a message.
By exchanging messages with the master device, the slave device obtains t1, t2, t3, and t4, and calculates the average link delay and time offset between the master and slave devices. The slave device can then adjust the local time according to the calculated time offset to synchronize with the master device. The formulas for calculating the link delay and time offset are as follows:
Average link delay = [(t4 - t1) - (t3 - t2)]/2
t2 = t1 + Delay + Offset = t1 + [(t4 - t1) - (t3 - t2)]/2 + Offset
Offset = [(t2 - t1) + (t3 - t4)]/2
In Figure 2, the time offset between the local clock and current time is calculated by PTP, and then the local clock is adjusted based on the time offset.
The Pdelay mechanism calculates the transmission time (link delay) between two communication ports that support the P2P mechanism using Pdelay_Req, Pdelay_Resp, and possible Pdelay_Resp_Follow_Up messages. The P2P mechanism is similar to the E2E mechanism except that it measures the delay of each link and transmits the link delay and resident time of a message on a transparent clock (TC) in a Pdelay_Resp or Pdelay_Resp_Follow_Up message to downstream devices. The P2P mechanism calculates the average link delay of the master and slave nodes based on the delay of each link and resident time on the TC.
In the Pdelay mechanism, the link delay can be measured between two connected ports that support the Pdelay mechanism regardless of their port states.
Timestamps t1 and t2 indicate the time when the Pdelay_Req message is sent and received. Timestamps t3 and t4 indicate the time when the Pdelay_Resp message is sent and received. The formula for calculating the delay of each link is as follows:
Link delay = [(t2 - t1) + (t4 - t3)]/2 = [(t2 - t3) + (t4 - t1)]/2