2

I am trying to sync the time with PTP; I've configured the Trimble device with PTP. However, when I use LinuxPTP with the below configuration, the local clock is always selected as the best master clock.

ptp4l[892.103]: selected local clock 00032d.fffe.55bd3b as best master 

I wonder why it's not picking up the Trimble device as the master clock.

Devices are connected via SFP/Fiber optic cables.

  • PTP Config file - /etc/linuxptp/ptpv2.conf
    [global] verbose 1 domainNumber 24 clockClass 6 priority1 128 priority2 128 [enp11s0] 
  • Run with sudo like this and console this output.
    $ sudo ptp4l -f /etc/linuxptp/ptpv2.conf ptp4l[886.038]: selected /dev/ptp7 as PTP clock ptp4l[886.039]: port 1 (enp11s0): INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[886.039]: port 0 (/var/run/ptp4l): INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[886.039]: port 0 (/var/run/ptp4lro): INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[892.103]: port 1 (enp11s0): LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES ptp4l[892.103]: selected local clock 00032d.fffe.55bd3b as best master ptp4l[892.103]: port 1 (enp11s0): assuming the grand master role 
  • I also captured the Wireshark Announce Message to see if it's helpful to debug this.
    Frame 9466: 78 bytes on wire (624 bits), 78 bytes captured (624 bits) on interface enp11s0, id 0 Ethernet II, Src: Trimble_70:07:6a (00:17:47:70:07:6a), Dst: IEEEI&MS_00:00:00 (01:1b:19:00:00:00) Precision Time Protocol (IEEE1588) 0000 .... = majorSdoId: Unknown (0x0) .... 1011 = messageType: Announce Message (0xb) 0000 .... = minorVersionPTP: 0 .... 0010 = versionPTP: 2 messageLength: 64 domainNumber: 24 minorSdoId: 0 flags: 0x003c 0... .... .... .... = PTP_SECURITY: False .0.. .... .... .... = PTP profile Specific 2: False ..0. .... .... .... = PTP profile Specific 1: False .... .0.. .... .... = PTP_UNICAST: False .... ..0. .... .... = PTP_TWO_STEP: False .... ...0 .... .... = PTP_ALTERNATE_MASTER: False .... .... .0.. .... = SYNCHRONIZATION_UNCERTAIN: False .... .... ..1. .... = FREQUENCY_TRACEABLE: True .... .... ...1 .... = TIME_TRACEABLE: True .... .... .... 1... = PTP_TIMESCALE: True .... .... .... .1.. = PTP_UTC_REASONABLE: True .... .... .... ..0. = PTP_LI_59: False .... .... .... ...0 = PTP_LI_61: False correctionField: 0.000000 nanoseconds correction: Ns: 0 nanoseconds correctionSubNs: 0 nanoseconds messageTypeSpecific: 0 ClockIdentity: 0x001747fffe70076a MAC Vendor: Trimble SourcePortID: 1 sequenceId: 28828 controlField: Other Message (5) logMessagePeriod: -3 originTimestamp (seconds): 0 originTimestamp (nanoseconds): 0 originCurrentUTCOffset: 37 priority1: 128 grandmasterClockClass: 6 grandmasterClockAccuracy: The time is accurate to within 100 ns (0x21) grandmasterClockVariance: 20061 priority2: 128 grandmasterClockIdentity: 0x001747fffe70076a localStepsRemoved: 0 TimeSource: GPS (0x20) 
  • Sync Command
    phc2sys -w -m -s enp11s0 -c CLOCK_REALTIME 

When I check some other configs on the internet, their logs show the correct clock selection, but mine always selects the best master clock as the local clock, and it won't sync the time from the master/boundary clock (right now, I am using a Trimble 1570001820 device with GPS).

Other notes:

  • NTP disabled
  • Hardware is capable of handling PTP, and the latest drivers are installed.

1 Answer 1

5

The Best Master Clock Algorithm (BMCA) goes as follows:

  1. Priority 1
  2. Clock Class
  3. Clock Accuracy
  4. Clock Offset Variance
  5. Priority 2
  6. Clock Identity
  7. Steps removed

In your case, the Priority 1 of the two clocks are the same (128) and the Clock Class is the same (6). I cannot see the Accuracy and Variance of your local clock in the data you provided, but I assume it must be the same (or better), too (0x21 and 20061). The Priority 2 is the same (128).

So far, all the values that can be seen in your question are identical, meaning the two clocks are considered "equally good" and neither is the "best" master.

Therefore, the Clock Identity (which is an EUI-64 formed from the EUI-48 of the MAC address of the clock's interface) is used as a tie-breaker. The Clock ID of the Trimble is 001747.fffe.70076a whereas your local clock's Clock Identity is 00032d.fffe.55bd3b, which is less than 001747.fffe.70076a.

Therefore, your local clock "wins" the BMCA.

The general advice is to give the intended grandmaster the lowest Priority 1 (e.g. 0). If you have multiple grandmaster clocks, they should all have the same Priority 1, so that who becomes the grandmaster is decided solely by the quality of the clock. It is generally also a good idea to give them different Priority 2, so that, if all have the same clock quality, you get to control which one becomes the master, as opposed to this being decided more or less "randomly" by the MAC address.

If you have a synchronization chain of clocks, it is generally advised to give each clock in the chain a slightly bigger Priority 1 (which makes it lower priority) than the preceding clock.

I work in a media infrastructure environment, where our synchronization chain typically looks like this:

  • 2 redundant clock generators with Priority 1 = 0.
  • Each clock generator is connected to at least one "PTP Feeder" switch.
  • 2 redundant "PTP Feeder" switches with Priority 1 = 10.
  • The two PTP Feeders are cross-connected, ideally with more than 1 redundant link.
  • Different switch vendors give different advice whether PTP should be injected at the Spines or at the Leaves. Depending on the switch vendor, either each PTP Feeder is connected to all Spines or all Leaves. If connected to the Spines, the Spines get Priority 20 and the Leaves 30, if connected to the Leaves, it's the other way around.
  • If there are aggregation switches hanging off the Leaves, those get Priority 1 = 40.
  • And so on …

And lastly, it is generally good practice to turn the master clock functionality off completely on all the devices you don't want to become master in the first place. So, all the devices which should be slaved to the master clock should be configured to "slave-only" mode. PTP Network Architecture Example

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.