Christmas Offer - Every Learner Must Check Out - Flat 88% OFF on All Access Pass
00
days
:
00
hours
:
00
minutes
:
00
seconds
PyNet Labs- Network Automation Specialists

What is PTP – Precision Time Protocol?

Author : PyNet Labs
Last Modified: January 19, 2024 
Blog Featured Image with text - What is PTP - Precision Time Protocol and an image of various PTP Clocks

Introduction

Nowadays, data is generated and transmitted all over the globe at an unprecedented rate. Hence, accurate and precise time synchronization is essential for almost every application and service. It is now crucial to have a common as well as reliable time reference across different devices and networks in order to ensure coordination, consistency, security, and quality.

However, achieving such a high level of time synchronization is not easy, especially when dealing with large and heterogeneous networks that span multiple domains and locations. Traditional time synchronization protocols, such as NTP (Network Time Protocol), need to be more accurate. This is where PTP (Precision Time Protocol) comes into action. In this blog, we will discuss PTP in detail, its purpose, different types of PTP clocks, and how PTP works.

Precision Time Protocol (PTP) is topic covered in CCNP Training and CCIE Training. Checkout PyNet Labs’ CCNP Enterprise Training to know more. Let’s understand what Precision time protocol is.

What is the Precision Time Protocol?

PTP, also known as Precision Time Protocol, is a synchronization protocol developed by the IEEE working group. It was initially published in 2002 and defined in the IEEE 1588-2002 standard. PTP is mainly utilized in order to achieve time synchronization with precision up to the nanosecond level over Ethernet networks as well as IP-based networks.

When we talk about the operation of PTP, it operates on a master-slave architecture. In this architecture, one or more master clocks transmit information about the time to slave clocks, which then adjust their clocks accordingly. Additionally, PTP minimizes the impact of network delays, including peer delay measurement, delay request response, and transparent clocks.

History of Precision Time Protocol

IEEE 1588, introduced by John Eidson, has a unique purpose not properly recognized by the NTP and GPS protocols. Therefore, in 2002 the Precision Time Protocol (PTP) was published and described in the IEEE 1588-2002 standard, which was officially called “Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems”.

But to improve accuracy, precision, and strength, its modified version was introduced in 2008 as IEEE 1588-2008 or PTP version 2 (PTPv2). But it does not match the backward compatibility of the original version, which is why in November 2019 an improved version of 2008, IEEE 1588-2019 or we can say PTPv2.1 was released.

Let’s discuss the purpose of the PTP protocol.

Purpose of PTP Protocol

The primary purpose of PTP is to offer consistent and precise timing across devices and networks, which makes it an ideal choice for applications that require high-performance time synchronization. Some examples of applications include:

  • Distributed computing: PTP assists in coordinating tasks across nodes that share a common clock domain.
  • Network security: PTP aids in preventing replay attacks and ensuring the integrity of timestamps in digital signatures and certificates.
  • Financial transactions: PTP helps guarantee the accuracy and fairness of trading operations by avoiding disputes over transaction timing.
  • Industrial automation: PTP synchronizes the functioning of sensors, actuators, controllers, and machines within a production line or factory.
  • Telecommunications: PTP aligns the frequency and phase of signals in networks and optical transport networks.

Before getting into the working of precision time protocol, let’s first understand the different types of PTP clocks.

Different Types of PTP Clocks

There are different types of PTP clocks depending on different roles and functions. Below, we have discussed the five types in detail.

A Grand Master Clock which is a clock and a PC connected to Boundary clock which is connected to 3 slave systems

Grand Master Clock (GMC)

This clock holds the highest level of precision within a PTP domain. Serves as the reference time source for all other clocks. One active GMC is allowed in a domain at any given time.

Boundary Clock (BC)

A BC clock can act as both a master and a slave clock with multiple network ports. For better precision of time, it receives time information from a higher-quality clock (such as GMC) on one port and further distributes it to lower-quality clocks (such as OCs) on other ports. Additionally, it can act as a backup GMC in case of the failure of the primary GMC.

Ordinary Clock (OC)

An OC is a clock equipped with a network port that can function as either a master or a slave clock. It receives time information from a higher-quality clock, such as a GMC or BC. It provides time information to a lower-quality clock, such as another OC.

Master Clock (MC)

An MC is just a term for any clock that offers time information to other clocks such as GMCs, BCs, and OCs. An MC can have multiple slave clocks associated with it.

Transparent Clock (TC)

A TC can be defined as a device that measures the residence time of PTP messages passing through it and further adds this information to the messages. It assists in reducing the effects of network delays on time synchronization.

Let’s move on to the functioning of the PTP Protocol.

How Does Precision Time Protocol Work?

When setting up a precision timing protocol (PTP) network, you will come across the term BMCA, which stands for “Best Master Clock Algorithm” (sometimes referred to as BMC).

The BMCA algorithm helps in selecting the clock to serve as the timing source for your network.

  • A master clock provides time to clocks in the network.
  • A slave clock receives time from clocks in the network.
  • A passive port is neither a master nor a slave.

PTP works somewhat similarly to Network Time Protocol (NTP) by exchanging synchronization messages between a master and slave clock. The protocol includes elements such as the master sync message, master delay response message, and slave clock delay request messages.

