Introduction to Precision Time Protocol (PTP)

Hello Babar

Yes, SW2 will become the master clock. The PTP Best Master Clock Algorithm (BMCA) will kick in and the process will result in SW2 becoming the master clock.

When SW1 initially comes back online, it will act as a slave because it has no knowledge of the current time. It will receive the sync messages from SW2 and adjust its clock accordingly. However, once it has updated its time, it will start sending announce messages again. If SW1 is still configured with a higher priority (lower priority number), the BMCA will determine that SW1 should be the master and it will take over that role again. In other words, the process is preemptive.

In order to answer the question, we must clarify a couple of things. There is a difference between the clock type, and the interface role.

The clock type refers to the type of clock the device itself represents. You can have the following types:

  • Grandmaster clock (GMC)
  • Ordinary clock (OC)
  • Boundary clock (BC)
  • Transparent clock (TC)

The interface role refers to the role each specific interface on a device has. The two roles are “master” and “slave”. The interface roles should always be chosen in such a way so that the master interface is closer to the GMC. Take a look at this diagram:

Notice the master role denoted by the “M” is always on the interfaces closest to the GMC, which is the authoritative time source. If the roles were switched, then the source of the time would be an OC, which by definition would be inaccurate. The BMCA takes care of this process.

Now if you had only two switches, there’s no way to explicitly configure one device as an OC. You can however change the priority of one switch so that the SW2 becomes an OC. In the event the master fails, the BMCA will run again, and the OC will become a GMC.

The algorithm determines whether a switch becomes a GMC or an OC, and it also determines the role of the interface. Does that make sense?

I hope this has been helpful!