Skip to content

TimeMachines will be closed Friday April 26th for the holiday. We will reopen on Monday April 29th. Orders received while we are closed will be fulfilled on a first in first out basis when we reopen. We apologize for any inconvenience this may cause.

Configure TimeMachines PTP servers with LinuxPTP

LinuxPTP is one of the best PTP clients available in the Linux world.  It is open source, has a huge number of options, supports hardware time stamping, and can sync the PTP time to the local computer.  LinuxPTP version 4.0+ will be required to run all of these examples, and the TM2000/2500 version 0.6.4.  This page will go through multiple different configurations providing the LinuxPTP configuration, the TM2000/2500 configuration, and the command line to start LinuxPTP.  LinuxPTP will not be run as a service for these examples to make it simpler to setup and see the results of the configuration.  TimeMachines is not able to provide LinuxPTP support on any particular system due the wide range of options that may exist on any given installation.

Notes:

  • Make sure the computer running LinuxPTP either has the firewall disabled, or the ports for PTP are open, usually 319 and 320.
  • If there is an ntp client running, stop it if trying to update the system clock.  It will interfere.
  • Use ethtool -T port, to check for hardware time stamping support.  Consult your NIC cards' installation information for driver support.
  • Usually the following command can be run in a separate terminal, or eventually the background, to sync the computer clock to the PTP source.
  • sudo phc2sys -a -r -m  (must run as root)  -a is autoconfig, -r is update realtime clock, and -m prints information about clock updates to the terminal
  • Command lines will be shown for each mode.  It assumes that the LinuxPTP Configuration File is stored in the .cfg file listed on the command line
  • The command line will also include the port to use with the -i command line option.  Replace this with the desired port on the LinuxPTP computer

Typical ptp4l terminal output:

Typical phc2sys terminal output:

Basic Multicast Mode, Two-Step

The Basic Multicast mode has the TM2000/2500 generating PTP packets to the standard multicast address for PTP (224.0.1.129).  This is a network efficient mode that supports the maximum number of clients simultaneously.

Typical command line:  sudo ptp4l -f multicast_2step.cfg -i eth1

LinuxPTP Configuration File:

-------------------------------------------

[global]
verbose 1
time_stamping hardware
twoStepFlag 1
clientOnly 1
[eth1]

TM2000/2500 PTP Configuration

Unicast Mode, Two-Step, G.8265.1 Telecom Profile

The Unicast mode has the TM2000/2500 generating PTP packets at the request of the client once it connects and requests synchronization.  No PTP packets are sent until requested.  This mode is less network bandwidth efficient and also significantly limits the number of clients the TM2000/2500 can support simultaneously.   Usually 3-5 clients is the maximum number of clients a TM2000/2500 can support in unicast mode.

The IP address in the [unicast_master_table] section will have to be updated to the IP address of the TM2000/2500, as will the NIC name.

Typical command line:  sudo ptp4l -f unicast_2step.cfg -i eth1

LinuxPTP Configuration File:

-------------------------------------------

[global]
unicast_req_duration 60
verbose 1
twoStepFlag 1
time_stamping hardware
logAnnounceInterval -1
logSyncInterval -2
clientOnly 1

[unicast_master_table]
table_id 1
logQueryInterval 2
UDPv4 192.168.1.21

[eth1]
unicast_master_table 1

TM2000/2500 PTP Configuration

Unicast Mode with IPv6, Two-Step, G.8265.1 Telecom Profile

The Unicast mode has the TM2000/2500 generating PTP packets at the request of the client once it connects and requests synchronization.  This mode differs from teh previous mode only in that it uses IPv6 to operate.  No PTP packets are sent until requested.  This mode is less network bandwidth efficient and also significantly limits the number of clients the TM2000/2500 can support simultaneously.   Usually 3-5 clients is the maximum number of clients a TM2000/2500 can support in unicast mode.

The IPv6 address in the [unicast_master_table] section will have to be updated to the IPv6 address of the TM2000/2500, as will the NIC name.

Typical command line:  sudo ptp4l -f unicast_ipv6.cfg -i eth1

LinuxPTP Configuration File:

-------------------------------------------

[global]
unicast_req_duration 60
verbose 1
twoStepFlag 1
time_stamping hardware
logAnnounceInterval -1
logSyncInterval -2
clientOnly 1
network_transport UDPv6

[unicast_master_table]
table_id 1
logQueryInterval 2
UDPv6 fec0:1::1642:fcff:feb6:a59f

