# Reference implementation for "time synchronization master" with SocketCAN

**URL:** <https://forum.opencyphal.org/t/reference-implementation-for-time-synchronization-master-with-socketcan/1981>\
**Category:** Applications & Usage\
**Created:** [September 12, 2023, 8:37am UTC](https://forum.opencyphal.org/t/reference-implementation-for-time-synchronization-master-with-socketcan/1981 "2023-09-12T08:37:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![heab](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/h/58956e/32.png) [@heab](https://forum.opencyphal.org/u/heab)\
**Post date:** [September 12, 2023, 8:37am UTC](https://forum.opencyphal.org/t/reference-implementation-for-time-synchronization-master-with-socketcan/1981/1 "2023-09-12T08:37:05Z")

</div>

Hi,

Is there a reference implementation for a “time synchronization master” with SocketCAN?  
Any ideas how to get the timestamp (other than use CAN loopback mode to Rx the node’s Tx frames) when the transport layer completes the transmission of a time sync message?

Thx!

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [September 12, 2023, 11:06am UTC](https://forum.opencyphal.org/t/reference-implementation-for-time-synchronization-master-with-socketcan/1981/2 "2023-09-12T11:06:50Z")

</div>

> [@heab](#):
>
> Is there a reference implementation for a “time synchronization master” with SocketCAN?

There is an open-source implementation for the original UAVCAN v0 in LibUAVCAN v0 here: [libcyphal/libuavcan/include/uavcan/protocol/global\_time\_sync\_master.hpp at legacy-v0 · OpenCyphal-Garage/libcyphal · GitHub](https://github.com/OpenCyphal-Garage/libcyphal/blob/legacy-v0/libuavcan/include/uavcan/protocol/global_time_sync_master.hpp)

In Cyphal, the logic is virtually identical.

> [@heab](#):
>
> Any ideas how to get the timestamp (other than use CAN loopback mode to Rx the node’s Tx frames) when the transport layer completes the transmission of a time sync message?

AFAIK there is no other reliable timestamping method available.
