Precision Time Protocol

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 was originally defined in the IEEE 1588-2002 standard, officially entitled "Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems". In 2008 a revised standard, IEEE 1588-2008 was released. This new version, also known as PTP Version 2, improves accuracy, precision and robustness but is not backwards compatible with the original 2002 version.[2]

"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."[3]

Contents

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. The ordinary clock is a device with a single network connection and is either the source of (master) or destination for (slave) a synchronization reference. The boundary clock has multiple network connections and can accurately bridge synchronization from one network segment to another. A synchronization master is elected for each of the network segments in the system. The root timing reference is called the grandmaster.[4] 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. 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. 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 uses the same epoch as Unix time (Midnight, 1 January 1970). Whereas Unix time is based on Coordinated Universal Time (UTC) and is subject to leap seconds, PTP is based on International Atomic Time (TAI) and moves forward monotonically. The PTP grandmaster communicates the current offset between UTC and TAI so that UTC can be computed from the received PTP time. The profile capability under IEEE 1588-2008 allows the use of application-specific epochs.[5]

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.[6]

Message transport

All PTP messages are sent using multicast messaging. IEEE 1588-2008 introduces an option for devices to negotiate unicast transmission on a port-by-port basis.[7]

PTP messages may use the Internet Protocol (IP) for transport. The original specification used only IPv4 transports,[8] but this has been extended to IPv6.[9] Over IP, messages use the User Datagram Protocol (UDP). Datagrams are transmitted using IP multicast addressing, for which multicast group addresses are defined for IPv4 and IPv6 (see table).[10] Event messages are sent to port number 319. General messages use port number 320. Replies to Management messages are always returned to the unicast address of the originator.

IP multicast group addresses
Messages IPv4 IPv6
All except peer delay messages 224.0.1.129[note 2] FF0x::181[note 3]
Peer delay messages: Pdelay_Req, Pdelay_Resp and Pdelay_Resp_Follow_Up[note 4] 224.0.0.107[note 5] FF02::6B

Encapsulation is also defined for bare IEEE 802.3 Ethernet,[9] DeviceNet,[11] ControlNet[12] and PROFIBUS.[13] PTP uses Ethertype 0x88F7 and an Ethernet multicast destination address of 01-1B-19-00-00-00 for all but peer delay messages. Peer delay messages are sent to 01-80-C2-00-00-0E.[9][note 6]

Domains

A domain[note 7] 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. Subdomains allow multiple clock distribution systems to share the same communications medium.

Subdomain name field contents (IEEE1588-2002) domainNumber
(IEEE1588-2008)
IPv4 multicast address
(IEEE1588-2002)[note 8]
Notes
_DFLT 0 224.0.1.129 Default domain
_ALT1 1 224.0.1.130 Alternate domain 1
_ALT2 2 224.0.1.131 Alternate domain 2
_ALT3 3 224.0.1.132 Alternate domain 3
Application specific up to 15 octets[14] 4 through 127 224.0.1.130, 131 or 132 as per hash function on Subdomain name[15] User-defined domains

Best master clock algorithm

The best master clock algorithm (BMC) 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 order indicated.[16]

  1. Priority 1
  2. Class
  3. Accuracy
  4. Variance
  5. Priority 2
  6. Unique identifier (tie breaker)

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

Synchronization

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

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

\ o(t) = s(t) - m(t)

where s(t) represents the time measured at the clock at physical time t, and m(t) represents the time measured at the master at physical time t.

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.

Each broadcast begins at time T1 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 T1' when this message is received.

The master may subsequently send a multicast Follow_Up with accurate T1 timestamp. Not all masters have ability to present an accurate time stamp in the Sync message. It is only after the transmission is complete that they are able to retrieve an accurate time stamp for the Sync transmission from their network hardware. Masters with this limitation use the Follow_Up message to convey T1. Masters with PTP capabilities built into their network hardware are able to present an accurate time stamp 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 d. The exchange begins with a clock sending a Delay_Req message at time T2 to the master. The master receives and time stamps the Delay_Req at time T2' and responds with a Delay_Resp message. The master includes the time stamp T2' in the Delay_Resp message.

Through these exchanges a clock learns T1, T1', T2 and T2'

If d is the transit time for the Sync message, and \tilde{o} is the constant offset between master and slave clocks, then

\ T1' - T1 = \tilde{o} %2B d and \ T2' - T2 = - \tilde{o} %2B d

Combining the above two equations, we find that

\tilde{o} = (T1'-T1-T2'%2BT2)/2

The clock now knows the offset \tilde{o} 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.[18]

Optional features

IEEE 1588-2008 standard lists the following set of features as optional features,any implementation may optionally support these features.

Implementations

1588 enabled Ethernet switches

1588 stand-alone solutions

Software

Silicon

Other

Related initiatives

