Discussion:
[Linuxptp-users] Selecting a master
Petr Kulhavy
2017-05-16 13:43:50 UTC
Permalink
Hello,

is it possible to explicitly tell ptp4l which master it should sync to
in case multiple masters are available on the network?

Thanks
Petr
Mace, Kyle P.
2017-05-16 13:51:06 UTC
Permalink
I have not personally done it but there might be a few options you can set up in a config file. This https://linux.die.net/man/8/ptp4l has a list of the configurations options. I would look into priority, domainNumber, and if doing L2 transport maybe ptp_dst_mac and p2p_dst_mac.
-----Original Message-----
From: Petr Kulhavy [mailto:***@jikos.cz]
Sent: Tuesday, May 16, 2017 8:44 AM
To: linuxptp-***@lists.sourceforge.net
Subject: [Linuxptp-users] Selecting a master

Hello,

is it possible to explicitly tell ptp4l which master it should sync to in case multiple masters are available on the network?

Thanks
Petr

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________
Linuxptp-users mailing list
Linuxptp-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users
Petr Kulhavy
2017-05-16 19:25:46 UTC
Permalink
Hi Kyle and thanks for your hints!
Priority and domainNumber relate to the local clock. And I need to to
this over UDP.

Cheers
Petr
Post by Mace, Kyle P.
I have not personally done it but there might be a few options you can set up in a config file. This https://linux.die.net/man/8/ptp4l has a list of the configurations options. I would look into priority, domainNumber, and if doing L2 transport maybe ptp_dst_mac and p2p_dst_mac.
-----Original Message-----
Sent: Tuesday, May 16, 2017 8:44 AM
Subject: [Linuxptp-users] Selecting a master
Hello,
is it possible to explicitly tell ptp4l which master it should sync to in case multiple masters are available on the network?
Thanks
Petr
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________
Linuxptp-users mailing list
https://lists.sourceforge.net/lists/listinfo/linuxptp-users
Richard Cochran
2017-05-16 20:05:44 UTC
Permalink
Post by Petr Kulhavy
is it possible to explicitly tell ptp4l which master it should sync to
in case multiple masters are available on the network?
The protocol will pick the best master automatically.

You can force one master to be the best by configuration at the
master.

At the slave end, there is an optional feature in 1588 called
"Acceptable master table", but this is not implemented in linuxptp.

Thanks,
Richard
Petr Kulhavy
2017-05-16 20:26:01 UTC
Permalink
Thanks Richard. That seems to be what I'm looking for ;-)

How is it with domain number? Does the domainNumber limit the slave to
operate only in that particular domain?
Can the domainNumber be changed in runtime using pmc?

Thanks
Petr
Post by Richard Cochran
Post by Petr Kulhavy
is it possible to explicitly tell ptp4l which master it should sync to
in case multiple masters are available on the network?
The protocol will pick the best master automatically.
You can force one master to be the best by configuration at the
master.
At the slave end, there is an optional feature in 1588 called
"Acceptable master table", but this is not implemented in linuxptp.
Thanks,
Richard
Richard Cochran
2017-05-17 08:12:46 UTC
Permalink
Post by Petr Kulhavy
How is it with domain number? Does the domainNumber limit the slave to
operate only in that particular domain?
Yes.
Post by Petr Kulhavy
Can the domainNumber be changed in runtime using pmc?
1588 allows this, but it is not implemented. We only have GET and not
SET for DOMAIN. Adding this should be easy, if you want to do it.
See how priority1 and priority2 are handled.

Thanks,
Richard
Miroslav Lichvar
2017-05-17 08:52:52 UTC
Permalink
Post by Petr Kulhavy
How is it with domain number? Does the domainNumber limit the slave to
operate only in that particular domain?
Can the domainNumber be changed in runtime using pmc?
If there is command to switch the domain in run time, what will decide
the domain needs to be switched?

