2011-11-02 00:32:40 +08:00
|
|
|
|
|
|
|
* Introduction
|
|
|
|
|
|
|
|
This software is an implementation of the Precision Time Protocol
|
|
|
|
(PTP) according to IEEE standard 1588 for Linux. The dual design
|
|
|
|
goals are to provide a robust implementation of the standard and to
|
|
|
|
use the most relevant and modern Application Programming Interfaces
|
|
|
|
(API) offered by the Linux kernel. Supporting legacy APIs and other
|
|
|
|
platforms is not a goal.
|
|
|
|
|
|
|
|
* License
|
|
|
|
|
|
|
|
The software is copyrighted by the authors and is licensed under the
|
|
|
|
GNU General Public License. See the file, COPYING, for details of
|
|
|
|
the license terms.
|
|
|
|
|
2012-08-30 17:19:28 +08:00
|
|
|
* Features
|
2011-11-02 00:32:40 +08:00
|
|
|
|
|
|
|
- Supports hardware and software time stamping via the Linux
|
|
|
|
SO_TIMESTAMPING socket option.
|
|
|
|
|
|
|
|
- Supports the Linux PTP Hardware Clock (PHC) subsystem by using the
|
2019-02-25 11:16:42 +08:00
|
|
|
clock_gettime family of calls, including the clock_adjtimex system
|
|
|
|
call.
|
2011-11-02 00:32:40 +08:00
|
|
|
|
2019-02-25 11:16:42 +08:00
|
|
|
- Implements Boundary Clock (BC), Ordinary Clock (OC) and
|
|
|
|
Transparent Clock (TC).
|
2011-11-02 00:32:40 +08:00
|
|
|
|
|
|
|
- Transport over UDP/IPv4, UDP/IPv6, and raw Ethernet (Layer 2).
|
|
|
|
|
2012-08-30 17:19:28 +08:00
|
|
|
- Supports IEEE 802.1AS-2011 in the role of end station.
|
|
|
|
|
2011-11-02 00:32:40 +08:00
|
|
|
- Modular design allowing painless addition of new transports and
|
|
|
|
clock servos.
|
|
|
|
|
2019-02-25 11:16:42 +08:00
|
|
|
- Implements unicast operation.
|
|
|
|
|
|
|
|
- Supports a number of profiles, including:
|
|
|
|
|
|
|
|
- The automotive profile
|
|
|
|
|
|
|
|
- The default 1588 profile.
|
|
|
|
|
|
|
|
- The enterprise profile.
|
|
|
|
|
|
|
|
- The telecom profiles G.8265.1, G.8275.1, and G.8275.2.
|
|
|
|
|
|
|
|
- Supports the NetSync Monitor protocol.
|
|
|
|
|
|
|
|
- Implements Peer to peer one-step.
|
|
|
|
|
|
|
|
- Supports bonded, IPoIB, and vlan interfaces.
|
|
|
|
|
2012-06-10 18:19:26 +08:00
|
|
|
* Getting the Code
|
|
|
|
|
2012-12-21 20:58:03 +08:00
|
|
|
You can download the latest released version at Source Forge.
|
|
|
|
|
|
|
|
http://sourceforge.net/projects/linuxptp/files/latest/download
|
|
|
|
|
2012-06-10 18:19:26 +08:00
|
|
|
The source code is managed using the git version control system. To
|
|
|
|
get your own copy of the project sources, use the following command.
|
|
|
|
|
|
|
|
#+BEGIN_EXAMPLE
|
|
|
|
git clone git://git.code.sf.net/p/linuxptp/code linuxptp
|
|
|
|
#+END_EXAMPLE
|
|
|
|
|
|
|
|
If the git protocol is blocked by your local area network, then you
|
|
|
|
can use the alternative HTTP protocol instead.
|
|
|
|
|
|
|
|
#+BEGIN_EXAMPLE
|
|
|
|
git clone http://git.code.sf.net/p/linuxptp/code linuxptp
|
|
|
|
#+END_EXAMPLE
|
|
|
|
|
2011-11-26 16:27:26 +08:00
|
|
|
* System Requirements
|
|
|
|
|
2019-02-25 11:26:36 +08:00
|
|
|
In order to run this software, you need Linux kernel version 3.0 or
|
|
|
|
newer. Check whether your network interface supports PTP with the
|
|
|
|
following command.
|
2012-07-20 02:51:46 +08:00
|
|
|
|
|
|
|
#+BEGIN_EXAMPLE
|
|
|
|
ethtool -T eth0
|
|
|
|
#+END_EXAMPLE
|
|
|
|
|
2019-02-25 11:26:36 +08:00
|
|
|
This command shows whether a MAC supports hardware or software time
|
|
|
|
stamping. The following example output indicates support for
|
|
|
|
hardware time stamping.
|
2011-11-26 16:27:26 +08:00
|
|
|
|
2019-02-25 11:26:36 +08:00
|
|
|
#+BEGIN_EXAMPLE
|
|
|
|
Time stamping parameters for eth6:
|
|
|
|
Capabilities:
|
|
|
|
hardware-transmit (SOF_TIMESTAMPING_TX_HARDWARE)
|
|
|
|
software-transmit (SOF_TIMESTAMPING_TX_SOFTWARE)
|
|
|
|
hardware-receive (SOF_TIMESTAMPING_RX_HARDWARE)
|
|
|
|
software-receive (SOF_TIMESTAMPING_RX_SOFTWARE)
|
|
|
|
software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
|
|
|
|
hardware-raw-clock (SOF_TIMESTAMPING_RAW_HARDWARE)
|
|
|
|
PTP Hardware Clock: 1
|
|
|
|
Hardware Transmit Timestamp Modes:
|
|
|
|
off (HWTSTAMP_TX_OFF)
|
|
|
|
on (HWTSTAMP_TX_ON)
|
|
|
|
Hardware Receive Filter Modes:
|
|
|
|
none (HWTSTAMP_FILTER_NONE)
|
|
|
|
all (HWTSTAMP_FILTER_ALL)
|
|
|
|
#+END_EXAMPLE
|
2011-11-26 16:27:26 +08:00
|
|
|
|
2019-02-25 11:26:36 +08:00
|
|
|
The next example shows the case where the MAC only supports software
|
|
|
|
time stamping. The ~ptp4l~ program requires either the ~-S~ command
|
|
|
|
line argument or the ~time_stamping software~ configuration option
|
|
|
|
when using such interfaces.
|
2011-11-26 16:27:26 +08:00
|
|
|
|
|
|
|
#+BEGIN_EXAMPLE
|
2019-02-25 11:26:36 +08:00
|
|
|
Time stamping parameters for enp6s0:
|
|
|
|
Capabilities:
|
|
|
|
software-transmit (SOF_TIMESTAMPING_TX_SOFTWARE)
|
|
|
|
software-receive (SOF_TIMESTAMPING_RX_SOFTWARE)
|
|
|
|
software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
|
|
|
|
PTP Hardware Clock: none
|
|
|
|
Hardware Transmit Timestamp Modes: none
|
|
|
|
Hardware Receive Filter Modes: none
|
2011-11-26 16:27:26 +08:00
|
|
|
#+END_EXAMPLE
|
|
|
|
|
2019-02-25 11:26:36 +08:00
|
|
|
Note the ~software-transmit (SOF_TIMESTAMPING_TX_SOFTWARE)~
|
|
|
|
capability. If this is lacking, then the MAC cannot be used at
|
|
|
|
all. However, adding this capability entails adding a single line
|
|
|
|
of code to the device driver.
|
2011-11-26 16:27:26 +08:00
|
|
|
|
2019-02-25 11:26:36 +08:00
|
|
|
* Installation
|
2011-11-26 16:27:26 +08:00
|
|
|
|
|
|
|
1. Just type 'make'
|
|
|
|
|
|
|
|
2. If you compiled your own kernel (and the headers are not
|
|
|
|
installed into the system path), then you should set the
|
|
|
|
KBUILD_OUTPUT environment variable as in the example, above.
|
|
|
|
|
2012-11-25 23:34:21 +08:00
|
|
|
3. In order to install the programs and man pages into /usr/local,
|
|
|
|
run the 'make install' target. You can change the installation
|
|
|
|
directories by setttings the variables prefix, sbindir, mandir,
|
|
|
|
and man8dir on the make command line.
|
2011-11-26 16:27:26 +08:00
|
|
|
|
2011-11-02 00:32:40 +08:00
|
|
|
* Getting Involved
|
|
|
|
|
|
|
|
The software development is hosted at Source Forge.
|
|
|
|
|
|
|
|
https://sourceforge.net/projects/linuxptp/
|
|
|
|
|
|
|
|
** Reporting Bugs
|
|
|
|
|
|
|
|
Please report any bugs or other issues with the software to the
|
|
|
|
linuxptp-users mailing list.
|
|
|
|
|
2011-11-26 16:27:26 +08:00
|
|
|
https://lists.sourceforge.net/lists/listinfo/linuxptp-users
|
|
|
|
|
2011-11-02 00:32:40 +08:00
|
|
|
** Development
|
|
|
|
|
|
|
|
If you would like to get involved in improving the software, please
|
|
|
|
join the linuxptp-devel mailing list.
|
2011-11-26 16:27:26 +08:00
|
|
|
|
|
|
|
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
|
|
|
|
|
2015-06-08 16:55:10 +08:00
|
|
|
*** Submitting Patches
|
|
|
|
|
|
|
|
1. Before submitting patches, please make sure that you are starting
|
|
|
|
your work on the *current HEAD* of the git repository.
|
|
|
|
|
|
|
|
2. Please checkout the ~CODING_STYLE.org~ file for guidelines on how to
|
|
|
|
properly format your code.
|
|
|
|
|
|
|
|
3. Describe your changes. Each patch will be reviewed, and the reviewers
|
|
|
|
need to understand why you did what you did.
|
|
|
|
|
|
|
|
4. *Sign-Off* each commit, so the changes can be properly attributed to
|
|
|
|
you and you explicitely give your agreement for distribution under
|
|
|
|
linuxptp's license. Signing-off is as simple as:
|
|
|
|
|
|
|
|
#+BEGIN_EXAMPLE
|
|
|
|
git commit -s
|
|
|
|
#+END_EXAMPLE
|
|
|
|
|
|
|
|
or by adding the following line (replace your real name and email)
|
|
|
|
to your patch:
|
|
|
|
|
|
|
|
#+BEGIN_EXAMPLE
|
|
|
|
Signed-off-by: Random J Developer <random@developer.example.org>
|
|
|
|
#+END_EXAMPLE
|
|
|
|
|
|
|
|
5. Finally, send your patches via email to the linuxptp-devel mailing
|
|
|
|
list, where they will be reviewed, and eventually be included in the
|
|
|
|
official code base.
|
|
|
|
|
|
|
|
#+BEGIN_EXAMPLE
|
|
|
|
git send-email --to linuxptp-devel@lists.sourceforge.net origin/master
|
|
|
|
#+END_EXAMPLE
|
|
|
|
|
2012-08-30 17:21:55 +08:00
|
|
|
* Thanks
|
|
|
|
|
2012-11-02 02:44:13 +08:00
|
|
|
Thanks to AudioScience Inc for sponsoring the 8021.AS support.
|
|
|
|
|
|
|
|
- http://www.audioscience.com
|
|
|
|
|
2016-12-10 02:40:17 +08:00
|
|
|
Thanks to Exablaze for donating an ExaNIC X10
|
|
|
|
|
|
|
|
- http://exablaze.com/exanic-x10
|
|
|
|
|
2013-06-14 17:46:40 +08:00
|
|
|
Thanks to Intel Corporation for donating four NICs, the 82574,
|
|
|
|
82580, 82599, and the i210.
|
2012-08-30 17:21:55 +08:00
|
|
|
|
|
|
|
- http://www.intel.com
|
|
|
|
- http://e1000.sourceforge.net
|
|
|
|
|
2017-11-26 03:43:38 +08:00
|
|
|
Thanks to Meinberg Funkuhren for donating a LANTIME M1000.
|
|
|
|
|
|
|
|
- https://www.meinbergglobal.com
|
|
|
|
|
2019-02-25 11:03:50 +08:00
|
|
|
Thanks to Moser Baer for sponsoring the Telecom Profiles and unicast
|
|
|
|
support.
|
|
|
|
|
|
|
|
- http://www.mobatime.com
|
|
|
|
|
2012-08-30 17:21:55 +08:00
|
|
|
For testing I use an OTMC 100 grandmaster clock donated by OMICRON Lab.
|
|
|
|
|
|
|
|
- http://www.omicron-lab.com/ptp
|