Notes

  1. ^ 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.
  2. ^ IEEE 1588-2002 uses this address for the default domain. Destination addresses 224.0.1.130 through 224.0.1.132 for alternate domains (see #Domains).
  3. ^ Where x is the address scope (2 for link-local) as per RFC 2373 (see IPv6 multicast address)
  4. ^ 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.
  5. ^ Peer delay messaging is not present in IEEE 1588-2002
  6. ^ In some PTP applications it is permissible to send all PTP messages to 01-1B-19-00-00-00
  7. ^ IEEE 1588-2002 defined a domain as any interconnected set of clocks (regardless of whether they synchronized to one another) and used subdomain to refer to what is known as a domain in IEEE 1588-2008.
  8. ^ IEEE 1588-2008 uses 224.0.1.129 as the address for all multicast messages.

References

  1. ^ "IEEE 1588 Systems". National Institute of Standards and Technology (NIST). http://ieee1588.nist.gov/. 
  2. ^ John Eidson (2 October 2010). "IEEE 1588 Standard Version 2 - A Tutorial". Archived from the original on 18 June 2010. http://www.webcitation.org/5qaJpYqCH. 
  3. ^ Eidson, John C. (April 2006). Measurement, Control and Communication Using IEEE 1588. Springer. ISBN 1-8462-8250-0. 
  4. ^ "Meanings of common terms used in IEEE 1588 url=http://ieee1588.nist.gov/terms.htm". Nation Institute or Standards and Technologies. Archived from the original on 17 June 2010. http://www.webcitation.org/5qaBMRXjA. 
  5. ^ IEEE 1588-2008 Annex B
  6. ^ IEEE 1588-2008 Clause 6.4
  7. ^ IEEE 1588-2008 Clause 16.1
  8. ^ IEEE 1588-2002 Annex D
  9. ^ a b c IEEE 1588-2008 Annex F
  10. ^ IEEE 1588-2008 Annex D and E
  11. ^ IEEE 1588-2008 Annex G
  12. ^ IEEE 1588-2008 Annex H
  13. ^ IEEE 1588-2008 Annex I
  14. ^ IEEE 1588-2002 Clause 6.2.5.1
  15. ^ IEEE 1588-2002 Annex C
  16. ^ IEEE 1588-2008 Figure 27
  17. ^ International standard IEC 61588: Precision clock synchronization protocol for networked measurement and control systems. 2004.
  18. ^ IEEE 1588.2008 Clause 6.2
  19. ^ "ACRA CONROL Launches Airborne IEEE 1588 Ethernet Switch". Limelon Advertising & Communications, Co.. 1 September 2011. http://www.newswiretoday.com/news/74476/. Retrieved 1 September 2011. 
  20. ^ "Allen-Bradley Stratix 8000 Modular Managed Switches". Rockwell Automation. 17 November 2011. http://abweb.rockwellautomation.com/en/epub/catalogs/12762/2181376/214372/9142990/tab4.html. Retrieved 17 November 2011. 
  21. ^ "Brocade Enables Service Provider Business Model Transformation via Breakthrough Public Cloud-Optimized Networking Solutions". Brocade Communications Systems, Inc.. 3 May 2011. http://newsroom.brocade.com/easyir/customrel.do?easyirid=74A6E71C169DEDA9&version=live&releasejsp=custom_184&prid=750964. Retrieved 27 July 2011. 
  22. ^ "Cisco Extends Highly Secure, Improved Communications in Rugged Environments with New Family of Industrial Ethernet Switches". Cisco Systems. 14 November 2007. http://newsroom.cisco.com/dlls/2007/prod_111407.html. Retrieved 6 July 2010. 
  23. ^ http://www.cisco.com/en/US/products/ps9670/index.html
  24. ^ http://www.cisco.com/en/US/prod/collateral/routers/ps10912/ps11610/data_sheet_c78-685686_ps9853_Products_Data_Sheet.html
  25. ^ "Hirschmann MACH1040 series switches". Hirschmann. http://www.e-catalog.beldensolutions.com/link/57078-24455-49846-49997-82828/en/conf/0. Retrieved 6 June 2011. 
  26. ^ "Hirschmann MICE Media Modules with 1588v2 support". Hirschmann. http://www.e-catalog.beldensolutions.com/link/57078-24455-49860-67478-84872/en/conf/0-0. Retrieved 6 June 2011. 
  27. ^ "Precision Time Protocol Solutions". RuggedCom. http://www.ruggedcom.com/aplications/time-sync. Retrieved 10 December 2010. 
  28. ^ "GarrettCom 10KT Industrial Managed 1588v2 Ethernet Switch". GarrettCom Europe. 26 July 2011. http://www.garrettcom.co.uk/industrial-managed-switches/10kt-1588-managed-switch. Retrieved 26 July 2011. 
  29. ^ "GarrettCom 12KX Industrial Managed 1588v2 Ethernet Switch". GarrettCom Europe. 26 July 2011. http://www.garrettcom.co.uk/industrial-managed-switches/12kx-layer3-gigabit-switch. Retrieved 26 July 2011. 
  30. ^ "SCALANCE X-300 managed". Siemens AG. 14 August 2011. http://www.automation.siemens.com/mcms/industrial-communication/en/ie/IE_switches_media-converters/scalance-x-300-managed/Pages/scalance-x-300-managed.aspx. Retrieved 14 August 2011. 
  31. ^ "Configuring an External Clock Synchronization Interface for MX Series Routers". Juniper Networks. 10 October 2010. http://www.juniper.net/techpubs/en_US/junos10.4/topics/task/configuration/chassis-external-clock-synchronization-interface-configuring-mx.html. Retrieved 15 November 2011. 
  32. ^ "Conemtech M50 module". http://www.conemtech.com/Products/Module_Components/M50.html/. Retrieved 28 October 2011. 
  33. ^ "Conemtech P50 board". http://www.conemtech.com/Products/Systems/P50.html/. Retrieved 28 October 2011. 
  34. ^ "IPITEK's Industry-Leading IEEE-1588v2 Solution". IPITEK. 20 April 2010. http://ipitek.com/msp-1588-release.php. Retrieved 5 may 2011. 
  35. ^ "IEEE 1588-2008 PTP Solutions". Oscilloquartz. http://www.oscilloquartz.com/index.php?pageid=1588. Retrieved 12 September 2010. 
  36. ^ "IEEE 1588 PTP Protocol Software - V2.". IXXAT. http://www.ixxat.com/ieee-1588-stack-v2_en.html. Retrieved 2 June 2011. 
  37. ^ "Openptp". http://sourceforge.net/projects/openptp/. Retrieved 2 June 2011. 
  38. ^ "MAX24288 Web Page". Maxim. http://www.maxim-ic.com/max24288. Retrieved 07 Nov 2011. 
  39. ^ "DS31408 Web Page". Maxim. http://www.maxim-ic.com/ds31408. Retrieved 07 Nov 2011. 
  40. ^ "Conemtech C34 SOC". http://www.conemtech.com/Products/Microprocessors/C34.html/. Retrieved 28 October 2011. 
  41. ^ "Caracal-1 Carrier Ethernet Switch". Vitesse. http://www.vitesse.com/products/product.php?number=VSC7428. Retrieved 21 September 2010. 
  42. ^ "IEEE-1588 Timing over Packet". Zarlink. http://www.zarlink.com/zarlink/hs/timing_PacketNetworks.htm. Retrieved 13 May 2011. 
  43. ^ "Conemtech Website". http://www.conemtech.com/. Retrieved 28 October 2011. 
  44. ^ "IEEE 1588 PTP Solutions". Symmetricom. http://www.symmetricom.com/products/ieee-1588-ptp-solutions/. Retrieved 6 July 2010. 
  45. ^ "IEEE 1588 PTP Solutions". EndRun. http://www.endruntechnologies.com/ptp-ieee-1588-grandmaster.htm. Retrieved 27 July 2011. 
  46. ^ "InES Institute of Embedded Systems, Zurich University of Applied Sciences". InES ZHAW. http://www.ines.zhaw.ch/en/engineering/ines/ieee-1588.html. Retrieved 3 March 2011. 
  47. ^ "IEEE 1588-2008 Embedded Timing Appliance". Black Brook Design. http://www.blackbrookdesign.com/index.html. Retrieved 18 December 2010. 
  48. ^ "White Rabbit, a fully deterministic Ethernet-based network for general purpose data transfer and synchronization.". OHR. http://www.ohwr.org/projects/white-rabbit. Retrieved 3 March 2011. 
  49. ^ "IEEE 1588v2 Solution". Moxa. http://www.moxa.com/Event/Sys/2011/IEEE_1588/index.htm. Retrieved 30 March 2011. 
  50. ^ "IEEE 1588 PTP Solutions". Meinberg. http://www.meinberg.de/english/products/timesource.htm#ptp. Retrieved 27 July 2011. 
  51. ^ "IEEE 1588 PTP IP Core". SoC-e. http://www.soc-e.com/soceindustrial.html#ptpbasic_product. Retrieved 6 October 2011. 
  52. ^ "IEEE 1588 PTP Solutions". Spectracom. http://www.spectracomcorp.com/ProductsServices/TimingSynchronization/PTPIEEE1588Products/tabid/1251/Default.aspx. Retrieved 2 November 2011. 
  53. ^ TFTS RFS-2009, SMPTE, 2009, http://store.smpte.org/product-p/tfts%20rfs-2009.htm, retrieved 2011-11-09 

External links