RTC Testbench - OPCUA over TSN¶
| Benchmark | Units | Version | Source | 
|---|---|---|---|
| microseconds | 5.2 | 
RTC-Testbench Prerequisites¶
Install Linutronix RTC Testbench
You can install this component from the ECI repository. Setup the ECI repository, then perform either of the following commands to install this component:

Install from individual RPM package
$ sudo dnf install rtc-testbench
 
 
Install from individual Deb package
$ sudo apt install rtc-testbench
Kernel Boot Parameters Configuration
The RTC-Testbench requires a real-time kernel with specific kernel boot parameters.
After Installing a Real-time Linux Kernel, verify the kernel boot parameters are correct:

$ cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-5.14.0-570.41.1.el9_6.x86_64+rt root=/dev/mapper/rhel-root ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet hpet=disable clocksource=tsc tsc=reliable intel_pstate=disable intel_idle.max_cstate=0 intel.max_cstate=0 processor.max_cstate=0 processor_idle.max_cstate=0 rcupdate.rcu_cpu_stall_suppress=1 mce=off nmi_watchdog=0 nosoftlockup noht numa_balancing=disable hugepages=1024 rcu_nocb_poll audit=0 irqaffinity=0 isolcpus=1-3 rcu_nocbs=1-3 nohz_full=1-3 i915.enable_dc=0 i915.disable_power_well=0
 
 
$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-6.6.23-rt26-intel-ese-standar-lts-rt+ root=UUID=55d16ddd-8a0a-4bf0-82f7-b87532a9694f ro debug=all nosplash intel_iommu=on iommu=pt video=efifb:off console=ttyS0,115200 console=tty0 clocksource=tsc tsc=reliable art=virtallow no_ipi_broadcast=1 nosoftlockup efi=runtime numa_balancing=disable hugepages=1024 audit=0 nmi_watchdog=0 irqaffinity=0 mce=off hpet=disable rcupdate.rcu_cpu_stall_suppress=1 rcu_nocb_poll noht isolcpus=4-15 rcu_nocbs=4-15 nohz_full=4-15 intel_pstate=disable intel.max_cstate=0 intel_idle.max_cstate=0 processor.max_cstate=0 processor_idle.max_cstate=0 i915.force_probe=* i915.enable_rc6=0 i915.enable_dc=0 i915.disable_power_well=0 i915.enable_guc=3 igb.blacklist=no
RTC-Testbench Overview¶
 
Figure 2: Physical Setup¶
The following example assumes a peer-to-peer setup between two TSN capable devices as shown in Figure 1. We will use systemd services from the tsn-endstation-netlink rpm provided by the ECI DNF repository for establishing PTP time synchronization. We will then install the rtc-testbench rpm and modify the scripts and configuration files to generate OPCUA traffic over the established TSN connection.
RTC-Testbench Configuration¶
- PTP Configuration - Please see gPTP Time Synchronization Service for Intel® Ethernet Controllers for PTP configuration on Linux Machines 1 & 2: - See systemd Network Manager TSN Endstation Configuration for Intel® Ethernet Controllers to install the TSN - systemdservices provided by ECI.
- See eci-ethirqs@.service- Networking Interrupts CPU Affinity for Intel® Ethernet Controllers to use the - systemdservice to configure network interrupt affinity to an isolated CPU.- For example, assuming the TSN interface is - enp1s0:- $ systemctl enable eci-ethirqs@enp1s0.service && systemctl start eci-ethirqs@enp1s0.service && systemctl status eci-ethirqs@enp1s0.service 
- See eci-ptp4l-p2p@.service - gPTP Time Synchronization Service for Intel® Ethernet Controllers to use the - systemdservice for PTP on the TSN interface and ensure time synchronization for both Linux Machine 1 & 2.- For example, assuming the TSN interface is - enp1s0:- $ systemctl enable eci-ptp4l-p2p@enp1s0.service && systemctl start eci-ptp4l-p2p@enp1s0.service && systemctl status eci-ptp4l-p2p@enp1s0.service 
- See eci-phc2sys@.service - PHC Time Synchronization Service for Intel® Ethernet Controllers to use the - systemdservice for PHC2SYS on the TSN interface and ensure time synchronization for both Linux Machine 1 & 2.- For example, assuming the TSN interface is - enp1s0:- $ systemctl enable eci-phc2sys@enp1s0.service && systemctl start eci-phc2sys@enp1s0.service && systemctl status eci-phc2sys@enp1s0.service 
- See eci-tsn-wait-sync-8021as@.service - TSN 802.1AS Services for Intel® Ethernet Controllers to use the - systemdservice for- check_clocksto verify clock synchronization.- For example, assuming the TSN interface is - enp1s0:- $ systemctl enable eci-tsn-wait-sync-8021as@enp1s0.service && systemctl start eci-tsn-wait-sync-8021as@enp1s0.service && systemctl status eci-tsn-wait-sync-8021as@enp1s0.service 
 
