Debian Codegraph @

Documentation/introduction.rst

raw
1 .. SPDX-License-Identifier: BSD-2-Clause
2 ..
3 .. Copyright (C) 2022-2025 Linutronix GmbH
4 .. Author Kurt Kanzenbach <[email protected]>
5 ..
6 .. Testbench documentation introduction file.
7 ..
8
9 Introduction
10 ============
11
12 The Linux RealTime Communication ``Testbench`` is a real-time and non-real time traffic validation
13 tool for converged Ethernet networks with and without utilization of TSN mechanisms. PROFINET as
14 well as OPC/UA PubSub and other configurable protocols are supported. Furthermore, the performance
15 validation of security algorithms for a particular hardware can be validated. The evaluation
16 application generates RT and non-RT traffic, mirrors traffic and performs consistency and latency
17 checks. The Linux RealTime Communication ``Testbench`` is split into two applications:
18
19 - ``reference``: Traffic generation and checking simulation
20 - ``mirror``: Traffic mirror application for traffic generated by ``reference``
21 application
22
23 The concept is shown below.
24
25 .. image:: images/overview.png
26 :width: 600
27 :alt: Linux RealTime Communication Testbench
28
29 The traffic generation and reception are based on standard Linux interfaces. RAW
30 sockets and BPF filters are utilized. The interface is configured into
31 promiscuous mode. Sending and receiving packets are implemented via system
32 calls.
33
34 Furthermore, the applications have been extended to alternatively use ``AF_XDP``
35 sockets in order to speed up the frame transmission and reception as well as to
36 improve deterministic behavior.
37
38 Both applications are configured via YAML files. Sample YAML files are provided
39 for both applications in the ``tests`` folder.
40
41 The tools are implemented in C and licensed under BSD-2-Clause. The coding style
42 is the Linux kernel one.
43
44 Version history:
45
46 - v1.0: February 2021, PROFINET RT simulation
47 - v2.0: February 2022, PROFINET TSN simulation
48 - v3.0: August 2022, Multi Middleware simulation
49 - v4.0: July 2023, PROFINET Security
50 - v5.0: September 2024, Grafana visualization
51 - v5.1: November 2024, Tooling and bugfixes
52 - v5.2: February 2025, Histogram and bugfixes
53 - v5.3: May 2025, AF_XDP Tx Launch Time and bugfixes
54 - v5.4: December 2025, Workload simulation and statistics
55
56 Motivation
57 ^^^^^^^^^^
58
59 Over the last years the Linux kernel and open source ecosystem is more and more optimized for
60 hard-realtime applications with the resulting Ethernet communication capabilities. Time
61 synchronization with PTP via 802.1AS and various traffic shapers defined by IEEE enable
62 deterministic frame reception and transmission. Furthermore, the PREEMPT_RT preemption model turns
63 Linux into a real-time Operating-System. How well do these mechanisms perform for real world use
64 cases? For instance, is it possible to run protocols like PROFINET or OPC UA Pub/Sub with the help
65 of TSN mechanisms on top of Linux? Which jitter, cycle times, throughputs and latencies can be
66 achieved on a given hardware and firmware platform? Which measures can be taken to optimize these
67 figures?
68
69 To answer these questions, the Linux RealTime Communication ``Testbench`` has been developed. The
70 purpose of that tool is to evaluate the robustness and realtime-performance of manufacturer’s
71 hardware as well as underlying drivers and the Linux network stack itself. It is not intended to be
72 used as a TSN conformance testing tool, it is intended for platform evaluations and
73 optimizations. The tool itself is independent of any hardware manufacturers. All used TSN mechanisms
74 are utilizing mainline Linux only utilities for data and control plane.
75
76 While the development of the tool started for PROFINET RT and later TSN, it is now able to generate
77 any kind of cyclic Ethernet payload. This way, different middlewares next to PROFINET such as OPC/UA
78 can be simulated and tested.
79
80 Driven by legal requirements like EU Cyber Resilience Act (CRA), security for industrial
81 communication systems is more and more playing a crucial role. The RTC ``Testbench`` can also be
82 used to measure and optimize the performance of a particular security implementation for
83 authentication and/or encryption of each processed frame.
84
85 Architecture
86 ^^^^^^^^^^^^
87
88 The application itself performs cyclic Ethernet communication. There are
89 different traffic classes ranging from real time Layer 2 up to UDP
90 communication. The cyclic receivers and transmitters utilize either traditional
91 ``AF_PACKET`` or modern ``AF_XDP`` sockets. For both socket types the receive
92 flow is configured via either BPF filters or eBPF XDP programs. Based on the
93 configuration, or profiles, the Linux RealTime Communication ``Testbench`` can simulate different
94 traffic types such as PROFINET or OPC/UA PubSub. The image below shows an
95 example of three different middlewares in combination with non-real time
96 applications utilizing XDP.
97
98 .. image:: images/ref_test_app_architecture_xdp.png
99 :width: 600
100 :alt: Linux RealTime Communication Testbench XDP Architecture