PTP Timing

Summary

The lab uses IEEE 1588v2 Precision Time Protocol in SMPTE 2059 profile (domain 127) to synchronize all media devices. The timing architecture follows a three-tier hierarchy: SERVER-PC runs a LinuxPTP (ptp4l) grandmaster, the MikroTik CRS326-24G-2S+RM acts as a hardware boundary clock with nanosecond-range timestamping on its RJ45 ports, and Stream-PC plus MSI Laptop run as PTP slaves.

PTP runs over the 1GbE control plane (CRS326 RJ45 ports), not the 10GbE media plane. The CRS326 supports SMPTE PTP profiles starting with RouterOS v7.14.3+, with domain GUI controls added in v7.15+. A critical configuration detail: when IGMP snooping is enabled on the CRS326, a static MDB entry for multicast group 224.0.1.129 must be added to all PTP ports AND the bridge interface, or boundary clock synchronization breaks.

Phase 1 uses software timestamping via WSL2, which delivers 10-100 microsecond accuracy. Hardware timestamping (sub-microsecond) is planned for later phases via Linux VM with NIC passthrough. The Mellanox ConnectX-3 NICs support hardware PTP timestamping natively.

Timeline

  • 2026-04-03: Lab design created. PTP boundary clock identified as core requirement.
  • 2026-04-03: Switch research completed. CRS326-24G-2S+RM selected — PTP on RJ45 ports confirmed.
  • 2026-04-03: Phase 1 implementation plan written. PTP grandmaster/slave configs drafted.
  • 2026-04-05: Hardware ordered, pending delivery.
  • 2026-04-16: CRS326 online with RouterOS 7.22.1. PTP boundary clock instance ptp1 created with SMPTE profile. PTP ports added for ether1 (laptop slave) and ether20 (SERVER-PC grandmaster pending cable move). Static MDB for 224.0.1.129 added. gm.cfg and slave.cfg committed to repo. WSL Ubuntu 24.04 configured on SERVER-PC and laptop with linuxptp 4.0, mirror networking mode. Software timestamping confirmed on both.

Current State

CRS326 boundary clock (configured, waiting for grandmaster):

  • /system ptp instance ptp1, profile=smpte, domain=auto (resolves to 127 per SMPTE 2059)
  • Note: MikroTik rejects 224.0.0.107 (“address not allowed”) — E2E mode doesn’t need P2P multicast

STALE — PTP port membership and static MDB interface= list changed in a 2026-04-17 session and have not been re-captured here. Refresh with /system ptp port print and /interface bridge mdb print from the switch, then update the ether assignments.

Grandmaster config (SERVER-PC WSL Ubuntu — ready, not started):

  • File: src/smpte-2110-lab/configs/ptp/gm.cfg
  • Domain: 127, Priority1/Priority2: 128, clockClass: 248
  • Sync interval: 125ms (logSyncInterval -3), Announce interval: 1s
  • Transport: L2 multicast, E2E delay mechanism
  • Timestamping: software (WSL2 mirror mode, no HW passthrough)

Planned GM relocation (2026-04-17 design): GM role migrates from SERVER-PC WSL → Dell OptiPlex 5060 SFF (incoming ~2026-04-22), running Ubuntu 24.04 LTS native. This unblocks HW timestamping via the onboard Intel I219-LM PHC (WSL2 can’t drive the PHC) and removes the GM from a daily-driver workstation that gets shut down. Same gm.cfg runs unchanged. Connects to CRS326 ether19. The OptiPlex simultaneously hosts the HDMI→2110 gateway, the home NAS, and the Linux dev environment — see docs/plans/2026-04-17-optiplex-nas-design.md.

Slave config (laptop-kai WSL Ubuntu — ready, not started):

  • File: src/smpte-2110-lab/configs/ptp/slave.cfg
  • Domain: 127, slaveOnly=1
  • Same transport/timestamping as GM

Known caveat: CRS326 emits PTP Sync/Announce as master on ether1 currently — with no higher-priority GM present, BMCA defaults to the local clock. Once SERVER-PC GM starts (clockClass 248 vs CRS326’s default), SERVER-PC should win BMCA.