If you need the system to be resilient against failures, it might be
better to run multiple slaves in different domains at the same time
and use for synchronization of the system clock only those that agree
with each another or with other time sources like NTP. It is
recommended by the Enterprise profile. You can easily do this with the
timemaster program from linuxptp.
--
Miroslav Lichvar
Petr Kulhavy
2017-05-17 13:01:03 UTC
Permalink
This post might be inappropriate. Click to display it.
Richard Cochran
2017-05-17 13:43:09 UTC
Permalink
Post by Petr Kulhavy
The reason why I was asking is that some protocols like AVB provide
the clock master ID and domain number with the stream description.
AVB, you say?

IIRC, there is absolutely nothing in 802.1AS-2011 that allows the
client to pick a GM in the way you describe.

Thanks,
Richard
Petr Kulhavy
2017-05-17 14:08:07 UTC
Permalink
See the "ts-refclk" attribute defined in RFC7273

Petr
Post by Richard Cochran
Post by Petr Kulhavy
The reason why I was asking is that some protocols like AVB provide
the clock master ID and domain number with the stream description.
AVB, you say?
IIRC, there is absolutely nothing in 802.1AS-2011 that allows the
client to pick a GM in the way you describe.
Thanks,
Richard
Richard Cochran
2017-05-17 17:16:20 UTC
Permalink
Post by Petr Kulhavy
See the "ts-refclk" attribute defined in RFC7273
Section 4.3:

The PTP protocols employ a distributed election protocol called the
"Best Master Clock Algorithm" (BMCA) to determine the active clock
master. The clock master choices available to BMCA can be restricted
or biased by configuration parameters to influence the election
process. In some systems, it may be desirable to limit the number of
possible PTP clock masters to avoid the need to re-signal timestamp
reference clock sources when the clock master changes.

So you can limit the masters in the normal way, that is, by
configuration of the masters.

Configuring a slave to choose a particular master is not specified in
RFC 7273. Or is it (TLDR)? If it is, then please point out where.

Thanks,
Richard
Petr Kulhavy
2017-05-17 22:43:02 UTC
Permalink
Hi Richard,

I'm reading once again the RFC and the AES specifications. The documents
indeed say that the receiver just checks if his clock matches the ts-refclk.
And if it doesn't it simply indicates that it cannot play.
So you're right. There is no need to influence the master selection, as
I originally though.

The only remaining question is how to efficiently get the ptp4l status
(or even better the status change event) from a C application.

Regards
Petr
Post by Richard Cochran
Post by Petr Kulhavy
See the "ts-refclk" attribute defined in RFC7273
The PTP protocols employ a distributed election protocol called the
"Best Master Clock Algorithm" (BMCA) to determine the active clock
master. The clock master choices available to BMCA can be restricted
or biased by configuration parameters to influence the election
process. In some systems, it may be desirable to limit the number of
possible PTP clock masters to avoid the need to re-signal timestamp
reference clock sources when the clock master changes.
So you can limit the masters in the normal way, that is, by
configuration of the masters.
Configuring a slave to choose a particular master is not specified in
RFC 7273. Or is it (TLDR)? If it is, then please point out where.
Thanks,
Richard
Richard Cochran
2017-05-18 04:42:32 UTC
Permalink
The only remaining question is how to efficiently get the ptp4l status (or
even better the status change event) from a C application.
We have the management interface over UNIX Domain Socket. You can
program this directly or fork+exec/popen the 'pmc' helper program.

Thanks,
Richard
Petr Kulhavy
2017-05-18 08:17:32 UTC
Permalink
Is the interface always polling? Or can the daemon send notifications?

Cheers
Petr
Post by Richard Cochran
The only remaining question is how to efficiently get the ptp4l status (or
even better the status change event) from a C application.
We have the management interface over UNIX Domain Socket. You can
program this directly or fork+exec/popen the 'pmc' helper program.
Thanks,
Richard
Richard Cochran
2017-05-18 12:19:23 UTC
Permalink
Post by Petr Kulhavy
Is the interface always polling? Or can the daemon send notifications?
We have one "push" message for port state. See phc2sys.c for the client side.

Internally, in ptp4l, the push code can be easily enough expanded if needs be.

Thanks,
Richard

Continue reading on narkive:
Loading...