Time Synchronization

Time Synchronization
News & Tutorials from Meinberg
  • PTP / IEEE 1588
  • NTP
  • Configuration Guidelines
  • Industry Applications
  • Security
Home » IEEE 1588 » BMCA Deep Dive: Part 2

BMCA Deep Dive: Part 2

March 11, 2022 by Douglas Arnold 3 Comments

Five-minute facts about packet timing

This is part 2 of a two-part description of the Best Master Clock Algorithm (BMCA).  In Part 1 we listed the information that is considered in the BMCA and what the priorities are amongst those quantities. You can think of this information as the clock credentials.  If you missed part 1, then you should read that first.  In Part 2 we will talk about how that information is used to by PTP nodes to choose the states that their ports should be in.

Figure 1 shows that states of a Master-only Ordinary Clock (OC).  Recall that an OC is a one-port PTP node, intended act as either a Grandmaster (GM) or a slave clock.  A Master-only OC is typically a time server with a GNSS receiver that is intended to serve either as the active GM of the PTP domain, or as a backup GM.  When it is ready to be a backup it will be in the Passive state.  Note that the backup GM knows to be in the Passive state because it received an announce message from a clock with better clock credentials (see part 1 of this discussion for what counts as better).  The Pre-master is a transition state intended to make sure that no Announce messages are arriving from better clocks.  The Pre-master state creates a short delay before an OC becomes the GM.  This delay is intended to reduce the number of port state transitions in the network when Announce messages are dropped in the network or there is a change in GM in the PTP domain. 

Figure 1:  State Diagram of Master-only Ordinary Clock

Figure 2 shows the same state diagram for a Slave-only OC.  Just as the case with the Master-only OC, the slave only OC will remain in the listening state until it receives an Announce message from a better clock, then it will be in the uncalibrated state until it has been able to set or steer its PTP clock to the time of the GM to within its accuracy specification.  After that it will be in the Slave state.

See also  The PTP AUTHENTICATION TLV
Figure 2:  State Diagram of Slave-only Ordinary Clock

In some applications it is desirable to always have some PTP node acting as the GM, even if it is a device intended to be a Slave in normal operation.  This might be a holdover situation for the PTP domain when the active GM becomes unavailable. Figure 3 shows a simplified view of an OC that can act as either a GM or Slave.  For simplicity the transitional states Pre-master, and uncalibrated have been omitted.  Not all PTP Profiles include these transitional states.  For example, IEEE 802.1AS does not include them.

Figure 3: State Diagram of a general Ordinary Clock.  Note that transitional states pre-master and uncalibrated are not shown for simplicity.

The BMCA operation in a Boundary Clock (BC) is more complicated than it is in an OC, because the state of a port depends on not just what Announce message the port receives, but also on what is received on the other ports as well.  Normally a BC will set one port in the Slave state and the other ports in the Master states.  The port in the Slave state will receive time from the GM, or an upstream BC, and that time will be used to set the BCs PTP clock.  The BC’s PTP clock will then provide time for PTP messages transmitted on the remaining ports, which are in the Master state. 

In Figure 4 Port 1 is not selected as the Slave port because it does not receive any Announce messages, in other words it is not connected to a PTP port in the Master state.  Port 2 does receive Announce messages, but not from a clock as good that received on Ports 3 and 4.  Port 3 is selected to be the port set to the Slave state over Port 4 because it received Announce messages from the same GM but through fewer intervening BCs, as indicated by the received steps removed value.

See also  The Sync Monitor reverse PTP mechanism
Figure 4: Port state decisions in a Boundary Clock

The situation depicted in Figure 5 is the same as that in Figure 4 except that Ports 4 and 5 receive Announce messages from the same GM each with the same number of steps removed. In this case the lower Port number, Port 3, is selected as the port in the Slave state, and Port 4 is put in the Passive state.  In BC ports are put in the Passive state for the purpose of breaking timing loops, in the case that timing loops are not otherwise prevented by a transport layer protocol like the Rapid Spanning Tree Protocol.

Figure 5: Port state decisions in a Boundary Clock. One of the ports is set to the Passive state to break a timing loop

If you have any questions about packet timing, don’t hesitate to send me an email at doug.arnold@meinberg-usa.com, or visit our website at www.meinbergglobal.com.

  • share 
  • share  
  • share 

Related posts:

  1. What Are All Of These IEEE 1588 Clock Types?
  2. BMCA deep dive: part 1
  3. Using SNMP to Manage Network Time Servers
  4. What Makes a Master the Best?
Previous Post - BMCA deep dive: part 1
Next Post - Genlock in a networked world

Filed Under: IEEE 1588

Comments

  1. Jerome TERNOY says

    October 26, 2022 at 10:28 am

    First time I hear about the removed steps value being used in BC for slave port election. Very useful, thank you very much !

    Reply
    • Douglas Arnold says

      October 26, 2022 at 9:41 pm

      You are so welcome.

      Reply
  2. Stanley says

    December 4, 2022 at 5:24 pm

    Thank you for the informative blog!

    Question on Figure 5. If Port 3 & Port 4 both receives the same PTP GM announce and steps removed messages advertised by two different BCs with different accuracies. What determines that Port 3 becomes Slave state and Port 4 Passive state? Would BCs’ timing properties(accuracy, offset from Master etc) matter?

    If Port 3 went down, Port 4 will transition to the Slave state. But when Port 3 came back up, would Port 4’s role flipped back to Passive?

    Also, Figure 4&5 is missing Port 4 labels.

    Reply

Discussion Area:

If you enjoyed this post, or have any questions left, feel free to leave a comment or question below.

Share Your Comments & Feedback Cancel reply

PTP Software

  • PTP Track HoundPTP / IEEE 1588 Protocol Analyzer

  • NTP / PTP Simulation Software
  • Meinberg Advertisement

    Categories

    • Authors
    • Configuration Guidelines
    • IEEE 1588
    • IEEE 1952
    • Industry Applications
    • NTP
    • Security

    External Links

  • NTP Security
    • Site Notice
    • Privacy Policy

    You may also like

    1. What Are All Of These IEEE 1588 Clock Types?
    2. BMCA deep dive: part 1
    3. Using SNMP to Manage Network Time Servers
    4. What Makes a Master the Best?

    © 2025 · Time Synchronization Blog

    MENU
    • PTP / IEEE 1588
    • NTP
    • Configuration Guidelines
    • Industry Applications
    • Security