On 4/28/2021 9:20 PM, Chris Rajula wrote:
> Thank you for your response!
> 
> I'm now even more curious as to what the offset value printed by the
> LinuxPTP tools actually mean.
> 

In general it is the offset value measured by the PTP algorithm. But
think about it.. No clock is perfect. Your local clock might not just
have the wrong offset, but it may also be running at the wrong rate. The
PTP algorithm and protocol account for more than just the following:

"read clock A"
"read clock B"
"difference of A and B"

Specifically, it accounts for also how to tell how far apart the two
clock reads were done.

Remember, time is always advancing. So if you read clock A and then
clock B, some time has passed. So the measurement from A is out of date.
How out of date?

PTP accounts for this by handling using timestamps of packets to measure
the delay across a network.

> I assumed that since those tools are capable of printing the offset,
> they contain code which does just that.
> 

They do. My point isn't that you can't do this, but that you need to
think through how you're doing it. PTP works by having high precision
timestamps for an event that has a stable delay between the two ends
(timestamp of send vs receive of a packet).

PCIe PTM mechanism (.getcrosstimestamp ioctl) also does timestamp
capture between a PCIe device clock and the platform ART based clock.

> In my naïve view, I thought that once the slave had been synchronized,
> the slave's clock frequency/phase had been adjusted to be somewhat
> 'locked' to the freq/phase of the master's clock.
> 

It has, yes. That's the goal of PTP. But PTP works across the network.
It doesn't synchronize other clocks on a system, for example the device
clock and the local clock.

> Isn't that the whole purpose behind PTP?
> Keeping track on the difference between master and slave values of
> seconds and nanoseconds and adjusting the slave's clock frequency so
> that slave calls to eg. clock_realtime result in values with high
> accuracy (i.e that the error between slave time and master time is kept
> low).
> 
> /Alex
Yes. Once you've done this part, you can then take timestamps between
the two clocks and compare them. There will be some small error, but the
goal of PTP is to keep that error to sub-microseconds (or even better).


_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to