Hi, Timemaster is a program to help simplify the configuration of the other programs, in that sense, it doesn't "do" any of the things on its own.
The flow diagram should be: 1. NTP --> system clock -> phc2sys -> ptp4l (master) -> network out to other PTP slaves ? ptp4l (slave) ? phc2sys ? system clock (No NTP here) If you're ptp4l is "master" that means it is serving time out the network and thus is the only time when NTP should be configured it. In this case, ptp4l would function as master on the PTP network, but would be the slave of the NTP daemon via phc2sys. It is possible your device is good enough to actually be the grand-master of time, in which case it could be used to set the system time as well. But that would really only occur if your PTP node is a dedicated clock, and I can't say I have experience setting one of those up. To perform the NTP syncs PTP master setup, you need to do something like: 1. Configure NTP to control the system clock 2. Configure phc2sys to drive the PTP hardware clock on your device. Your problem is that this behavior does not allow automatic configuration, because phc2sys can't switch servos while running. Since it will attempt to drive the system time 100% when tuning system time to ptp4l you get the result where NTP attempts to interfere. a. If you do this manually, however, then it won't automatically switch directions for you I believe that is the crux if your issue here. In addition, I think you have the notion of slave/master backwards. Slave means that it is receiving time from the network and thus is the "master" time source in the system. Master means it is serving time out the network and is thus the "slave" to the system time. This dual usage of terminology can get confusing. Regards, Jake From: Harold Lapprich [mailto:hlappr...@pixel-velocity.com] Sent: Monday, August 17, 2015 10:16 AM To: Miroslav Lichvar Cc: Keller, Jacob E; linuxptp-users@lists.sourceforge.net Subject: RE: [Linuxptp-users] Grandmaster Auto-Negotiation and Reconfiguration of phc2sys to ptp4l Synchronization Miroslav, Thanks again for the quick response, trying to simplify the discussion and therefore minimize any mis-understanding by providing the following simply flow diagrams: Need to support the following 2 scenarios using the 'linuxptp' applications but NOT both in the same network configuration (only 1 of the 2 will exist) 1. NTP <---- timemaster <---- system clock <---- phc2sys <---- 'ptp4l (master)' ----//---->ptp4l (slaves)---->phc2sys---->system clock 2. NTP ----> timemaster ----> system clock ----> phc2sys ----> 'ptp4l (master)' ----//----ptp4l (slaves)---->phc2sys---->system clock Please let me know if the proceeding flow diagrams are NOT correct? I. Do you need NTP as a time source? Or just serve time over NTP? The former conflicts with your requirement to allow ptp4l to be a master as phc2sys would need to be the process that synchronizes the clock and not chronyd/ntpd. Want the ability to have NTP as a time source or serve time over NTP but not both at the same time (therefore need the capability to do both, 1: when local network configuration is standalone then a network server will be locked to PTP time via PTP-->NTP, and 2: when the local network is a subset of a larger network and therefore NTP --> PTP). The configuration will be a known entity and therefore the 'linuxptp' application configuration files created appropriately this is NOT something that needs to happen automatically. II. The former conflicts with your requirement to allow ptp4l to be a master as phc2sys would need to be the process that synchronizes the clock and not chronyd/ntpd. It is my understanding that 1 of the PTP clients has to be a master (ptp4l master) but the master can be locked to the system clock by phc2sys (this is what I am currently doing, ptp4l -i eth0 and phc2sys -a -r -r). Then 'timemaster' would be used to synchronize the system clock to NTP. 1. NTP <---- timemaster <---- system clock <---- phc2sys <---- 'ptp4l (master)' ----//---->ptp4l (slaves)---->phc2sys---->system clock III. The problem is that when phc2sys is configured to feed chronyd/ntpd, it is not able to synchronize the PTP clock in the reverse direction when ptp4l is master. It is my understanding that the ptp4l(master) will be driving phc2sys to drive the system clock (1: 'ptp2l -i eth0 -m', 'phc2sys -a -r -r -m'; 2: 'ptp4l -i eth0 -s -m', 'phc2sys -a -r -m'). Or another words PTP master clock will be driving everything. 1. NTP <---- timemaster <---- system clock <---- phc2sys <---- 'ptp4l (master)' ----//---->ptp4l (slaves)---->phc2sys---->system clock Jake Keller If you run ptp4l on all your systems, and each one also running phc2sys, it will: on system which is "master" phc2sys will drive the ptp4l hw clock based on local time ptp4l will sync time out the network using PTP on systems which are not master ptp4l will sync time in from network to hw clock phc2sys will sync hw clock to CLOCK_REALTIME. Also Jake Keller response: "But if you want to also use NTP as a clock source, then you need to use timemaster, as otherwise phc2sys and ntpd will interfere with each other." Dosen't this imply that using 'timemaster' will remove this issue (phc2sys will synchronize the PTP (master) clock to the system clock and NTP will synchronize the system clock)? Harold -----Original Message----- From: Miroslav Lichvar [mailto:mlich...@redhat.com] Sent: Monday, August 17, 2015 11:54 AM To: Harold Lapprich <hlappr...@pixel-velocity.com<mailto:hlappr...@pixel-velocity.com>> Cc: Keller, Jacob E <jacob.e.kel...@intel.com<mailto:jacob.e.kel...@intel.com>>; linuxptp-users@lists.sourceforge.net<mailto:linuxptp-users@lists.sourceforge.net> Subject: Re: [Linuxptp-users] Grandmaster Auto-Negotiation and Reconfiguration of phc2sys to ptp4l Synchronization On Mon, Aug 17, 2015 at 02:14:36PM +0000, Harold Lapprich wrote: > "If you run ptp4l on all your systems, and each one also running > phc2sys, it will: > > on system which is "master" > > phc2sys will drive the ptp4l hw clock based on local time > > ptp4l will sync time out the network using PTP > > on systems which are not master > > ptp4l will sync time in from network to hw clock > > phc2sys will sync hw clock to CLOCK_REALTIME. > > But if you want to also use NTP as a clock source, then you need to > use timemaster, as otherwise phc2sys and ntpd will interfere with each other." Strictly speaking you just need to configure phc2sys to use the NTP SHM servo to feed chronyd/ntpd so they can select the best source or combine multiple sources and synchronize the clock. That's how phc2sys is configured by timemaster. Do you need NTP as a time source? Or just serve time over NTP? The former conflicts with your requirement to allow ptp4l to be a master as phc2sys would need to be the process that synchronizes the clock and not chronyd/ntpd. If you just need to serve NTP, you can configure chronyd/ntpd to not synchronize the clock and keep phc2sys in the control of the clock. > So when NTP is to be the clock source (and vice versa) then 'timermaster' is > needed because phc2sys and ntpd will interfere with one another. Now the > problem is GrandMaster failure, if I understand you correctly when another > PTP system on the network becomes the GrandMater 'timemaster' will NOT > automatically reconfigure and start using NTP as the clock source (using > timemaster to start PTP configuration on all systems on the PTP network)? The problem is that when phc2sys is configured to feed chronyd/ntpd, it is not able to synchronize the PTP clock in the reverse direction when ptp4l is master. > If this is the case then one would have to have another application running > in the background to detect the switch, create the appropriate 'timemaster' > configuration file and start? There is currently no way to configure timemaster to serve local time over PTP. phc2sys would need to allow that first. -- Miroslav Lichvar
------------------------------------------------------------------------------
_______________________________________________ Linuxptp-users mailing list Linuxptp-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-users