PTPv2

Prev Next

Global Time PTPv2

FMADIO capture systems support PTPv2 using the linux PTP open source project. ( http://linuxptp.sourceforge.net/ )  running only on the 10G management interface. 1G links are supported using 1G RJ45 SFP transceiver.

Step 1) Configure timming to use PTPv2

Enabling PTPv2 via GUI is as follows

Step 2) Use baremetal NIC on the PTPv2 interface

In addition the 10G Bridged networking config must be disabled. As LinuxPTP must run directly on the bare metal NIC to accurately hardware timestamp the incoming packets.

Please edit the file

/opt/fmadio/etc/60-persistent-ethernet.rules

Change the "phy10" values as shown below to "man10"

Before Bare Metal NIC

Changed to "man10" as follows

Enable Bare metal 10G interface

Step 3) Reboot

System must be rebooted for the above to take effect.


PTPv2 VLAN Interface

In some environments PTPv2 is run on its own dedicated VLAN interface.

Step 1) Set the VLAN

To enable this update the configuration file

/opt/fmadio/etc/time.lua

Specifically setting the VLANID as follows, in the below example its set to VLANID "123"

["PTP"] =
{
    ["Master0"] = "",
    ["Master1"] = "",
    ["Master2"] = "",
    ["Master3"] = "",
    ["UpdateRate"] = "",
    ["VLANID"] = "123",
    ["Interface"] = "man10",
},

After editing save and confirm the file syntax is correct, ensure there are no syntax or parse errors. The  correct output is shown below.

fmadio@fmadio20n40v3-364:~$ fmadiolua /opt/fmadio/etc/time.lua
fmad fmadlua Aug 10 2021
failed to open self? [fmadiolua]
loading filename [/opt/fmadio/etc/time.lua]
done 0.000051Sec 0.000001Min
fmadio@fmadio20n40v3-364:~$

Step 2) Reboot or restart linuxptp daemon

Either reboot the system, or kill all ptp processes (e.g. sudo killall ptp4l; sudo killall phc2sys)

Step 3) Confirm network interface is created

On reboot a man10.123  VLAN interface that matches the set VLANID should be populated as follows

fmadio@fmadio20n40v3-364:~$ ifconfig man10.123
man10.123 Link encap:Ethernet  HWaddr 18:C0:4D:17:7A:4E
          BROADCAST MULTICAST  MTU:9200  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

fmadio@fmadio20n40v3-364:~$

Step 4) Confirm linux4ptp daemons are binded

And the linux ptp daemon should have binded  to the newly created instance as follows

fmadio@fmadio20n40v3-364:~$ ps aux |grep ptp4l
64727 root     /opt/fmadio/bin/ptp4l -4 -H -i man10.123 -m -s
fmadio@fmadio20n40v3-364:~$

And the PHC interface also

fmadio@fmadio20n40v3-364:~$ ps aux |grep phc2sys
64729 root     /opt/fmadio/bin/phc2sys -s man10.123 -c CLOCK_REALTIME -w -m -P 0.7 -I 0.3
fmadio@fmadio20n40v3-364:~$

PTPv2 on Second 10G Port

The above config assumes PTPv2 is running on the primary 10G management port. There is not requirement for using the primary port, instead the 2nd 10G management port can also be used. Below are the differences required

Step 1) n the udev rules phy10 -> phy11 -> man11

Use phy11 interface

Default setting

Rename to man11

Use baremetal 10G interface

Step 2) Set the IP address of man11

man11 needs to be configured with an IP address, either editing  network config file directly

/opt/fmadio/etc/network.lua

or using the fmadiocli command line utility

Step 3) Specify man11 in the ptp config per below

["PTP"] =
{
    ["Master0"] = "",
    ["Master1"] = "",
    ["Master2"] = "",
    ["Master3"] = "",
    ["UpdateRate"] = "",
    ["VLANID"] = nil,
    ["Interface"] = "man11",
},

Step 4) Finished


PTP on the Second 1G RJ45 Port

PTPv2 can be run on the 2nd 1G management interface, as it supports both a PHC clock and IEE1588 hardware timestamping.

NOTE: PTPv2 can not be run on the primary/first 1G interface as this is a software bridged interface and does not support hardware timestamping.

Step 1) Configure the udev rules as follows

/opt/fmadio/etc/60-persistent-ethernet.rules

Set the phy1 interface renamed to man1 as shown below

Step 2) Set the IP address of man1

man1 needs to be configured with an IP address that the PTP master can reach. Set the network information either editing  network config file directly

/opt/fmadio/etc/network.lua

or using the fmadiocli command line utility

Step 3) Specify man1 in the ptp config per below

["PTP"] =
{
    ["Master0"] = "",
    ["Master1"] = "",
    ["Master2"] = "",
    ["Master3"] = "",
    ["UpdateRate"] = "",
    ["VLANID"] = nil,
    ["Interface"] = "man1",
},

Custom LinuxPTP Config

FMADIO system use the standard LinuxPTP project for time synchronization

https://linuxptp.sourceforge.net/

As such the PTP configuration is highly customizable. For example Broadcast environments use a non standard domain and update rate. FMADIO support this by using a custom LinuxPTP configuration file.

Custom config file can be located below

/opt/fmadio/etc/ptp4l.conf

If this file is present the system will use it when starting the application ptp4l.

NOTE: if changing the PTPv2 ethernet interface in the ptp4l.conf its also required to change it in the general /opt/fmadio/etc/time.lua configuration file (for the PHC setting)

After creating or editing the file, need to stop ptp4l as follows

After creating or editing the file, need to stop ptp4l as follows

// Some code
sudo killall ptp4l
sudo killall phc2sys

The system will then automatically start it on a 60sec timer.

Logfiles for debugging can be found in

/mnt/store0/log/ptp_ptp4l.log
/mnt/store0/log/ptp_phc2sys.log

Layer2 PTPv2 Configuration

By default Linux4ptp will run in a layer 3 IP multicast / Unicast mode, per the man page

network_transport

Select the network transport. Possible values are UDPv4, UDPv6 and L2. The default is UDPv4.

In some configurations that is not ideal, instead a pure layer 2 mode is the preferred transport.

To enable Layer2 create the file

/opt/fmadio/etc/ptp4l.conf

The configuration (using man10 as the interface) is shown below

[global]
# Automatically select the delay mechanism (E2E or P2P)
delay_mechanism auto

# Use IEEE 802.3 (Ethernet) as the network transport
network_transport L2

# use the man10 interface (assuming the 60-udev rules have been updated)
[man10]

Save the file and restart ptp4linux using

sudo killall ptp4l

Debug

If the system is not synchronizing correctly the following log files may help debug the problem

/mnt/store0/log/ptp_ptp4l.log
/mnt/store0/log/ptp_phc2sys.log

In addition there are log files showing the startup process which can be helpful.

/mnt/store0/log/time_ptp.stdouterr_YYYYMMMDD

General System FPGA clock synchronization log file is located below, this is more for FPGA timestamp issues than configuration of PTPv2

/mnt/store0/log/fnic_clock.cur