ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How does ROS optimize topic routes in multi-machine setups?

asked 2021-06-28 20:37:26 -0500

cwillia109 gravatar image

Let's say I have 3 ROS1 nodes all publishing and subscribing to the same topic. 2 of them are running on the same machine and the last on another, and both machines are connected via a router. Will the 2 nodes on the same machine communicate over lo for the least amount of latency? If not, and if all 3 nodes are running on the same machine, but the ROS_IP is set to its router-provided IP address, will all 3 communicate over the router?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-06-29 02:37:02 -0500

gvdhoorn gravatar image

updated 2021-06-29 02:38:31 -0500

Let's say I have 3 ROS1 nodes all publishing and subscribing to the same topic. 2 of them are running on the same machine and the last on another, and both machines are connected via a router. Will the 2 nodes on the same machine communicate over lo for the least amount of latency?

Likely, but it's mostly up to the networking stack of the OS to determine what the "best" route is for packets to reach their destination.

If not, and if all 3 nodes are running on the same machine, but the ROS_IP is set to its router-provided IP address, will all 3 communicate over the router?

I personally don't know any IP stack which would send traffic across a remote host if the destination for that traffic is a local address.

In other words: the router is / should not be involved at all if the destination of a packet is a local address.

But it's not ROS which "notices" or "optimises" this. That's basic IP networking.

How does ROS optimize topic routes in multi-machine setups?

The direct answer here would be: it doesn't, as that's not one of its responsibilities.

It's the underlying OS and its network stack which determine what happens in this case.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-06-28 20:37:26 -0500

Seen: 140 times

Last updated: Jun 29 '21