This page describes the installation of the following components:
After completing this install guide, you should be able to run PTP simulations with LibPTP.
The installation of OMNeT++ is described in detail in the official Install Guide. When running OMNeT++ for the first time, you are asked whether you would like to install example projects or the INET framework. We recommend not to install these projects.
Your OMNeT++ installation should look similar as shown in the following image. The (empty) Project Explorer of OMNeT++ is highlighted in the image.
LibPTP with OMNeT++ 4.6 is known to run well on Ubuntu 16.04. With Ubuntu 18.04 and newer we have experienced problems. Windows 10 might work, but is not fully tested/supported.
As a result, the recommended platform is still Ubuntu 16.04. If you would like to help with testing/porting on your favorite platform please contact us in the discussion forum.
Knowledge about OMNeT++ is of great importance when working with LibPTP. We recommend to read the OMNeT++ User Guide before diving into LibPTP. OMNeT++ also comes with a tutorial for beginners, called TicToc, which can be found in the directory ./doc/tictoc-tutorial/index.html of the OMNeT++ sources. Completing is tutorial is also highly recommended.
Download the sources for INET 2.6 from the INET project. Extract the archive to a local folder.
Right-click in the Project Explorer area, and select Import….
Select General/Existing Projects into Workspace.
You should see the Import Projects popup as shown below.
Select the root directoy by clicking Browse and choose the directory where you have extracted the INET source code. Click Finish
The INET project should now be shown in your project explorer.
In the project explorer, right-click on the INET project and select Build Project. This will take some time, and as a result you should have a newly compiled library in the folder out/gcc-debug/src within the INET project (assuming you have not changed any default settings).
Get the sources from Github.
As for the previous projct, add the project to OMNeT++ via Import - Existing Projects info Workspace.
As for the previous projct, build the project via right-click and selecting Build Project. The result of the build process is again a compiled library.
Get the sources from Github.
As for the previous projct, add the project to OMNeT++ via Import - Existing Projects info Workspace.
LibPTP depends on the circular_buffer module of the boot library. The circular_buffer module is a header-only module, which means consists only of header files and no additional library files need to be linked.
Installation depends on your operating system. Following are instructions for Ubuntu-based Linux systems and Windows.
Ubuntu:
On Ubuntu, you can install the complete Boost development files with the following command:
sudo apt install libboost-dev
Windows:
On Windows, we recommend carrying out the following steps:
Additionally, LibPTP has dependencies on the two previous projects (INET and OMNeT_Utils). You can check that the project references are correctly configured by right-clicking on the LibPTP project and selecting Properties. The projects INET and OMNeT_Utils should be selected in the Project References tab.
As with the previous projct, build the project via right-click and selecting Build Project. The result of the build process is again a compiled library.
Get the sources from Github.
As for the previous projct, add the project to OMNeT++ via Import - Existing Projects info Workspace.
The PTP_Simulations project has a dependency on the libPTP project. You can check that the project references are correctly configured again in the Project References tab of the projects properties. The project libPTP should be selected.
As for the previous projct, build the project via right-click and selecting Build Project. The result of the build process is an executable. This is the executable that will carry out your simulations.
When the PTP_Simulations has been built successfully, you should be able to carry out simulations. The PTP_Simulations contains example simulations. As an example, open simulations/PTP/Mixed_Test_2 in the project explorer. Right-click on the file Mixed_Test_2.ned and select Run as - OMNeT++ Simulation.
OMNeT++ might show a popup informing you that a run configuration is created for this simulation. Select Do not show this message again and click OK.
Concratulations!
You should now see your first PTP simulation! Have fun exploring PTP!
Get the sources from Github.
Please follow the Install Guide provided by libPLN. After completing this step, you should have two static libraries:
Tell libPTP to actually use libPLN by defining HAS_LIBPLN
Now, when libPTP is compiled, it will find that HAS_LIBPLN is defined and try to use libPLN. This requires that additional header files are available for a successful compilation.
Add the include paths for libPLN:
/home/wolfgang/ptp/libPLN
/home/wolfgang/ptp/libPLN/src
Rebuild the libPTP project
Add the library path for libPLN to the project
/home/wolfgang/ptp/libPLN/build/lib/static
Tell OMNeT++ to link the libraries for libPLN when building the simulation
OMNeT++ has it’s own build system, and for adding the libraries we can’t use the usual way it is done in Eclipse (by adding entries in C/C++ General -> Paths and Symbols -> Libraries). We have to use OMNeT++ -> Makemake menu:
Rebuild the PTP_Simulations project
Your PTP_Simulations project should now be able to carry out simulations where the clock noise is produced by libPLN.