Linuxptp on green interface

NethServer Version: 7.4.1708
Module: ptp4l

Hello,
I’m looking to implement linuxptp on my server in gateway mode to synchronise it with a ptp grandmaster present on my lan (so i’m using ptp4l on green interface).

here you can see some of my config files:

/usr/lib/systemd/system/ptp4l.service:

[Unit]
Description=Precision Time Protocol (PTP) service

[Service]
Type=simple
ExecStart=/usr/sbin/ptp4l -i eno1 -m -f /etc/ptp4l.conf
ExecStop=/bin/pkill -f ptp4l

[Install]
WantedBy=multi-user.target

/etc/ptp4l.conf:

[global]
#
# Default Data Set
#
twoStepFlag             1
slaveOnly               0
priority1               128
priority2               128
domainNumber            0
clockClass              248
clockAccuracy           0xFE
offsetScaledLogVariance 0xFFFF
free_running            0
freq_est_interval       1
dscp_event              56
dscp_general            0
#
# Port Data Set
#
logAnnounceInterval     1
logSyncInterval         -1
logMinDelayReqInterval  0
logMinPdelayReqInterval 0
announceReceiptTimeout  3
syncReceiptTimeout      0
delayAsymmetry          0
fault_reset_interval    2
neighborPropDelayThresh 20000000
#
# Run time options
#
assume_two_step         0
logging_level           6
path_trace_enabled      0
follow_up_info          0
hybrid_e2e              0
tx_timestamp_timeout    5
use_syslog              1
verbose                 0
summary_interval        6
kernel_leap             1
check_fup_sync          0
#
# Servo Options
#
pi_proportional_const       0.17
pi_integral_const           0.0076
pi_proportional_scale       0.0
pi_proportional_exponent    -0.3
pi_proportional_norm_max    0.7
pi_integral_scale           0.0
pi_integral_exponent        0.4
pi_integral_norm_max        0.3
step_threshold              0.02
first_step_threshold        0.00002
max_frequency               0
clock_servo                 pi
sanity_freq_limit           500000000
ntpshm_segment              0
#
# Transport options
#
transportSpecific       0x0
ptp_dst_mac             01:1B:19:00:00:00
p2p_dst_mac             01:80:C2:00:00:0E
udp_ttl                 5
udp6_scope              0x0E
uds_address             /var/run/ptp4l
#
# Default interface options
#
network_transport       UDPv4
delay_mechanism         E2E
time_stamping           hardware
tsproc_mode             filter
delay_filter            moving_median
delay_filter_length     10
egressLatency           0
ingressLatency          0
boundary_clock_jbod     0
#
# Clock description
#
productDescription      SERVER;NETHSERVER;
revisionData            ;;
manufacturerIdentity    00:00:00
userDescription         ;
timeSource              0xA0
[eno1]

ifconfig (partial response):

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.100.254  netmask 255.255.255.0  broadcast 192.168.100.255
        ether 90:1b:0e:cf:46:43  txqueuelen 1000  (Ethernet)
        RX packets 1051880  bytes 184553354 (176.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 653916  bytes 728246906 (694.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xdfa00000-dfa7ffff

ip maddr:

1:      lo
        inet  224.0.0.1
        inet6 ff02::1
        inet6 ff01::1
2:      eno1
        link  01:00:5e:00:00:01
        link  01:00:5e:00:00:fb
        inet  224.0.0.251
        inet  224.0.0.1
        inet6 ff02::1
        inet6 ff01::1
3:      eno2
        link  01:00:5e:00:00:01
        link  33:33:00:00:00:01
        link  33:33:ff:23:c9:28
        link  01:00:5e:00:00:fb
        inet  224.0.0.251
        inet  224.0.0.1
        inet6 ff02::1:ff23:c928
        inet6 ff02::1
        inet6 ff01::1

ptp4l(1.8 version) seems to work perfectly but it can’t receive ptp event incoming packets so it always assumes grandmaster role even in slave mode.
On the other side, I’m sure that it can send ptp event packet
I’ve finally suspected a problem with shorewall but when shorewall is stopped,problem persist.
I don’t understand where igmp ptp incoming packets are dropped…

Hi @Back_Back,

welcome to NethServer community!

Is ptp4l listening on the right IP and ports?

netstat -ltunp

You may try to open the port in the Firewall module in web UI or to add the ptp4l service to NethServer via config db:

http://docs.nethserver.org/en/v7/firewall.html#firewall-and-gateway
http://docs.nethserver.org/projects/nethserver-devel/en/v7/services.html#add-a-new-service

Hi mrmarkuz,
Thanks for reply
UDP ports 319 and 320 are open in firewall and ptp4l service is present in nethserver config db.
and netstat -ltunp says that ptp4l is listening on 0.0.0.0 local addresses on ports 320 and 319. How I can specify a specific local address (the green interface one) for ptp4l to listen?

Sorry, I don’t use ptp4l but what I found out, the config looks correct.

In the manpage I found this:

The global section (indicated as [global]) sets the program options, clock options and default port options. Other sections are port specific sections and they override the default port options. The name of the section is the name of the configured port
(e.g. [eth0]). Ports specified in the configuration file don’t need to be specified by the -i option. An empty port section can be used to replace the command line option.

Maybe you have to remove the -i option in the service file or the “[eno1]” line in the config file?

Thanks mrmarkuz,
But remove -i option doesn’t change anything.
I suspect ptp4l to only listen itself.
I don’t know why but it doesn’t see event packets send by other ptp clock on the lan.
I’ve tested ptp4l on an ubuntu ( live usb ) to see if there’s a problem on the lan and ptp4l works out of the box.
May be incoming event packets are dropped but I don’t see why ! (no firewall, I’ve tested with shorewall disabled too…).
Is there a particular treatment of incoming packets on the green interface?

Other services listen to 0.0.0.0 too, it means listen to all addresses.

Just an idea: Do you use samba DC or webvirtmgr? In these cases a network bridge br0 is used for green network. Maybe you need “-i br0” and “[br0]”?

I have no clue about PTP but CentOS/RHEL seems to use chrony as time server whereas Ubuntu uses ntp.
I found some instructions for RHEL, maybe it’s helpful:

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-hw_timestamping

1 Like

SOLVED
Hello,
I’ve finally find the solution.
The problem was the IGMP version used by my eno1 interface( IGMP v3 by default) and the lack of compatibility with ptp aware switches and the other machines on the network (wich commonly use v2 and v1).
I force eno1 to use version 1 and now everything is OK.

Regards

1 Like