Bodet-Time
  • Home
  • Resources
  • Blog
  • NTP vs. PTP: Which protocol to choose according to your needs?
NTP vs. PTP: Which protocol to choose according to your needs?

It is paramount to make sure that all machines on a computer network are synchronised for software or industrial operations of many economic sectors. There are several ways to time synchronise machines via the network. To do so, time synchronisation protocols are used to synchronise different machines by broadcasting timestamps. These protocols usually broadcast the time of a reference clock such as an atomic clock or a GPS. However, the more extended a network, the more difficult it can be to synchronise machines.

Nowadays, the most widely used protocols are NTP (Network Time Protocol) and PTP (Precision Time Protocol). Each one of these protocols meets specific purposes which are more or less suitable depending on required applications.

NTP

NTP (Network Time Protocol) is one of the first time synchronisation protocols to be developed. It has been first standardised in 1985 in the RFC 958. From version 0, this protocol offers an accuracy of less than one second. The first version has been introduced in 1988 in the RFC 1059. The next year, the second version of NTP has been standardised to add an authentication mechanism (RFC 1119 version). Version 3 has been introduced in 1992 in the RFC 1305. Eventually, the current version (the fourth one) has been introduced in June 2010 in the RFC 5905.

NTP is a hierarchical protocol. The reference clock is at the top of the hierarchy. The latter will broadcast its time across the entire NTP network. The NTP network is organised in layers which are defined according to their distance from the reference clock. The latter is in layer 0.

The protocol has a tree-like architecture: the primary NTP servers are in layer 1 and are synchronised with a reference source (atomic clock, coded time receiver, GPS receiver...). The other servers are in layer 2 and synchronise with one or several servers of layer 1, and so on.

The standard supports up to 16 layers but in practice, most servers are in layers 3 and 4. The farther the servers in the hierarchy, the more communication delays accumulate and affect the synchronisation quality.

The NTP protocol organised in layers

NTP has been constantly evolving and can now reach an accuracy of microseconds, while protecting communications if needed. This is the most simple protocol to choose for extended networks.

PTP

PTP (Precision Time Protocol) is a more recent protocol which has been standardised by the IEEE under the name IEEE-1588. Its first version dates back to 2002 and has been reviewed in 2008 and 2019. The 2008 version is considered as the second version. However, it is not compatible with the 2002 version. The 2019 version is not a major version. In fact, it only offers some optimisations, such as for management of environments with multiple domains.

PTP offers a very high accuracy down to nanoseconds on local networks. Since PTP is a network protocol, the latter can operate over large distances even if larger distances between clocks mean accumulated delays. It is then more difficult to reach the highest accuracy. Unlike NTP, the Precision Time Protocol relies on hardware timestamps. As such, it requires specific hardware to operate.

PTP operates in domains which are defined by a set of clocks synchronised with each other. The default configuration only features a single domain. The PTP protocol operates in asymmetrical mode with a master clock that will broadcast its timestamp to the slave clocks. The slave clocks will then send messages to the master clock to calculate the delay between them, in order to correctly synchronise their clock. In order to define which will be the master clock of a domain, PTP uses the BMCA algorithm (Best Master Clock Algorithm). The BMCA watches each clock broadcasting its features to the other clocks and identifies the most appropriate clock to be the master clock. The master clock will then broadcast the time of a reference clock (atomic clock or GPS) to achieve the most accurate synchronisation possible.

Due to its high accuracy and operation on standard networks, PTP is widely used in many industries with demanding needs in terms of time synchronisation. These industries have generally introduced profiles (PTP configuration) meeting specific needs and suitable for each application.

Which protocol to choose according to your needs?

Not all protocols meet the same needs. NTP is one of the main time synchronisation protocols. It has evolved over the years without becoming obsolete, and keeps meeting the needs of many users. The fact that is it easy to implement, the many public NTP servers available and its microsecond accuracy make it an obvious choice for anyone not developing applications and whose synchronisation needs are not critical. As such, applications that are able to introduce a slight delay between the different clocks can entirely rely on NTP, which is software developed on a network.

PTP offers better guarantees, but more complex deployment and maintenance. A standardisation effort enables to use profiles suitable for each application, thus making hardware commissioning and interoperability easier. Network equipment (switch or router) often support the PTP protocol, which allows for better delay estimation and greater accuracy over large distances. Besides, PTP is paramount for the most demanding industrial applications and for which a time synchronisation breakdown would have consequences.

To conclude, choosing the synchronisation protocol depends on many settings, such as the considered application, the size of the network to synchronise, the expected accuracy, and so on.

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. The modular design of Netsilon time servers adapts and evolves according to the needs and applications, by offering time synchronisation via NTP and PTP protocols.

Do you require assistance?

Share the article