diff --git a/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_ROUTER_CONFIG.json5 b/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_ROUTER_CONFIG.json5 index f100eff6..22c1b2e3 100644 --- a/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_ROUTER_CONFIG.json5 +++ b/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_ROUTER_CONFIG.json5 @@ -135,11 +135,11 @@ /// Accepts a single value (e.g. autoconnect: ["router", "peer"]) /// or different values for router, peer and client (e.g. autoconnect: { router: [], peer: ["router", "peer"] }). /// Each value is a list of: "peer", "router" and/or "client". - autoconnect: { router: [], peer: ["router", "peer"] }, + autoconnect: { router: [], peer: ["router", "peer"], client: ["router"] }, /// Whether or not to listen for scout messages on UDP multicast and reply to them. listen: true, }, - /// The gossip scouting configuration. + /// The gossip scouting configuration. Note that instances in "client" mode do not participate in gossip. gossip: { /// Whether gossip scouting is enabled or not enabled: true, @@ -149,10 +149,17 @@ /// It mostly makes sense when using "linkstate" routing mode where all nodes in the subsystem don't have /// direct connectivity with each other. multihop: false, + /// Which type of Zenoh instances to send gossip messages to. + /// Accepts a single value (e.g. target: ["router", "peer"]) which applies whatever the configured "mode" is, + /// or different values for router or peer mode (e.g. target: { router: ["router", "peer"], peer: ["router"] }). + /// Each value is a list of "peer" and/or "router". + /// ROS setting: by default all peers rely on the router to discover each other. Thus configuring the peer to send gossip + /// messages only to the router is sufficient and avoids unecessary traffic between Nodes at launch time. + target: { router: ["router", "peer"], peer: ["router"]}, /// Which type of Zenoh instances to automatically establish sessions with upon discovery on gossip. /// Accepts a single value (e.g. autoconnect: ["router", "peer"]) - /// or different values for router, peer and client (e.g. autoconnect: { router: [], peer: ["router", "peer"] }). - /// Each value is a list of: "peer", "router" and/or "client". + /// or different values for router or peer mode (e.g. autoconnect: { router: [], peer: ["router", "peer"] }). + /// Each value is a list of: "peer" and/or "router". autoconnect: { router: [], peer: ["router", "peer"] }, }, }, @@ -191,6 +198,14 @@ /// The routing strategy to use in peers. ("peer_to_peer" or "linkstate"). mode: "peer_to_peer", }, + /// The interests-based routing configuration. + /// This configuration applies regardless of the mode (router, peer or client). + interests: { + /// The timeout to wait for incoming interests declarations in milliseconds. + /// The expiration of this timeout implies that the discovery protocol might be incomplete, + /// leading to potential loss of messages, queries or liveliness tokens. + timeout: 10000, + }, }, // /// Overwrite QoS options for Zenoh messages by key expression (ignores Zenoh API QoS config for overwritten values) @@ -343,11 +358,11 @@ open_timeout: 10000, /// Timeout in milliseconds when accepting a link accept_timeout: 10000, - /// Maximum number of zenoh session in pending state while accepting + /// Maximum number of links in pending state while performing the handshake for accepting it accept_pending: 100, - /// Maximum number of sessions that can be simultaneously alive + /// Maximum number of transports that can be simultaneously alive for a single zenoh sessions max_sessions: 1000, - /// Maximum number of incoming links that are admitted per session + /// Maximum number of incoming links that are admitted per transport max_links: 1, /// Enables the LowLatency transport /// This option does not make LowLatency transport mandatory, the actual implementation of transport @@ -429,14 +444,14 @@ /// then amount of memory being allocated for each queue is SIZE_XXX * LINK_MTU. /// If qos is false, then only the DATA priority will be allocated. size: { - control: 1, - real_time: 1, - interactive_high: 1, - interactive_low: 1, + control: 2, + real_time: 2, + interactive_high: 2, + interactive_low: 2, data_high: 2, - data: 4, - data_low: 4, - background: 4, + data: 2, + data_low: 2, + background: 2, }, /// Congestion occurs when the queue is empty (no available batch). congestion_control: { @@ -464,6 +479,12 @@ /// The maximum time limit (in ms) a message should be retained for batching when back-pressure happens. time_limit: 1, }, + allocation: { + /// Mode for memory allocation of batches in the priority queues. + /// - "init": batches are allocated at queue initialization time. + /// - "lazy": batches are allocated when needed up to the maximum number of batches configured in the size configuration parameter. + mode: "lazy", + }, }, }, /// Configure the zenoh RX parameters of a link diff --git a/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5 b/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5 index eea7c67d..ef38e538 100644 --- a/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5 +++ b/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5 @@ -140,11 +140,11 @@ /// Accepts a single value (e.g. autoconnect: ["router", "peer"]) /// or different values for router, peer and client (e.g. autoconnect: { router: [], peer: ["router", "peer"] }). /// Each value is a list of: "peer", "router" and/or "client". - autoconnect: { router: [], peer: ["router", "peer"] }, + autoconnect: { router: [], peer: ["router", "peer"], client: ["router"] }, /// Whether or not to listen for scout messages on UDP multicast and reply to them. listen: true, }, - /// The gossip scouting configuration. + /// The gossip scouting configuration. Note that instances in "client" mode do not participate in gossip. gossip: { /// Whether gossip scouting is enabled or not enabled: true, @@ -154,10 +154,17 @@ /// It mostly makes sense when using "linkstate" routing mode where all nodes in the subsystem don't have /// direct connectivity with each other. multihop: false, + /// Which type of Zenoh instances to send gossip messages to. + /// Accepts a single value (e.g. target: ["router", "peer"]) which applies whatever the configured "mode" is, + /// or different values for router or peer mode (e.g. target: { router: ["router", "peer"], peer: ["router"] }). + /// Each value is a list of "peer" and/or "router". + /// ROS setting: by default all peers rely on the router to discover each other. Thus configuring the peer to send gossip + /// messages only to the router is sufficient and avoids unecessary traffic between Nodes at launch time. + target: { router: ["router", "peer"], peer: ["router"]}, /// Which type of Zenoh instances to automatically establish sessions with upon discovery on gossip. /// Accepts a single value (e.g. autoconnect: ["router", "peer"]) - /// or different values for router, peer and client (e.g. autoconnect: { router: [], peer: ["router", "peer"] }). - /// Each value is a list of: "peer", "router" and/or "client". + /// or different values for router or peer mode (e.g. autoconnect: { router: [], peer: ["router", "peer"] }). + /// Each value is a list of: "peer" and/or "router". autoconnect: { router: [], peer: ["router", "peer"] }, }, }, @@ -194,6 +201,14 @@ /// The routing strategy to use in peers. ("peer_to_peer" or "linkstate"). mode: "peer_to_peer", }, + /// The interests-based routing configuration. + /// This configuration applies regardless of the mode (router, peer or client). + interests: { + /// The timeout to wait for incoming interests declarations in milliseconds. + /// The expiration of this timeout implies that the discovery protocol might be incomplete, + /// leading to potential loss of messages, queries or liveliness tokens. + timeout: 10000, + }, }, // /// Overwrite QoS options for Zenoh messages by key expression (ignores Zenoh API QoS config for overwritten values) @@ -346,11 +361,11 @@ open_timeout: 10000, /// Timeout in milliseconds when accepting a link accept_timeout: 10000, - /// Maximum number of zenoh session in pending state while accepting + /// Maximum number of links in pending state while performing the handshake for accepting it accept_pending: 100, - /// Maximum number of sessions that can be simultaneously alive + /// Maximum number of transports that can be simultaneously alive for a single zenoh sessions max_sessions: 1000, - /// Maximum number of incoming links that are admitted per session + /// Maximum number of incoming links that are admitted per transport max_links: 1, /// Enables the LowLatency transport /// This option does not make LowLatency transport mandatory, the actual implementation of transport @@ -432,14 +447,14 @@ /// then amount of memory being allocated for each queue is SIZE_XXX * LINK_MTU. /// If qos is false, then only the DATA priority will be allocated. size: { - control: 1, - real_time: 1, - interactive_high: 1, - interactive_low: 1, + control: 2, + real_time: 2, + interactive_high: 2, + interactive_low: 2, data_high: 2, - data: 4, - data_low: 4, - background: 4, + data: 2, + data_low: 2, + background: 2, }, /// Congestion occurs when the queue is empty (no available batch). congestion_control: { @@ -467,6 +482,12 @@ /// The maximum time limit (in ms) a message should be retained for batching when back-pressure happens. time_limit: 1, }, + allocation: { + /// Mode for memory allocation of batches in the priority queues. + /// - "init": batches are allocated at queue initialization time. + /// - "lazy": batches are allocated when needed up to the maximum number of batches configured in the size configuration parameter. + mode: "lazy", + }, }, }, /// Configure the zenoh RX parameters of a link diff --git a/zenoh_cpp_vendor/CMakeLists.txt b/zenoh_cpp_vendor/CMakeLists.txt index 75a5ee2f..ec04e52d 100644 --- a/zenoh_cpp_vendor/CMakeLists.txt +++ b/zenoh_cpp_vendor/CMakeLists.txt @@ -17,14 +17,14 @@ find_package(ament_cmake_vendor_package REQUIRED) # when expanded. set(ZENOHC_CARGO_FLAGS "--no-default-features$--features=shared-memory zenoh/transport_compression zenoh/transport_tcp zenoh/transport_tls") -# Set VCS_VERSION to include latest changes from zenoh/zenoh-c to benefit from : -# - https://github.com/eclipse-zenoh/zenoh/pull/1685 (Fix deadlock in advanced subscription undeclaration) -# - https://github.com/eclipse-zenoh/zenoh/pull/1696 (Fix SHM Garbage Collection (GC) policy) -# - https://github.com/eclipse-zenoh/zenoh/pull/1708 (Fix gossip with TLS endpoints) -# - https://github.com/eclipse-zenoh/zenoh/pull/1717 (Improve performance of a large number of peers) +# Set VCS_VERSION to include latest changes from zenoh/zenoh-c/zenoh-cpp to benefit from : +# - https://github.com/eclipse-zenoh/zenoh/pull/173 (Improve config to support priorities range in locators) +# - https://github.com/eclipse-zenoh/zenoh/pull/1736, https://github.com/eclipse-zenoh/zenoh/pull/1735, +# https://github.com/eclipse-zenoh/zenoh/pull/1744, https://github.com/eclipse-zenoh/zenoh/pull/1749, +# https://github.com/eclipse-zenoh/zenoh/pull/1751 (Improve performance of a large number of peers) ament_vendor(zenoh_c_vendor VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git - VCS_VERSION 328736fe9bb9b654b1d9f47eecfc6d52f0d7d587 + VCS_VERSION 5fce7fb1d397e016ad02a50bde4262007d755424 CMAKE_ARGS "-DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}" "-DZENOHC_BUILD_WITH_UNSTABLE_API=TRUE" @@ -33,12 +33,9 @@ ament_vendor(zenoh_c_vendor ament_export_dependencies(zenohc) -# Set VCS_VERSION to include latest changes from zenoh-cpp to benefit from : -# - https://github.com/eclipse-zenoh/zenoh-cpp/pull/342 (Fix include what you use) -# - https://github.com/eclipse-zenoh/zenoh-cpp/pull/363 (Fix memory leak in string deserialization) ament_vendor(zenoh_cpp_vendor VCS_URL https://github.com/eclipse-zenoh/zenoh-cpp - VCS_VERSION bbfef04e843289aae70b5aa060a925e8ee5b1b6f + VCS_VERSION bd4d741c6c4fa6509d8d745e22c3c50b4306bd65 CMAKE_ARGS -DZENOHCXX_ZENOHC=OFF )