Fast-DDS icon indicating copy to clipboard operation
Fast-DDS copied to clipboard

[21899] SHM-only tranport (host id) is dependent from the real IPv4 adresses

Open lexamor opened this issue 4 months ago • 2 comments

Is there an already existing issue for this?

  • [X] I have searched the existing issues

Expected behavior

SHM (only) transport should work on the same host independently if network interfaces have assigned IPv4 addresses or not.

Current behavior

All SHM locators are filtered out because Participants are considered to belong to different hosts, but this is not the case.

Steps to reproduce

  1. Two DomainParticpinats (with the same QoS values, domain_id, etc) are always instantiated on the same (Linux) host, belong to different processes, and are executed under the same user.
  2. No network connection (WiFi or Ethernet) is established
  3. Set DomainParticipants QoS to use only shared memory transport. i.e
    DomainParticipantQos pqos = fastdds::PARTICIPANT_QOS_DEFAULT;
    pqos.transport().use_builtin_transports = false;
    auto shm_transport = std::make_shared<eprosima::fastdds::rtps::SharedMemTransportDescriptor>();
    pqos.transport().user_transports.push_back(shm_transport);
  1. Run first app
  2. Connect host to the network (connect LAN cable, WiFi, etc) -> as a result, a real IPv4 (e.g. 192.168..) addr will be assigned to some network interface
  3. Run the second app
  4. As a result participants are not discovered because the first Participant calculated host_id value using "fallback" way without knowledge of an IPv4 locator, but the second Participant used IPv4 addr value for host_id calculation. Later, this calculated host_id value is encoded in the Participant discovery meta-packet with offered traffic locators and announced to another remote participant. But since the values of host_id are different, participants are considered to belong to different hosts, and all SHM locators are filtered out. https://github.com/eProsima/Fast-DDS/blob/v2.14.1/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp#L542 https://github.com/eProsima/Fast-DDS/blob/v2.14.1/src/cpp/rtps/builtin/data/ProxyDataFilters.hpp#L50 And since we have only SHM transport enabled, and do not have any other transport locators, the (Participant) discovery is not finished and no further steps (i.e. EDP, data exchange) happened.

The opposite scenario, when IPv4 addr is available during the first Participant instantiation, and before the second Participant launch interface goes down/disconnects is also reproducible.

Fast DDS version/commit

2.6.9 2.14.1

Platform/Architecture

Ubuntu Focal 20.04 amd64, Other. Please specify in Additional context section.

Transport layer

Shared Memory Transport (SHM)

Additional context

No response

XML configuration file

No response

Relevant log output

No response

Network traffic capture

No response

lexamor avatar Oct 09 '24 11:10 lexamor