Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,43 @@ layout: learningpathall

## The Need for Scalable Communication in Robotics and Edge Computing

Modern robotics and industrial IoT (IIoT) systems are evolving rapidlyfrom indoor collaborative arms on assembly lines to fleets of outdoor autonomous delivery robots.
Modern robotics and industrial IoT systems are evolving rapidly, from indoor collaborative arms on assembly lines to fleets of outdoor autonomous delivery robots.
These applications must operate in real-time, often across multiple compute nodes, over networks that may span factory LANs, 5G cellular links, or even cloud data centers.

Such systems require fast, reliable, and scalable data communication between nodes.
This includes not just broadcasting sensor updates or actuator commands (i.e., pub/sub), but also performing state queries, storing values for later use, and even distributed computation across nodes. A modern protocol must be:
This includes not just broadcasting sensor updates or actuator commands (pub/sub), but also performing state queries, storing values for later use, and even distributed computation across nodes.

A modern protocol must be:
* Low-latency: Immediate delivery of time-critical messages.
* High-throughput: Efficient data flow across many devices.
* Decentralized: No reliance on central brokers or fixed infrastructure.
* Flexible: Able to run on lightweight edge devices, across WANs, or inside cloud-native environments.

Traditional communication stacks such as DDS ([Data Distribution Service](https://en.wikipedia.org/wiki/Data_Distribution_Service)) serve as the backbone for middleware like ROS 2. However, DDS struggles in multi-network or wireless environments where multicast is unavailable, or NAT traversal is needed.
Traditional communication stacks such as Data Distribution Service (DDS) serve as the backbone for middleware like ROS 2. However, DDS struggles in multi-network or wireless environments where multicast is unavailable, or NAT traversal is needed.
These constraints can severely impact deployment and performance at the edge.


## Zenoh: An Open-Source Pub/Sub Protocol for the Industrial Edge
## Zenoh: an open-source pub/sub protocol for the Industrial Edge

[Eclipse Zenoh](https://zenoh.io/) is a modern, [open-source](https://github.com/eclipse-zenoh/zenoh) data-centric communication protocol that goes beyond traditional pub/sub. Designed specifically for edge computing, IIoT, robotics, and autonomous systems, Zenoh unifies:
[Eclipse Zenoh](https://zenoh.io/) is a modern, open-source, data-centric communication protocol that goes beyond traditional pub/sub. Designed specifically for edge computing, industrial IoT, robotics, and autonomous systems, Zenoh unifies:

* Data in motion through a powerful and efficient pub/sub model.
* Data at rest via geo-distributed storage plugins.
* Data in use with direct query support.
* On-demand computation via queryable nodes that can generate data dynamically.
- Data in motion through a powerful and efficient pub/sub model.
- Data at rest via geo-distributed storage plugins.
- Data in use with direct query support.
- On-demand computation via queryable nodes that can generate data dynamically.

Unlike most traditional stacks, Zenoh is fully decentralized and designed to operate across cloud-to-edge-to-thing topologies, making it ideal for industrial robotics, autonomous systems, and smart environments.

It supports heterogeneous platforms, is implemented in Rust for performance and safety, and also offers bindings for Python, enabling rapid prototyping.

Zenoh is particularly effective in wireless, 5G, or cross-network deployments where multicast and DDS fall short.
Its routing engine avoids excessive discovery traffic, conserves bandwidth, and supports seamless bridging between legacy ROS 2/DDS apps and modern, optimized Zenoh networks using zenoh-bridge-dds.

In this learning path, you’ll use Zenoh to build and validate a multi-node distributed communication system across multiple Arm-based platforms, gaining hands-on experience with data exchange and coordination between edge devices.

To make the upcoming demo more intuitive and easy to follow, we’ll demonstrate the setup using two physical Cortex-A Linux devices.

I’ll be using Raspberry Pi boards in this learning path, but you’re free to substitute them with any Cortex-A devices that support network connectivity with Linux-based OS installed, depending on your development setup.

In real-world ROS 2 deployment scenarios, developers typically conduct validation and performance testing across systems with more than two nodes.
To simulate such environments, using [Arm virtual hardware](https://www.arm.com/products/development-tools/simulation/virtual-hardware) is also a common and efficient approach.

This will help you quickly validate your architecture choices and communication patterns when designing distributed applications.

* Raspberry Pi,
* Linux-based Cortex-A, or
* Arm Virtual Hardware (AVH).
Its routing engine avoids excessive discovery traffic, conserves bandwidth, and supports seamless bridging between legacy ROS 2/DDS apps and modern, optimized Zenoh networks using Zenoh-Bridge-DDS, a bridge between DDS systems and Zenoh networks.

After this learning path, you will:
* Understand the core architecture and data flow principles behind Eclipse Zenoh, including its support for pub/sub, querying, and queryable edge functions.
* Build and run distributed Zenoh examples across multiple Arm-based nodes—using Raspberry Pi or AVH to simulate scalable deployment environments.
* Rebuild and extend the Zenoh queryable example to simulate edge-side logic.
In this Learning Path, you’ll use Zenoh to build and validate a multi-node distributed communication system across multiple Arm-based platforms, gaining hands-on experience with data exchange and coordination between edge devices.

By the end of this learning path, you’ll have deployed a fully functional, scalable, and latency-aware Zenoh system.
The examples use Raspberry Pi boards, but you’re free to substitute any Cortex-A or Neoverse devices that support network connectivity running Linux.

You can also check [here](https://zenoh.io/docs/getting-started/first-app) to find some simple examples.
Upon completion, you will be able to:
- Understand the core architecture and data flow principles behind Eclipse Zenoh, including its support for pub/sub, querying, and queryable edge functions.
- Build and run distributed Zenoh examples across multiple Arm-based nodes using Raspberry Pi or other Arm Linux devices.
- Rebuild and extend the Zenoh queryable example to simulate edge-side logic.
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,59 @@ layout: learningpathall

## Setting Up Zenoh on Arm Devices

The following instructions are verified on both Raspberry Pi 4/5 and Arm Virtual Hardware, but you can implement them on any Cortex-A Linux device.
The following instructions have been verified on both Raspberry Pi 4 and 5 devices, but you can implement them on any Arm Linux device.

Before building Zenoh, make sure your system has the necessary development tools and runtime libraries.

### Install the Rust build environment
### Install the Rust development environment

First, we need to install the [Rust](https://www.rust-lang.org/) build environment, since the core of Zenoh is totally developed using Rust to keep it safe and efficient.

Follow this [installation guide](https://learn.arm.com/install-guides/rust/) to install Rust and Cargo on Arm Linux, a build system for Rust. Or, simply use the following commands.
First, install the [Rust](https://www.rust-lang.org/) environment, since the core of Zenoh is developed using Rust to keep it safe and efficient.

```bash
curl https://sh.rustup.rs -sSf | sh
sudo apt update
sudo apt install -y curl gcc
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
```

Follow the prompts to complete the installation. If successful, you’ll see:
Near the end of the installation you will see the success message:

```output
Rust is installed now. Great!
```

For more details, refer to [Rust’s official install guide.](https://doc.rust-lang.org/cargo/getting-started/installation.html#install-rust-and-cargo)
Make sure to source the environment to add Rust to your shell environment:

### Install ROS 2
```bash
source "$HOME/.cargo/env"
```

[Robot Operating System](https://www.ros.org/) is a set of software libraries and tools that help you build robot applications. From drivers to state-of-the-art algorithms, and with powerful developer tools, ROS has what you need for your next robotics project. And it's all open source.
You can learn more using the [Rust install guide](/install-guides/rust/) for Arm Linux.

Since ROS was started in 2007, a lot has changed in the robotics and ROS community. The goal of the [ROS 2](https://docs.ros.org/en/rolling/index.html) project is to adapt to these changes, leveraging what is great about ROS 1 and improving what isn’t.
### Install ROS 2

Here is the quick [installation guide](https://learn.arm.com/install-guides/ros2/) about how to install ROS 2 in Arm platform.
[Robot Operating System](https://www.ros.org/) is a set of software libraries and tools that help you build robot applications. ROS provides everything from drivers to state-of-the-art algorithms, as well as developer tools. It is completely open-source.

Follow the [ROS2 installation guide](/install-guides/ros2/) to install ROS 2 on your Arm platforms.

### Download and build the Zenoh source

Now, we can clone the Zenoh.
Clone the Zenoh repository:

```bash
cd ~
cd $HOME
git clone https://github.com/eclipse-zenoh/zenoh.git
```

After that, simply use cargo to build the source.
After cloning, use cargo to build the source:

```bash
cd zenoh
cargo build --release --all-targets -j $(nproc)
```

This will take several minutes depending on your device. Once the installation is complete, you should see:
This process will take several minutes depending on your device. Once the installation is complete, you should see:

```output
cargo build --release --all-targets -j $(nproc)
Updating crates.io index
Downloaded humantime v2.2.0
Downloaded spin v0.10.0
Expand Down Expand Up @@ -101,7 +104,26 @@ This may become a hard error in the future; see <https://github.com/rust-lang/ca
After the build process, the binary executables will be stored under the directory of `~/zenoh/target/release/examples/`.

{{% notice Note %}}
Installation time may vary depending on your device’s processing power.
Installation time may vary depending on your device’s performance.
{{% /notice %}}

If you get a build error:
```output
error[E0599]: no function or associated item named `start` found for struct `StoragesPlugin` in the current scope
--> plugins/zenoh-plugin-storage-manager/tests/operations.rs:91:55
```

Edit the file `./plugins/zenoh-plugin-storage-manager/tests/operations.rs` and comment the line shown below and add the second line to the file:

```rust
//use zenoh_plugin_trait::Plugin;
use crate::path::to::Plugin;
```

Run the build again:

```bash
cargo clean && cargo build
```

With Zenoh successfully compiled, you’re ready to explore how nodes communicate using the Zenoh runtime.
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,26 @@ layout: learningpathall

After building Zenoh and its core examples, your next step is to deploy them across multiple Arm-based devices.

In this session, you’ll use Raspberry Pi boards to simulate a scalable, distributed environmentbut the same workflow applies to any Arm Linux system, including Arm cloud instances and Arm Virtual Hardware.
In this section, you’ll use Raspberry Pi boards to simulate a scalable, distributed environment, but the same workflow applies to any Arm Linux system, including Arm cloud instances.

You’ll learn how to use Docker to deploy the environment on physical devices, and how to duplicate virtual instances using snapshot cloning on Arm Virtual Hardware.
You’ll learn how to use Docker to deploy the environment on physical devices.

This setup lets you simulate `real-world`, `cross-node communication`, making it ideal for validating Zenoh's performance in robotics and industrial IoT use cases.
This setup lets you simulate real-world, cross-node communication, making it ideal for validating Zenoh's performance in robotics and industrial IoT use cases.

### Install Docker on Raspberry Pi
### Install Docker

To simplify this process and ensure consistency, you’ll use Docker to containerize your Zenoh and ROS 2 environment.
To simplify this process and ensure consistency, you can use Docker to containerize your Zenoh and ROS 2 environment.
This lets you quickly replicate the same runtime on any device without needing to rebuild from source.

This enables multi-node testing and real-world distributed communication scenarios.

First, install the docker environment on each of Raspberry Pi if you don't have that.
First, install Docker on each of Raspberry Pi.

```bash
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker pi
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
sudo usermod -aG docker $USER ; newgrp docker
```

Log out and back in, or run newgrp docker to activate Docker group permissions.

### Create a ROS 2 + DDS Docker Image

In a working directory, create a `Dockerfile` with the following content to create the ROS 2 / DDS docker image.
Expand All @@ -47,24 +45,22 @@ CMD bash
Under the directory where the above Dockerfile exists, run the following command to generate the docker image.

```bash
$ docker build -t zenoh-node .
docker build -t zenoh-node .
```

After this has been done, the created ROS 2 docker image can be seen by the following command.
After this has been done, the created ROS 2 Docker image can be seen by the following command.

```bash
$ docker images | grep zenoh-node
docker images | grep zenoh-node
```

```output
zenoh-node latest b7a9c27cf8a8 About a minute ago 962MB
```

### Transfer the Docker Image on Another RPi

You now need to transfer the Docker image to your second device. Choose one of the following methods:
### Transfer the Docker image to the other Raspberry Pi

You have two options:
There are two options to transfer the Docker image to your second device. Choose one of the following methods.

Option 1: Save and copy via file

Expand All @@ -74,31 +70,24 @@ scp zenoh-node.tar pi@<target_ip>:/home/pi/
```

On the target device:

```bash
docker load < zenoh-node.tar
```

Option 2: Push to a container registry (e.g., DockerHub or GHCR).
Option 2: Push the image to a container registry such as Docker Hub

You can also push the image to Docker Hub or GitHub Container Registry and pull it on the second device.

### Run the Docker Image

Once the image is successfully loaded into second device, you can run the container by
Once the image is successfully loaded on second device, you can run the container.

```bash
docker run -it --network=host zenoh-node
```

Now, all the Zenoh example binaries are now available within this container, allowing you to test pub/sub and query flows across devices.

### Another Duplicate Setting Option on Arm Virtual Hardware

If you have [Corellium](https://www.corellium.com/) account, you can

1. Set up and install Zenoh on a single AVH instance.
2. Use the [Clone](https://support.corellium.com/features/snapshots) function to duplicate the environment.
3. Optionally, you may optionally rename the device to avh* for easy device recognition by changing the setting in the `/etc/hostname` file.
The Zenoh example binaries are now available within this container, allowing you to test pub/sub and query flows across devices.

## Run Zenoh in Multi-Node Environment

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,36 @@ weight: 5
layout: learningpathall
---

## Example 1: Simple Pub/Sub
## Example 1: Simple pub/sub

This first test demonstrates real-time publish/subscribe model using two Raspberry Pi devices.
This first test demonstrates the real-time publish/subscribe model using two Raspberry Pi devices.

The following command is to initiate a subscriber for a key expression `demo/example/**`, i.e. a set of topics starting with the path `demo/example`.
The following command is to initiate a subscriber for a key expression `demo/example/**`, a set of topics starting with the path `demo/example`.

### Step 1: Run Subscriber
### Step 1: Run subscriber

Log in to Pi using any of the methods:
Run the subscriber example on one of the Raspberry Pi systems.

```bash
cd ~/zenoh/target/release/examples
./z_sub
```

### Step 2: Run Publisher
### Step 2: Run publisher

Then, log in to another machine Pi.
Then, log in to the other Raspberry Pi and run the publisher.

```bash
cd ~/zenoh/target/release/examples
./z_pub
```

The result will look like:
The result is shown below:

![img1 alt-text#center](zenoh_ex1.gif "Figure 1: Simple Pub/Sub")

In the left-side window, I have logged into the device Pi4 and run the z_sub program.
It receives values with the key `demo/example/zenoh-rs-pub` continuously published by z_pub running on Pi in the right-side window.
The left-side window shows the `z_sub` program.

It receives values with the key `demo/example/zenoh-rs-pub` continuously published by `z_pub` running in the right-side window.

This basic example shows Zenoh's zero-config discovery and low-latency pub/sub across physical nodes.
Loading