Stratum 1 PTP Grandmaster: CM4 + SR1723U10 (Part 1) | Opscode - Linux & Infrastructure EngineeringTable of Contents
I work with industrial infrastructure that requires nanosecond-accurate time synchronization. The commercial GPS-disciplined PTP grandmaster clocks that solve this problem run from several thousand dollars on the low end, and considerably more with options and support. I had CM4s and CM4 IO boards already sitting in the lab. A TimeHAT with an OCP M.2 GNSS module would have been the cleaner path at around $400, but that is steep when the goal is learning how PTP actually works, not deploying production infrastructure. This build came in at around $103 in new parts.<br>This post documents what I built, what broke, what I had to fix, and the results I measured.<br>What is PTP and why does it matter#<br>Time precision is a spectrum:<br>UnitWhat it isExample Uses1 second (s)The tick of a clockHuman scheduling, cron jobs1 millisecond (ms)1 second split into 1,000 piecesWeb browsing, video streaming, log timestamps1 microsecond (µs)1 second split into 1,000,000 piecesHigh-frequency trading, audio/video sync, distributed databases1 nanosecond (ns)1 second split into 1,000,000,000 piecesAerospace instrumentation, industrial automation, scientific data acquisition, this buildNTP is good enough for web servers, databases, authentication systems, and anything where you need to know when something happened but don’t need to coordinate hardware events across machines. Over a LAN with a good reference, NTP can reach low microseconds. Over the WAN it typically lands in the low milliseconds. The ceiling is the network path jitter between client and server, every variable delay adds noise to the offset estimate.<br>PTP (Precision Time Protocol, IEEE 1588) handles the nanosecond tier. With hardware timestamping at the Ethernet PHY layer, PTP can synchronize clocks to within tens of nanoseconds on a local network. The grandmaster clock is the root time source. It takes GPS-disciplined time and distributes it to clients via the PTP protocol.<br>A nanosecond is the time it takes light to travel about 30 centimeters (roughly 1 foot). After this build, the clocks on my homelab nodes were off from GPS truth by the time it takes light to travel across a room.<br>Hardware#<br>ComponentNotesCostRaspberry Pi CM4 (8GB/32GB eMMC)Already ownedN/ACM4 IO BoardAlready ownedN/ASR1723U10 GPS moduleu-blox M10 based~$15JEFA Tech U.FL to SMA pigtailFor antenna connection~$8Bingfu GPS antennaActive, SMA~$12MOOKEERF SMA cablesVarious lengths~$10Waveshare CM4 IO Board case1U aluminum~$25ELEGOO Dupont jumper wire kitFor wiring~$8M2.5 standoff kitMounting hardware~$812V 2A power supplyFor IO board~$12CR2032 batteryFor onboard RTC~$5Total (new parts) ~$103 The CM4 and IO board were already on hand.<br>This build vs the TimeHAT path:<br>This BuildTimeHAT PathComputeCM4 + IO Board (owned)Raspberry Pi 5 (~$80)GPS integrationSR1723U10 + wiring (~$23)TimeHAT + OCP M.2 GNSS module (~$395)AntennaBingfu + pigtail (~$20)Same antenna works (~$20)OscillatorStandard crystalTCXO (temperature compensated)New spend ~$103 ~$475+ The oscillator difference matters. The TimeHAT includes a TCXO, which compensates for temperature-induced frequency drift. During GPS holdover, a TCXO holds time significantly more accurately than a standard crystal because its frequency stays stable as the board heats up or cools down. The CM4 uses a standard crystal with no temperature compensation. This build held 15ms of drift over 10 hours of holdover, which was acceptable for this use case. In a production environment where holdover accuracy is critical, the TCXO is worth the cost difference.<br>The TimeHAT also uses an Intel i226 NIC rather than relying on the CM4’s onboard BCM54210PE, uses proper SMA connectors, and requires no jumper wires. If you are starting from zero hardware, that path is easier. If you have a CM4 already and want to understand what is happening at the PHY level, this build gets you there for a fraction of the cost.<br>The key hardware fact: The CM4 uses the BCM54210PE Ethernet PHY which has full IEEE 1588v2 hardware timestamping support. This is what makes sub-microsecond PTP possible on the CM4. The BCM54210PE timestamps packets right at the wire inside the PHY, before the packet touches the kernel network stack. This eliminates the jitter that comes from kernel scheduling and interrupt handling.<br>Clients:<br>Turing Pi 2 cluster board (RTL8370MB-CG+ switch)<br>RK1 compute module (Rockchip RK3588, Ubuntu 22.04)<br>CM4 (Ubuntu 24.04), the k8s1 node<br>The Turing Pi 2 has two external RJ45 ports. Both ports are bridged into the same switch fabric as the four node slots. The grandmaster is plugged into ge1 (the second RJ45 port). The RK1 and CM4 client nodes are on the internal node slots. All five are on the same RTL8370MB-CG+ switch fabric, which means PTP packets between the grandmaster and clients pass through a single switch hop with no routing involved.<br>Why Ubuntu 24.04#<br>The CM4...