Skip to content

Commit 489bb42

Browse files
committed
fixed issues with images path and done some rewording
1 parent 6181a95 commit 489bb42

File tree

1 file changed

+17
-26
lines changed

1 file changed

+17
-26
lines changed

content/blog/2025-07-11-Zenoh-Pico-Peer-to-peer-unicast.md

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
---
2-
title: "Zenoh-Pico peer to peer unicast mode"
3-
date: 2025-07-10
2+
title: "Zenoh-Pico Peer to Peer Improvements"
3+
date: 2025-07-09
44
menu: "blog"
5-
weight: 20250710
6-
description: "July 10th, 2025 -- Paris."
5+
weight: 20250709
6+
description: "July 9th, 2025 -- Paris."
77
draft: false
88
---
99

10-
# Introduction
11-
12-
As hinted at in our blog post about Zenoh-Pico performance improvements, we’ve now introduced a long-requested peer-to-peer unicast mode for Zenoh-Pico! Let's dive into how it works.
10+
As hinted at in our [previous blog](http://localhost:1313/blog/2025-04-09-zenoh-pico-performance/) post on Zenoh-Pico performance improvements, we’ve now introduced a long-requested peer-to-peer unicast mode for Zenoh-Pico! Let's dive into how it works.
1311

1412
## What is Zenoh-Pico?
1513

16-
Zenoh-Pico is the lightweight, native C implementation of the [Eclipse Zenoh](http://zenoh.io) protocol, designed specifically for constrained devices. It provides a streamlined, low-resource API while supporting all abstractions from [Rust Zenoh](https://github.com/eclipse-zenoh/zenoh): pub, sub and query. Zenoh-Pico already supports a broad range of platforms and protocols, making it a versatile choice for embedded systems development.
14+
Zenoh-Pico is the lightweight, native C implementation of the [Zenoh](http://github.com/eclipse-zenoh/zenoh) protocol, designed specifically for constrained devices. It provides a streamlined, low-resource API while supporting all abstractions from [Rust Zenoh](https://github.com/eclipse-zenoh/zenoh): pub, sub and query, advanced pub/sub and so on. Zenoh-Pico already supports a broad range of platforms and protocols, making it a versatile choice for embedded systems development.
1715

18-
# Peer-to-Peer Unicast
16+
## Peer-to-Peer Unicast
1917

2018
Until now, if you didn’t want to run a router with Zenoh-Pico nodes, you had to rely on multicast transport—an option that isn’t always feasible. Additionally, this method was limited to UDP, which lacks reliability.
2119

@@ -25,7 +23,7 @@ This feature is supported and has been tested on all platforms, including FreeRT
2523

2624
Architecture-wise, we use non-blocking sockets and I/O multiplexing to handle all connections on a single RX thread, plus an additional thread that listens on a socket and accepts incoming connections. For resource-efficiency reasons, peer-unicast nodes do not route traffic: every message received from a connected peer triggers our API, and every message created via our API is sent to all connected peers. This design allows for a single TX and a single RX buffer.
2725

28-
## Examples:
26+
### Examples:
2927

3028
Here is an example showing how to implement a 1:N (or N:1) communication graph:
3129

@@ -57,21 +55,21 @@ To implement an N:N graph:
5755
./build/example/z_sub -e tcp/127.0.0.1:7447 -e tcp/127.0.0.1:7448 -e tcp/127.0.0.1:7449
5856
```
5957

60-
# Performances
58+
## Performances
6159

62-
## Test Details
60+
### Test Details
6361

6462
In addition to enabling peer-to-peer unicast, we improved general library CPU utilization, further boosting throughput and latency by approximately 10%. The tests were run on an Ubuntu 22.04 laptop equipped with an AMD Ryzen 7735U and 32 GB of RAM.
6563

66-
## Configuration
64+
### Configuration
6765

6866
Note that the Zenoh-Pico configuration used for testing deviates from the default. Here are the changes:
6967

7068
* `Z_FEATURE_SESSION_CHECK` set to 0 (default 1): Skips the publisher’s session reference upgrade. This is risky if you use the publisher after closing the session.
7169
* `Z_FEATURE_BATCH_TX_MUTEX` set to 1 (default 0): Allows the batching mechanism to hold the mutex, which can prevent the lease task from sending keep-alives, triggering connection closure.
7270
* `Z_FEATURE_RX_CACHE` set to 1 (default 0): Activates the RX LRU cache. It consumes some memory to store results of key expressions that trigger callbacks—useful in repetitive, high-throughput scenarios.
7371

74-
## Results
72+
### Results
7573

7674
{{< figure-inline
7775
src="../../img/20250711-Zenoh-Pico-peer-to-peer-unicast/perf_lat.png"
@@ -87,7 +85,7 @@ The round-trip time for packets below 16 KiB is under 20 µs—meaning a one-way
8785

8886
With up to 20 million messages per second for 8-byte messages, peer-to-peer unicast achieves over **4x the throughput** of client mode for small payloads, and still improves performance by **30% for larger payloads**.
8987

90-
# Multicast Declarations
88+
## Multicast Declarations
9189

9290
Alongside peer-to-peer unicast, we’ve implemented a multicast declaration feature. This allows multicast transport to:
9391

@@ -96,23 +94,16 @@ Alongside peer-to-peer unicast, we’ve implemented a multicast declaration feat
9694

9795
This feature is disabled by default and can be enabled by setting `Z_FEATURE_MULTICAST_DECLARATIONS`to 1. It's off by default because, for it to work correctly, all existing nodes must redeclare all key expressions and subscriptions whenever a new node joins the network—which can lead to congestion.
9896

99-
# Memory Allocation Improvements
100-
101-
Previously, we discussed reducing dynamic memory allocations without providing measurements. We've now addressed this by measuring allocations using [heaptrack](https://github.com/KDE/heaptrack). Below are the results from the client throughput test in 1.0:
102-
103-
{{< figure-inline
104-
src="../../img/20250711-Zenoh-Pico-peer-to-peer-unicast/malloc_1_0.png"
105-
class="figure-inline"
106-
alt="1.0 heaptrack" >}}
97+
## Memory Allocation Improvements
10798

108-
And here are the results for the current version:
99+
Previously, we discussed reducing dynamic memory allocations without providing measurements. We've measured allocations using [heaptrack](https://github.com/KDE/heaptrack), and below you can see the results for the latest version:
109100

110101
{{< figure-inline
111102
src="../../img/20250711-Zenoh-Pico-peer-to-peer-unicast/malloc_current.png"
112103
class="figure-inline"
113104
alt="current heaptrack" >}}
114105

115-
## Memory Breakdown:
106+
### Memory Breakdown:
116107

117108
The latest version of Zenoh-Pico includes some major performance and memory utilisation improvements, here are the latest numbers:
118109

@@ -125,6 +116,6 @@ The latest version of Zenoh-Pico includes some major performance and memory util
125116

126117
Since this test involved a single subscriber, no message copies were needed. With multiple subscribers, data copies would be required—but only for auxiliary data (like key expressions), as payloads are reference-counted.
127118

128-
# Final Thoughts
119+
## Final Thoughts
129120

130121
This release brings substantial improvements to Zenoh-Pico's flexibility and performance. Peer-to-peer unicast opens the door to more robust, scalable topologies without requiring a central router. And the combined enhancements in memory use, throughput, and latency make it a strong choice for high-performance embedded applications.

0 commit comments

Comments
 (0)