Collaborate on good documentation ( Zenoh book ) #184
jcos1
started this conversation in
Ideas and new features
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Some notes to get started (at a lower level) ...
Intro
To send a resource to a zenoh router, various messages need to be exhanged between the zenoh client and the zenoh router.
First four handshake messages are sent. These are the Message ❱ InitSyn, the Message ❱ InitAck*)*, the Message ❱ OpenSyn and the Message ❱ OpenAck.
Then a Message ❱ Frame can be sent. One type of frame is a Message ❱ Frame ❱ Push. A push frame can contain a Message ❱ Frame ❱ Push ❱ Put. This put will publish a resource (some payload on some resource key).
So to publish a value we will need the following messages:
Transports
The messages can be implemented for different transports. These transports are described over here at
io/zenoh-links
Message
We will now have a look at the messages on TCP.
Each Zenoh TCP message starts with 2 bytes indicating the length (little-endian).
This is followed by a byte containing some flags and an ID to indicate what is inside the message.
The possible types of messages are defined here at
commons/zenoh-protocol/src/transport
The IDs for these messages are defined here at commons/zenoh-protocol/src/transport/mod.rs
Message ❱ Init (Syn and Ack)
These messages are described over here at commons/zenoh-protocol/src/transport/init.rs
Message ❱ Open (Syn and Ack)
These message are described over here at commons/zenoh-protocol/src/transport/open.rs
Message ❱ KeepAlive
KeepAlive messages are sent by both client and router to keep the connection alive.
The keep alive message is described over here at commons/zenoh-protocol/src/transport/keepalive.rs
Message ❱ Frame
A Message ❱ Frame starts with a byte containing an ID to indicate what is inside the frame.
The first three bits of this byte are used to set some flags for the frame.
The possible types of frames are defined here at commons/zenoh-protocol/src/network
The IDs for these frames are defined here at commons/zenoh-protocol/src/network/mod.rs
Message ❱ Frame ❱ Declare
The Message ❱ Frame ❱ Declare contains a declaration. These are defined over here at
commons/zenoh-protocol/src/network/declare.rs
This declaration can be one of these.
The IDs for these declarations are defined here at
commons/zenoh-protocol/src/network/declare.rs
Example: a Message ❱ Frame ❱ Declare ❱ D_SUBSCRIBER message is sent to subscribe to a certain key expression.
Example: a Message ❱ Frame ❱ Declare ❱ D_KEYEXPR message is sent to map a resource key (aka topic name) to a short number. This is very useful when sending data repeatedly because it reduces the message size alot.
Message ❱ Frame ❱ Push
The possible types of Message ❱ Frame ❱ Push message are defined here at commons/zenoh-protocol/src/zenoh
Example: a Message ❱ Frame ❱ Push ❱ Put message is sent to publish a certain key.
Message ❱ Frame ❱ Request ❱ Query
There is only one type of Message ❱ Frame ❱ Request message. This is described over here at commons/zenoh-protocol/src/zenoh
The other types were removed from the protocol:
Message ❱ Frame ❱ Response
There are two types of Message ❱ Frame ❱ Response message. This is described over here at commons/zenoh-protocol/src/zenoh
TO BE DOCUMENTED
There are some other IDs for possible frame bodies defined over here at commons/zenoh-protocol/src/zenoh/mod.rs
Testing and troubleshooting
Zenoh swiss army knife CLI Tool
Zenoh-hammer (aka MQTT Explorer for zenoh)
All reactions