This guide runs the S2OPC OPC UA PubSub sample across a Time-Sensitive Networking path between two Linux hosts, using the kernel's ETF (Earliest TxTime First) qdisc for transmit scheduling and IEEE 1588 / IEEE 802.1AS time synchronisation through linuxptp. Publisher and subscriber are two DUTs connected peer-to-peer through Intel i210 NICs. Versions used here: RT kernel 5.05, linuxptp v3.1, iproute2 v5.0; the lowest publisher cycle time exercised was 1 ms.
# wget https://github.com/richardcochran/linuxptp/archive/v3.1.tar.gz # tar -xvf linuxptp-3.1.tar.gz # cd linuxptp-3.1/ # make # make install
# cd .. # wget https://github.com/shemminger/iproute2/archive/v5.0.0.tar.gz # tar -xvzf iproute2-5.0.0.tar.gz # ./configure # make # make install
On DUT 1 (publisher): Run the below commands; Replace the IFNAME with the i210 interface name. Use “ifconfig” to find the interface name.
# tc qdisc add dev <IFNAME> parent root handle 100 mqprio num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 0 # tc qdisc add dev <IFNAME> parent 100:1 etf offload clockid CLOCK_TAI delta 150000
Time synchronization is one of the core functionalities of TSN which uses IEEE 1588 in 802.1AS, also known as Precision Time Protocol (PTP).
In this demo, DUT 1 will act as ptp4l master and DUT 2 as ptp4l slave.
On DUT 1 (publisher):
# ptp4l -i <IFNAME> -2 -mq
# phc2sys -s enp1s0 -m -O 0
On DUT 2 (subscriber):
# ptp4l -2 -s -i <IFNAME> -m
# git clone https://gitlab.com/systerel/S2OPC.git # cd S2OPC
# ./build.sh # cd build/bin # ./udp_rt_pub
In DUT 2 (subscriber): For measuring the layer2 network jitter, run the below command
# tcpdump -c 60000 -i <IFNAME> -w tmp.pcap -j adapter_unsynced -tt –time-stamp-precision=nano udp port 4840
Now, open the trace in wireshark and verify the packet-to-packet jitter.
To download live analyzer tool
To see our test bench results
For more help with setting up your evaluation and toolkits, contact us at adopt.opctsn@aeicor.com
You can also reach S2OPC support at https://www.s2opc.com