The primary role of the Zenoh router is to act as a discovery service for ROS nodes running on the same host. When a node starts, it automatically tries to connect to the local Zenoh router. If the connection fails, the node waits until the router becomes available. The router shares the locators (IP + port) of each node with others, allowing them to automatically establish peer-to-peer connections. Once nodes are connected, they no longer need the router to communicate with each other.
To test this, open three different terminals within the same container (using the login_container.sh script under the docker directory) and run the demo_nodes_cpp package’s talker and listener:
ros2 run rmw_zenoh_cpp rmw_zenohdros2 run demo_nodes_cpp talkerros2 run demo_nodes_cpp listenerCTRL+C to stop the Zenoh router. The talker and listener will continue exchanging messages without the router.[!NOTE] The router may be started after the Nodes! Each Node periodically tries to connect to the router. As soon as the router discovers the Nodes, it propagates their endpoints to each other via a gossip protocol and each peer establish a direct connection with each other peer.

You can also test with a ROS service:
ros2 run demo_nodes_cpp add_two_ints_serverros2 run demo_nodes_cpp add_two_ints_clientAnd with an Action:
ros2 run action_tutorials_cpp fibonacci_action_serverros2 run action_tutorials_cpp fibonacci_action_clientAdditionally, you can use the ros2 command-line tool to inspect the system:
ros2 node listros2 topic listros2 service listros2 action listEven if the Zenoh router is stopped, the ros2 command-line tool will continue to function.
Why?