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
@@ -1,12 +1,12 @@
---
title: Introduction to Zenoh
title: Build scalable communication systems with Eclipse Zenoh
weight: 2

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## The Need for Scalable Communication in Robotics and Edge Computing
## The need for scalable communication in robotics and edge computing

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.
Expand All @@ -15,36 +15,34 @@ Such systems require fast, reliable, and scalable data communication between nod
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.
* 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 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.
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. Zenoh was developed to address these challenges with a unified approach to data movement, storage, and interaction across heterogeneous, distributed systems.


## Zenoh: an open-source pub/sub protocol for the Industrial Edge
## What is Zenoh? A scalable pub/sub protocol for the industrial edge

[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, a bridge between DDS systems and Zenoh networks.
Zenoh excels in wireless, 5G, and cross-network deployments, which are environments where multicast is unavailable and DDS often struggles. 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.

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.

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 substitute Raspberry Pi with any Linux-based Arm device that supports networking, such as a Cortex-A or Neoverse board.

By the end of this Learning Path, you'll be able to:
- Explain the core architecture and data flow principles behind Eclipse Zenoh protocol, 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 a Zenoh queryable node to simulate edge-side logic

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
@@ -1,64 +1,62 @@
---
title: Setting Up Zenoh on Arm Devices
title: Get started with Zenoh on Raspberry Pi and Arm Linux

weight: 3

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Setting Up Zenoh on Arm Devices
## Set up Zenoh on Arm devices

The following instructions have been verified on both Raspberry Pi 4 and 5 devices, but you can implement them on any Arm Linux device.
This section shows you how to install and build the open-source Eclipse Zenoh protocol on Arm-based devices like Raspberry Pi.

Before building Zenoh, make sure your system has the necessary development tools and runtime libraries.
The following instructions have been verified on Raspberry Pi 4 and 5, but you can use any Arm Linux device. These steps apply to Raspberry Pi and other Arm-based Linux platforms. Before building Zenoh, make sure your system has the necessary development tools and runtime libraries.

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

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.
First, install the [Rust](https://www.rust-lang.org/) environment. The core of Zenoh is developed in Rust for performance and safety.

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

Near the end of the installation you will see the success message:
Near the end of the installation, you should see the message:

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

Make sure to source the environment to add Rust to your shell environment:
Source your shell environment to activate Rust:

```bash
source "$HOME/.cargo/env"
```

You can learn more using the [Rust install guide](/install-guides/rust/) for Arm Linux.
For more information, see the [Rust Install Guide](/install-guides/rust/) for Arm Linux.

### Install ROS 2
## Install ROS 2

[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.
If you plan to use Zenoh alongside ROS 2, for example, to bridge DDS-based nodes, you should install ROS 2 before proceeding. See the [ROS2 Installation Guide](/install-guides/ros2/) to install ROS 2 on your Arm platforms.

### Download and build the Zenoh source
## Download and build the Zenoh source

Clone the Zenoh repository:

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

After cloning, use cargo to build the source:
Build the source using Cargo:

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

This process 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. When complete, you should see output like:

```output
Updating crates.io index
Expand Down Expand Up @@ -101,13 +99,16 @@ This may become a hard error in the future; see <https://github.com/rust-lang/ca
Finished `release` profile [optimized] target(s) in 6m 28s
```

After the build process, the binary executables will be stored under the directory of `~/zenoh/target/release/examples/`.
After the build process, the binary executables will be located at `~/zenoh/target/release/examples/`.

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

If you get a build error:

## Troubleshooting build errors

If you get a build error like this:
```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
Expand All @@ -120,7 +121,7 @@ Edit the file `./plugins/zenoh-plugin-storage-manager/tests/operations.rs` and c
use crate::path::to::Plugin;
```

Run the build again:
Then rebuild:

```bash
cargo clean && cargo build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
---
title: Setting Up a Multi-Node Environment
title: Containerize and deploy Zenoh across multiple Raspberry Pi devices

weight: 4

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Deploying Zenoh on Multiple Raspberry Pi Devices
## Deploy Zenoh on multiple Raspberry Pi devices

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

If you’ve already installed Zenoh on an Arm Cortex-A or Neoverse platform as shown in the previous section, you can simply copy the compiled binaries from `~/zenoh/target/release/` to each of your Raspberry Pi devices.

However, to streamline deployment across multiple devices and ensure repeatability, this section demonstrates how to package Zenoh into a Docker image for batch rollout and scalable testing.

This containerized approach not only simplifies deployment on Raspberry Pi, but also integrates seamlessly with Arm cloud platforms such as AWS Graviton Arm Cortex-A Linux or Arm Virtual Hardware—enabling a consistent cloud-to-edge development and validation workflow.
If you’ve already installed Zenoh on an Arm Cortex-A or Neoverse platform as shown in the previous section, you can copy the compiled binaries from `~/zenoh/target/release/` to each of your Raspberry Pi devices.

In this session, you’ll use Raspberry Pi boards to simulate a scalable distributed environment. The same workflow applies to any Arm Linux system, including cloud instances and virtual hardware.
To simplify and scale deployment across multiple devices, this section shows how to containerize Zenoh with Docker for streamlined distribution and consistent multi-node testing. This containerized approach enables repeatable rollouts and makes it easier to test distributed communication across Raspberry Pi, Arm cloud instances (like AWS Graviton), and Arm Virtual Hardware.

This setup allows you to simulate real-world, cross-node communication scenarios, making it ideal for evaluating Zenoh’s performance in robotics and industrial IoT applications.
In this session, you’ll use Raspberry Pi boards to simulate a scalable distributed environment. The same workflow applies to any Arm Linux system, including cloud instances and virtual hardware. This setup allows you to simulate real-world, cross-node communication scenarios, making it ideal for evaluating Zenoh’s performance in robotics and industrial IoT applications. This setup simulates real-world, cross-node communication scenarios, making it ideal for robotics and industrial IoT applications that require fast, decentralized messaging using pub/sub, storage, and query models.

### Install Docker on Raspberry Pi
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.
## Install Docker on Raspberry Pi
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.
This enables scalable, multi-node testing in realistic distributed environments.

First, install Docker on each of Raspberry Pi.
First, install Docker on each Raspberry Pi device:

```bash
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
sudo usermod -aG docker $USER ; newgrp docker
```

### Create a ROS2 + Zenoh Docker Image
## Create a Docker image with ROS 2 and Zenoh

To ensure compatibility with ROS-related tools, create a `Dockerfile` based on `ros:galactic `, and use the official Rust installation method to build Zenoh, as shown below.

Expand Down Expand Up @@ -83,7 +79,8 @@ WORKDIR /root/zenoh/target/release
CMD ["/bin/bash"]
```

Under the directory where the above Dockerfile exists, run the following command to generate the docker image.
From the directory containing the above Dockerfile, run the following command to generate the docker image:


```bash
docker build -t zenoh-node .
Expand All @@ -106,12 +103,16 @@ You can pull it directly using:
```bash
docker pull odinlmshen/zenoh-node
```
{{% notice Tip %}}
Once built, you can reuse this Docker image across multiple Arm-based nodes, including Raspberry Pi, AWS Graviton, and Arm Virtual Hardware.
{{% /notice %}}

## Transfer the Docker image to another Raspberry Pi

### Transfer the Docker image to the other Raspberry Pi

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
1. Save and copy using the file:

```bash
docker save zenoh-node > zenoh-node.tar
Expand All @@ -124,11 +125,11 @@ On the target device:
docker load < zenoh-node.tar
```

Option 2: Push the image to a container registry such as Docker Hub
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
## Run the Docker image

Once the image is successfully loaded on the second device, you can run the container to start the Zenoh environment.

Expand All @@ -138,15 +139,17 @@ docker run -it --network=host zenoh-node

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
## Run Zenoh examples in a multi-node environment

With Zenoh running inside containers across devices, you’re now ready to explore real-time communication using prebuilt examples.

You’re now ready to run and test Zenoh communication flows across distributed edge devices.
The following examples are written in Rust and precompiled in your container image. They're fully interoperable and can be used to demonstrate Zenoh's key capabilities across devices. The Rust binaries are available in the `$ZENOH_LOC/target/release/examples/` directory. If you haven't set `ZENOH_LOC`, they can be found under `~/zenoh/target/release/examples/`.


The source of the examples written in Rust will be provided, and both are interoperable. The
Rust binaries are already available under: `$ZENOH_LOC/target/release/examples/` directory.
The following sections illustrate the procedures to run the Zenoh examples so as to demonstrate the primary capabilities of Zenoh:
- Basic pub/sub – for real-time message distribution
- Query and storage – for persisting and retrieving historical data
- Queryable – for enabling on-demand remote computation
- Dynamic queryable with computation – for executing dynamic logic across nodes

The following sections illustrate the procedures to run the Zenoh examples so as to demonstrate the primary capabilities of Zenoh
1. Basic Pub/Sub – for real-time message distribution
2. Query and Storage – to persist and retrieving historical data
3. Queryable – to enable on-demand remote computation
4. Dynamic Queryable with Computation
With your Zenoh examples running across containers, you’re now ready to build and benchmark real-time communication flows across nodes, which is ideal for simulating robotic fleets or industrial systems.
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
---
title: Zenoh Example-1 Simple Pub/Sub
title: Run a simple Zenoh pub/sub example
weight: 5

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Example 1: Simple pub/sub
## Test Zenoh pub/sub across two devices

This first test demonstrates the real-time publish/subscribe model using two Raspberry Pi devices.
This example demonstrates how to use Zenoh’s real-time publish/subscribe model to exchange messages between two Raspberry Pi devices over a local network.

The following command is to initiate a subscriber for a key expression `demo/example/**`, a set of topics starting with the path `demo/example`.
Pub/sub is a core Zenoh communication pattern where data producers (publishers) send values to a key, and data consumers (subscribers) receive updates for matching key expressions. In this case, the subscriber listens for all messages published under the key expression `demo/example/**`, which matches any topic that begins with `demo/example/`. This enables flexible topic filtering and lightweight data dissemination across distributed systems.

### Step 1: Run subscriber
## Start the subscriber node

Run the subscriber example on one of the Raspberry Pi systems.
Run the subscriber example on one of the Raspberry Pi systems:

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

### Step 2: Run publisher
## Start the publisher node

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

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

The result is shown below:
{{% notice Tip %}}
You can run both `z_sub` and `z_pub` on the same device for testing, but running them on separate Raspberry Pis demonstrates Zenoh’s distributed discovery and cross-node communication.
{{% /notice %}}

![img1 alt-text#center](zenoh_ex1.gif "Figure 1: Simple Pub/Sub")
## Observe the pub/sub data flow

The left-side window shows the `z_sub` program.
The results are shown below:

It receives values with the key `demo/example/zenoh-rs-pub` continuously published by `z_pub` running in the right-side window.
![img1 Zenoh subscriber receiving messages from a publisher in a two-terminal view#center](zenoh_ex1.gif "Simple Pub/Sub")

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 example confirms that Zenoh’s zero-configuration peer discovery and real-time pub/sub communication are working correctly across physical nodes.

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