What's so great about PTP?

What's so great about PTP?

Posted on 27/03/2017 by Quentin Griffiths

With Precision Time Protocol (PTP) you no longer need to run a dedicated timing network through your substation.

Timing moves into your Ethernet network - removing the need for extra cabling and reducing installation costs. With automatic clock switching you also increase the reliability of your timing network by reducing outages or false tripping caused by clock failure in a network.

With an accuracy that can potentially exceed IRIG-B while also running over an Ethernet network, PTP takes the best bits from IRIG-B and NTP to get accurate sync within a substation.

Because of this some large Transmission Service Operators around the globe have begun implementing trial PTP sites. They’ve achieved simplified network designs and increased reliability, as well as future proofing their designs for the upcoming sync requirements of digital substations.


Here's an example of a product we make with PTP support (which also has support for older standards)

PTP is not just for power though. It’s an advanced timing technology which represents the future direction of accurate time synchronisation across all industries. These are expanding daily and can range from synchronising an autonomous vehicle, to providing accurate time to a mission critical 61850 process bus installation in a substation, through to synchronising high speed cameras on a crop monitoring UAV. The applications for PTP are truly endless and can be applied to almost any industry where accurate time is required.

So the age of DC pulses, IRIG-B, and similar timing technologies is ending as the world of connected devices grows. Here we’ll cover off some of the basics of PTP and to give an overview of the types, features and functions which are included.


What is PTP officially?


PTP, also known as IEEE1588v2, is an Ethernet based timing protocol designed to deliver high accuracy timing packets to the end devices through hardware time stamping of packets and accumulated delay calculations. It’s similar in a sense to NTP and was developed to provide sub microsecond timing accuracy.



Figure 1 – PTP Ping Pong Operation



How does PTP work?


Like NTP, PTP uses a ping pong approach to transfer accurate time to a slave device. Referring to the simplified image shown in figure 1, the process starts with the master clock sending out a sync packet to the network. Depending on the settings used this will be sent as a unicast or a multicast message. The packet is time stamped as it is sent from the clock. This sync packet contains the accurate TAI time of day as well as the ‘exact’ (< 100 ns) time the packet left the port, TS1.

The slave device receives the packet and applies a time stamp, TS2, before processing the packet and sending it back to the master device, time stamping the packet as it leaves, TS3. This is known as the Delay request packet.

The master receives the Delay request packet and time stamps it on receipt before sending it back as a Delay response message, with the TS4 time stamp now included.

The slave device now knows the time stamps TS1 to TS4. Using this data it can calculate the complete internal processing time as well as the network latency between the master and the slave device.

Note; in PTP the network latency is assumed to be symmetrical – the same lag in both directions. This might be incorrect if multiple network paths exist, creating a scenario where the network propagation delays are no longer symmetrical. This should be considered in the network design phase to be sure that sub microsecond accuracy is maintained.


Does PTP use UTC time?


PTP uses a time base known as the International Atomic Time or TAI for short. TAI in its most basic form is the UTC time plus ‘leap seconds’ that have been added since the ‘beginning of time’ in 1972. As of the 31st of December 2016, TAI time is exactly 37 seconds ahead of UTC.

In many applications, this does not matter as the PTP slaves will automatically adjust their time output to match UTC.

You can find more about TAI time and leaps seconds here.


What makes PTP so accurate?


PTP uses what is known as hardware time stamping to achieve sub microsecond accuracy. In a PTP aware device an incoming packet is stamped with TAI time as it enters the port; well before any packet processing is done. With the time stamping being done in hardware it no longer matters how long the software takes to process the packet, removing the inaccuracies or variations created by software latencies.

For many devices, the accuracy of the time stamp is < 100 ns at the port level. When a packet is being sent, it is time stamped as it is physically leaving the port. In many case the stamp is bundled into the packet as it is hitting the wire, meaning that it is attached at the last possible moment.

With the packet getting stamped every time it enters and leaves a device, the time it takes to travel through the network is measured. When the packet arrives at its destination the end device will know what the time was when the packet left the clock and how long it took to get there. It can then use this information to calculate the current time to an accuracy of 1 µs or better!


So, what is a PTP profile?


A PTP profile is at its most simplest the settings configured within the protocol to follow the requirements outlined in the related specification. For example, the default profile sends out its packets over a multicast address and is designed for use within a closed network. The Telecom’s profile on the other hand requires the use of unicast messaging and is designed for use across wide area networks. Each profile has several key differences not only in the communication layer, but also in the packet structure. As noted, to gain sync the same profile is required on both the master and the slave unit.


What happens when I have multiple PTP clocks in a network?


Within PTP there is an algorithm called the Best Master Clock Algorithm or the BMCA for short. During start up, and continuing through day to day operation, the BMCA runs on all the clocks available in the network. The BMCA is used to determine which of the clocks in the network is the best clock for the job!

The BMCA works through the analysis of the announce messages which are sent out from the master clock, generally once per second. The announce messages are a way for the master clock to tell the network that it is still alive and for it to report its accuracy. The slave devices and other clocks on the network will monitor these messages to determine the health of the master. If the master clock’s accuracy degrades due to loss of GPS reception, the other clocks on the network who believe they are now superior will start to announce their presence… through announce messages.

The clocks will now negotiate between one another to battle it out for the top spot. During this battle the PTP grandmasters will compare their accuracy and their sync source as well as their user defined hierarchy as set in the PTP priority settings. If all are equal the device with the higher MAC address will win and take over the master clock role.

In a large network with multiple clocks available, this can help to add a level of redundancy. The term redundancy is used quite broadly to cover an event where the master clock goes offline due to a failure. A secondary clock on the network will notice the lack of announce messages from the primary clock and will begin to announce its presence. In less than a minute a new grandmaster will have taken the place of the original clock, reducing the amount time in which the sync packets are lost.


Closing words


With the increasing requirements for high precision time sync and for smart, redundant networks, the use of PTP within a substation environment is becoming the new normal. With this, I leave you with a final question - are you prepared to make the move to PTP?

Further reading:

How do I get even more network redundancy?

To get in depth about PTP, see our whitepaper





What's so great about PTP?