How Does BMCA (Best Master Clock Algorithm) Work in IEEE 1588 PTP?

Q: What is the Best Master Clock Algorithm (BMCA)?

A: The Best Master Clock Algorithm (BMCA) is the mechanism defined in the IEEE 1588 Precision Time Protocol (PTP) that automatically determines which clock on a network should serve as the Grandmaster (GM) — the authoritative time source from which all other clocks synchronize. BMCA runs independently on every PTP device, and each port compares the attributes of its own clock against announcements received from neighboring clocks. Through this distributed comparison, all devices independently reach the same conclusion about which clock is best, without requiring a centralized controller.

Q: How does the comparison process work?

A: When a PTP device receives an Announce message from a neighbor, BMCA compares a ranked set of attributes to decide which clock is superior. The comparison follows a strict priority order:
  1. clockClass — highest priority in comparison
  2. clockAccuracy
  3. offsetScaledLogVariance (stability)
  4. priority1
  5. clockIdentity
  6. priority2
  7. Port address / sequence

The first attribute that differs determines the winner. The losing clock's port transitions to a Slave (or Passive) state relative to the winner.

Q: What is clockClass and why does it matter?

A: clockClass is an integer value (0–255) that indicates the quality and traceability of a clock's time source. Lower values represent better quality. Key ranges include:

Because clockClass is the first comparison attribute, a GPS-locked clock (class 6) will always outrank a locally free-running clock (class 248), regardless of other settings.

Q: What are priority1 and priority2?

A: Priority1 and priority2 are user-configurable values (0–255) that give administrators manual control over GM selection.

Setting priority1 = 255 effectively excludes a clock from ever becoming the Grandmaster.

Q: Summary

A: BMCA ensures robust, automatic, and deterministic GM selection. clockClass governs time-source quality, priority1 provides strong administrative preference, and priority2 offers fine-grained tiebreaking — together giving engineers full control over PTP grandmaster topology.

Need precision timing solutions? Get a quote from BRIDZA

← Back to Resources