- Update rtc-testbench scripts - After - rtc-testbenchis installed and PTP is configured on both machines, navigate to- /usr/share/rtc-testbench/tests/opcua/on both systems.- $ cd /usr/share/rtc-testbench/tests/opcua/ 
- On Linux Machine 2, update - mirror.shto point to your system TSN interface and comment out the PTP script commands, update the copy and run commands:- set -e cd "$(dirname "$0")" # Start PTP #../../scripts/ptp.sh enp5s0 # Handled by ECI eci-ptp4l-p2p systemd service #sleep 30 # Configure flow ./flow_cml.sh enp5s0 sleep 30 # Start one instance of mirror application cp /usr/lib64/rtc-testbench/ebpf/xdp_kern_*.o . taskset -c 3 /usr/bin/mirror -c mirror_opcua_vid200_cml.yaml >mirror1.log & exit 0 
- On Linux Machine 1, update - ref.shto point to your system TSN interface and comment out the PTP script commands, update the copy and run commands:- set -e cd "$(dirname "$0")" # Start PTP #../../scripts/ptp.sh enp5s0 # Handled by ECI eci-ptp4l-p2p systemd service #sleep 30 # Configure flow ./flow_cml.sh enp5s0 sleep 30 # Start one instance of reference application cp /usr/lib64/rtc-testbench/ebpf/xdp_kern_*.o . taskset -c 3 /usr/bin/reference -c reference_opcua_vid200_cml.yaml >ref1.log & exit 0 
 
- Update yaml files: - reference_opcua_vid200_cml.yamlon Linux Machine 1 and- mirror_opcua_vid200_cml.yamlon Linux Machine 2:- Make sure - GenericL2Interfaceis pointing to the local TSN capable interface on both Linux Machine 1 & 2
- Change - GenericL2Destinationto point to the MAC Address of the opposite system’s TSN interface (for example see- ip aoutput on Linux Machine 1 and update- mirror_opcua_vid200_cml.yamlon Linux Machine 2)
   - YAML Configuration Example¶ 
Execute RTC-Testbench¶
- Navigate to - /usr/share/rtc-testbench/tests/opcua/on both systems:- $ cd /usr/share/rtc-testbench/tests/opcua/ 
- Run mirror.sh on Linux Machine 2 - $ ./mirror.sh
- Run ref.sh on Linux Machine 1 - $ ./ref.sh
- Monitor output - View logs on Linux Machine 1 to verify OPCUA RTT statistics - $ tail -f /var/log/reference_opcua_vid200.log - Ensure - OpcUaRttOutliers=0and- OpcUaOnewayOutliers=0consistently when running with the TSN configuration.- OpcUaRttAvgshould also be- <2000 uswhen running with the default cycle time of- 1000 useven with increased network traffic.
- See https://linutronix.github.io/RTC-Testbench/test.html for additional details 
 
