I am pretty new to Ubuntu but recently I had to sync the clocks of multiple machines in a LAN. I chose Linux PTP due to the fact that while all machines were different, they were all ruing either Ubuntu or Lubuntu as their OS and Linux PTP was free. When trying to implement IEEE 1588 protocol on all of these machines I ran into lots of problems and what documentation I did find was either over my head due to the fact I am a novice, or incomplete. What follows are the steps I found worked for me. You'll have to excuse me if any of the information or terminology is incorrect, like I said I'm pretty new to this. Hope it helps!
IEEE1588 Linux PTP
Linux PTP is a software implementation of PrecisionTime Protocol (PTP) that is in accordance with the IEEE 1588standard. Linux PTP makes use of the Linux keel, this allowed usto take advantage of the flexibility that is inherent to LinuxApplication Programming Interfaces (API). Another very practicalreason for our choice was cost. Linux PTP is free and readilyavailable for download.
Some useful features of Linux PTP are as follows.
PTP Prerequisites
The machinerequirements for Linux PTP implementation
Beforestarting the process of implementing Linux PTP it was imperative tosee if the machines at our disposal had the capabilities listeddirectly above by using the 'ethtool'.
$ethtool -T <network interface>
This command will list the time stamping capabilitiesof the chosen network interface. In our case only software timestamping is available. Another advantage of the ethtool ioctl isthat while ruing the ptp4l program (ptp4l does the heavy liftingfor clock syncronization), it will use ethtool in order to discoverthe proper PHC device.
Some other tools that will be needed in order tomanipulate, compile, and build the appropriate keel are
All of these tools can be obtained with the apt-getinstall command.
LinuxKeel Manipulation
The most difficult part of Linux PTP implementation(for novices to Linux like me) is the reconfiguration of the LinuxKeel. In order to sync the clocks of two or more machines threekeel configuration options are needed.
The environment I worked to synchronize was anon-homogeneous one in that the machines were both physicallydifferent and the operating systems (along with the keels) varied. By looking at the .config file for each keel it was evident that inall cases the CONFIG_NETWORK_PHY_TIMESTAMPING option was set to 'n'(not available). In most cases the other two options were set to 'm'(modular). It has been my experience that either 'y' (on) or 'm' areacceptable states for these options.
What follows will be generalized script of commands andactions I have taken in order to get the Linux keel in anacceptable state for the implementation of IEEE 1588. These steps(with slight variations) are able to build a working keel in bothUbuntu and Lubuntu.
KeelConfiguration Set Up
KeelReconfiguration (While in Menu-Config)
KeelBuild
LinuxPTP Installation
Useof Linux PTP
After Linux PTP stack gets made and installed on thedesired machines it is possible to synchronize their clocks. This isaccomplished by proper networking and the ptp4l command. There are two ways to utilize ptp4l.
The first way is to specify the desired options in thecommand line. The least specific command that will start 1588protocol is $ptp4l -i <desired networking interface>. However for the environment I was working in I needed a few extracommand options. For our purposes $ptp4l -i <net int> -m -Swas the command used.
This file basically does the same thing as laying outthe options in the command line. The one important difference isthat in a configuration file it is possible to identify multiplenetwork interfaces. This is necessary if the machine is to be set upas a boundary clock. Many more options are laid out in the manualfor ptp4l.
InformationGathering
It is easy to tell if ptp4l is doing it's job. Eitherthe -m in the command line or the verbose 1 option inthe configuration file will update the status of synchronization tothe standard out every second by default. This information can bebroken down as follows
برچسب:
نویسنده: استخدام کار