Precision Time Protocol

Last updated

The Precision Time Protocol (PTP) is a protocol used to synchronize clocks throughout a computer network. On a local area network, it achieves clock accuracy in the sub-microsecond range, making it suitable for measurement and control systems. [1] PTP is employed to synchronize financial transactions, mobile phone tower transmissions, sub-sea acoustic arrays, and networks that require precise timing but lack access to satellite navigation signals.

Contents

The first version of PTP, IEEE 1588-2002, was published in 2002. IEEE 1588-2008, also known as PTP Version 2, is not backward compatible with the 2002 version. IEEE 1588-2019 was published in November 2019 and includes backward-compatible improvements to the 2008 publication. IEEE 1588-2008 includes a profile concept defining PTP operating parameters and options. Several profiles have been defined for applications including telecommunications, electric power distribution and audiovisual uses. IEEE 802.1AS is an adaptation of PTP for use with Audio Video Bridging and Time-Sensitive Networking.

History

According to John Eidson, who led the IEEE 1588-2002 standardization effort, "IEEE 1588 is designed to fill a niche not well served by either of the two dominant protocols, NTP and GPS. IEEE 1588 is designed for local systems requiring accuracies beyond those attainable using NTP. It is also designed for applications that cannot bear the cost of a GPS receiver at each node, or for which GPS signals are inaccessible." [2]

PTP was originally defined in the IEEE 1588-2002 standard, officially entitled Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems, and published in 2002. In 2008, IEEE 1588-2008 was released as a revised standard; also known as PTP version 2 (PTPv2), it improves accuracy, precision and robustness but is not backward compatible with the original 2002 version. [3] IEEE 1588-2019 was published in November 2019, [4] is informally known as PTPv2.1 and includes backwards-compatible improvements to the 2008 publication. [5]

Architecture

The IEEE 1588 standards describe a hierarchical master–slave architecture for clock distribution. Under this architecture, a time distribution system consists of one or more communication media (network segments), and one or more clocks. An ordinary clock is a device with a single network connection and is either the source of (master or leader) or destination for (slave or follower) a synchronization reference. A boundary clock has multiple network connections and can accurately synchronize one network segment to another. A synchronization master is selected for each of the network segments in the system. The root timing reference is called the grandmaster. [6] The grandmaster transmits synchronization information to the clocks residing on its network segment. The boundary clocks with a presence on that segment then relay accurate time to the other segments to which they are also connected.

A simplified PTP system frequently consists of ordinary clocks connected to a single network, and no boundary clocks are used. A grandmaster is elected and all other clocks synchronize directly to it.

IEEE 1588-2008 introduces a clock associated with network equipment used to convey PTP messages. The transparent clock modifies PTP messages as they pass through the device. [7] Timestamps in the messages are corrected for time spent traversing the network equipment. This scheme improves distribution accuracy by compensating for delivery variability across the network.

PTP typically uses the same epoch as Unix time (start of 1 January 1970). [lower-alpha 1] While the Unix time is based on Coordinated Universal Time (UTC) and is subject to leap seconds, PTP is based on International Atomic Time (TAI). The PTP grandmaster communicates the current offset between UTC and TAI, so that UTC can be computed from the received PTP time.

Protocol details

Synchronization and management of a PTP system is achieved through the exchange of messages across the communications medium. To this end, PTP uses the following message types.

Messages are categorized as event and general messages. Event messages are time-critical in that accuracy in transmission and receipt timestamp accuracy directly affects clock distribution accuracy. Sync, Delay_Req, Pdelay_Req and Pdelay_resp are event messages. General messages are more conventional protocol data units in that the data in these messages is of importance to PTP, but their transmission and receipt timestamps are not. Announce, Follow_Up, Delay_Resp, Pdelay_Resp_Follow_Up, Management and Signaling messages are members of the general message class. [8] :Clause 6.4

Message transport

