linuxptp is an open source and completely free command-line software project written in C and designed from the ground up as an implementation of the Precision Time Protocol (PTP) on GNU/Linux operating systems, according to the IEEE 1588-2002 standard.
Features at a glance
Key features include support for software and hardware time stampings through the Linux SO_TIMESTAMPING socket option, support for IEEE 802.1AS-2011, which acts as an end station, as well as transport support over UDP/IPv6, UDP/IPv4, UDS local, and raw Ethernet (Layer 2).
Additionally, the program supports the Linux PHC (PTP Hardware Clock) subsystem via clock_gettime-based calls, including clock_adjtimex, implements Ordinary Clock (OC) and Boundary Clock (BC), and offers a modular design that allows users to add support for more clock servos or new transports.
The linuxptp project comprises of various commands, including pmc, ptp4l, phc_ctl, phc2sys, hwstamp_ctl, and timemaster. To view the command-line options and usage message of each command, simply add the --help option to the respective command when running it (e.g. pmc --help).
Getting started with linuxptp
The linuxptp software is quite easy to install, despite the fact that it may not be available in the main software repositories of your GNU/Linux operating systems. So, if you want to install it, simply download and save the source package somewhere on your computer, preferably your Home directory, and extract its contents using an archive manager utility.
Then, open a terminal emulator application, run the ‘make’ command to compile the program and generate the binary files enumerated in the above section. Install everything system wide by running the ‘make install’ command as root or the ‘sudo make install’ command as a privileged user. More details can be found on the project’s homepage (see link below).