Bodet-Time
  • Home
  • Resources
  • Blog
  • All you need to know about PTP
All you need to know about PTP

Precision Time Protocol (PTP) is a time synchronisation protocol which ensures that all clocks within the same network are synchronised with the minimum possible offset. To do so, the PTP protocol will broadcast the time of a reference clock, which is most of the time an atomic clock or a GPS.

The PTP protocol is standardised under the name IEEE-1588. The first version dates back to 2002. It has been developed to offer greater accuracy than existing protocols (such as NTP Network Time Protocol). PTP offers a theoretical accuracy in the nanosecond range on LAN networks.

Unlike NTP, the PTP protocol relies on hardware timestamps. As such, it requires specific equipment to operate, thus enabling it to reach a very high level of accuracy. The IEEE-1588 standard has been reviewed several times, especially in 2008 in order to standardise the second version of the Precision Time Protocol (the most widely used nowadays).

This second version is not compatible with the first version of the protocol. The most recent version of the IEEE-1588 standard dates back to 2019. This is not a major version but it is compatible with the 2008 version. This version provides some improvements such as management of multiple domains.

The different types of clocks

Within a PTP domain, the different clocks that need to synchronise with each other do not have the same role. As a matter of fact, the PTP protocol operates on a master-slave mode. Clocks will not rely on network time but rather on identifying a master clock. The master clock will then broadcast its timestamp to slave clocks. All participants in a PTP domain will then start by choosing a master clock. This selection is carried out via the BMCA algorithm (Best Master Clock Algorithm). Selecting a master clock can be carried out periodically within a PTP network, whether following a failure of the master clock, or when a slave clock considers to be more qualified to fulfil this role.

In addition to these two roles (master and slave) a PTP network generally requires the use of routers, switches or gateways which are of two types: The first type is the transparent clock. A transparent clock is usually a network device located between a master clock and a slave clock. These specific time servers will calculate the time necessary for packets to pass through them and will adjust timestamps to allow better delay calculation and therefore greater accuracy.

The different types of clocks - Transparent clock

The second type is the Boundary clock. A boundary clock is a clock that will both fulfil the role of master and slave. It will synchronise with another master clock which will also be master to synchronise a set of slave clocks on the network. This allows for reduction of the distance between slave clocks and the master clock as well as the number of requests made by slave clocks. By reducing the distance between slave clocks and the master clock, boundary clocks enable to reduce delays and therefore improve the accuracy and the time synchronisation of the network.

The different types of clocks - Boundary clock

The different operating modes

Since the second version of the PTP protocol, two operating modes are available to calculate delays: End-to-End or Peer-to-Peer.

In End-to-End mode, delays are calculated in a comprehensive manner between slaves and masters while Peer-to-Peer mode calculates delays for each link. The Peer-to-Peer mode allows for more accurate assessment of delays but do require specific hardware to operate. The End-to-End mode operates regardless of the hardware used in the PTP network. It this therefore more robust.

Other modes are available: one-step and two-step modes.

This difference depends on the hardware used for clocks that need to timestamp their messages. If the hardware allows a message to be edited as it is sent, including the timestamp of when it was sent directly in the message, then we talk about one-step mode. Otherwise, clocks are in two-step mode. It is possible to both use the one-step and two-step mode within the same PTP network.

The different types of messages

To obtain a highly accurate time synchronisation, clocks transmit different types of synchronisation messages. Below is the non-exhaustive list of the main messages that devices of a PTP network can exchange for providing time synchronisation:

  • Announce: These are messages exchanged in order to select a master clock. Network participants broadcast their features to each other and select the best clock to be the master clock.
  • Sync: These messages are sent by the master clock to the slave clocks in order for them to synchronise.
  • Follow_Up: This message can follow a Sync message if the master clock is not able to include the message timestamp in the message itself. In that case, the Follow_Up message contains the timestamp of the synchronisation message.
  • Delay_Req: This message is sent by a slave clock to enable it to calculate the round-trip communication delay in order to synchronise with the master clock. This message is used in End-to-End mode.
  • Delay_Resp: The master clock responds to the slave mode so that the latter can effectively calculate the delay. This message is used in End-to-End mode.
  • PDelay_Req: This message is sent to calculate the delay of a link. This message is used in Peer-to-Peer mode.
  • PDelay_Resp: This message is sent in response to a PDelay_Req message to calculate the delay of a link. Used with Peer-to-Peer mode.
The different types of messages

Domains

PTP domains are a set of clocks synchronised with each other. They are often excluded from PTP presentations since most organisations only use a single domain. Domains are not necessarily exclusive of each other. A clock can belong to several domains and the latter is not required to have the same role in each domain. As such, a clock can be slave in one domain and master in another. Managing a PTP network with multiple domains remains complex but it enables to obtain a time synchronisation suitable for each use.

PTP in the industry sector

PTP offers excellent accuracy guarantees for time synchronisation. Therefore, it is used in applications with high synchronisation needs: audio/video networks, financial transactions, mobile networks, and so on.

Sectors that are more likely to use PTP have defined profiles (configurations) to meet their specific needs:

  • For example, the telecommunications sector has defined 3 standards called G.8265.1 (Frequency profile), G.8275.1 and G.8275.2 (Time/phase profile). Each profile meets a specific need of these networks.
  • The energy sector defined the three following profiles: C37.238: 2011 and C37.238: 2017 (Power profile) and IEC 61850 9-3 (Utility profile)
  • The industry sector has defined the IEEE 1588v2 (default profile) and the IEEE802.1AS (TSN profile: Time Sensitive Network)
  • The SMPTE ST2059-2 and Media AES67 profiles are used in broadcast professional networks. The SMPTE profile complies with the ST 2110 standard and defines PTP network settings in order to achieve an accuracy of less than one frame, thus providing maximum protection against synchronisation problems when broadcasting video or audio content.

With over 150 years of expertise in time management and present in more than 140 countries, Bodet Time is a major French leader in time synchronisation and time frequency. Netsilon PTP time servers provide a reliable, accurate reference time meeting the needs of air, railway, industrial, energy and broadcasting sectors.

Do you have a project? Require assistance

Share the article