Precision Time Protocol (PTP) is described in the IEEE 1588 standard and is a protocol for distributing time across a packet network. It works by sending a message from a master clock to a slave clock, indicating the time shown on the master. However, the main challenge is calculating the delay of that message, and much of the PTP protocol is dedicated to solving this problem.
For example, if I send a letter with the time and date I sent it, that is not useful to the recipient unless they know how long the letter took to arrive. If they knew I used a next-day delivery service, they could adjust their calendar correctly, but not their clock. The precision with which they know the delay is the precision with which they can adjust their time.
PTP works through a bidirectional exchange of time messages, known as “event messages”. From these, it is easy to calculate a “round-trip delay”, and the protocol calculates the delay of one-way messages simply by dividing the round-trip delay in half. This assumption is the protocol’s Achilles heel: it simply does not have the information needed to correctly calculate the one-way delay. An asymmetry problem occurs when the outbound and return messages take different times to cross the network, resulting in an incorrect time estimate.
The protocol uses three key techniques to reduce error in delay estimation:
- Hardware timestamping: records with precision the time at which event messages cross the physical interface. This eliminates software delay in recognizing and processing messages.
- Boundary clocks: recover the time at intermediate points in the network and transmit it in a new set of messages. These clocks are typically located in network switches and routers and help reduce the effect of network delay variation, such as that caused by queue delays.
- Transparent clocks: can also be found in network switches and routers, but instead of recovering and resending the time, they simply record the time the message took to traverse that switch or router. When the message finally reaches the slave clock, it contains information about accumulated delay across the network, allowing the slave clock to align its local time more precisely with the master clock.
#Synchronization #SYNC #Networks #IEEE #PTP