Get started
Real-Time Requirements
The exact real-time requirements always depend on the use case.
In this document we assume a robotic control application over EtherCAT with a cycle time of 1 ms.
Scheduling latency
The most important metric is the scheduling latency.
The maximum scheduling latency should normally be smaller than 10% of the cycle time.
So for this example, a scheduling latency of 100 µs would be acceptable.
voraus-rt-ipc-eval determines the scheduling latency using cyclictest, which runs at a high
SCHED_FIFO priority alongside an artificial system load (stress-ng). The worst-case latency
observed over the test duration is the number that matters.
Network round-trip-time
The network stack and network device drivers in the Linux kernel are complicated pieces of software, which are optimized for throughput rather than latency.
Even if the system already has a very low scheduling latency, sending a packet and receiving the answer can still take several milliseconds under load without special tuning.
voraus-rt-ipc-eval determines the network round-trip time using an EtherCAT device as a
loopback target. The maximum RTT should be smaller than roughly 25% of the cycle time (≤ 250 µs
for a 1 ms cycle time).
Setup
Before running the evaluation, the system should be tuned for real-time performance.
The most impactful measure is installing a PREEMPT_RT-patched kernel. Additional steps such as
setting appropriate kernel boot parameters and pinning IRQ affinity can reduce worst-case latency further.
See Real-Time System Setup for detailed instructions.
1. Required Hardware
To measure the network round-trip time you need an EtherCAT device connected to the network
interface that will later be used for the fieldbus.
This example assumes enp1s0 is the network interface to use.
2. Run the Evaluation
voraus-rt-ipc-eval is shipped as a self-contained Docker image.
All required utilities (cyclictest, stress-ng, etc.) are bundled inside the image.
Pull the image:
docker pull voraus.jfrog.io/docker/voraus-rt-ipc-eval
The image requires the following Linux capabilities:
| Flag | Reason |
|---|---|
--cap-add SYS_NICE | Allows cyclictest to set a SCHED_FIFO real-time scheduler priority. |
--cap-add IPC_LOCK | Allows cyclictest to lock memory pages (mlock). |
--cap-add NET_RAW | Required for EtherCAT raw sockets (Layer 2, outside the IP stack). |
--cap-add NET_ADMIN | Required to configure network interface properties (e.g. setting promiscuous mode). |
--device /dev/cpu_dma_latency | Allows cyclictest to disable CPU sleep states. |
To keep things simple, we use the --privileged flag in the examples instead of the flags above.
Also --network host is required for layer 2 access to the NIC.
This is an example to run only cyclictest and skip the network test:
docker run -it --privileged -v "$(pwd)/results:/results" voraus.jfrog.io/docker/voraus-rt-ipc-eval
See the usage page for further options and examples.