4.12.1 Introduction to IEEE 802.1AS / IEEE 1588
Many end applications that are run on a network require a common time base; these applications are often called time-aware. Input sensor data needs timestamping for processing and analysis; motor and brake controls must be synchronized to control machines; chimes and lights are coordinated for a better user experience. IEEE Std 1588 describes the PTP protocol, which is used to synchronize clocks across a network. PTPv2 is a feature rich standard that allows for many variations, not all of which are compatible. IEEE Std 802.1AS specifies a subset of PTP, a PTP profile, called generalized Precision Time Protocol (gPTP) which is increasingly used in embedded systems. gPTP uses only layer 2 (Ethernet) synchronization, which relies on the precise timestamping of specific packets used to distribute clock and delay information across a network.
In a time-aware network, any given network segment, including a 10BASE-T1S multidrop segment, has one clock source. This source can be any element on the segment or it can be a time-aware bridge, which is synchronized to the main system clock elsewhere on the network. The clock source periodically broadcasts the current system time using the PTP SYNC message and captures the exact time at which the message is transmitted. The timestamp for the SYNC message is then provided to the clock followers, either directly in the SYNC packet, or in a separate FOLLOWUP packet. Other time aware devices on the network segment capture the time that the SYNC message arrives and use that, along with the information from the FOLLOWUP message when needed, to adjust their local clocks to match that of the clock source. In a time aware system with known, fixed network delays, it is possible to achieve very precise clock synchronization using only these messages.
To account for network delays when they are not known, PTP includes peer delay message types, which are used in a similar manner to calculate the delay between the local clock source and each element on the segment. One of these messages, PDELAY_REQUEST requires precision timestamping on egress from the network element and ingress to the local clock master, similar to that required on the SYNC message. The algorithm which calculates the delay between peers assumes that the delays are constant and symmetric; it can compensate for any fixed delay, including timestamping a packet at a fixed point later than the standard end of Start-of-Frame Delimiter (SFD).