How does one go about setting up Precision Time Protocol (PTP, high precision NTP)) IEEE 5888

Hi,

I see many router NICs claim IEEE 5888, also wifi should support wifi-ptp.

But how do you set it up, what hardware can you use as the time source (if you need accurate time and not just accurate time synchronization between devices)

As for packages I see kmod-ptp and linuxptp but not sure how to set them up and how to test them once their work.

Some more reading

https://openwrt.org/packages/pkgdata/kmod-ptp-qoriq

https://wiki.mef.net/pages/viewpage.action?pageId=29230774

https://forum.archive.openwrt.org/viewtopic.php?id=61532

Two uses that come to mind for this are phase coherent audio playback and RTK GPS. But just having really accurate time is a good thing on its own.

2 Likes

I can answer the time source part. Never done PTP but i'm interested too.

GPS. Or GPS disciplined local oscillator. And then upgrade your oscillator to whatever precision/accuracy you want. (i.e. thermally stabilised, how many PPM you need, get an atomic clock etc)

edit: Just to clarify for readability so this works well with @brada4 's comment: an oscillator is a clock source

1 Like

Easiest client is chrony. There should be network card, sometimes even PCI hub with autonomous clock. Or at least kvm ptp driver.
Probably you need to add new kmod packages with all needed clock support.

EDIT: this is to test concepts and the software chain involved, the network time distibution takes that microsecond callibration.

You can disable conntrack for NTP and grow from centisecs to sub-millisec precision.

1 Like

I will bite? How that, if I might ask respectfully? As far as I can tell NTP with internet time servers is at best good for millisecond precision (based on jitter/latency variance to host on the internet), for sub-miilisecond a local NTP server seems required, but with a local server, how does conntrack matter?

1 Like

I don't know the specific and that would have to be experimentally demonstrated, but if the packets have an extra round trip into the memory of a non-deterministic preemptive kernel then it makes sense that could add extra error to the timing signal. Especiallly if the system is under heavy load.

It probably matter less, the stronger your cpu is. I'm curious to know if that really works and makes a difference.

But on the other hand, people who need a good time reference would probably use an externally calibrated clock or a GPS signal (that's probably the easiest, but I have no idea how hard it is to get accurate GPS timing through an rs232 port)

Personnally, I am more curious about having a PTP relative time reference for my LAN (to synchronize sound on LAN) than to have an absolute time reference from the outside world.

1 Like

The sync process is unidirectional, so you just need every network switch to patch up packets by their own forwarding latency... Given variety of hardware platforms that number is not easy to estimate.

Okay so I did some research as I got up way too early this morning =P.

Meinberg looks to have the best blog post / application note?
Quite recent too, at least compared to what else I could find.
The next best I could find was skyworks an1208?

Anyway the TL;DR is basically a TCXO will probably be fine if you don't lose GPS sync?

In reading some other documents, looks like there's some peculiarities regarding clock selection with PTP and selecting your clock sources (edit: out of localyl available, if you have multiple sources?) I don't know enough....