Basic session example
This is a clean example of a Zenoh session configuration file. While you can further optimize your connection, this setup should enable you to connect your remote computer to the robots successfully.
{
mode: "peer",
connect: {
timeout_ms: { router: -1, peer: -1, client: 0 },
endpoints: [
"tcp/localhost:7447"
],
exit_on_failure: { router: false, peer: false, client: true },
retry: {
period_init_ms: 1000,
period_max_ms: 4000,
period_increase_factor: 2,
},
},
listen: {
timeout_ms: 0,
endpoints: [
///"tcp/localhost:0"
"tcp/[::]:0"
],
exit_on_failure: true,
retry: {
period_init_ms: 1000,
period_max_ms: 4000,
period_increase_factor: 2,
},
},
open: {
return_conditions: {
connect_scouted: true,
declares: true,
},
},
scouting: {
timeout: 3000,
delay: 500,
multicast: {
enabled: false,
address: "224.0.0.224:7446",
interface: "auto", // If not set or set to "auto" the interface if picked automatically
ttl: 1,
autoconnect: { router: [], peer: ["router", "peer"] },
listen: true,
},
gossip: {
enabled: true,
multihop: false,
autoconnect: { router: [], peer: ["router", "peer"] },
},
},
timestamping: {
enabled: { router: true, peer: true, client: true },
drop_future_timestamp: false,
},
queries_default_timeout: 10000,
routing: {
router: {
peers_failover_brokering: true,
},
peer: {
mode: "peer_to_peer",
},
},
transport: {
unicast: {
open_timeout: 10000,
accept_timeout: 10000,
accept_pending: 100,
max_sessions: 1000,
max_links: 1,
lowlatency: false,
qos: {
enabled: true,
},
compression: {
enabled: false,
},
},
multicast: {
join_interval: 2500,
max_sessions: 1000,
qos: {
enabled: false,
},
compression: {
enabled: false,
},
},
link: {
tx: {
sequence_number_resolution: "32bit",
lease: 10000,
keep_alive: 4,
batch_size: 65535,
queue: {
size: {
control: 1,
real_time: 1,
interactive_high: 1,
interactive_low: 1,
data_high: 2,
data: 4,
data_low: 4,
background: 4,
},
congestion_control: {
drop: {
wait_before_drop: 1000,
max_wait_before_drop_fragments: 50000,
},
block: {
wait_before_close: 5000000,
},
},
batching: {
enabled: true,
time_limit: 1,
},
},
},
rx: {
buffer_size: 65535,
max_message_size: 1073741824,
},
tls: {
root_ca_certificate: null,
listen_private_key: null,
listen_certificate: null,
enable_mtls: false,
connect_private_key: null,
connect_certificate: null,
verify_name_on_connect: true,
close_link_on_expiration: false,
},
},
shared_memory: {
enabled: false,
},
auth: {
usrpwd: {
user: null,
password: null,
dictionary_file: null,
},
pubkey: {
public_key_pem: null,
private_key_pem: null,
public_key_file: null,
private_key_file: null,
key_size: null,
known_keys_file: null,
},
},
},
adminspace: {
enabled: true,
permissions: {
read: true,
write: false,
},
},
}
Zenoh Session Configuration Reference
Identifier
- ID:
"1234567890abcdef"
- Type: Unsigned 128-bit integer in lowercase hexadecimal (no leading zeros)
- If not set, a random ID is used
- Warning: Must be unique in the Zenoh network
Node Mode
- mode:
"peer"
- Options:
router
, peer
, client
Connection Configuration
Connect
Parameter |
Value |
Notes |
timeout_ms |
{ router: -1, peer: -1, client: 0 } |
Timeout per mode (-1 = infinite) |
endpoints |
["tcp/localhost:7447"] |
List of endpoints to connect to |
exit_on_failure |
{ router: false, peer: false, client: true } |
Whether to exit if connection fails |
retry.period_init_ms |
1000 |
Initial retry delay |
retry.period_max_ms |
4000 |
Max retry delay |
retry.period_increase_factor |
2 |
Retry delay backoff factor |
Listen
Parameter |
Value |
Notes |
timeout_ms |
0 |
Timeout for listening |
endpoints |
["tcp/localhost:0"] |
List of endpoints to listen on |
exit_on_failure |
true |
Exit if listen fails |
retry.period_init_ms |
1000 |
Initial retry delay |
retry.period_max_ms |
4000 |
Max retry delay |
retry.period_increase_factor |
2 |
Retry backoff factor |
Session Behavior
Open
Parameter |
Value |
Notes |
connect_scouted |
true |
Wait for scouted peers/routers |
declares |
true |
Wait for peer declares |
Discovery (Scouting)
Timeout and Delay
Parameter |
Value |
timeout |
3000 ms |
delay |
500 ms |
Multicast Scouting
Parameter |
Value |
enabled |
false |
address |
"224.0.0.224:7446" |
interface |
"auto" |
ttl |
1 |
autoconnect.router |
[] |
autoconnect.peer |
["router", "peer"] |
listen |
true |
Gossip Scouting
Parameter |
Value |
enabled |
true |
multihop |
false |
autoconnect.router |
[] |
autoconnect.peer |
["router", "peer"] |
Timestamping
Parameter |
Value |
enabled |
{ router: true, peer: true, client: true } |
drop_future_timestamp |
false |
Query Configuration
- queries_default_timeout:
10000 ms
Routing
Router Routing
Parameter |
Value |
peers_failover_brokering |
true |
Peer Routing
Parameter |
Value |
mode |
"peer_to_peer" |
Transport Configuration
Unicast Transport
Parameter |
Value |
Notes |
open_timeout |
10000 ms |
Timeout when opening a link |
accept_timeout |
10000 ms |
Timeout when accepting a link |
accept_pending |
100 |
Max pending sessions |
max_sessions |
1000 |
Max alive sessions |
max_links |
1 |
Max incoming links per session |
lowlatency |
false |
Incompatible with QoS |
qos.enabled |
true |
Enables QoS |
compression.enabled |
false |
Enables compression |
Multicast Transport
Parameter |
Value |
Notes |
join_interval |
2500 ms |
JOIN message interval |
max_sessions |
1000 |
Max multicast sessions |
qos.enabled |
false |
QoS default false for compatibility |
compression.enabled |
false |
Compression default false |
Link Configuration
TX Parameters
Parameter |
Value |
Notes |
sequence_number_resolution |
"32bit" |
Can be 8, 16, 32, or 64 bit |
lease |
10000 ms |
Link lease duration |
keep_alive |
4 |
# of keep-alives per lease |
batch_size |
65535 |
Max 16-bit size |
TX Queue Size
Priority |
Size |
control |
1 |
real_time |
1 |
interactive_high |
1 |
interactive_low |
1 |
data_high |
2 |
data |
4 |
data_low |
4 |
background |
4 |
Congestion Control
Control Type |
Parameter |
Value |
Drop |
wait_before_drop |
1000 µs |
Drop |
max_wait_before_drop_fragments |
50000 µs |
Block |
wait_before_close |
5000000 µs |
Batching
Parameter |
Value |
enabled |
true |
time_limit |
1 ms |
RX Parameters
Parameter |
Value |
Notes |
buffer_size |
65535 |
Recommended to increase for high throughput |
max_message_size |
1073741824 |
Default is 1GiB |
TLS Configuration
Parameter |
Value |
root_ca_certificate |
null |
listen_private_key |
null |
listen_certificate |
null |
enable_mtls |
false |
connect_private_key |
null |
connect_certificate |
null |
verify_name_on_connect |
true |
close_link_on_expiration |
false |
so_rcvbuf / so_sndbuf |
optional |
Shared Memory
Parameter |
Value |
enabled |
false |
Authentication
Username/Password
Parameter |
Value |
user |
null |
password |
null |
dictionary_file |
null |
Public Key Auth
Parameter |
Value |
public_key_pem |
null |
private_key_pem |
null |
public_key_file |
null |
private_key_file |
null |
key_size |
null |
known_keys_file |
null |
Admin Space
Parameter |
Value |
enabled |
true |
permissions.read |
true |
permissions.write |
false |