jhelovuo / RustDDS

Rust implementation of Data Distribution Service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running RustDDS only on localhost

raidv opened this issue · comments

commented

Hi. I have a local setup where I have RustDDS running in one program, reading data from serial and forwarding it over DDS. The receiving end is running node-openDDS implementation. Everything works fine when any of the physical NICs are switched on and connected (Ethernet cable plugged in or WiFi connected).
Whenever I disconnect the physical interface, I get the following warning on RustDDS side:

[2022-07-14T07:38:03Z WARN rustdds::network::udp_sender] send_to_locator - send_to 239.255.0.1:19900 : Os { code: 101, kind: NetworkUnreachable, message: "Network is unreachable" }

In this state there are no more messages published according to wireshark.

The same behaviour occurs when I disable the interfaces from terminal (ip link set $IF down)

As I understand (also mentioned here) DDS discovery is sent over all non-loopback interfaces (so, by default no localhost?).
Is there a possibility to do all the communication on localhost and is this RustDDS specific problem or something that conflicts with the whole RTPS protocol on a level I have yet to understand?
I seem to find little to none documentation of similar issues on the internet.

Loopback interface is not used, because RTPS Discovery works over multicast, and loopback interfaces do not support that.

Some possible solutions:

  1. Do not use Discovery, but configure the endpoints manually (or from your application code). Some DDS libraries support this, but RustDDS does not (yet) have it. Maybe you could implement such a feature?
  2. Many DDS implementations do localhost communication using shared memory and bypass the network stack altogether, but AFAIK this is not standardised and does not work across different implementations. If such a shared-memory commincation specification were available, maybe RustDDS could implement that and even be compatible with someone else.
commented

Ok. So currently not possible. I do not see myself in the near future implementing neither of the proposed solutions.
Leaving the issue currently open in case someone else stumbles on it (and decides to implement a solution to it). Feel free to close it if need be.