Example PTP Instance Configurations¶
The following sections provide example configuration steps for some PTP configurations supported by StarlingX.
T-BC - Simple PTP configuration¶
This example presents a Border Clock setup where an external PTP PTS
provides a time source for the system. Only ptp4l
and phc2sys
are used
for this configuration.
Using the topology shown, the following examples provide configurations for each service type:

T-BC configuration¶
ptp4l¶
Create the instance.
~(keystone_admin)]$ system ptp-instance-add ptp-inst1 ptp4l
Create a PTP interface for the instance.
~(keystone_admin)]$ system ptp-interface-add ptp-iface1 ptp-inst1
Assign host interfaces to the PTP interface.
~(keystone_admin)]$ system host-if-ptp-assign controller-0 if0 ptp-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if1 ptp-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if2 ptp-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if3 ptp-iface1
Note
The
if0-if3
field should be a name listed by the system host-if-list <hostname> -a command.Additionally, assign ports for the second NIC.
~(keystone_admin)]$ system host-if-ptp-assign controller-0 if4 ptp-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if5 ptp-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if6 ptp-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if7 ptp-iface1
Note
The
if0-if3
field should be a name listed by the system host-if-list <hostname> -a command.Add a parameter to the instance (e.g. domainNumber=24). Additional parameters can be added for other functionality.
~(keystone_admin)]$ system ptp-instance-parameter-add ptp-inst1 domainNumber=24
Assign the PTP instance to controller-0.
~(keystone_admin)]$ system host-ptp-instance-assign controller-0 ptp-inst1
Apply the configuration.
~(keystone_admin)]$ system ptp-instance-apply
phc2sys¶
Create the instance.
~(keystone_admin)]$ system ptp-instance-add phc-inst1 phc2sys
Create a PTP interface for the instance.
~(keystone_admin)]$ system ptp-interface-add phc-iface1 phc-inst1
Assign host interface(s) to the PTP interface.
~(keystone_admin)]$ system host-if-ptp-assign controller-0 if0 phc-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if1 phc-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if2 phc-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if3 phc-iface1
Note
The
if0-if3
field should be a name listed by the system host-if-list <hostname> -a command.Assign host interfaces from the second NIC.
~(keystone_admin)]$ system host-if-ptp-assign controller-0 if4 phc-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if5 phc-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if6 phc-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if7 phc-iface1
Note
The
if0-if3
field should be a name listed by the system host-if-list <hostname> -a command.Add the required
uds_address
anddomainNumber
parameters to the instance.~(keystone_admin)]$ system ptp-instance-parameter-add phc-inst1 uds_address=/var/run/ptp4l-ptp-inst1 ~(keystone_admin)]$ system ptp-instance-parameter-add phc-inst1 domainNumber=24
Note
The path assigned to
uds_address
must use the name of theptp4l
instance thatphc2sys
is tracking.Assign the instance to controller-0.
~(keystone_admin)]$ system host-ptp-instance-assign controller-0 phc-inst1
Apply the configuration.
~(keystone_admin)]$ system ptp-instance-apply
T-GM - Alternate PTP Configuration¶
This example shows how to setup a PTS node when a time source is available
via a locally connected GNSS signal. The ptp4l
, phc2sys
, ts2phc
and clock instance types are used for this configuration.
Using the topology shown, the following examples provide configurations for each service type.
Dual NIC Deployment with GNSS¶
ts2phc¶
Procedure
Create an instance.
~(keystone_admin)]$ system ptp-instance-add ts1 ts2phc
Create the interface and assign to ports.
~(keystone_admin)]$ system ptp-interface-add tsint1 ts1 # This is the port/PHC that we want to sync to GNSS time stamps, could be multiple PHCs if required ~(keystone_admin)]$ system host-if-ptp-assign controller-0 oam0 tsint1 # Assign a port on the second nic as well ~(keystone_admin)]$ system host-if-ptp-assign controller-0 data0 tsint1 This value is the path to the GNSS serial port that is connected, will vary system to system ~(keystone_admin)]$ system ptp-instance-parameter-add ts1 ts2phc.nmea_serialport=/dev/gnss0
Additionally, find the NMEA serial port name of a given interface or NIC.
~(keystone_admin)]$ ls /sys/class/net/<network-interface>/device/gnss/
For example, to find the NMEA serial port name of the enp81s0f0 interface:
~(keystone_admin)]$ ls /sys/class/net/enp81s0f0/device/gnss/
Assign the instance to a host.
~(keystone_admin)]$ system host-ptp-instance-assign controller-0 ts1
Apply the configuration.
~(keystone_admin)]$ system ptp-instance-apply
phc2sys¶
Procedure
Add the instance.
~(keystone_admin)]$ system ptp-instance-add phc-inst1 phc2sys
Use the interface name that is being synced with
ts2phc
above.For example, if oam0 is on ens1f0, use ens1f0 below.
~(keystone_admin)]$ cmdline_opts='-w -s <port_name>'
Add the required
uds_address
anddomainNumber
parameters to the instance.$ system ptp-instance-parameter-add phc-inst1 uds_address=/var/run/ptp4l-ptp-inst1 $ system ptp-instance-parameter-add phc-inst1 domainNumber=24
Note
The path assigned to uds_address must use the name of the ptp4l instance that phc2sys is tracking.
Assign the instance to a host.
~(keystone_admin)]$ system host-ptp-instance-assign controller-0 phc-inst1
Apply the configuration.
~(keystone_admin)]$ system ptp-instance-apply
ptp4l¶
Note
You must create a second instance for the second NIC and repeat this process.
Procedure
Create instance.
~(keystone_admin)]$ system ptp-instance-add ptp-inst1 ptp4l
Create an interface for the instance.
~(keystone_admin)]$ system ptp-interface-add ptp-iface1 ptp-inst1
Assign ports to the interface.
~(keystone_admin)]$ system host-if-ptp-assign controller-0 if0 ptp-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if1 ptp-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if2 ptp-iface1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 if3 ptp-iface1
Add parameters to the instance.
~(keystone_admin)]$ system ptp-instance-parameter-add ptp-inst1 domainNumber=24
If configuring a PTS node, set the special
ptp4l
parametercurrentUtcOffsetValid=1
.This allows the local clock and all downstream clocks to use the announced UTC offset.
$ system ptp-instance-parameter-add ptp-inst1 currentUtcOffsetValid=1
Assign the PTP instance to controller-0.
~(keystone_admin)]$ system host-ptp-instance-assign controller-0 ptp-inst1
Apply the configuration.
~(keystone_admin)]$ system ptp-instance-apply
clock¶
Note
These parameters are used to enable the UFL/SMA ports, recovered clock syncE, and so-on. Refer to the user’s guide for the Westport Channel or Logan Beach NIC for additional details on how to operate these cards.
The following PTP parameters can be applied to the interface of a clock instance:
sma1 input/output
sma2 input/output
u.fl1 output
u.fl2 input
synce_rclka enabled
synce_rclkb enabled
Procedure
Create the instance.
~(keystone_admin)]$ system ptp-instance-add cl1 clock
Create a PTP interface and assign host interfaces to it.
~(keystone_admin)]$ system ptp-interface-add clint1 cl1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 oam0 clint1
The parameters are ultimately applied to the whole NIC, so adding multiple interface from the same NIC will override each other. The exception is the
synce_rclk
params, which are specific to the individual port.Add interface parameters.
~(keystone_admin)]$ system ptp-interface-parameter-add clint1 sma1=output synce_rclka=enabled
Assign the instance to a host.
~(keystone_admin)]$ system host-ptp-instance-assign controller-0 cl1
Create a second clock interface to take input on the sma1 port in order to pass GNSS data to the second NIC.
Create a PTP interface and assign host interfaces to it.
~(keystone_admin)]$ system ptp-interface-add clint2 cl1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 data0 clint2
Add interface parameters.
~(keystone_admin)]$ system ptp-interface-parameter-add clint2 sma1=input synce_rclka=enabled
Apply the configuration.
~(keystone_admin)]$ system ptp-instance-apply
T-GM - Dual NIC Deployment with GNSS and Timing Modules¶
This scenario presents an example of T-GM setup where the two NICs use GNSS as the precise time source. This configuration can be extended to include additional NICs.
T-GM Configuration¶
clock¶
Create an instance.
~(keystone_admin)]$ system ptp-instance-add clock0 clock
Create an interface to configure NIC1, add parameter(s), and assign the host interface(s) to it. The SDP1 pin is assigned to channel 1 and will receive the signal from DPLL. Input reference clock for PHC will be a 156.25 MHz signal from DPLL (TIME_REF). Use DPLL clock signal (SyncE) as TX reference clock for PHY port.
~(keystone_admin)]$ system ptp-interface-add clock0if0 clock0 ~(keystone_admin)]$ system ptp-interface-parameter-add clock0if0 sdp1=input ~(keystone_admin)]$ system ptp-interface-parameter-add clock0if0 tspll_cfg=timeref_156.25 ~(keystone_admin)]$ system ptp-interface-parameter-add clock0if0 tx_clk=synce ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f0 clk0if0
Create an interface to configure the other ports of NIC1. Use DPLL clock signal (SyncE) as TX reference clock for PHY port.
~(keystone_admin)]$ system ptp-interface-add clock0if1 clock0 ~(keystone_admin)]$ system ptp-interface-parameter-add clock0if1 tx_clk=synce ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f1 clock0if1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f2 clock0if1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f3 clock0if1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f4 clock0if1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f5 clock0if1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f6 clock0if1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f7 clock0if1
Create an interface to configure NIC2, add parameter(s), and assign the host interface(s) to it. SDP1 pin is assigned to channel 1 and will receive the signal from DPLL. For additional NICs, run the following commands for each NIC.
~(keystone_admin)]$ system ptp-interface-add clock0if2 clock0 ~(keystone_admin)]$ system ptp-interface-parameter-add clock0if2 sdp1=input ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f0 clock0if2
Assign the instance to a host.
~(keystone_admin)]$ system host-ptp-instance-assign controller-0 clock0
Apply the configuration.
~(keystone_admin)]$ system ptp-instance-apply
ts2phc¶
Create an instance and add parameter(s). This instance will synchronize the PHCs with the external timestamp signal coming from the GNSS.
~(keystone_admin)]$ system ptp-instance-add ts0 ts2phc ~(keystone_admin)]$ system ptp-instance-parameter-add ts0 ts2phc.nmea_serialport=/dev/ttyACM0
Note
The GNSS serial port and baud rate may vary depending on the platform.
Create an interface, add parameter(s), and assign the host interface(s) to it. The clock signal will be received by the SDP1 pin on channel 1 of each NIC.
~(keystone_admin)]$ system ptp-interface-add ts0if0 ts0 ~(keystone_admin)]$ system ptp-interface-parameter-add ts0if0 ts2phc.channel=1 ts2phc.pin_index=1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f0 ts0if0
Assign the host interface(s) of the other NICs that will be synchronized by the GNSS timestamps.
~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f0 ts0if0
Assign the instance to a host.
~(keystone_admin)]$ system host-ptp-instance-assign controller-0 ts0
Apply the configuration.
~(keystone_admin)]$ system ptp-instance-apply
ptp4l¶
Create an instance for NIC1 and add parameter(s). It is recommended to create a
ptp4l
instance for each PHC.~(keystone_admin)]$ system ptp-instance-add ptp0 ptp4l ~(keystone_admin)]$ system ptp-instance-parameter-add ptp0 domainNumber=24 ~(keystone_admin)]$ system ptp-instance-parameter-add ptp0 dataset_comparison=G.8275.x
Create an interface, add parameter(s), and assign host interface(s) to it.
~(keystone_admin)]$ system ptp-interface-add ptp0if0 ptp0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f0 ptp0if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f1 ptp0if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f2 ptp0if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f3 ptp0if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f4 ptp0if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f5 ptp0if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f6 ptp0if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f7 ptp0if0
Assign the instance to a host.
~(keystone_admin)]$ system host-ptp-instance-assign controller-0 ptp0
Repeat the procedure in a similar manner for the additional NICs.
~(keystone_admin)]$ system ptp-instance-add ptp1 ptp4l ~(keystone_admin)]$ system ptp-instance-parameter-add ptp1 domainNumber=24 ~(keystone_admin)]$ system ptp-instance-parameter-add ptp1 dataset_comparison=G.8275.x ~(keystone_admin)]$ system ptp-interface-add ptp1if0 ptp1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f0 ptp1if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f1 ptp1if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f2 ptp1if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f3 ptp1if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f4 ptp1if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f5 ptp1if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f6 ptp1if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f7 ptp1if0 ~(keystone_admin)]$ system host-ptp-instance-assign controller-0 ptp1
Apply the configuration.
~(keystone_admin)]$ system ptp-instance-apply
phc2sys¶
Create an instance and add parameter(s). This instance will synchronize the system clock with the NIC1 PHC via the PTP port (-s option).
~(keystone_admin)]$ system ptp-instance-add phc0 phc2sys ~(keystone_admin)]$ system ptp-instance-parameter-add phc0 domainNumber=24 ~(keystone_admin)]$ system ptp-instance-parameter-add phc0 uds_address=/var/run/ptp4l-ptp0 ~(keystone_admin)]$ system ptp-instance-parameter-add phc0 cmdline_opts='-w -s enp1s0f0'
Note
For the -s option in the
cmdline_opts
parameter, it is necessary to add the PTP port of NIC1. To find the PTP port, find the interface that contains theptp
folder:$ ls /sys/class/net/enp1*/device/ptp /sys/class/net/enp1s0f0/device/ptp: ptp0
Assign the instance to a host.
~(keystone_admin)]$ system host-ptp-instance-assign controller-0 phc0
Apply the configuration.
~(keystone_admin)]$ system ptp-instance-apply
T-BC - Dual NIC Deployment with Timing Module¶
This scenario presents an example of T-BC configuration where NIC1 is
synchronized via ptp4l
and then NIC2 is synchronized via a clock signal
generated by NIC1.
This configuration can be extended to include additional NICs.
T-BC configuration¶
Note
In a setup where Intel E825 and E830 NICs are used, the incoming PTP and SyncE clock sources must be connected to the E825 ports only.
clock¶
Create an instance.
~(keystone_admin)]$ system ptp-instance-add clock0 clock
Create an interface to configure NIC1, add parameter(s), and assign the host interface(s) to it. The SDP0 pin is assigned to channel 1 and will generate a 1 PPS signal to DPLL. Input reference clock for PHC will be a 156.25 MHz signal from DPLL (TIME_REF). Use DPLL clock signal (SyncE) as TX reference clock for PHY port.
~(keystone_admin)]$ system ptp-interface-add clock0if0 clock0 ~(keystone_admin)]$ system ptp-interface-parameter-add clock0if0 sdp0=output period_sdp0=1pps ~(keystone_admin)]$ system ptp-interface-parameter-add clock0if0 tspll_cfg=timeref_156.25 ~(keystone_admin)]$ system ptp-interface-parameter-add clock0if0 tx_clk=synce ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f0 clk0if0
Create an interface to configure the other ports of NIC1. Use DPLL clock signal (SyncE) as TX reference clock for PHY port.
~(keystone_admin)]$ system ptp-interface-add clock0if1 clock0 ~(keystone_admin)]$ system ptp-interface-parameter-add clock0if1 tx_clk=synce ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f1 clock0if1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f2 clock0if1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f3 clock0if1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f4 clock0if1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f5 clock0if1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f6 clock0if1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp1s0f7 clock0if1
Create an interface to configure NIC2, add parameter(s), and assign the host interface(s) to it. SDP1 pin is assigned to channel 1 and will receive the signal from DPLL. For additional NICs, run the following commands for each NIC.
~(keystone_admin)]$ system ptp-interface-add clock0if2 clock0 ~(keystone_admin)]$ system ptp-interface-parameter-add clock0if2 sdp1=input ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f0 clock0if2
Assign the instance to a host.
~(keystone_admin)]$ system host-ptp-instance-assign controller-0 clock0
Apply the configuration.
~(keystone_admin)]$ system ptp-instance-apply
ts2phc¶
Create an instance and add parameter(s). This instance will synchronize the PHCs with the clock signal generated by NIC1.
~(keystone_admin)]$ system ptp-instance-add ts0 ts2phc ~(keystone_admin)]$ system ptp-instance-parameter-add ts0 cmdline_opts='-s generic'
Create an interface, add parameter(s), and assign the host interface(s) of the NICs that will be synchronized by NIC1 clock signal. The clock signal will be received by the SDP1 pin on channel 1 of each NIC.
~(keystone_admin)]$ system ptp-interface-add ts0if0 ts0 ~(keystone_admin)]$ system ptp-interface-parameter-add ts0if0 ts2phc.channel=1 ts2phc.pin_index=1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f0 ts0if0
Assign the instance to a host.
~(keystone_admin)]$ system host-ptp-instance-assign controller-0 ts0
Apply the configuration.
~(keystone_admin)]$ system ptp-instance-apply
ptp4l¶
Create an instance for NIC1 and add parameter(s). It is recommended to create a
ptp4l
instance for each PHC.~(keystone_admin)]$ system ptp-instance-add ptp0 ptp4l ~(keystone_admin)]$ system ptp-instance-parameter-add ptp0 domainNumber=24 ~(keystone_admin)]$ system ptp-instance-parameter-add ptp0 dataset_comparison=G.8275.x
Create an interface, add parameter(s), and assign the host interface(s) to it.
~(keystone_admin)$ system ptp-interface-add ptp0if0 ptp0 ~(keystone_admin)$ system host-if-ptp-assign controller-0 enp1s0f0 ptp0if0 ~(keystone_admin)$ system host-if-ptp-assign controller-0 enp1s0f1 ptp0if0 ~(keystone_admin)$ system host-if-ptp-assign controller-0 enp1s0f2 ptp0if0 ~(keystone_admin)$ system host-if-ptp-assign controller-0 enp1s0f3 ptp0if0 ~(keystone_admin)$ system host-if-ptp-assign controller-0 enp1s0f4 ptp0if0 ~(keystone_admin)$ system host-if-ptp-assign controller-0 enp1s0f5 ptp0if0 ~(keystone_admin)$ system host-if-ptp-assign controller-0 enp1s0f6 ptp0if0 ~(keystone_admin)$ system host-if-ptp-assign controller-0 enp1s0f7 ptp0if0
Assign the instance to a host.
~(keystone_admin)]$ system host-ptp-instance-assign controller-0 ptp0
Repeat the procedure in a similar manner for the additional NICs.
~(keystone_admin)]$ system ptp-instance-add ptp1 ptp4l ~(keystone_admin)]$ system ptp-instance-parameter-add ptp1 domainNumber=24 ~(keystone_admin)]$ system ptp-instance-parameter-add ptp1 dataset_comparison=G.8275.x ~(keystone_admin)]$ system ptp-interface-add ptp1if0 ptp1 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f0 ptp1if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f1 ptp1if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f2 ptp1if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f3 ptp1if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f4 ptp1if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f5 ptp1if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f6 ptp1if0 ~(keystone_admin)]$ system host-if-ptp-assign controller-0 enp2s0f7 ptp1if0 ~(keystone_admin)]$ system host-ptp-instance-assign controller-0 ptp1
Apply the configuration.
~(keystone_admin)]$ system ptp-instance-apply
phc2sys¶
Create an instance and add parameter(s). This instance will synchronize the system clock with the NIC1 PHC via the PTP port (-s option).
~(keystone_admin)]$ system ptp-instance-add phc0 phc2sys ~(keystone_admin)]$ system ptp-instance-parameter-add phc0 domainNumber=24 ~(keystone_admin)]$ system ptp-instance-parameter-add phc0 uds_address=/var/run/ptp4l-ptp0 ~(keystone_admin)]$ system ptp-instance-parameter-add phc0 cmdline_opts='-w -s enp1s0f0'
Assign the instance to a host.
~(keystone_admin)]$ system host-ptp-instance-assign controller-0 phc0
Apply the configuration.
~(keystone_admin)]$ system ptp-instance-apply