WSL2 mirror-mode multicast limitation (discovered 2026-04-16):

Phase 1 attempted to run both ptp4l grandmaster (SERVER-PC WSL) and slave (laptop-kai WSL) with WSL2 in mirror networking mode. GM transmit works fine — tcpdump on SERVER-PC eth2 shows PTP emissions to 224.0.1.129 ports 319/320. CRS326 ether20 RX counters confirm the packets arrive at the switch. CRS326’s dynamic MDB correctly includes ether1 (laptop) and ether20 (SERVER-PC) for group 224.0.1.129 after IGMP join.

The blocker: laptop-side WSL eth0 receives zero PTP multicast packets, even with:

  • IGMP snooping on at CRS326 with static + dynamic MDB entries
  • Promiscuous mode enabled on eth0
  • Windows firewall set to Private
  • Mirror mode enabled in .wslconfig

Root cause: WSL2 mirror mode does not propagate IGMP group joins from the Linux guest to the Windows host’s NIC multicast filter. The Windows NIC silently drops 224.0.1.129 frames at the hardware level before they reach WSL. The Intel/Realtek drivers on this laptop do not expose a “accept all multicast” toggle in Get-NetAdapterAdvancedProperty. Unicast works fine (ping, SSH — both proven end-to-end through the CRS326 path).

Consequence for the lab: PTP slave cannot run in WSL2 on this hardware/OS combination. The infrastructure (switch config, VLAN, bridge MDB, IGMP snooping, BC instance) is all proven correct via multicast hitting ether20 RX and the GM transmit side working cleanly. Only the WSL2 → Windows NIC multicast delivery fails.

Resolution path: Phase 2 native Linux dual-boot. When the laptop is rebooted into native Ubuntu 24.04, the Linux kernel drives the NIC directly, IGMP joins propagate to hardware, and PTP multicast delivery works normally. This is also required for hardware PTP timestamping (sub-microsecond accuracy) which WSL2 can’t do either.

For tonight: end of software-timestamping Phase 1 scope without a live sync demo. All hardware and CRS326 config is production-ready and committed to repo at configs/switch/crs326-ptp-config.rsc and configs/ptp/{gm.cfg,slave.cfg}. Phase 2 dual-boot is the unblock.

Key Decisions

  • 2026-04-03: Chose SMPTE 2059 domain 127 over default domain 0 — matches broadcast industry standard.
  • 2026-04-03: PTP runs on 1GbE control plane, not 10GbE media plane — mirrors professional split-plane architecture.
  • 2026-04-03: SFP+ uplink port excluded from PTP — prevents PTP leaking to UniFi production network.
  • 2026-04-03: Software timestamping accepted for Phase 1 — WSL2 can’t do hardware timestamping, but still demonstrates protocol concepts.

Experiments & Results

ExperimentStatusFindingSource
PTP sync with SW timestampingPlannedExpected 10-100 us offsetPhase 1 plan
PTP sync with HW timestampingFutureExpected sub-microsecondArchitecture doc
Boundary clock vs end-to-endDecidedBC chosen for interview value and accuracySwitch research

Gotchas & Known Issues

  • IGMP + PTP conflict on MikroTik: When IGMP snooping is enabled, the dynamic MDB entry for 224.0.1.129 excludes the bridge interface, breaking BC sync. Fix: static MDB entry including all PTP ports AND the bridge interface.
  • CRS326 PTP ports: PTP only works on RJ45 ports, NOT SFP+ ports. This is a hardware limitation of the CRS326.
  • WSL2 limitation: No hardware timestamping support. For HW timestamping, need a Linux VM with PCIe NIC passthrough.
  • Peer delay group: Also need static MDB entry for 224.0.0.107 on all PTP ports.

Open Questions

  • What PTP offset will WSL2 software timestamping actually achieve on this network?
  • Is Hyper-V or VirtualBox better for ConnectX-3 passthrough for hardware timestamping?
  • Should the GPS grandmaster (Phase B) replace or supplement the SERVER-PC grandmaster?

Sources