SlideShare a Scribd company logo
Zero Overhead


Pub/Sub


Store/Query


Compute
Advanced Technology Office


Angelo	Corsaro,	PhD
Chief	Technology	Officer
Luca	Cominardi,	PhD
Senior	Technologist
Gabriele	Baldoni
Technologist
Julien	Enoch
Senior	Technologist
Olivier	Hecart
Senior	Technologist


installation
in Python
Requires Python 3.6 minimum.


Latest version (stable):


• Available on pypi.org (https://pypi.org/project/eclipse-zenoh)


• Binary wheels for x86_64, i686 and aarch64


• For other platforms: source distribution requiring Rust toolchain (https://www.rust-lang.org/tools/install)
pip install eclipse-zenoh
Version in development (master):


• https://github.com/eclipse-zenoh/zenoh-python


• Requires Rust toolchain (https://www.rust-lang.org/tools/install)
pip install https://github.com/eclipse-zenoh/zenoh-python/zipball/master
Code examples:


• https://github.com/eclipse-zenoh/zenoh-python/tree/master/examples/zenoh
router - in Docker
Latest version (stable):
docker pull eclipse/zenoh:latest
Version in development (master):
docker pull eclipse/zenoh:master
Usage:
docker run --init eclipse/zenoh --help
docker run --init -p 7447:7447/tcp -p 7447:7447/udp -p 8000:8000/tcp eclipse/zenoh
router - native
Latest version (stable):


• https://download.eclipse.org/zenoh/zenoh/latest


• Files: eclipse-zenoh-<version>-<platform>.tgz (or .zip)
Version in development (master):


• https://download.eclipse.org/zenoh/zenoh/master


• Files: eclipse-zenoh-<version>-<platform>.tgz (or .zip)
zenohd --help
RUST_LOG=info zenohd
Usage:


geo-distributed
Peer-to-peer
Peer
Peer
Peer
Peer
Peer
• Multicast discovery


• Unicast “neighbour to
neighbour” discovery


• Unicast “reference
point” discovery
from zenoh import Zenoh


z = Zenoh({"mode": "peer"})
Clique
Peer
Peer
Peer
Peer
Peer
Available soon !!!
Mesh
Peer init in Python:
Routed communication
Client
Client
Client
Client


Router
from zenoh import Zenoh


z = Zenoh({


"mode": "client",


"peer": "tcp/127.0.0.1:7447"


})
Client init in Python:
zenohd
Single router startup:
Routed communication
Client
Client
Peer
Peer
Peer
Peer
Peer
Peer
Peer
Peer
Peer
Peer


Router
Routers network
Clique Mesh
Available soon !!!


Router


Router


Router


Router


Router


Router


Router


Router


Router


Router
zenohd


-e tcp/<host1>:7447


-e tcp/<host2>:7447


...
Connected router startup:
Full picture Peer
Peer
Peer
Peer
Peer
Peer
Peer
Peer
Peer
Peer Client
Client
Client


Router


Router


Router


pub/sub
pub/sub in Python
Publications are made via the put() operation:


• See https://github.com/eclipse-zenoh/zenoh-python/blob/master/examples/zenoh/z_put.py
from zenoh import Zenoh


z = Zenoh({})


workspace = z.workspace()


workspace.put("/demo/example/hi", "Hello World!")
Subscriptions are made via the subscribe() operation:


• See https://github.com/eclipse-zenoh/zenoh-python/blob/master/examples/zenoh/z_sub.py
from zenoh import Zenoh, ChangeKind


def listener(change):


print("{} : {} (encoding: {} , timestamp: {})".format(change.path,


"DELETED" if change.kind == ChangeKind.DELETE else change.value.get_content(),


"none" if change.kind == ChangeKind.DELETE else change.value.encoding_descr(),


change.timestamp))


z = Zenoh({})


workspace = z.workspace()


workspace.subscribe("/demo/example/**", listener)
Value types and encodings
zenoh supports different value types.


Each has an encoding described by its mime-type:
from zenoh import Zenoh


import json


z = Zenoh({})


workspace = z.workspace()


# - String


workspace.put('/demo/example/String', 'Hello World!')


# - Integer


workspace.put('/demo/example/Integer', 3)


# - Float


workspace.put('/demo/example/Float', 3.14)


# - Properties (as a Dictionary with str only)


workspace.put('/demo/example/Properties', {'p1': 'v1', 'p2': 'v2'})


# - Json (str format)


workspace.put('/demo/example/Json',


Value.Json(json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])))


# - Raw ('application/octet-stream' encoding by default)


workspace.put('/demo/example/Raw', b'x48x69x21')


# - Custom


workspace.put('/demo/example/Custom',


Value.Custom('my_encoding', b'x48x69x21'))


store/query
Storages
Peer
Peer
Peer
Peer
Peer Client
Client
Client


Router


Router


Router
zenohd


--mem-storage '/a/b/**'


--mem-storage '/x/y/**'


...
Router with in-memory storages:
• Deployed in router


• Store publications
matching its selector


• Replies to queries
/a/b/**
/x/y/**
put(/x/y/1)
put(/a/b/2)
get(a/b/*)
g
e
t
(
/
x
/
y
/
*
)
pub/store/query in Python
Deletions from storage are made via the delete() operation:


• See https://github.com/eclipse-zenoh/zenoh-python/blob/master/examples/zenoh/z_delete.py
from zenoh import Zenoh


z = Zenoh({})


workspace = z.workspace()


workspace.delete("/demo/example/hi")
Publications are made via the put() operation (seen previously).


Queries are made via the get() operation:


• See https://github.com/eclipse-zenoh/zenoh-python/blob/master/examples/zenoh/z_get.py
from zenoh import Zenoh


z = Zenoh({})


workspace = z.workspace()


for data in workspace.get("/demo/example/**"):


print("{} : {} (encoding: {} , timestamp: {})".format(


data.path, data.value.get_content(), data.value.encoding_descr(), data.timestamp))


compute/query
Compute
Peer
Peer
Peer
Peer
Peer Client
Client
Client


Router


Router


Router
• Eval function declared by
zenoh applications that
compute a value on demand


• Called by queries
register_eval(/x/y/z)
get(a/b/*)
g
e
t
(
/
x
/
y
/
*
)
register_eval(/a/b/c)
Compute/query in Python
Queries are made via the get() operation (seen previously).
Compute are declared via the register_eval() operation:


• See https://github.com/eclipse-zenoh/zenoh-python/blob/master/examples/zenoh/z_eval.py
import datetime


from zenoh import Zenoh


def eval_callback(get_request):


get_request.reply("/demo/example/eval", "It's {}".format(datetime.datetime.now().time()))


z = Zenoh({})


workspace = z.workspace()


workspace.register_eval("/demo/example/eval", eval_callback)


REST API
REST API
Implemented as a plugin. Default port: 8080.


The zenoh put/get/delete operations map to the PUT/GET/DELETE HTTP methods.


Example using the curl command:
# Put a string value in /demo/example/test


curl -X PUT -d 'Hello World!' http://localhost:8000/demo/example/test


# Put a JSON value in /demo/example/json


curl -X PUT -H "Content-Type: application/json" -d '{"value": "Hello World!"}' http://localhost:8000/demo/example/test


# Put a Properties value in /demo/example/props


curl -X PUT -H 'content-type:application/properties' -d 'k1=v1;k2=v2' http://localhost:8000/demo/example/props


# Get the keys/values matching /demo/**


curl http://localhost:8000/demo/**


# Get the keys/values matching /demo/example/*eval (i.e. the zenoh eval examples)


# with property name=Bob


curl http://localhost:8000/demo/example/*eval?(name=Bob)


# Delete key/value /demo/example/test


curl -X DELETE http://localhost:8000/demo/example/test


backend and storages
Backends
A zenoh backend is:


• a library, loaded on demand by the zenoh router (name: libzbackend_<id>.so)


• a factory for zenoh storages


• leveraging a speci
fi
c technology to implement storages


Existing backends:


• In-memory: built-in in zenoh router


• File system:


• https://github.com/eclipse-zenoh/zenoh-backend-
fi
lesystem


• RocksDB:


• https://github.com/eclipse-zenoh/zenoh-backend-rocksdb


• In
fl
uxDB:


• https://github.com/eclipse-zenoh/zenoh-backend-in
fl
uxdb
Admin space
zenoh admin space:


•A zenoh key/value space with under /@/**


•Addressable via zenoh APIs


using put/get/delete operations


•Each router addressable via its ID, or the "local"
keyword for the router an API is connected to
/@/router/1a2b3c.../plugin/storages
/backend
/memory /rocksdb /<beid>
/storage /storage
/s2
/s1
...
...
/storage
/db2
/db1 ...
# Get local router's info


curl http://localhost:8000/@/router/local


# Get all routers' of the system


curl http://localhost:8000/@/router/*


# Get local router's storages info


curl http://localhost:8000/@/router/local/**/storages/**
Examples using the REST API:
Backends/storages management
Examples using the REST API:
# Add a memory storage


curl -X PUT -H 'content-type:application/properties' -d 'path_expr=/demo/test/**'


http://localhost:8000/@/router/local/plugin/storages/backend/memory/storage/my-test


# Add a FileSystem backend (assuming libzbackend_fs.so is available)


curl -X PUT -H 'content-type:application/properties'


http://localhost:8000/@/router/local/plugin/storages/backend/fs


# Add a FileSystem storage


curl -X PUT -H 'content-type:application/properties' -d 'path_expr=/demo/example/**;path_prefix=/demo/example;dir=test'


http://localhost:8000/@/router/local/plugin/storages/backend/fs/storage/my-test


# Add an InfluxDB backend (assuming libzbackend_influxdb.so is available and InfluxDB running at http://localhost:8086)


curl -X PUT -H 'content-type:application/properties' -d 'url=http://localhost:8086'


http://localhost:8000/@/router/local/plugin/storages/backend/influxdb


# Add an InfluxDB storage using the database named "zenoh-example"


curl -X PUT -H 'content-type:application/properties' -d 'path_expr=/demo/example/**;db=zenoh-example'


http://localhost:8000/@/router/local/plugin/storages/backend/influxdb/storage/my-test


plugins
Plugins
A zenoh plugin is


• a library, loaded at start-up by the zenoh router (name: libzplugin_<id>.so)


• similar to zenoh application using the zenoh APIs (in RUST)


• using the router's runtime => no transport overhead


Existing plugins:


• REST plugin (packaged with zenoh deliverable)


• Storages plugin (packaged with zenoh deliverable)


• WebServer plugin:


• https://github.com/eclipse-zenoh/zenoh-plugin-webserver


• DDS plugin:


• https://github.com/eclipse-zenoh/zenoh-plugin-dds
Live Demo
zenoh
us-west.zenoh.io


/demo/us-west/**
us-east.zenoh.io


/demo/us-east/**
eu.zenoh.io


/demo/eu/**
ap.zenoh.io


/demo/ap/**
Example:


• Put data: curl -X PUT -d 'Hello World!' http://us-west.zenoh.io:8000/demo/eu/test


• Get data: curl http://ap.zenoh.io:8000/demo/*/test
us-west.zenoh.io


/demo/us-west/**
us-east.zenoh.io


/demo/us-east/**
eu.zenoh.io


/demo/eu/**
ap.zenoh.io


/demo/ap/**
Example:


• Get time series: curl http://us-west.zenoh.io:8000/demo/influxdb/**?(stoptime=now())


• Browse /public/**: http://eu.zenoh.io:8080/public
File system storage


/public/**
File system storage


/public/**
InfluxDB storage


/demo/influxdb/**
RocksDB storage


/demo/rocksdb/**
After addition of backends/storages:
References
Innovating Together

More Related Content

What's hot (20)

PDF
Side by Side with Elasticsearch & Solr, Part 2
Sematext Group, Inc.
 
PPTX
モノリスからマイクロサービスへの移行 ~ストラングラーパターンの検証~(Spring Fest 2020講演資料)
NTT DATA Technology & Innovation
 
PDF
分散トレーシング技術について(Open tracingやjaeger)
NTT Communications Technology Development
 
PDF
Docker実践入門
hiro nemu
 
PDF
全文検索でRedmineをさらに活用!
Kouhei Sutou
 
PDF
WebSocket / WebRTCの技術紹介
Yasuhiro Mawarimichi
 
PPTX
Orion Context Broker 20221220
Fermin Galan
 
PPTX
大量のデータ処理や分析に使えるOSS Apache Sparkのご紹介(Open Source Conference 2020 Online/Kyoto ...
NTT DATA Technology & Innovation
 
PDF
Fluentdのお勧めシステム構成パターン
Kentaro Yoshida
 
PDF
ログ+メトリック+トレースの組み合わせで構築する一元的なオブザーバビリティ
Elasticsearch
 
PPTX
Airflow at lyft
Tao Feng
 
PDF
ストリーム処理を支えるキューイングシステムの選び方
Yoshiyasu SAEKI
 
PDF
MySQL・PostgreSQLだけで作る高速あいまい全文検索システム
Kouhei Sutou
 
PPTX
Prometheus入門から運用まで徹底解説
貴仁 大和屋
 
PPTX
分析指向データレイク実現の次の一手 ~Delta Lake、なにそれおいしいの?~(NTTデータ テクノロジーカンファレンス 2020 発表資料)
NTT DATA Technology & Innovation
 
PDF
Nervesが開拓する「ElixirでIoT」の新世界
Hideki Takase
 
PDF
Kubernetesのしくみ やさしく学ぶ 内部構造とアーキテクチャー
Toru Makabe
 
PDF
Where狙いのキー、order by狙いのキー
yoku0825
 
PPTX
本当は恐ろしい分散システムの話
Kumazaki Hiroki
 
PDF
Running Apache Spark on Kubernetes: Best Practices and Pitfalls
Databricks
 
Side by Side with Elasticsearch & Solr, Part 2
Sematext Group, Inc.
 
モノリスからマイクロサービスへの移行 ~ストラングラーパターンの検証~(Spring Fest 2020講演資料)
NTT DATA Technology & Innovation
 
分散トレーシング技術について(Open tracingやjaeger)
NTT Communications Technology Development
 
Docker実践入門
hiro nemu
 
全文検索でRedmineをさらに活用!
Kouhei Sutou
 
WebSocket / WebRTCの技術紹介
Yasuhiro Mawarimichi
 
Orion Context Broker 20221220
Fermin Galan
 
大量のデータ処理や分析に使えるOSS Apache Sparkのご紹介(Open Source Conference 2020 Online/Kyoto ...
NTT DATA Technology & Innovation
 
Fluentdのお勧めシステム構成パターン
Kentaro Yoshida
 
ログ+メトリック+トレースの組み合わせで構築する一元的なオブザーバビリティ
Elasticsearch
 
Airflow at lyft
Tao Feng
 
ストリーム処理を支えるキューイングシステムの選び方
Yoshiyasu SAEKI
 
MySQL・PostgreSQLだけで作る高速あいまい全文検索システム
Kouhei Sutou
 
Prometheus入門から運用まで徹底解説
貴仁 大和屋
 
分析指向データレイク実現の次の一手 ~Delta Lake、なにそれおいしいの?~(NTTデータ テクノロジーカンファレンス 2020 発表資料)
NTT DATA Technology & Innovation
 
Nervesが開拓する「ElixirでIoT」の新世界
Hideki Takase
 
Kubernetesのしくみ やさしく学ぶ 内部構造とアーキテクチャー
Toru Makabe
 
Where狙いのキー、order by狙いのキー
yoku0825
 
本当は恐ろしい分散システムの話
Kumazaki Hiroki
 
Running Apache Spark on Kubernetes: Best Practices and Pitfalls
Databricks
 

Similar to Zenoh Tutorial (20)

PDF
"Taming the Dragon": Get Started with Zenoh
ZettaScaleTechnology
 
PDF
Guillotina: The Asyncio REST Resource API
Nathan Van Gheem
 
PDF
"Taming the Dragon": Zenoh's Genesis
ZettaScaleTechnology
 
PDF
Nell’iperspazio con Rocket: il Framework Web di Rust!
Commit University
 
PDF
"Taming the Dragon": Zenoh on Microcontrollers and Low Power Networks
ZettaScaleTechnology
 
PDF
Exploring Google APIs with Python
wesley chun
 
PDF
GOTO 2011 preso: 3x Hadoop
fvanvollenhoven
 
PDF
Fluentd v0.12 master guide
N Masahiro
 
KEY
Couchdb: No SQL? No driver? No problem
delagoya
 
PDF
Katello on TorqueBox
lzap
 
PDF
Fluentd Unified Logging Layer At Fossasia
N Masahiro
 
PDF
Introduction to MongoDB and Ruby
MongoDB
 
PDF
Building a Distributed Build System at Google Scale
Aysylu Greenberg
 
KEY
Polyglot parallelism
Phillip Toland
 
PDF
Exploring Google APIs with Python
wesley chun
 
PDF
Writing a REST Interconnection Library in Swift
Pablo Villar
 
PDF
Fluentd and Embulk Game Server 4
N Masahiro
 
PPTX
REST with Eve and Python
PiXeL16
 
PPT
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
guest517f2f
 
PPT
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Pamela Fox
 
"Taming the Dragon": Get Started with Zenoh
ZettaScaleTechnology
 
Guillotina: The Asyncio REST Resource API
Nathan Van Gheem
 
"Taming the Dragon": Zenoh's Genesis
ZettaScaleTechnology
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Commit University
 
"Taming the Dragon": Zenoh on Microcontrollers and Low Power Networks
ZettaScaleTechnology
 
Exploring Google APIs with Python
wesley chun
 
GOTO 2011 preso: 3x Hadoop
fvanvollenhoven
 
Fluentd v0.12 master guide
N Masahiro
 
Couchdb: No SQL? No driver? No problem
delagoya
 
Katello on TorqueBox
lzap
 
Fluentd Unified Logging Layer At Fossasia
N Masahiro
 
Introduction to MongoDB and Ruby
MongoDB
 
Building a Distributed Build System at Google Scale
Aysylu Greenberg
 
Polyglot parallelism
Phillip Toland
 
Exploring Google APIs with Python
wesley chun
 
Writing a REST Interconnection Library in Swift
Pablo Villar
 
Fluentd and Embulk Game Server 4
N Masahiro
 
REST with Eve and Python
PiXeL16
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
guest517f2f
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Pamela Fox
 
Ad

More from Angelo Corsaro (20)

PDF
Data Decentralisation: Efficiency, Privacy and Fair Monetisation
Angelo Corsaro
 
PDF
zenoh -- the ZEro Network OverHead protocol
Angelo Corsaro
 
PDF
Breaking the Edge -- A Journey Through Cloud, Edge and Fog Computing
Angelo Corsaro
 
PDF
Eastern Sicily
Angelo Corsaro
 
PDF
fog05: The Fog Computing Infrastructure
Angelo Corsaro
 
PDF
fog05: The Fog Computing Platform
Angelo Corsaro
 
PDF
Programming in Scala - Lecture Four
Angelo Corsaro
 
PDF
Programming in Scala - Lecture Three
Angelo Corsaro
 
PDF
Programming in Scala - Lecture Two
Angelo Corsaro
 
PDF
Programming in Scala - Lecture One
Angelo Corsaro
 
PDF
Data Sharing in Extremely Resource Constrained Envionrments
Angelo Corsaro
 
PDF
The DDS Security Standard
Angelo Corsaro
 
PDF
The Data Distribution Service
Angelo Corsaro
 
PDF
RUSTing -- Partially Ordered Rust Programming Ruminations
Angelo Corsaro
 
PDF
Vortex II -- The Industrial IoT Connectivity Standard
Angelo Corsaro
 
PDF
Fog Computing Defined
Angelo Corsaro
 
PDF
DDS In Action Part II
Angelo Corsaro
 
PDF
DDS in Action -- Part I
Angelo Corsaro
 
PDF
DDS and OPC UA Explained
Angelo Corsaro
 
PDF
The Cloudy, Foggy and Misty Internet of Things -- Toward Fluid IoT Architect...
Angelo Corsaro
 
Data Decentralisation: Efficiency, Privacy and Fair Monetisation
Angelo Corsaro
 
zenoh -- the ZEro Network OverHead protocol
Angelo Corsaro
 
Breaking the Edge -- A Journey Through Cloud, Edge and Fog Computing
Angelo Corsaro
 
Eastern Sicily
Angelo Corsaro
 
fog05: The Fog Computing Infrastructure
Angelo Corsaro
 
fog05: The Fog Computing Platform
Angelo Corsaro
 
Programming in Scala - Lecture Four
Angelo Corsaro
 
Programming in Scala - Lecture Three
Angelo Corsaro
 
Programming in Scala - Lecture Two
Angelo Corsaro
 
Programming in Scala - Lecture One
Angelo Corsaro
 
Data Sharing in Extremely Resource Constrained Envionrments
Angelo Corsaro
 
The DDS Security Standard
Angelo Corsaro
 
The Data Distribution Service
Angelo Corsaro
 
RUSTing -- Partially Ordered Rust Programming Ruminations
Angelo Corsaro
 
Vortex II -- The Industrial IoT Connectivity Standard
Angelo Corsaro
 
Fog Computing Defined
Angelo Corsaro
 
DDS In Action Part II
Angelo Corsaro
 
DDS in Action -- Part I
Angelo Corsaro
 
DDS and OPC UA Explained
Angelo Corsaro
 
The Cloudy, Foggy and Misty Internet of Things -- Toward Fluid IoT Architect...
Angelo Corsaro
 
Ad

Recently uploaded (20)

PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
July Patch Tuesday
Ivanti
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
July Patch Tuesday
Ivanti
 

Zenoh Tutorial

  • 1. Zero Overhead Pub/Sub Store/Query Compute Advanced Technology Office Angelo Corsaro, PhD Chief Technology Officer Luca Cominardi, PhD Senior Technologist Gabriele Baldoni Technologist Julien Enoch Senior Technologist Olivier Hecart Senior Technologist
  • 3. in Python Requires Python 3.6 minimum. Latest version (stable): • Available on pypi.org (https://pypi.org/project/eclipse-zenoh) • Binary wheels for x86_64, i686 and aarch64 • For other platforms: source distribution requiring Rust toolchain (https://www.rust-lang.org/tools/install) pip install eclipse-zenoh Version in development (master): • https://github.com/eclipse-zenoh/zenoh-python • Requires Rust toolchain (https://www.rust-lang.org/tools/install) pip install https://github.com/eclipse-zenoh/zenoh-python/zipball/master Code examples: • https://github.com/eclipse-zenoh/zenoh-python/tree/master/examples/zenoh
  • 4. router - in Docker Latest version (stable): docker pull eclipse/zenoh:latest Version in development (master): docker pull eclipse/zenoh:master Usage: docker run --init eclipse/zenoh --help docker run --init -p 7447:7447/tcp -p 7447:7447/udp -p 8000:8000/tcp eclipse/zenoh
  • 5. router - native Latest version (stable): • https://download.eclipse.org/zenoh/zenoh/latest • Files: eclipse-zenoh-<version>-<platform>.tgz (or .zip) Version in development (master): • https://download.eclipse.org/zenoh/zenoh/master • Files: eclipse-zenoh-<version>-<platform>.tgz (or .zip) zenohd --help RUST_LOG=info zenohd Usage:
  • 7. Peer-to-peer Peer Peer Peer Peer Peer • Multicast discovery • Unicast “neighbour to neighbour” discovery • Unicast “reference point” discovery from zenoh import Zenoh z = Zenoh({"mode": "peer"}) Clique Peer Peer Peer Peer Peer Available soon !!! Mesh Peer init in Python:
  • 8. Routed communication Client Client Client Client 
 Router from zenoh import Zenoh z = Zenoh({ "mode": "client", "peer": "tcp/127.0.0.1:7447" }) Client init in Python: zenohd Single router startup:
  • 10. Routers network Clique Mesh Available soon !!! 
 Router 
 Router 
 Router 
 Router 
 Router 
 Router 
 Router 
 Router 
 Router 
 Router zenohd 
 -e tcp/<host1>:7447 
 -e tcp/<host2>:7447 
 ... Connected router startup:
  • 11. Full picture Peer Peer Peer Peer Peer Peer Peer Peer Peer Peer Client Client Client 
 Router 
 Router 
 Router
  • 13. pub/sub in Python Publications are made via the put() operation: • See https://github.com/eclipse-zenoh/zenoh-python/blob/master/examples/zenoh/z_put.py from zenoh import Zenoh z = Zenoh({}) workspace = z.workspace() workspace.put("/demo/example/hi", "Hello World!") Subscriptions are made via the subscribe() operation: • See https://github.com/eclipse-zenoh/zenoh-python/blob/master/examples/zenoh/z_sub.py from zenoh import Zenoh, ChangeKind def listener(change): print("{} : {} (encoding: {} , timestamp: {})".format(change.path, "DELETED" if change.kind == ChangeKind.DELETE else change.value.get_content(), "none" if change.kind == ChangeKind.DELETE else change.value.encoding_descr(), change.timestamp)) z = Zenoh({}) workspace = z.workspace() workspace.subscribe("/demo/example/**", listener)
  • 14. Value types and encodings zenoh supports different value types. 
 Each has an encoding described by its mime-type: from zenoh import Zenoh import json z = Zenoh({}) workspace = z.workspace() # - String workspace.put('/demo/example/String', 'Hello World!') # - Integer workspace.put('/demo/example/Integer', 3) # - Float workspace.put('/demo/example/Float', 3.14) # - Properties (as a Dictionary with str only) workspace.put('/demo/example/Properties', {'p1': 'v1', 'p2': 'v2'}) # - Json (str format) workspace.put('/demo/example/Json', Value.Json(json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]))) # - Raw ('application/octet-stream' encoding by default) workspace.put('/demo/example/Raw', b'x48x69x21') # - Custom workspace.put('/demo/example/Custom', Value.Custom('my_encoding', b'x48x69x21'))
  • 16. Storages Peer Peer Peer Peer Peer Client Client Client 
 Router 
 Router 
 Router zenohd 
 --mem-storage '/a/b/**' 
 --mem-storage '/x/y/**' 
 ... Router with in-memory storages: • Deployed in router • Store publications matching its selector • Replies to queries /a/b/** /x/y/** put(/x/y/1) put(/a/b/2) get(a/b/*) g e t ( / x / y / * )
  • 17. pub/store/query in Python Deletions from storage are made via the delete() operation: • See https://github.com/eclipse-zenoh/zenoh-python/blob/master/examples/zenoh/z_delete.py from zenoh import Zenoh z = Zenoh({}) workspace = z.workspace() workspace.delete("/demo/example/hi") Publications are made via the put() operation (seen previously). Queries are made via the get() operation: • See https://github.com/eclipse-zenoh/zenoh-python/blob/master/examples/zenoh/z_get.py from zenoh import Zenoh z = Zenoh({}) workspace = z.workspace() for data in workspace.get("/demo/example/**"): print("{} : {} (encoding: {} , timestamp: {})".format( data.path, data.value.get_content(), data.value.encoding_descr(), data.timestamp))
  • 19. Compute Peer Peer Peer Peer Peer Client Client Client 
 Router 
 Router 
 Router • Eval function declared by zenoh applications that compute a value on demand • Called by queries register_eval(/x/y/z) get(a/b/*) g e t ( / x / y / * ) register_eval(/a/b/c)
  • 20. Compute/query in Python Queries are made via the get() operation (seen previously). Compute are declared via the register_eval() operation: • See https://github.com/eclipse-zenoh/zenoh-python/blob/master/examples/zenoh/z_eval.py import datetime from zenoh import Zenoh def eval_callback(get_request): get_request.reply("/demo/example/eval", "It's {}".format(datetime.datetime.now().time())) z = Zenoh({}) workspace = z.workspace() workspace.register_eval("/demo/example/eval", eval_callback)
  • 22. REST API Implemented as a plugin. Default port: 8080. 
 The zenoh put/get/delete operations map to the PUT/GET/DELETE HTTP methods. Example using the curl command: # Put a string value in /demo/example/test curl -X PUT -d 'Hello World!' http://localhost:8000/demo/example/test # Put a JSON value in /demo/example/json curl -X PUT -H "Content-Type: application/json" -d '{"value": "Hello World!"}' http://localhost:8000/demo/example/test # Put a Properties value in /demo/example/props curl -X PUT -H 'content-type:application/properties' -d 'k1=v1;k2=v2' http://localhost:8000/demo/example/props # Get the keys/values matching /demo/** curl http://localhost:8000/demo/** # Get the keys/values matching /demo/example/*eval (i.e. the zenoh eval examples) # with property name=Bob curl http://localhost:8000/demo/example/*eval?(name=Bob) # Delete key/value /demo/example/test curl -X DELETE http://localhost:8000/demo/example/test
  • 24. Backends A zenoh backend is: • a library, loaded on demand by the zenoh router (name: libzbackend_<id>.so) • a factory for zenoh storages • leveraging a speci fi c technology to implement storages Existing backends: • In-memory: built-in in zenoh router • File system: • https://github.com/eclipse-zenoh/zenoh-backend- fi lesystem • RocksDB: • https://github.com/eclipse-zenoh/zenoh-backend-rocksdb • In fl uxDB: • https://github.com/eclipse-zenoh/zenoh-backend-in fl uxdb
  • 25. Admin space zenoh admin space: 
 •A zenoh key/value space with under /@/** 
 •Addressable via zenoh APIs 
 using put/get/delete operations 
 •Each router addressable via its ID, or the "local" keyword for the router an API is connected to /@/router/1a2b3c.../plugin/storages /backend /memory /rocksdb /<beid> /storage /storage /s2 /s1 ... ... /storage /db2 /db1 ... # Get local router's info curl http://localhost:8000/@/router/local # Get all routers' of the system curl http://localhost:8000/@/router/* # Get local router's storages info curl http://localhost:8000/@/router/local/**/storages/** Examples using the REST API:
  • 26. Backends/storages management Examples using the REST API: # Add a memory storage curl -X PUT -H 'content-type:application/properties' -d 'path_expr=/demo/test/**' 
 http://localhost:8000/@/router/local/plugin/storages/backend/memory/storage/my-test # Add a FileSystem backend (assuming libzbackend_fs.so is available) curl -X PUT -H 'content-type:application/properties' 
 http://localhost:8000/@/router/local/plugin/storages/backend/fs # Add a FileSystem storage curl -X PUT -H 'content-type:application/properties' -d 'path_expr=/demo/example/**;path_prefix=/demo/example;dir=test' 
 http://localhost:8000/@/router/local/plugin/storages/backend/fs/storage/my-test # Add an InfluxDB backend (assuming libzbackend_influxdb.so is available and InfluxDB running at http://localhost:8086) curl -X PUT -H 'content-type:application/properties' -d 'url=http://localhost:8086' 
 http://localhost:8000/@/router/local/plugin/storages/backend/influxdb # Add an InfluxDB storage using the database named "zenoh-example" curl -X PUT -H 'content-type:application/properties' -d 'path_expr=/demo/example/**;db=zenoh-example' 
 http://localhost:8000/@/router/local/plugin/storages/backend/influxdb/storage/my-test
  • 28. Plugins A zenoh plugin is • a library, loaded at start-up by the zenoh router (name: libzplugin_<id>.so) • similar to zenoh application using the zenoh APIs (in RUST) • using the router's runtime => no transport overhead Existing plugins: • REST plugin (packaged with zenoh deliverable) • Storages plugin (packaged with zenoh deliverable) • WebServer plugin: • https://github.com/eclipse-zenoh/zenoh-plugin-webserver • DDS plugin: • https://github.com/eclipse-zenoh/zenoh-plugin-dds
  • 30. us-west.zenoh.io 
 /demo/us-west/** us-east.zenoh.io 
 /demo/us-east/** eu.zenoh.io 
 /demo/eu/** ap.zenoh.io /demo/ap/** Example: • Put data: curl -X PUT -d 'Hello World!' http://us-west.zenoh.io:8000/demo/eu/test • Get data: curl http://ap.zenoh.io:8000/demo/*/test
  • 31. us-west.zenoh.io 
 /demo/us-west/** us-east.zenoh.io 
 /demo/us-east/** eu.zenoh.io 
 /demo/eu/** ap.zenoh.io /demo/ap/** Example: • Get time series: curl http://us-west.zenoh.io:8000/demo/influxdb/**?(stoptime=now()) • Browse /public/**: http://eu.zenoh.io:8080/public File system storage 
 /public/** File system storage 
 /public/** InfluxDB storage 
 /demo/influxdb/** RocksDB storage 
 /demo/rocksdb/** After addition of backends/storages: