Hello.

I'm trying to synchronize time using one computer as master and another as
slave.

The command used is as follows.
[Master]
./ptp4l -i eno1 -m
./phc2sys -a -r -r -m

[Slave]
./ptp4l -i ens4f0 -s -m
./phc2sys -a -r -r -m

The output is as follows.

[Master]
root@democtl:~/linuxptp-3.1.1# ./ptp4l -i eno1 -m
ptp4l[5347.666]: selected /dev/ptp0 as PTP clock
ptp4l[5347.666]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[5347.667]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[5354.018]: port 1: LISTENING to MASTER on
ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
ptp4l[5354.019]: selected local clock 3cecef.fffe.0f0e54 as best master
ptp4l[5354.019]: port 1: assuming the grand master role

root@democtl:~/linuxptp-3.1.1# ./phc2sys -a -r -r -m
phc2sys[5354.077]: port 3cecef.fffe.0f0e54-1 changed state
phc2sys[5354.077]: reconfiguring after port state change
phc2sys[5354.077]: selecting eno1 for synchronization
phc2sys[5354.077]: selecting CLOCK_REALTIME as the master clock
phc2sys[5354.077]: eno1 sys offset 157769435242960916 s0 freq   +5100 delay
   838
phc2sys[5355.078]: eno1 sys offset 157769435242960918 s1 freq   +5102 delay
   836
phc2sys[5356.078]: eno1 sys offset     -1804 s2 freq   +3298 delay    833
phc2sys[5357.078]: eno1 sys offset         1 s2 freq   +4562 delay    834
phc2sys[5358.078]: eno1 sys offset       531 s2 freq   +5092 delay    830
phc2sys[5359.079]: eno1 sys offset       535 s2 freq   +5255 delay    825
phc2sys[5360.079]: eno1 sys offset       373 s2 freq   +5254 delay    834
phc2sys[5361.079]: eno1 sys offset       220 s2 freq   +5213 delay    836
phc2sys[5362.079]: eno1 sys offset       108 s2 freq   +5167 delay    837
phc2sys[5363.080]: eno1 sys offset        35 s2 freq   +5126 delay    830
phc2sys[5364.080]: eno1 sys offset         0 s2 freq   +5102 delay    836


[Slave]
root@demo1:~/linuxptp-3.1.1# ./ptp4l -i ens4f0 -s -m
ptp4l[1989.882]: selected /dev/ptp7 as PTP clock
ptp4l[1989.889]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[1989.889]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[1991.183]: port 1: new foreign master 3cecef.fffe.0f0e54-1
ptp4l[1995.183]: selected best master clock 3cecef.fffe.0f0e54
ptp4l[1995.183]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE
ptp4l[1997.183]: master offset 419811980807575924 s0 freq      +0 path
delay        23
ptp4l[1998.183]: master offset 419811980807584081 s1 freq   +8156 path
delay        23
ptp4l[1999.183]: master offset        -17 s2 freq   +8139 path delay
 23
ptp4l[1999.183]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
ptp4l[2000.183]: master offset      -1921 s2 freq   +6230 path delay
 1964
ptp4l[2001.183]: master offset          0 s2 freq   +7575 path delay
 1964
ptp4l[2002.183]: master offset        393 s2 freq   +7968 path delay
 2165
ptp4l[2003.183]: master offset        466 s2 freq   +8158 path delay
 2264
ptp4l[2004.183]: master offset        475 s2 freq   +8307 path delay
 2266

root@demo1:~/linuxptp-3.1.1# ./phc2sys -a -r -r -m
phc2sys[2001.023]: reconfiguring after port state change
phc2sys[2001.023]: selecting CLOCK_REALTIME for synchronization
phc2sys[2001.023]: selecting ens4f0 as the master clock
phc2sys[2001.023]: CLOCK_REALTIME phc offset 419812022665851840 s0 freq
 +0 delay    942
phc2sys[2002.024]: CLOCK_REALTIME phc offset 419812022665812900 s1 freq
 -38932 delay    932
phc2sys[2003.024]: CLOCK_REALTIME phc offset       543 s2 freq  -38389
delay    940
phc2sys[2004.024]: CLOCK_REALTIME phc offset       772 s2 freq  -37997
delay    939
phc2sys[2005.024]: CLOCK_REALTIME phc offset       769 s2 freq  -37769
delay    937
phc2sys[2006.025]: CLOCK_REALTIME phc offset       560 s2 freq  -37747
delay    941
phc2sys[2007.025]: CLOCK_REALTIME phc offset       257 s2 freq  -37882
delay    945
phc2sys[2008.025]: CLOCK_REALTIME phc offset        62 s2 freq  -38000
delay    938
phc2sys[2009.025]: CLOCK_REALTIME phc offset       -14 s2 freq  -38057
delay    935
phc2sys[2010.026]: CLOCK_REALTIME phc offset       -87 s2 freq  -38134
delay    942
phc2sys[2011.026]: CLOCK_REALTIME phc offset      -108 s2 freq  -38182
delay    942
phc2sys[2012.026]: CLOCK_REALTIME phc offset       -51 s2 freq  -38157
delay    937
phc2sys[2013.026]: CLOCK_REALTIME phc offset       -26 s2 freq  -38147
delay    935
phc2sys[2014.027]: CLOCK_REALTIME phc offset         7 s2 freq  -38122
delay    945
phc2sys[2015.027]: CLOCK_REALTIME phc offset        14 s2 freq  -38113
delay    935

I have the following questions:
1. What is the difference between the delay output from phc2sys and the
path delay output from ptp4l of the slave?
I know the path delay as the expected delay time of the sync message sent
from the Master, but I'm not sure about the concept of delay.

2. If you change the master's time arbitrarily while PTP time is
synchronized by entering the command written above (example: change the
time randomly by entering date -s '2012-01-01 00:00:00' in the master) Is
there a way for the Slave to automatically synchronize accordingly? (Or is
there an option to synchronize it to the master's clock every specific
period?)

Any advice would be appreciated.
_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to