Thread: [Linuxptp-users] Selecting a master
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Petr K. <br...@ji...> - 2017-05-16 13:44:08
|
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 |
From: Mace, K. P. <Kyl...@gd...> - 2017-05-16 13:51:17
|
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:br...@ji...] Sent: Tuesday, May 16, 2017 8:44 AM To: lin...@li... 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 Lin...@li... https://lists.sourceforge.net/lists/listinfo/linuxptp-users |
From: Petr K. <br...@ji...> - 2017-05-16 19:26:00
|
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 On 16/05/17 15:51, Mace, Kyle P. wrote: > 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:br...@ji...] > Sent: Tuesday, May 16, 2017 8:44 AM > To: lin...@li... > 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 > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linuxptp-users |
From: Richard C. <ric...@gm...> - 2017-05-16 20:05:58
|
On Tue, May 16, 2017 at 03:43:50PM +0200, Petr Kulhavy wrote: > 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 |
From: Petr K. <br...@ji...> - 2017-05-18 08:17:45
|
Is the interface always polling? Or can the daemon send notifications? Cheers Petr On 18/05/17 06:42, Richard Cochran wrote: > On Thu, May 18, 2017 at 12:43:02AM +0200, Petr Kulhavy wrote: >> 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 |
From: Richard C. <ric...@gm...> - 2017-05-18 12:19:38
|
On Thu, May 18, 2017 at 10:17:32AM +0200, Petr Kulhavy wrote: > 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 |
From: Petr K. <br...@ji...> - 2017-05-16 20:26:11
|
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 On 16/05/17 22:05, Richard Cochran wrote: > On Tue, May 16, 2017 at 03:43:50PM +0200, Petr Kulhavy wrote: >> 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 |
From: Richard C. <ric...@gm...> - 2017-05-17 08:13:00
|
On Tue, May 16, 2017 at 10:26:01PM +0200, Petr Kulhavy wrote: > How is it with domain number? Does the domainNumber limit the slave to > operate only in that particular domain? Yes. > 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 |
From: Miroslav L. <mli...@re...> - 2017-05-17 08:53:09
|
On Tue, May 16, 2017 at 10:26:01PM +0200, Petr Kulhavy wrote: > 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 |
From: Petr K. <br...@ji...> - 2017-05-17 13:01:22
|
The reason why I was asking is that some protocols like AVB provide the clock master ID and domain number with the stream description. The slave is supposed to sync to the given master and domain rather than to the best one. This of course will be fully exploited only in non-trivial networks, where multiple masters are present. I'm thinking of the following slave set-up: by default it runs ptp4l with a reasonable config (i.e. the best master algorithm) and on stream reception it reconfigures ptp4l to the required master and domain number, using the local UDS. Once the domain number configuration and acceptable masters table are implemented, this should be possible. Petr On 17/05/17 10:52, Miroslav Lichvar wrote: > On Tue, May 16, 2017 at 10:26:01PM +0200, Petr Kulhavy wrote: >> 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. > |
From: Richard C. <ric...@gm...> - 2017-05-17 13:43:21
|
On Wed, May 17, 2017 at 03:01:03PM +0200, Petr Kulhavy wrote: > 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 |
From: Petr K. <br...@ji...> - 2017-05-17 14:08:26
|
See the "ts-refclk" attribute defined in RFC7273 Petr On 17/05/17 15:43, Richard Cochran wrote: > On Wed, May 17, 2017 at 03:01:03PM +0200, Petr Kulhavy wrote: >> 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 |
From: Richard C. <ric...@gm...> - 2017-05-17 17:16:33
|
On Wed, May 17, 2017 at 04:08:07PM +0200, Petr Kulhavy wrote: > 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 |
From: Petr K. <br...@ji...> - 2017-05-17 22:43:20
|
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 On 17/05/17 19:16, Richard Cochran wrote: > On Wed, May 17, 2017 at 04:08:07PM +0200, Petr Kulhavy wrote: >> 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 > |
From: Richard C. <ric...@gm...> - 2017-05-18 04:42:44
|
On Thu, May 18, 2017 at 12:43:02AM +0200, Petr Kulhavy wrote: > 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 |