linuxubuntuyoctoclockptp

ptp4l High Values of Master offset, freq and path delay


I have the following testbed

Master

TQMLS1028A-IND

It just have Hardware Timestamp Operating System,

ID="poky"
NAME="Poky (Yocto Project Reference Distro)"
VERSION="3.0.4 (zeus)"
VERSION_ID="3.0.4"
PRETTY_NAME="Poky (Yocto Project Reference Distro) 3.0.4 (zeus)"

It has ptp4l version 2.0

Slave

PC It just have Software Timestamp Operating System:

NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

I am using this command for the master

taskset -c 1 chrt 99 ptp4l -i eno1 -mq

This command for the slave

sudo taskset -c 1 chrt 99 ptp4l -S -i enp3s0f1 -mq -s

It is giving me very high values of Master offset, freq and path delay and it goes to the state s2 SLAVE on MASTER_CLOCK_SELECTED but just for a few seconds. It is giving the below error

ptp4l[7632.725]: master offset 1611850007215613701 s2 freq +100000000 path delay  17013783
ptp4l[7633.625]: master offset 1611850007110097044 s2 freq +100000000 path delay  22519248
ptp4l[7634.525]: clockcheck: clock jumped forward or running faster than expected!
ptp4l[7634.525]: master offset 1611850010370484934 s0 freq +100000000 path delay  22519248
ptp4l[7634.525]: port 1: SLAVE to UNCALIBRATED on SYNCHRONIZATION_FAULT
ptp4l[7635.425]: master offset 1611850010270476347 s0 freq +100000000 path delay  22519248
ptp4l[7636.325]: master offset 1611850010167504974 s0 freq +100000000 path delay  25493617

There are certain configuration files in the linuxptp repository of git, and I have tried to use the gPTP.cfg file toc configure the ptpt4l, with the commands For Master

taskset -c 1 chrt 99 ptp4l -f gPTP.cfg -i eno1 -mq

For Slave

sudo taskset -c 1 chrt 99 ptp4l -S -f gPTP.cfg -i enp3s0f1 -mq -s

But it is worst because the SLAVE dont tries to synchronize at all

ptp4l[8748.087]: selected local clock b82a72.fffe.9ac430 as best master
ptp4l[8751.360]: selected local clock b82a72.fffe.9ac430 as best master
ptp4l[8754.814]: selected local clock b82a72.fffe.9ac430 as best master

I am not sure if the issue is because they have different timestamping or if there is any configuration file or parameters I have to give them.

Can you help on this?

Thank you in advance


Solution

  • This issue was solve with the following

    1. Turn off the NTP service in both systems
           timedatectl set-ntp false
           sudo systemctl stop systemd-timedated.service
           sudo systemctl stop systemd-timesyncd
    
    
    1. Synchronize the time in the NIC with the following command, eno1 is the interface. Be careful with this becasue the NIC can have a different time that the system clock and can create problems. Take in consideration that eno1 is the interface where are you making the synchro
            phc2sys -c eno1 -O 0 -w -m -s CLOCK_REALTIME
    
    1. Turn on the phc2sys so it synchronize the system clock to ptp clock of interface
             phc2sys -s eno1 -m -w
    
    1. Turn on the ptp4l in the master
              ptp4l -i eno1 -mq -2
    
    1. Turn on the ptp4l in the slave side
               ptp4l -S -i enp3s0f1 -mq -s -2
    
    

    The option -2 (IEEE 802.3 or Ethernet) in the ptp4l, it can be change to -4 (UDP IPV4) or -6 (UDP IPV6)