vol17. BMCA (Best Master Clock Algorithm) について

概要

  • gPTP のGrand Master(GM)を選択するアルゴリズム。ネットワーク上の各クロックの中から、最もqualityの高いclock をみつけだす

  • BMCAを使用することにより以下が保証されている
    • Best Master Clock を特定する
    • すべてのgPTP device (time aware system) は、同じGMを使用することを保証される
    • GMがなんらかの理由でネットワークから外れた場合、代わりのデバイスGMになる

  • 自動車への実装は、かなりの点でIEEEの標準規格と異なる[1]
    • IEEE
      • ネットワークトポロジーやBMCAなど動的な設定がゆるされている
    • 自動車
      • 静的に事前決定される
        • 一意のシステムを作成し、システムを最適化させるため
        • 起動時間の短縮

topology

https://upload.wikimedia.org/wikipedia/en/thumb/6/64/Clock-Master.pdf/page1-1200px-Clock-Master.pdf.jpg

アルゴリズム

  1. 各gPTP device (switch, endpoint) は、Announce messageを用いて、自身の持つクロック情報をネットワーク内にmulticast 転送する。
  2. Message を受け取ったその他のgPTP deviceは、受信したクロック情報と自身のクロック情報を、以下の属性順に比較し、優先するソースを選択する。
  3. よりよいクロックを持つデバイスからannouce message を受け取った場合、そのポートはslave port へと移行する。(Announce message を発行するのを停止する)

Announce message

  • master portが発行する
  • 以下のクロック属性情報をもつ
    • priority1
    • clockClass
    • clockAccuracy
    • offsetScaledLogVariance
    • priority2
    • clockIdentity

クロック優劣の決定方法

  • systemIdentity で数字が小さい方が勝ち
  • IEEE802.1ASより引用

The systemIdentity attribute of a time-aware system is a
UInteger112 (i.e., a 14-byte, unsigned integer) formed by
concatenating the following attributes, in the following order,
from most significant to least significant bit:

a) priority1 (1 octet, see 8.6.2.1)
b) clockClass (1 octet, see 8.6.2.2 and 6.3.3.8)
c) clockAccuracy (1 octet, see 8.6.2.3 and 6.3.3.8)
d) offsetScaledLogVariance (2 octets, see 8.6.2.4 and 6.3.3.8)
e) priority2 (1 octet, see 8.6.2.5)
f) clockIdentity (8 octets, see 8.5.2.2 and 6.3.3.6)

g) A is better than B if and only if SA < SB, and
h) B is better than A if and only if SB < SA.