←back to thread

221 points mfiguiere | 1 comments | | HN request time: 0s | source
Show context
kazinator ◴[] No.33696172[source]
It is not accurate to say that PTP is a predecessor to NTP.

You need both.

PTP synchronizes clocks to a ridiculous precision, like down to nanoseconds. To do that, it uses support in the ethernet hardware. Hardware adds precision stamps to the PTP-related ethernet frames, so that the time calculations are free of jitters induced by the higher network stacks.

A cool thing is that PTP-aware routers/switches can actually rewrite the timestamps in PTP packets to subtract their own propagation delay accurately.

Something in the network has to use NTP, if it is important for the devices to have the correct calendar date and time; you don't use PTP over the Internet to get time from a remote server.

The real-time clock being synchronized isn't even the system clock in the first place, but a high resolution RTC that is in the network adapters and switches.

As an additional utility on top of the PTP stack, there is the possibility of synchronizing the host system's clock with the help of PTP.

PTP is used for things like generating precise signals in certain applications. E.g. Some devices that have PTP support can be programmed to generate periodic pulses which are clocked by the sychronized real-time clock. With PTP, two such signals from separate devices on the network can align very precisely. Such an application doesn't care about the time of day, just that the signals are synced.

replies(1): >>33696839 #
willis936 ◴[] No.33696839[source]
Just because high precision tasks don't care about time of day as much, PTP still uses TAI timestamps. The only time of day information missing is leap seconds, and those were a mistake that is being corrected. You don't need NTP for time of day when PTP is used.
replies(2): >>33699341 #>>33716131 #
1. bradknowles ◴[] No.33716131{3}[source]
PTP uses the time stamps that are configured. By default it might use TAI, but that's not the only option.

Feel free to look at the documentation I linked above.