RTC-Testbench Sample Logs¶
[1760567735. 98328147]: [INFO]: OpcUaSent=672416 | OpcUaReceived=672352 | OpcUaRttMin=1494 [us] | OpcUaRttMax=1506 [us] | OpcUaRttAvg=1499.639338 [us] | OpcUaOnewayMin=478 [us] | OpcUaOnewayMax=500 [us] | OpcUaOnewayAvg=491.236150 [us] | OpcUaRttOutliers=0 | OpcUaOnewayOutliers=0 |
[1760567736. 98327985]: [INFO]: OpcUaSent=704416 | OpcUaReceived=704352 | OpcUaRttMin=1494 [us] | OpcUaRttMax=1506 [us] | OpcUaRttAvg=1499.639149 [us] | OpcUaOnewayMin=478 [us] | OpcUaOnewayMax=500 [us] | OpcUaOnewayAvg=491.234555 [us] | OpcUaRttOutliers=0 | OpcUaOnewayOutliers=0 |
[1760567737. 98328189]: [INFO]: OpcUaSent=736448 | OpcUaReceived=736384 | OpcUaRttMin=1494 [us] | OpcUaRttMax=1506 [us] | OpcUaRttAvg=1499.638210 [us] | OpcUaOnewayMin=478 [us] | OpcUaOnewayMax=500 [us] | OpcUaOnewayAvg=491.225099 [us] | OpcUaRttOutliers=0 | OpcUaOnewayOutliers=0 |
[1760567738. 98328117]: [INFO]: OpcUaSent=768448 | OpcUaReceived=768384 | OpcUaRttMin=1494 [us] | OpcUaRttMax=1506 [us] | OpcUaRttAvg=1499.638148 [us] | OpcUaOnewayMin=478 [us] | OpcUaOnewayMax=500 [us] | OpcUaOnewayAvg=491.218115 [us] | OpcUaRttOutliers=0 | OpcUaOnewayOutliers=0 |
[1760567739. 98327813]: [INFO]: OpcUaSent=800480 | OpcUaReceived=800416 | OpcUaRttMin=1494 [us] | OpcUaRttMax=1506 [us] | OpcUaRttAvg=1499.637560 [us] | OpcUaOnewayMin=478 [us] | OpcUaOnewayMax=500 [us] | OpcUaOnewayAvg=491.216827 [us] | OpcUaRttOutliers=0 | OpcUaOnewayOutliers=0 |
[1760567740. 98328153]: [INFO]: OpcUaSent=832512 | OpcUaReceived=832448 | OpcUaRttMin=1494 [us] | OpcUaRttMax=1506 [us] | OpcUaRttAvg=1499.637955 [us] | OpcUaOnewayMin=478 [us] | OpcUaOnewayMax=500 [us] | OpcUaOnewayAvg=491.217131 [us] | OpcUaRttOutliers=0 | OpcUaOnewayOutliers=0 |
[1760567741. 98328322]: [INFO]: OpcUaSent=864512 | OpcUaReceived=864448 | OpcUaRttMin=1494 [us] | OpcUaRttMax=1506 [us] | OpcUaRttAvg=1499.636525 [us] | OpcUaOnewayMin=478 [us] | OpcUaOnewayMax=500 [us] | OpcUaOnewayAvg=491.214683 [us] | OpcUaRttOutliers=0 | OpcUaOnewayOutliers=0 |
[1760567742. 98328189]: [INFO]: OpcUaSent=896544 | OpcUaReceived=896480 | OpcUaRttMin=1494 [us] | OpcUaRttMax=1506 [us] | OpcUaRttAvg=1499.636416 [us] | OpcUaOnewayMin=478 [us] | OpcUaOnewayMax=500 [us] | OpcUaOnewayAvg=491.213534 [us] | OpcUaRttOutliers=0 | OpcUaOnewayOutliers=0 |
