I know that this is a complex topic, but has anyone over here used Precision Time Protocol or PTP for time synchronization in their Network Telemetry operations or anything as such? We are adding timing information to our custom headers on P4 language for computing one-way delay and would like to make the delay computations synchronized through the use of a PTP server in our system. Could anybody help me out with it, please? In case you need more information, I can provide you with that as well.
PTP time synchronization between devices is typically a feature that a commercial device implementation would provide with driver and hardware support for that feature explicitly. Often the implementation of that feature would not itself be P4-programmable. Only the resulting synchronized time value would become readable in your P4 program, e.g. as an input metadata field.
Trying to implement PTP time synchronization by writing P4 code, on a system that did not already provide it for you at a lower level, might be possible, but I would expect the error tolerances would increase noticeably on the time synchronization.