Basics of real-time measurement, control, and communication using IEEE 1588: Part 4One of the primary objectives of IEEE 1588 is to achieve sub-microsecond synchronization accuracy. To achieve this objective, the protocol must:
Provide one or more events that can be timestamped and used as the basis for computing clock corrections,
Communicate the needed timestamps to the clocks requiring this information, and
Overcome timing impairments introduced by the various components of the system.
Figure 3.9 below is a simplified diagram of the sequencing and critical timestamps associated with timing messages.
|Figure 3.9. Timing diagram for synchronization messages|
The basic sequence in synchronizing a slave clock to a master clock is:
The master clock sends a Sync message to all directly connected slave clocks. The master clock generates a timestamp t1 based on the master's local clock, indicating the Sync message sending time at the master clock.
A slave clock receives the Sync message and generates a timestamp t2 based on the slave's local clock, indicating the Sync message receipt time at the slave.
The master clock communicates the Sync message sending timestamp t1 to the slaves as a data field in a Follow Up message.
The slave clock sends a Delay Req message to the master clock. The slave clock generates a timestamp t3 based on the slave's local clock, indicating the Delay Req sending time at the slave clock.
The master clock receives the Delay Req message and generates a timestamp t4 based on the master's local clock, indicating the Delay Req receipt time at the master clock.
The master clock communicates the Delay Req receipt timestamp t4 to the slave as a data field in a Delay Resp message.
The slave uses the four timestamps t1, t2, t3, and t4 to compute the offset between the slave and master clocks.
The offset between the time as seen by the master clock and a slave is computed based on the four timestamps present in the slave after an exchange of these four timing messages. This computation is based on the following definitions of the quantities illustrated in Figure 3.9:
The measured difference between the time a Sync message is received at the slave and the time it was sent by the master:
ms difference = t2 - t1 (3.1)
The measured difference between the time a Delay Req message is received at the master and the time it was sent by the slave:
sm_difference = t4 - t3 (3.2)
The actual offset between the time observed on the master and slave clocks:
offset = tslave - tmaster (3.3)
The actual propagation time for a Sync message traveling between the master and slave clocks:
ms delay = t2m - t1 (3.4)
The actual propagation time for a Delay Req message traveling between the slave and master clocks:
sm delay = t4 - t3m (3.5)
The following relationships are derived from first principles:
= offset + ms delay
sm difference = - offset + sm delay (3.7)
Rearranging Equations 3.6 and 3.7 yields
offset = [(ms difference - sm difference) - (ms delay - sm delay)] ÷ 2 (3.8)
ms delay + sm delay = ms difference + sm difference (3.9)
Thus, there are two equations (Equations 3.8 and 3.9) involving two measured quantities: ms difference and sm difference; and three unknowns: offset, ms delay, and sm delay.
It is clearly impossible to solve Equations 3.8 and 3.9 without additional independent measurements or assumptions. This problem is not confined to IEEE 1588, but is shared by all synchronization protocols based on the exchange of timing information over channels with unknown propagation delays. The assumption - Equation 3.10 - used by the PTP protocol is that the two propagation times are equal.
If the error caused by this assumption is significant relative to the required synchronization accuracy, then some sort of calibration correction must be applied.
sm delay = ms delay = one way delay (3.10)
Combining Equations 3.1, 3.2, 3.8, 3.9, and 3.10
offset = (ms difference - sm difference) ÷ 2 = [(t2 - t1) - (t4 - t3)] ÷ 2 (3.11)
one way delay = (ms difference + sm difference) ÷ 2 = [(t2 - t1) + (t4 - t3)] ÷ 2 (3.12)