Discussion:
[Linuxptp-devel] ptp4l vs ptpd
Drasko DRASKOVIC
2013-05-13 16:54:22 UTC
Permalink
Hi all,
what is the real difference between ptp4l and ptpd?

On ptp4l page (http://linuxptp.sourceforge.net/) is stated : This software is an
implementation of the Precision Time Protocol (PTP) according to IEEE
standard 1588 for Linux.
On ptpd page (http://ptpd.sourceforge.net/) it is stated : The PTP
daemon (PTPd) implements the Precision Time protocol (PTP) as defined
by the relevant IEEE 1588 standard.


Why two implementations, why two separate projects ?

BR,
DRasko
Keller, Jacob E
2013-05-13 17:00:44 UTC
Permalink
-----Original Message-----
Sent: Monday, May 13, 2013 9:54 AM
Subject: [Linuxptp-devel] ptp4l vs ptpd
Hi all,
what is the real difference between ptp4l and ptpd?
On ptp4l page (http://linuxptp.sourceforge.net/) is stated : This software is an
implementation of the Precision Time Protocol (PTP) according to IEEE
standard 1588 for Linux.
On ptpd page (http://ptpd.sourceforge.net/) it is stated : The PTP
daemon (PTPd) implements the Precision Time protocol (PTP) as
defined
by the relevant IEEE 1588 standard.
Why two implementations, why two separate projects ?
BR,
DRasko
Both ptp4l and ptpd are implementations of a 1588 PTP daemon. Ptp4l was started
by Richard Cochran after being unable to get traction in the ptpd community
regarding his series of kernel patches which implemented proper PTP support in
the kernel. The original ptpd code base is somewhat old, and cluttered, and
difficult to maintain. It also has a goal of implementing PTP daemon application on
multiple operating systems and previously was unwilling to take the hardware
timestamping approach used by the PTP core. This may have changed since ptp4l
was started.

Many proprietary PTP stack implementations are based ontop of ptpd, and do not
use the PTP core kernel module. PTP4l relies on the ptp core kernel module
which can be implemented by network drivers to enable a ptp clock device
which is used for hardware timestamping.

Effectively, this project was started due to a difference in goal and opinion
from the ptpd project.

- Jake
Drasko DRASKOVIC
2013-05-13 17:44:06 UTC
Permalink
Hi Jacob,

On Mon, May 13, 2013 at 7:00 PM, Keller, Jacob E
Post by Keller, Jacob E
Both ptp4l and ptpd are implementations of a 1588 PTP daemon. Ptp4l was started
by Richard Cochran after being unable to get traction in the ptpd community
regarding his series of kernel patches which implemented proper PTP support in
the kernel. The original ptpd code base is somewhat old, and cluttered, and
difficult to maintain. It also has a goal of implementing PTP daemon application on
multiple operating systems and previously was unwilling to take the hardware
timestamping approach used by the PTP core. This may have changed since ptp4l
was started.
Many proprietary PTP stack implementations are based ontop of ptpd, and do not
use the PTP core kernel module. PTP4l relies on the ptp core kernel module
which can be implemented by network drivers to enable a ptp clock device
which is used for hardware timestamping.
Effectively, this project was started due to a difference in goal and opinion
from the ptpd project.
Thanks a lot for the detailed answer.

I am interested if ptp4l supports SW-only timestamping - I guess yes.

I am asking that because I would like to synchronize several slaves to
one master via WiFi link.

What precision (i.e. clock offsets between nodes) I can expect via
this method - I mean in which magnitude : 100uS, 1ms or more ?


BR,
Drasko
Keller, Jacob E
2013-05-13 18:10:57 UTC
Permalink
Hi,
-----Original Message-----
Sent: Monday, May 13, 2013 10:44 AM
To: Keller, Jacob E
Subject: Re: [Linuxptp-devel] ptp4l vs ptpd
Hi Jacob,
On Mon, May 13, 2013 at 7:00 PM, Keller, Jacob E
Post by Keller, Jacob E
Both ptp4l and ptpd are implementations of a 1588 PTP daemon. Ptp4l
was started
Post by Keller, Jacob E
by Richard Cochran after being unable to get traction in the ptpd
community
Post by Keller, Jacob E
regarding his series of kernel patches which implemented proper PTP
support in
Post by Keller, Jacob E
the kernel. The original ptpd code base is somewhat old, and
cluttered, and
Post by Keller, Jacob E
difficult to maintain. It also has a goal of implementing PTP daemon
application on
Post by Keller, Jacob E
multiple operating systems and previously was unwilling to take the
hardware
Post by Keller, Jacob E
timestamping approach used by the PTP core. This may have changed
since ptp4l
Post by Keller, Jacob E
was started.
Many proprietary PTP stack implementations are based ontop of ptpd,
and do not
Post by Keller, Jacob E
use the PTP core kernel module. PTP4l relies on the ptp core kernel
module
Post by Keller, Jacob E
which can be implemented by network drivers to enable a ptp clock
device
Post by Keller, Jacob E
which is used for hardware timestamping.
Effectively, this project was started due to a difference in goal and
opinion
Post by Keller, Jacob E
from the ptpd project.
Thanks a lot for the detailed answer.
I am interested if ptp4l supports SW-only timestamping - I guess yes.
I am asking that because I would like to synchronize several slaves to
one master via WiFi link.
What precision (i.e. clock offsets between nodes) I can expect via
this method - I mean in which magnitude : 100uS, 1ms or more ?
BR,
Drasko
Ptp4l does indeed support software based timestamping. However, I honestly do not know what you would expect in terms of magnitude... I believe it should be under 1ms, but I haven't tested it before especially over Wifi link. This setup would be quite possible in ptp4l, though you would definitely get better support if the Wifi card(s) have support for hardware timestamping, and supported the ptp framework. I don't know of any that do this however... At any rate software timestamping is enabled either via config file or the software command line switch.

- Jake
Miroslav Lichvar
2013-05-14 09:15:32 UTC
Permalink
Post by Drasko DRASKOVIC
I am interested if ptp4l supports SW-only timestamping - I guess yes.
I am asking that because I would like to synchronize several slaves to
one master via WiFi link.
ptp4l can do SW time stamping, but with a wireless network you almost
certainly want to use NTP instead of PTP as PTP relies on stable delay
in the sync message delivery.
--
Miroslav Lichvar
Drasko DRASKOVIC
2013-05-14 09:46:38 UTC
Permalink
Hi Miroslav,
Post by Miroslav Lichvar
Post by Drasko DRASKOVIC
I am interested if ptp4l supports SW-only timestamping - I guess yes.
I am asking that because I would like to synchronize several slaves to
one master via WiFi link.
ptp4l can do SW time stamping,
Would this demand WiFi module driver modifications, or this is already
implemented?
Post by Miroslav Lichvar
but with a wireless network you almost
certainly want to use NTP instead of PTP as PTP relies on stable delay
in the sync message delivery.
Would NTP in the 802.11 conditions perform better than PTP with pure
SW timestamping?

BTW, I opted for SW timestamps as I have not found any WiFi card that
has HW timestamping. I guess something like this does not exist
because of nature of 802.11 - high jitter, as already mentioned).

I have no cable connection between my embedded computers, only WiFi. I
can add some other radio link, but no cable. And at this point I have
no idea how to synchronize them below 1ms of clock offset, except
using PTP.


Kind regards,
Drasko
Miroslav Lichvar
2013-05-14 11:22:41 UTC
Permalink
Post by Drasko DRASKOVIC
Post by Miroslav Lichvar
but with a wireless network you almost
certainly want to use NTP instead of PTP as PTP relies on stable delay
in the sync message delivery.
Would NTP in the 802.11 conditions perform better than PTP with pure
SW timestamping?
I think it would. If you choose an NTP implementation which can filter
samples by delay (for example chrony and its maxdelay options), it
should be able to get better than 1ms accuracy easily.
--
Miroslav Lichvar
Drasko DRASKOVIC
2013-05-14 13:16:04 UTC
Permalink
Hi Miroslav,
Post by Miroslav Lichvar
Post by Drasko DRASKOVIC
Post by Miroslav Lichvar
but with a wireless network you almost
certainly want to use NTP instead of PTP as PTP relies on stable delay
in the sync message delivery.
Would NTP in the 802.11 conditions perform better than PTP with pure
SW timestamping?
I think it would. If you choose an NTP implementation which can filter
samples by delay (for example chrony and its maxdelay options), it
should be able to get better than 1ms accuracy easily.
thanks a lot for the advice. I am looking at the Crony right now.

Can you explain please the benefits that can be achieved with
"maxdelay" options (transfer will be via WiFi).
Miroslav Lichvar
2013-05-14 13:48:29 UTC
Permalink
Post by Drasko DRASKOVIC
thanks a lot for the advice. I am looking at the Crony right now.
Can you explain please the benefits that can be achieved with
"maxdelay" options (transfer will be via WiFi).
With the maxdelay, maxdelayratio or maxdelaydevratio options you can
control the maximum allowed delay for the sample to be included in the
offset calculation. Samples which were delayed in the network (and so
are inaccurate) should be ignored. For example, maxdelayratio 1.1 will
allow only 10% variability in the delay. As a lot of the samples will
be dropped, the polling interval should be shorted (minpoll and
maxpoll options).

If you have more questions about chrony, please ask them on the chrony
mailing list, it's off topic here.

Thanks,
--
Miroslav Lichvar
Christian Riesch
2013-05-14 10:12:00 UTC
Permalink
Hi Drasko,
-----Original Message-----
I am asking that because I would like to synchronize several slaves to
one master via WiFi link.
What precision (i.e. clock offsets between nodes) I can expect via
this method - I mean in which magnitude : 100uS, 1ms or more ?
In the last years a number of scientific papers have been presented at the ISPCS [1] about IEEE 1588 and WiFi links. The papers are available on IEEE Xplore, see e.g. [2] for the proceedings of last year's conference.

Christian

[1] http://www.ispcs.org
[2] http://ieeexplore.ieee.org/xpl/mostRecentIssue.jsp?punumber=6329542
Loading...