Iceoryx: true zero-copy inter-process-communication
Published: 2023-12-07 07:25:51

Hello Readers,

My name is Nithyanand T, and I work at Luxoft India as a Junior Software Developer. Luxoft has given me several opportunities to work on various projects, which has inspired me to learn the essential processes involved in developing AUTOSAR Modulеs and Add-Ons in Iceoryx IPC Mechanism.


Introduction
Glad you joined this great Eclipse project! To get started, you'll give a quick background presentation, showing the scope of the project and everything you'll need to set up, 

along with a first-time use case. First: What is iceoryx? iceoryx is an inter-process communication (IPC) middleware for various operating systems (we currently support Linux, macOS, QNX, FreeBSD and Windows 10). It comes from the automotive industry, where large amounts of data must be transferred between different processes in driver assistance or automated driving systems. However, effective communication mechanisms can also be applied to broader use cases, such as robotics or game development.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ghaa7ig7yhf5v4d7dt1a.gif)





iceoryx uses a true zero-copy shared memory approach that allows data to be transferred from publishers to subscribers without a single copy. This ensures data transmission with a constant delay, regardless of the size of the payload.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lhk6h3mwwb4luybjlx67.png)

You're right, middleware is a cluttered time period and might by some means be all or nothing. To get a higher impact what this indicates for iceoryx, please have a examine our dreams and non-dreams.

Don't get too fearful of the API whilst walking via the example.Think of the untyped C++ and the C API as a "plumbing" one ("plumbing" as defined in Git, which means low-level). We're not using the "plumbing" APIs ourselves, but instead the typed C++ API. The everyday use case is that iceoryx is included as high-overall performance IPC shipping layer in a larger framework with extra API layers. An instance for such a "porcelain" API could be ROS 2.

Full API documentation can be found at 🌐 https://iceoryx.io.

**Supported Platforms**

Supported Platforms Editing or adding new platforms is described in the custom iceoryx platforms article.

The operating system compiler supports shared memory command line parsing privileges
Linux	gcc/clang	yes	yes
QNX	gcc	yes	yes
MacOS	clang	no, not planned for implementation	yes
Windows 10 msvc no, now no longer deliberate for implementation could be implemented
FreeBSD (Unix)	clang	no, not planned for implementation	yes
In general, Unix platforms should work with iceoryx, but we only test FreeBSD with our CI.

**Build and install**

All iceoryx libraries are deployed as unbiased CMake packages. Posh uses and relies on hoof functions. You can build amazing hooves and integrate them into existing CMake projects. Although we strive to be fully POSIX compliant, we recommend using Ubuntu 18.0 and at least GCC 7.5.0 for development.

**Linux**

sudo apt install gcc g++ cmake libacl1-dev libncurses5-dev pkg-config
Additionally, there is an optional dependency on the cpptoml library that is used to parse the RouDi configuration file containing the mempool configuration.

**Windows**
If you don't have a Windows installation, Microsoft provides free software images here.
Additionally, CMake and git are required. The option to add CMake to the system PATH for all users should be set when installing. If you are using the Microsoft developer image, Visual Studio Community 2019 is already installed, otherwise you can find it here.

To be able to compile iceoryx, the Desktop development with C++ Workload must be installed. To do this, launch VisualStudioInstaller and select the Edit button for Visual Studio Community 2019.

Either VS Code or Developer Command Prompt may be used to construct iceoryx with CMake. It may take a restart or two for CMake to find the compiler. Alternatively, C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars6 .bat can be run in any shell to set all build paths.

** Build with CMake**

CMakeLists.txt from the iceoryx_meta file can be used to develop ICEoryx with the IDE.

1. Clone the repository

git clone https://github.com/eclipse-iceoryx/iceoryx.git

2. Generate the necessary build files

cd iceoryx
cmake -Bbuild -Hiceoryx_meta
//// after installing external dependencies (eg ncurses) you must add them
//to your prefix path
cmake -Bbuild -Hiceoryx_meta -DCMAKE_PREFIX_PATH=$(PWD)/build/dependencies/

**RouDi** 

RouDi is an abbreviation for Routing and Discovery. RouDi looks after the verbal exchange setup however does now no longer absolutely take part withinside the verbal exchange among the writer and the subscriber or the patron and the server. RouDi may be concept of because the switchboard operator of iceoryx. One of its different important duties is the setup of the shared reminiscence, which the programs use for replacing payload data. Sometimes known as daemon, RouDi manages the shared reminiscence and is chargeable for the carrier discovery, i.e. allowing subscribers/customers to discover subjects provided with the aid of using publishers/servers. It additionally maintains song of all programs that have initialized a runtime and are consequently capable of create publishers, subscribers, servers or customers. It presents centers for programs to question this information. When an utility crashes, RouDi cleans up all resources. Due to our on the whole lock-loose inter-manner mechanisms (handiest one remaining lock; we're running to put off it), iceoryx-primarily based totally verbal exchange is a whole lot extra dependable in comparison to conventional mechanism the use of locking. To view the to be had command line alternatives for RouDi call $ICEORYX_ROOT/build/iox-roudi --help. 

Shared Memory

 To allow zero-reproduction inter-manner verbal exchange, iceoryx makes use of the shared reminiscence approach, i.e. publishers and subscribers or customers and servers can speak through shared reminiscence ensuing in zero-reproduction verbal exchange. Shared reminiscence is bodily reminiscence this is made reachable to a couple of methods through a mapping to a reminiscence vicinity of their digital cope with spaces.

Conclusion

In this Article I have tried to explain about the Significance of Iceoryx IPC Meachanism, in upcoming slides i will explain more Please let me know if any improvements needs to be done Thank you.