Both master and slave clocks record precise timestamps of network activities. These timestamps measure network latency and ensure synchronization between slave clocks and the master. The sync messages are transmitted by the master clock every two seconds, while the slave unit usually sends one delay request message per minute.

To calculate the offset for each slave clock accurately, four timestamps are recorded during interactions between the slave and master clocks.

The diagram below displays the timestamps commonly denoted as T1, T2, T3 and T4.

A Master Clock against a Slave Clock and various timestamps at slave clock.

Note: The delay from the master to the slave and the delay from the slave to the master must be calculated separately.

Master to the Slave Delay

The first timestamp, T1, represents the moment when the master sends out the sync message via the Ethernet port. It is included in the follow_Up message since it accurately records when the sync message was transmitted.

The second timestamp, T2, indicates the time when the slave receives the sync message.

Once both T1 and T2 are known to the slave clock, we can calculate the delay between the master and slave by subtracting T1 from T2.

Slave to the Master Delay

The third timestamp, T3, signifies when the slave sends out a delay request message, i.e., Delay_Req. The fourth and final timestamp, T4, marks when the master receives this delay request.

Once both T3 and T4 are available to analyze at the slave clock, we can calculate that delay value between slave and master by subtracting T3 from T4.

Once the differences between the master-to-slave and slave-to-master are available on the slave side, we can determine the one-way delay. The one-way delay is calculated by adding the master-to-slave difference and the slave-to-master difference and then dividing it by two.

One-way Delay = [(T2 – T1) + (T4 – T3)] / 2

After that, we calculate a value (offset value) to adjust the slave clock.

Offset = master to slave difference minus one-way delay.

To simplify this calculation further:

Offset = [(T2 – T1) – (T4 – T3)] / 2

Note: By utilizing this offset, the slave clock can align its time with that of the master clock.

This is how Precision Time Protocol Works.

Best Master Clock Algorithm (BMCA)

Priority1: Considering the value that you have manually configured in the range of 0-255.

Class: This indicates the type of clock source, and the default value is 248. For example; If a clock is connected to GPS which is class 6 then after losing its source it becomes class 7.

Accuracy: This reflects the “true” timing accuracy level of the clock, and, by default, the atomic clock has some deviation. A lower value of the clock means better accuracy of the clock.

Variation: This shows the clock’s stability in considering future changes over time. This means that lower variance indicates better stability.

Priority2: Again, consider a value between 0-255 that you configured manually.

Identity: An 8-byte number that typically corresponds to the device’s MAC address.

When the BMC algorithm is completed, the master clock broadcasts sync messages at regular intervals. When a current master clock identifies a new superior master clock, it stops transmitting sync messages (or announcing messages in the context of IEEE 1588-2008) and thereafter, the identified new clock gets the role of master clock.

Features of Precision Time Protocol

Some of the most important features of Precision Time Protocol are –

  • Alternative time-scale functionality
  • Grand Master Clock Synchronization
  • Master-Slave Architecture
  • Traceable communication path

How is PTP better than NTP?

Here’s why PTP is better than NTP:

If we talk about systems that use NTP, those work asynchronously in a distributed environment without a global clock and depend on each other with check-ins for synchronization. Due to multiple check-ins, network shutdown issues occur as the system grows and more check-ins affect network operations.

Using logical clock methods that are distributed sequentially according to single node clocks in the database with appropriate sorting steps and physical methods. Therefore, to ensure that all clocks are in sync, engineers deliberately invent delays to account for network latency.

However, in PTP, the functions are like a smartphone clock as it updates the time according to the network behavior. This allows the system to synchronize and rely on individual sources of official time such as how smartphones adjust to time zone changes or daylight savings. Where NTP systems manually adjust for time changes such as daylight savings.

Advantages of Precision Time Protocol

Here are some of the advantages of PTP Protocol –

  • Accurate time stamping
  • Well-established clock synchronization
  • Advanced Security Measures
  • Coordinated Work and Synchronous Communication

Disadvantages of Precision Time Protocol

Some of the disadvantages of PTP are –

  • If the master clock fails the entire communication stops
  • Possibility of Synchronization Manipulation
  • Uncertain Selection of New Master Clock

These are the advantages and disadvantages of Precision Time Protocol.

Frequently Asked Questions

Q1. What is Precision Time Protocol used for?

Precision Type Protocol is used to synchronize the clocks of devices connected to a network.

Q2. What is the difference between NTP and PTP?

NTP and PTP are protocols for synchronizing clocks over a network. NTP is older and more widely used, but PTP is more accurate and precise.

Q3. What is a precise protocol?

A precise protocol is a set of rules that specify how to perform a task or communicate data accurately and consistently.

Q4. What is PTP mean in networking?

PTP stands for Precision Time protocol, which offers clock synchronization in a network. It provides microsecond accuracy that is suitable for control systems.

Conclusion

PTP, or precision time protocol, is a powerful and flexible protocol that offers high-performance time synchronization for various applications that require precise and consistent timing across different devices and networks. In this blog, we have discussed the PTP protocol in detail, its purpose, different types of PTP clocks, and how PTP functions.

Recent Blog Post

Leave a Reply

Your email address will not be published. Required fields are marked *

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram