Posts Tagged ‘SimonGasse’
[OxidizeConf2024] SommR Time in Automotive
Pioneering Rust in Automotive Middleware
The automotive industry demands robust, reliable software to manage complex communication protocols, particularly for software-defined vehicles. At OxidizeConf2024, Sebastian Rietzscher from CARIAD, alongside Simon Gasse and Morgen Mey from Accenture, delivered an insightful exploration of SommR, a Rust-based implementation of the Scalable Service-Oriented Middleware over IP (SOME/IP) protocol. This trio from Volkswagen’s software arm and Accenture’s consulting expertise showcased how Rust’s safety and performance features enable a modern approach to automotive communication, addressing challenges in serialization, testing, and documentation.
SOME/IP, a standard for remote procedure calls and service discovery in automotive electronic control units (ECUs), is typically implemented in closed-source stacks. Sebastian, Simon, and Morgen presented SommR as a fully Rust-based alternative, focusing on its daemon—the central hub for communication. The daemon facilitates publish-subscribe patterns and service discovery over TCP or UDP, critical for rich OS ECUs running Linux or real-time embedded systems. By leveraging Rust, SommR ensures type safety and memory guarantees, vital for meeting ISO 26262 safety standards.
Simplifying Communication with Serde
A key challenge in SOME/IP is its flexible serialization, which allows varied string encodings and tag-length-value formats, complicating deserialization. Simon detailed SommR’s use of a specialized serde data format to handle this complexity. Unlike eager deserialization, which loads entire payloads into memory, SommR explores limited borrowing to optimize performance, though Sebastian noted constraints due to SOME/IP’s inconsistent struct layouts. This approach enhances efficiency in resource-constrained ECUs, ensuring robust communication between applications and the daemon.
The team also introduced cloneable connections, enabling multiple applications to share communication channels without compromising safety. This design simplifies app-to-app interactions across the network, a critical feature for automotive systems where scalability is paramount. By integrating serde with Rust’s type system, SommR provides a clean, safe API that reduces errors and enhances maintainability, aligning with the industry’s push for reliable software in safety-critical environments.
Enhancing Testing with Custom Macros
Testing in automotive software requires rigorous coverage to meet quality standards, yet debugging complex macros can be daunting. Morgen shared how SommR extended Rust’s #[test] macro to create a custom testing framework, making it more accessible and engaging. Using tools like cargo-expand, quote, and syn, the team simplified macro development, while trybuild sanitized error messages, improving developer experience. This effort resulted in an impressive 80% test coverage, satisfying quality departments and encouraging broader test adoption among developers.
The custom macro approach streamlined testing for SommR’s daemon and applications, ensuring compliance with automotive standards. However, challenges like macro debugging complexity were acknowledged, with Morgen advising reliance on established tools to avoid manual token stream manipulation. This testing strategy not only enhances code reliability but also fosters a culture of quality within the development team, a critical factor for SommR’s planned transition to mass production.
Addressing Versioning and Observability
Versioning and observability posed significant hurdles for SommR, particularly in maintaining compatibility across frequent updates. Sebastian highlighted the team’s detours in managing versioning, where Rust’s strict type system required careful handling to avoid breaking changes. Observability, crucial for monitoring communication flows in automotive systems, was improved through enhanced logging and tracing, leveraging Rust’s ecosystem tools to provide actionable insights.
Documentation emerged as a final theme, with the team emphasizing its role in ensuring SommR’s usability and maintainability. By prioritizing clear, comprehensive documentation, they aim to support developers integrating SommR into production systems. While currently a demonstrator, Sebastian expressed confidence in SommR’s path to series production, driven by Rust’s safety guarantees and the team’s collaborative efforts with CARIAD and Accenture.