How eclipse-zenoh/zenoh-pico works
Zenoh-Pico is a native C implementation of Zenoh for constrained devices. Applications open a session, declare publishers, subscribers, queryables or liveliness entities, then publish samples or issue queries; matching data and replies are delivered through session and transport layers to local or remote peers. The principal stages are API/session setup, data and query operations, protocol encoding, transport, and platform links. The README also describes storage/query and compute capabilities, but the excerpts do not establish a separate storage engine. Some subsystem links below reflect module responsibilities and documented capabilities; unsampled call wiring is not inferred.
Main entry points: link.c Link selection · manager.c Transport setup · query.c Query and reply · unicast.c Unicast transport
Components 24
Application API
- C API
src/api/api.c - Publish and subscribe
- Query and reply
src/net/query.c - Admin and liveliness
src/api/admin_space.c
Session operations
- Session state
src/net/session.c - Subscriptions and samples
src/session/subscription.c - Query tracking
src/session/query.c - Queryable matching
src/session/queryable.c - Key expressions
src/session/keyexpr.c - Liveliness
src/session/liveliness.c - Local delivery
src/session/loopback.c
Protocol and transport
- Wire codec
src/protocol/codec.c - Protocol messages
src/protocol/definitions/message.c - Transport setup
src/transport/manager.c - Unicast transport
src/transport/unicast.c - Multicast transport
src/transport/multicast.c
Platform links
- Link selection
src/link/link.c - TCP links
src/link/unicast/tcp.c - UDP links
src/link/unicast/udp.c - Serial links
src/link/unicast/serial.c - WebSocket links
src/link/unicast/ws.c - Platform networking
src/system/common/platform.c
Other components
- Application
- Zenoh peers
Connections 25
- Application → C API: calls
- C API → Session state: opens session
- Application → Publish and subscribe: publishes data
- Application → Query and reply: issues queries
- Application → Admin and liveliness: manages entities
- Query and reply → Local delivery: delivers locally
- Query and reply → Query tracking: tracks replies
- Subscriptions and samples → Key expressions: matches keys
- Queryable matching → Key expressions: matches keys
- Session state → Transport setup: opens transport
- Transport setup → Unicast transport: creates
- Transport setup → Multicast transport: creates
- Unicast transport → Wire codec: encodes messages
- Multicast transport → Wire codec: encodes messages
- Wire codec → Protocol messages: serializes
- Transport setup → Link selection: selects link
- Link selection → TCP links: opens TCP
- Link selection → UDP links: opens UDP
- Link selection → Serial links: opens serial
- Link selection → WebSocket links: opens WebSocket
- TCP links → Platform networking: uses platform networking
- UDP links → Platform networking: uses platform networking
- Unicast transport → Zenoh peers: exchanges messages
- Multicast transport → Zenoh peers: exchanges messages
- Liveliness → Session state: uses session