PTP messages may use the User Datagram Protocol over Internet Protocol (UDP/IP) for transport. IEEE 1588-2002 uses only IPv4 transports, [9] :Annex D but this has been extended to include IPv6 in IEEE 1588-2008. [8] :Annex F In IEEE 1588-2002, all PTP messages are sent using multicast messaging, while IEEE 1588-2008 introduced an option for devices to negotiate unicast transmission on a port-by-port basis. [8] :Clause 16.1 Multicast transmissions use IP multicast addressing, for which multicast group addresses are defined for IPv4 and IPv6 (see table). [8] :Annex D and E Time-critical event messages (Sync, Delay_req, Pdelay_Req and Pdelay_Resp) are sent to port number 319. General messages (Announce, Follow_Up, Delay_Resp, Pdelay_Resp_Follow_Up, management and signaling) use port number 320. [8] :Clause 6.4

Multicast group addresses
MessagesIPv4IPv6IEEE 802.3 Ethernet [8] :Annex F [lower-alpha 3] Type
All except peer delay messages224.0.1.129 [lower-alpha 4] FF0x::181 [lower-alpha 5] 01-1B-19-00-00-00 [lower-alpha 6] Forwardable
Peer delay messages: Pdelay_Req, Pdelay_Resp and Pdelay_Resp_Follow_Up [lower-alpha 7] 224.0.0.107 [lower-alpha 8] FF02::6B01-80-C2-00-00-0ENon-forwardable

In IEEE 1588-2008, encapsulation is also defined for DeviceNet, [8] :Annex G ControlNet [8] :Annex H and PROFINET. [8] :Annex I

Domains

A domain [lower-alpha 9] is an interacting set of clocks that synchronize to one another using PTP. Clocks are assigned to a domain by virtue of the contents of the Subdomain name (IEEE 1588-2002) or the domainNumber (IEEE 1588-2008) fields in PTP messages they receive or generate. Domains allow multiple clock distribution systems to share the same communications medium.

Subdomain name field contents (IEEE1588-2002)IPv4 multicast address
(IEEE1588-2002) [lower-alpha 10]
domainNumber
(IEEE1588-2008)
Notes
_DFLT224.0.1.1290Default domain
_ALT1224.0.1.1301Alternate domain 1
_ALT2224.0.1.1312Alternate domain 2
_ALT3224.0.1.1323Alternate domain 3
Application specific up to 15 octets [9] :Clause 6.2.5.1224.0.1.130, 131 or 132 as per hash function on Subdomain name [9] :Annex C4 through 127User-defined domains

Best master clock algorithm

The best master clock algorithm (BMCA) performs a distributed selection of the best candidate clock based on the following clock properties:

IEEE 1588-2008 uses a hierarchical selection algorithm based on the following properties, in the indicated order: [8] :Figure 27

  1. Priority 1 the user can assign a specific static-designed priority to each clock, preemptively defining a priority among them. Smaller numeric values indicate higher priority.
  2. Class each clock is a member of a given class, each class getting its own priority.
  3. Accuracy precision between clock and UTC, in nanoseconds (ns)
  4. Variance variability of the clock
  5. Priority 2 final-defined priority, defining backup order in case the other criteria were not sufficient. Smaller numeric values indicate higher priority.
  6. Unique identifier MAC address-based selection is used as a tiebreaker when all other properties are equal.

IEEE 1588-2002 uses a selection algorithm based on similar properties.

Clock properties are advertised in IEEE 1588-2002 Sync messages and in IEEE 1588-2008 Announce messages. The current clock master transmits this information at regular interval. A clock which considers itself a better master clock will transmit this information in order to invoke a change of master clock. Once the current master recognises the better clock, the current master stops transmitting Sync messages and associated clock properties (Announce messages in the case of IEEE 1588-2008) and the better clock takes over as master. [10] The BMC algorithm only considers the self-declared quality of clocks and does not take network link quality into consideration. [11]

Synchronization

Through use of the BMC algorithm, PTP selects a master source of time for an IEEE 1588 domain and for each network segment in the domain.

Clocks determine the offset between themselves and their master. [12] Let the variable represent physical time. For a given slave device, the offset at time is defined by:

where represents the time measured by the slave clock at physical time , and represents the time measured by the master clock at physical time .

The master periodically broadcasts the current time as a message to the other clocks. Under IEEE 1588-2002 broadcasts are up to once per second. Under IEEE 1588-2008, up to 10 per second are permitted.

IEEE 1588 synchronisation mechanism and delay calculation IEEE1588 1.jpg
IEEE 1588 synchronisation mechanism and delay calculation

Each broadcast begins at time with a Sync message sent by the master to all the clocks in the domain. A clock receiving this message takes note of the local time when this message is received.

The master may subsequently send a multicast Follow_Up with accurate timestamp. Not all masters have the ability to present an accurate timestamp in the Sync message. It is only after the transmission is complete that they are able to retrieve an accurate timestamp for the Sync transmission from their network hardware. Masters with this limitation use the Follow_Up message to convey . Masters with PTP capabilities built into their network hardware are able to present an accurate timestamp in the Sync message and do not need to send Follow_Up messages.

In order to accurately synchronize to their master, clocks must individually determine the network transit time of the Sync messages. The transit time is determined indirectly by measuring round-trip time from each clock to its master. The clocks initiate an exchange with their master designed to measure the transit time . The exchange begins with a clock sending a Delay_Req message at time to the master. The master receives and timestamps the Delay_Req at time and responds with a Delay_Resp message. The master includes the timestamp in the Delay_Resp message.

Through these exchanges a clock learns , , and .

If is the transit time for the Sync message, and is the constant offset between master and slave clocks, then

Combining the above two equations, we find that

The clock now knows the offset during this transaction and can correct itself by this amount to bring it into agreement with their master.

One assumption is that this exchange of messages happens over a period of time so small that this offset can safely be considered constant over that period. Another assumption is that the transit time of a message going from the master to a slave is equal to the transit time of a message going from the slave to the master. Finally, it is assumed that both the master and slave can accurately measure the time they send or receive a message. The degree to which these assumptions hold true determines the accuracy of the clock at the slave device. [8] :Clause 6.2

Optional features

IEEE 1588-2008 standard lists the following set of features that implementations may choose to support:

IEEE 1588-2019 adds additional optional and backward-compatible features: [5]

See also

Notes

  1. The profile capability under IEEE 1588-2008 allows the use of application-specific epochs. [8] :Annex B
  2. In IEEE 1588-2002, information carried by Announce messages is carried in the Sync messages. In IEEE 1588-2008, the Sync message has been optimized and this information is no longer carried here.
  3. PTP over bare IEEE 802.3 Ethernet using Ethertype 0x88F7
  4. IEEE 1588-2002 non-default domains use destination addresses 224.0.1.130 through 224.0.1.132 (see #Domains).
  5. Where x is the address scope (2 for link-local) as per RFC 2373 (see IPv6 multicast address)
  6. In some PTP applications it is permissible to send all PTP messages to 01-1B-19-00-00-00
  7. Peer delay messages are intended to propagate to the immediately connected neighbor. The multicast addresses for these messages are designed to be link-local in scope and are not passed through a router. IEEE 1588-2008 also recommends setting time to live to 1 (IPv4) or hop limit to 0 (IPv6) as further insurance that the messages will not be routed.
  8. Peer delay messaging is not present in IEEE 1588-2002
  9. IEEE 1588-2002 defines a domain as any interconnected set of clocks (regardless of whether they synchronized to one another) and uses subdomain to refer to what is known as a domain in IEEE 1588-2008.
  10. IEEE 1588-2008 uses 224.0.1.129 as the address for all multicast messages.
  11. AVB is further extended by the IEEE 802.1 Time-Sensitive Networking (TSN) Task Group.

Related Research Articles

<span class="mw-page-title-main">Network Time Protocol</span> Standard protocol for synchronizing time across devices

The Network Time Protocol (NTP) is a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks. In operation since before 1985, NTP is one of the oldest Internet protocols in current use. NTP was designed by David L. Mills of the University of Delaware.

The RTP Control Protocol (RTCP) is a binary-encoded out-of-band signaling protocol that functions alongside the Real-time Transport Protocol (RTP). Its basic functionality and packet structure is defined in RFC 3550. RTCP provides statistics and control information for an RTP session. It partners with RTP in the delivery and packaging of multimedia data but does not transport any media data itself.

Clock synchronization is a topic in computer science and engineering that aims to coordinate otherwise independent clocks. Even when initially set accurately, real clocks will differ after some amount of time due to clock drift, caused by clocks counting time at slightly different rates. There are several problems that occur as a result of clock rate differences and several solutions, some being more acceptable than others in certain contexts.

EtherCAT is an Ethernet-based fieldbus system developed by Beckhoff Automation. The protocol is standardized in IEC 61158 and is suitable for both hard and soft real-time computing requirements in automation technology.

In audio and broadcast engineering, audio over Ethernet (AoE) is the use of an Ethernet-based network to distribute real-time digital audio. AoE replaces bulky snake cables or audio-specific installed low-voltage wiring with standard network structured cabling in a facility. AoE provides a reliable backbone for any audio application, such as for large-scale sound reinforcement in stadiums, airports and convention centers, multiple studios or stages.

Audio-to-video synchronization refers to the relative timing of audio (sound) and video (image) parts during creation, post-production (mixing), transmission, reception and play-back processing. AV synchronization can be an issue in television, videoconferencing, or film.

Stream Reservation Protocol (SRP) is an enhancement to Ethernet that implements admission control. In September 2010 SRP was standardized as IEEE 802.1Qat which has subsequently been incorporated into IEEE 802.1Q-2011. SRP defines the concept of streams at layer 2 of the OSI model. Also provided is a mechanism for end-to-end management of the streams' resources, to guarantee quality of service (QoS).

Synchronous Ethernet (SyncE) is an ITU-T standard for computer networking that facilitates the transference of clock signals over the Ethernet physical layer. This signal can then be made traceable to an external clock.

High-availability Seamless Redundancy (HSR) is a network protocol for Ethernet that provides seamless failover against failure of any single network component. PRP and HSR are independent of the application-protocol and can be used by most Industrial Ethernet protocols in the IEC 61784 suite. HSR does not cover the failure of end nodes, but redundant nodes can be connected via HSR.

Parallel Redundancy Protocol (PRP) is a network protocol standard for Ethernet that provides seamless failover against failure of any network component. This redundancy is invisible to the application.

PTPd is an open source implementation of the Precision Time Protocol for Unix-like computers.

Symmetricom, Inc. develops, manufactures, and supplies timekeeping technology to customers in industry and government worldwide that require extremely precise synchronization. Symmetricom products supported precise timing standards, including GPS-based timing, IEEE 1588 (PTP), Network Time Protocol (NTP), Synchronous Ethernet and Data Over Cable Service Interface Specifications (DOCSIS®) timing.

White Rabbit is the name of a collaborative project including CERN, GSI Helmholtz Centre for Heavy Ion Research and other partners from universities and industry to develop a fully deterministic Ethernet-based network for general purpose data transfer and sub-nanosecond accuracy time transfer. Its initial use was as a timing distribution network for control and data acquisition timing of the accelerator sites at CERN as well as in GSI's Facility for Antiproton and Ion Research (FAIR) project. The hardware designs as well as the source code are publicly available. The name of the project is a reference to the White Rabbit appearing in Lewis Carroll's novel Alice's Adventures in Wonderland.

AES67 is a technical standard for audio over IP and audio over Ethernet (AoE) interoperability. The standard was developed by the Audio Engineering Society and first published in September 2013. It is a layer 3 protocol suite based on existing standards and is designed to allow interoperability between various IP-based audio networking systems such as RAVENNA, Livewire, Q-LAN and Dante.

Time-Sensitive Networking (TSN) is a set of standards under development by the Time-Sensitive Networking task group of the IEEE 802.1 working group. The TSN task group was formed in November 2012 by renaming the existing Audio Video Bridging Task Group and continuing its work. The name changed as a result of the extension of the working area of the standardization group. The standards define mechanisms for the time-sensitive transmission of data over deterministic Ethernet networks.

<span class="mw-page-title-main">IEC/IEEE 61850-9-3</span>

IEC/IEEE 61850-9-3 or PUP is an international standard for precise time distribution and clock synchronization in electrical grids with an accuracy of 1 μs.
It supports precise time stamping of voltage and current measurement for differential protection, wide area monitoring and protection, busbar protection and event recording.
It can be used to ensure deterministic operation of critical functions in the automation system.
It belongs to the IEC 61850 standard suite for communication networks and systems for power utility automation.

Industrial automation systems consisting of several distributed controllers need a precise synchronization for commands, events and process data. For instance, motors for newspaper printing are synchronized within some 5 microseconds to ensure that the color pixels in the different cylinders come within 0.1 mm at a paper speed of some 20 m/s. Similar requirements exist in high-power semiconductors and in drive-by-wire vehicles. This synchronisation is provided by the communication network, in most cases Industrial Ethernet. Many ad-hoc synchronization schemes exist, so IEEE published a standard Precision Time Protocol IEEE 1588 or "PTP", which allows sub-microsecond synchronization of clocks. PTP is formulated generally, so concrete applications need a stricter profile. In particular, PTP does not specify how the clocks should operate when the network is duplicated for better resilience to failures.

SMPTE 2059 is a standard from the Society of Motion Picture and Television Engineers (SMPTE) that describes how to synchronize video equipment over an IP network. The standard is based on IEEE 1588-2008. SMPTE 2059 is published in two parts on 9 April 2015:

<span class="mw-page-title-main">Audio Video Bridging</span> Specifications for synchronized, low-latency streaming through IEEE 802 networks

Audio Video Bridging (AVB) is a common name for the set of technical standards which provide improved synchronization, low latency, and reliability for switched Ethernet networks. AVB embodies the following technologies and standards:

References

  1. Eidson, John (10 October 2005). "IEEE-1588 Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems, a Tutorial". National Institute of Standards and Technology (NIST).
  2. Eidson, John C. (April 2006). Measurement, Control and Communication Using IEEE 1588. Springer. ISBN   978-1-84628-250-8.
  3. Eidson, John (2 October 2006). "IEEE 1588 Standard Version 2 - A Tutorial" (PDF). Archived from the original (PDF) on 31 March 2010. Retrieved 12 June 2008.
  4. "1588-2019 - IEEE Approved Draft Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems". IEEE. Retrieved 15 February 2020.
  5. 1 2 Douglas Arnold (24 September 2017). "What's coming In the Next Edition of IEEE 1588?" . Retrieved 15 February 2020.
  6. "Meanings of common terms used in IEEE 1588". National Institute of Standards and Technology. Archived from the original on 27 May 2010. Retrieved 19 May 2006.
  7. "AN-1838 IEEE 1588 Boundary Clock and Transparent Clock Implementation Using the DP83640" (PDF). ti.com. Texas Instruments. Retrieved 17 July 2019.
  8. 1 2 3 4 5 6 7 8 9 10 11 12 IEEE Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems, IEEE, 24 July 2008, doi:10.1109/IEEESTD.2008.4579760, ISBN   978-0-7381-5400-8
  9. 1 2 3 IEEE Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems, IEEE, 8 November 2002, doi:10.1109/IEEESTD.2002.94144, ISBN   978-0-7381-3369-0
  10. Watt, Steve T.; Achanta, Shankar; Abubakari, Hamza; Sagen, Eric (March 2014), Understanding and Applying Precision Time Protocol (PDF), retrieved 9 September 2017
  11. FSMLabs Technical Staff (September 2015), Smart and Dumb PTP Client and the "so-called"Best Master Clock Algorithm , retrieved 17 May 2018
  12. International standard IEC 61588: Precision clock synchronization protocol for networked measurement and control systems. 2004.
  13. ISPCS website
  14. Geoffrey M. Garner (28 May 2010), IEEE 802.1AS and IEEE 1588 (PDF)
  15. SMPTE Publishes First Two Parts of Standard Enabling Deployment of PTP-Timed Equipment in Existing SDI Plants, Society of Motion Picture and Television Engineers, 13 April 2015, retrieved 21 May 2015
  16. AES-R16-2016: AES Standards Report - PTP parameters for AES67 and SMPTE ST 2059-2 interoperability, Audio Engineering Society, 2 May 2016
  17. 1 2 https://www.smpte.org/sites/default/files/users/user27446/AES67%20for%20Audio%20Production-Background%20Applications%20and%20Challenges.pdf [ dead link ]
  18. "PTPv2 Timing protocol in AV networks". Luminex. 6 June 2017. Q-LAN updated to PTPv2 approximately two years ago.
  19. Pepiciello, Antonio; Vaccaro, Alfredo (17 December 2018), "A reliable architecture based on Precision Time Protocol for WAMPAC synchronization", 2018 AEIT International Annual Conference, IEEE, pp. 1–5, doi:10.23919/AEIT.2018.8577414, ISBN   978-8-8872-3740-5, S2CID   58819556