[eth1]
unicast_master_table 1

TM2000/2500 PTP Configuration

Telecom, Layer 2, G.8275.1 Telecom Profile

This is another mulitcast mode PTP server, however it runs on Layer2 and confirms to the G.8275.1 standard.

Typical command line:  sudo ptp4l -f G8275.1_L2.cfg -i eth1

LinuxPTP Configuration File:

-------------------------------------------

[global]
dataset_comparison G.8275.x
G.8275.defaultDS.localPriority 128
maxStepsRemoved 255
logAnnounceInterval -1
logSyncInterval -2
logMinDelayReqInterval -2
clientOnly 1
G.8275.portDS.localPriority 128
network_transport L2
domainNumber 0
verbose 1
time_stamping hardware

TM2000/2500 PTP Configuration

Telecom, G.8275.2 Unicast Telecom Profile

The G.8275.2 IPv4 Unicast mode has the TM2000/2500 generating PTP packets at the request of the client once it connects and requests synchronization.  No PTP packets are sent until requested.  This mode is less network bandwidth efficient and also significantly limits the number of clients the TM2000/2500 can support simultaneously.   Usually 3-5 clients is the maximum number of clients a TM2000/2500 can support in unicast mode.

The IP address in the [unicast_master_table] section will have to be updated to the IP address of the TM2000/2500, as will the NIC name.

Typical command line:  sudo ptp4l -f G8275.2_client.cfg -i eth1

LinuxPTP Configuration File:

-------------------------------------------

[global]
dataset_comparison G.8275.x
G.8275.defaultDS.localPriority 128
maxStepsRemoved 255
logAnnounceInterval -1
logSyncInterval -2
clientOnly 1
G.8275.portDS.localPriority 128
hybrid_e2e 1
#inhibit_multicast_service 1
#unicast_listen 1
#unicast_req_duration 60
domainNumber 0
verbose 1
time_stamping hardware
#
# Customize the following for slave operation:
#
[unicast_master_table]
table_id 1
logQueryInterval 2
UDPv4 192.168.1.21
#
[eth1]
unicast_master_table 1

TM2000/2500 PTP Configuration

TM2000/2500 PTP Configuration

gPTP Peer to Peer, Layer 2

The gPTP is another Layer2 protocol that uses the Peer to Peer Delay method.

Typical command line:  sudo ptp4l -f gPTP_client.cfg -i eth1

LinuxPTP Configuration File:

-------------------------------------------

[global]
clientOnly 1
logAnnounceInterval -1
logSyncInterval -2
syncReceiptTimeout 3
neighborPropDelayThresh 1000
min_neighbor_prop_delay -20000000
assume_two_step 1
transportSpecific 0x1
network_transport L2
delay_mechanism Auto
time_stamping hardware
verbose 1

TM2000/2500 PTP Configuration

Automotive Profile, Layer 2

The Layer 2 Automotive Profile has the most setup on both the client and the TM2000/2500.  The major idea behind Automotive Profile is that the network is closed and largely deterministic.  Both Delay Request and Announce Packets are inhibited for this reason.  Additional information is also added to the Sync Packets in this profile.  The client is typically setup to allow a faster move to the correct time as well.  Once the ptp4l servo becomes locked, the ptp4l output will switch to showing the "Master offset" value on each line with the current servo lock state.

As of this writing, the phc2sys command listed above, doesn't appear to recognize this mode, but sync to the ptp clock is working as expected.  Will update when a solutions is verified.

Typical command line:  sudo ptp4l -f automotive-slave.cfg -i eth1

LinuxPTP Configuration File:

-------------------------------------------

[global]
priority1 248
priority2 248
logSyncInterval -3
syncReceiptTimeout 3
neighborPropDelayThresh 800
min_neighbor_prop_delay -20000000
assume_two_step 1
path_trace_enabled 1
clientOnly 1
transportSpecific 0x1
network_transport L2
delay_mechanism P2P
time_stamping hardware
verbose 1
#
# Automotive Profile specific options
#
BMCA noop
clientOnly 1
inhibit_announce 1
asCapable true
ignore_source_id 1
#
# Required to quickly correct Time Jumps in master
#
step_threshold 1
operLogSyncInterval 0
operLogPdelayReqInterval 2
msg_interval_request 1
servo_offset_threshold 30
servo_num_offset_values 10

TM2000/2500 PTP Configuration

Scroll To Top