News for hackers. Stuff that matters.
Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by throw0101a on Friday September 03, 2021 @07:06AM (#28402654)
Is anyone using PTP and its requisite accuracy in production? If so, what's your use-case?

Our central NTP servers are getting, per "ntpq -c kerninfo", sub-millisecond error:

     $ ntpq -c kerninfo
     associd=0 status=0615 leap_none, sync_ntp, 1 event, clock_sync,
     pll offset:            -0.257641
     pll frequency:         7.5157
     maximum error:         0.165426
     estimated error:       0.000422
     […]
That's talking to a couple of Stratum 1, and a bunch of S2, servers.
Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by michaelt on Friday September 03, 2021 @09:46AM (#28404168)
The most well known applications include:

* High-speed stock trading, where regulations often require precise timestamping.

* Cell phone networks, where adjacent towers have to hold their frequencies precisely, and synchronise their transmit and receive time windows to avoid interference.

* Certain types of distributed database [1]

At a broader level, guarantees/specifications about NTP accuracy are hard to find. If you google 'NTP accuracy' you'll find a very wide range of claims, from sub-millisecond to >1 second [2]

Indeed, a lot of the NTP userbase has timing requirements so lax they can 'smear' a leapsecond [3] over the course of 24 hours, tolerating a sustained error of hundreds of milliseconds. They've got good reasons for doing it - but it goes to show big errors are possible even under normal, correct operation.

Therefore, if you have an application that needs single-millisecond-level accuracy, you won't find an NTP product specification saying it's what you want.

[1] https://en.wikipedia.org/wiki/Spanner_(database)#Architectur... [2] http://www.ntp.org/ntpfaq/NTP-s-algo.htm#Q-ACCURATE-CLOCK [3] https://developers.google.com/time/smear

Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by huntero on Friday September 03, 2021 @10:47AM (#28404919)
PTP is a great choice when you need your time-sync to leave the software domain, for instance, locking an external PLL for frequency and phase aligned clocks.

PTP enabled MAC's and PHY's usually have a dedicated hardware output for a PPS (pulse-per-second) or faster clock, generated directly from the hardware PTP counters.

In the video world, we get great results synchronizing software events with NTP, but whenever you jump to a physical interface (DisplayPort, HDMI, SDI, etc.), NTP-based clocks are far too jittery.

I've seen some work using the PTP hardware in the MAC with the NTP protocol, a sort of hybrid approach, but don't have any first hand experience.

Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by bestouff on Friday September 03, 2021 @09:25AM (#28403877)
PTP and NTP don't have the same use:

- PTP is for sub-nanosecond local networks, with possibly hundreds of packets per second, local (in network card) clocks, hardware timestamping everywhere

- NTP if for long distance sync, with sophisticated statistical smoothing from several upstream servers

Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by jhellan on Friday September 03, 2021 @09:33AM (#28403975)
Basically, PTP assumes that network delays are deterministic. If that's true, it is very precise. If not, PTP is the wrong tool. NTP assumes that network delays are stochastic, and uses sophisticated algorithms to account for this. PTP has much simpler algorithms, which can be implemented in electronics, where internal timings can be characterized. NTP is more complex, and tends to run on a general purpose computer. This adds internal OS timings to the uncertainty.
Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by dpzmick on Friday September 03, 2021 @10:38AM (#28404784)
> If so, what's y̶o̶u̶r̶ a use-case?

CERN uses PTP on steroids for physics experiments: https://white-rabbit.web.cern.ch/

Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by dtgriscom on Friday September 03, 2021 @02:56PM (#28407952)
Audio over IP solutions. Having all your workstations synchronized within a few samples makes it possible to greatly reduce I/O buffer size and thus latency.
Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by hacker_newz on Friday September 03, 2021 @07:49AM (#28402938)
Any organization that requires nanosecond precision uses PTP. In my experience this usually includes financial exchanges that want to measure latency in trade routing.
Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by fires10 on Friday September 03, 2021 @12:57PM (#28406633)
Industrial control systems and various sensor systems use it because it is built in to the network. Think embedded devices.
Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by hansor on Friday September 03, 2021 @10:40AM (#28404805)
Every telecom too. LTE and 5G requires PTP in general.
Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by OrvalWintermute on Friday September 03, 2021 @10:58AM (#28405080)
> Is anyone using PTP and its requisite accuracy in production? If so, what's your use-case?

Yes; satellite ground systems, satellite communications, earth observation

Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by traceroute66 on Friday September 03, 2021 @07:37AM (#28402842)
Have you tried Chrony instead of Ntpd ?

    System time     : 0.000084656 seconds slow of NTP time
    Last offset     : -0.000029673 seconds
    RMS offset      : 0.000046217 seconds
    Frequency       : 17.760 ppm slow
    Residual freq   : -0.001 ppm
    Skew            : 0.012 ppm
    Root delay      : 0.001419884 seconds
    Root dispersion : 0.000967303 seconds
Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by insaneirish on Friday September 03, 2021 @09:46AM (#28404170)
> If so, what's your use-case?

Certain regulations in the financial industry lead you towards using it.

For example, Europe's MiFID II requires some systems to time stamp with 1 µs increments and 100 µs accuracy. PTP is the most common way to sync systems that have this requirement.

Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by M2Ys4U on Friday September 03, 2021 @10:30AM (#28404681)
>Is anyone using PTP and its requisite accuracy in production? If so, what's your use-case?

I've seen it used in projects for frame-accurate timing for IP video production (the use case was more TV studios than, say, Twitch streams)

Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by danbr on Friday September 03, 2021 @10:26AM (#28404638)
> what's your use-case?

Camera triggering/time stamping of frames that requires sub-millisecond accuracy, between multiple devices.

Re:Time Card and PTP on a Raspberry Pi Compute Module 4 by magicalhippo on Friday September 03, 2021 @08:14AM (#28403129)
FWIW I posted some stats from my Raspberry Pi with a GPS module here[1] along with a VM on the same LAN. The tl/dr of the Pi:

    $ chronyc sourcestats
    210 Number of sources = 7
    Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev
    ==============================================================================
    PPS1                        8   6   112     -0.018      0.020   -105ns   336ns
The other computers on the LAN have typically ~30uS std dev.

[1]: https://news.ycombinator.com/item?id=28372861