Hi all,
I’d like to share how we ended up using iceoryx2 as a transport for a SOME/IP stack, and what we measured along the way.
About the project: someipx is a clean-room SOME/IP implementation in C (with C++, ara::com, Rust and C# layers on top, running on Mac, Linux, Windows, QNX and many more). It supports Service Discovery, pub/sub with eventgroups, request/response methods, fields, and SOME/IP-TP segmentation. The one design decision that matters for this post is that the stack never touches a socket. It talks to a small, vendor-neutral POSIX-style transport port (one header: open, bind, send, receive upcall, main function), and an adapter implements that port on whatever is underneath: BSD sockets, Winsock2, an in-process loopback for tests, or a serial link. We plan to open-source someipx soon; I’ll add the repository link here when it’s public.
Why iceoryx2: A lot of SOME/IP traffic in a real system never leaves the host: several processes on one ECU talking to each other, with the kernel UDP loopback in between. That’s two kernel copies and a handful of syscalls per datagram, for messages that are often 16 to a few hundred bytes. Because our stack only knows the transport port, we could replace the whole kernel path without changing a line in the SOME/IP logic. iceoryx2 was the obvious candidate for me: zero-copy, no central daemon, a clean C API, and the dead-node cleanup story we needed for crashed processes.
How the adapter maps SOME/IP onto iceoryx2:
The adapter (someip_net_iox2.c, about 1k lines) carries one UDP datagram per iceoryx2 sample:
- Payload: The payload type is a
u8slice withinitial_max_slice_len = 1500and the static allocation strategy, so a sample is one MTU-sized datagram and the slice length is never reallocated. - Header: A small user header carries what UDP would have given the receiver for free: address family, source address and port, a sender ID (the PID), and a per-sender sequence number.
- Service Names: These mirror the socket model. A bound unicast port
Pbecomes<prefix>/udp/Pwith exactly one subscriber. A multicast join of groupGon portPbecomes<prefix>/mcast/<G as hex>/P, and every joined socket in every process holds a subscriber on it, so one publish fans out to all of them. The prefix isolates process groups (and letsctest -jrun tests in parallel without seeing each other). - Safe Overflow:
enable_safe_overflowis on. A full receive queue overwrites its oldest sample, which is exactly UDP’s drop-when-full behaviour, and a sender never blocks. The receiver tracks the sequence number per sender and counts gaps as dropped datagrams. - Port Checks: The “exclusive bind” check (
EADDRINUSE) reads the service’s dynamic subscriber count. Transient ports are probed the same way. - Caching: Senders keep an LRU cache of publishers keyed by destination service. An evicted publisher is retired for one more main-function cycle before it’s dropped, because dropping a publisher discards its unread samples.
- Zero-Copy Integration: On send, when the stack hands us a copy callback instead of a buffer, we loan the slice and let the stack serialise straight into shared memory. On receive, we pay one copy per datagram, because the port’s receive upcall takes a mutable buffer and the stack may send from inside it.
- Cleanup:
SomeIpNet_Initruns dead-node cleanup, so a crashed process doesn’t leave stale ports behind.
Everything above the port is unmodified: our existing pub/sub binaries run SD, the subscribe/ack handshake, events, methods, and TP reassembly across processes as iceoryx2 samples. The whole thing is opt-in behind a CMake option (plus a separate Bazel module and a Conan (ROS2) option) so the default build never downloads iceoryx2 or needs a Rust toolchain.
Numbers:
Same stack, same benchmark sources, same poll loop; only the linked transport differs. Tested on Apple M3 Max, macOS, iceoryx2 v0.10.0, one run (so indicative rather than universal).
| Metric | POSIX UDP loopback | iceoryx2 adapter |
|---|---|---|
| Method round trip, 16 B payload, p50 / p99 | 47.1 / 558.7 µs | 1.6 / 3.2 µs |
| Method round trip, 1392 B payload, p50 / p99 | 35.7 / 122.4 µs | 1.8 / 4.3 µs |
| Method round trip, 8000 B (6 TP segments), p50 | 94.7 µs | 7.4 µs |
| Event throughput, 1024 B, one subscriber | 27.8k msg/s (28.5 MB/s) | 709k msg/s (726 MB/s) |
| Event multicast, 1024 B, four subscribers | 11.8k msg/s per sub | 238k msg/s per sub |
For reference, the in-process loopback adapter (pure SOME/IP stack cost, no IPC) sits at 0.3 to 0.4 µs p50, and a raw iceoryx2 ping-pong without SOME/IP sits at 0.8 to 0.9 µs. So the stack over iceoryx2 is well below even raw UDP without any SOME/IP on top (around 27 to 29 µs here). Under saturation, the iceoryx2 rows show 0.03 to 0.43% loss, which is the safe-overflow queue doing its job while UDP loopback on this machine simply throttled the sender.
Things we noticed, for whoever finds it useful:
- The v0.10.0 C FFI had every call we needed (slice loan, user header, safe overflow, allocation strategy, dynamic subscriber count, dead-node cleanup). We didn’t have to drop into Rust at all.
- The dynamic allocation strategy caught us once (“losing dynamic data” on reallocation); for a fixed-MTU datagram transport, static is the right choice anyway.
- The adapter currently busy-polls its main function (that’s what the transport port offers today). A WaitSet-driven, blocking main loop would need a new port API and is on the list; it would change the CPU picture a lot more than the latency one.
A ROS 2 angle:
someipx also ships a ROS 2 gateway (Jazzy, production testing status): our Franca IDL generator emits the .msg / .srv files plus an rclcpp node that embeds the someipx runtime, so a SOME/IP service shows up as ordinary ROS 2 topics and services (events become topics, fields become a latched topic plus a setter service, methods become services), with SOME/IP-SD discovery and ECU restarts handled underneath. Today that bridge talks SOME/IP over UDP.
Since the transport is a link-time choice, the obvious experiment is to put the bridge on the same host as the SOME/IP processes, link it against the iceoryx2 adapter, and run ROS 2 itself on rmw_iceoryx2, so a message would travel SOME/IP process → bridge → ROS 2 node without ever touching the kernel network stack. We haven’t run that combination yet, but it’s an exciting architectural prospect.
What’s next:
Rust and C# versions of the adapter (both runtimes have the same pluggable transport trait/interface), a WaitSet-based main loop, and a per-transport MTU so large payloads can skip SOME/IP-TP entirely on shared memory, where a 1500 B limit is artificial.
Greetings to Berlin and a big shoutout to the iceoryx2 team
The combination of a clean C API and predictable queue semantics made this a really short task rather than a long one. Happy to answer questions.