Security and Performance Considerations in ROS 2: A Balancing Act

Jongkil Kim, Jonathon M. Smereka, Calvin Cheung, Surya Nepal, Marthie GroblerarXiv 2018

Introduction

As the Robot Operating System (ROS) evolves from a research tool into a foundation for production-grade Cyber-Physical Systems (CPS), the shift from ROS 1 to ROS 2 introduces critical architectural changes. While ROS 1 was designed for trusted, ideal network conditions, ROS 2 adopts the Data Distribution Service (DDS) middleware standard to handle real-time, non-ideal networks. However, integrating security into these systems introduces a significant "balancing act" between robust protection and the low-latency requirements essential for robotics.

Experimental Methodology

This study evaluates the performance overhead of ROS 2 security features using a multi-pronged approach. The researchers established a physical testbed consisting of a high-power publisher (MPub) and a lower-power subscriber (MSub) connected via both wired Ethernet and wireless Wi-Fi.

Performance was benchmarked across three primary configurations:

  1. No Security: Standard clear-text communication.
  2. Cryptographic Algorithms (SROS2): Native DDS security utilizing AES-GCM for encryption and authentication.
  3. SSL/TLS (VPN): Encapsulating standard ROS 2 traffic within an OpenVPN tunnel.

The benchmarks involved transmitting random messages ranging from 16 bytes to 12,000 bytes, with 1,000 iterations per test to ensure statistical significance. Additionally, the team performed static analysis on the eProsima Fast RTPS middleware and formal verification of the DDS handshake protocol.

Performance Evaluation

Throughput Analysis

The results indicate a substantial throughput penalty when enabling native security. As shown in the throughput benchmarks, SROS2 (Cryptographic Alg.) consistently underperforms compared to both unsecured traffic and the VPN-based SSL/TLS approach.

Wired and Wireless Throughput comparison across security configurations.

Interestingly, the VPN solution demonstrated superior optimization for larger packet sizes. While the decentralized nature of DDS security requires every node to manage its own cryptographic operations, the centralized but highly optimized VPN architecture maintained higher speeds with lower relative overhead as data volume increased.

Latency and Wireless Sensitivity

Latency is a critical metric for real-time robotic control. The study found that enabling SROS2 nearly doubled communication latency in wired environments. This overhead becomes even more pronounced in wireless networks, where cryptographic handshakes and packet encryption contribute to significant jitter and latency spikes.

Wired and Wireless Latency comparison across security configurations.

In wireless scenarios, the performance gap between unsecured and secured communication widened, potentially impacting the responsiveness of autonomous systems operating over Wi-Fi.

Security and Implementation Gaps

Beyond raw performance, the researchers identified several critical security and implementation concerns:

  • Lack of Forward Secrecy: The current DDS implementation uses fixed Diffie-Hellman keys within certificates. This lack of ephemeral keys means that a single compromised long-term private key could allow an attacker to decrypt all previously intercepted traffic.
  • Specification Discrepancies: A gap exists between the DDS security specification and its real-world implementation. For example, while the spec mandates a 96-bit Initialization Vector (IV) for AES-GCM, the tested implementation used 128 bits, raising concerns about interoperability and hidden vulnerabilities.
  • Code Fragility: Static analysis revealed seven bugs in the middleware, including memory leaks in RViz and potential null pointer dereferences in the ROS Middleware Interface (RMW).

Conclusion and Future Work

The findings suggest that while ROS 2 provides the framework for secure robotics, the native implementation currently faces significant performance and cryptographic hurdles. To bridge this gap, the authors recommend:

  1. Adopting Ephemeral Diffie-Hellman (DHE): To ensure forward secrecy.
  2. FIPS Validation: Utilizing validated cryptographic modules like OpenSSL.
  3. Continuous Auditing: Implementing rigorous static and dynamic analysis to catch implementation errors in the rapidly evolving ROS 2 ecosystem.

Future research should explore how these decentralized security overheads scale in large-scale robotic swarms compared to centralized VPN architectures.

Summary updated

BibTeX
@misc{kim2018security,
  author = {Jongkil Kim and Jonathon M. Smereka and Calvin Cheung and Surya Nepal and Marthie Grobler},
  title = {{Security and Performance Considerations in ROS 2: A Balancing Act}},
  year = {2018},
  eprint = {1809.09566},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1809.09566},
}
Figure