Skip to content

Restrict DDS middleware network traffic to localhost #798

@hidmic

Description

@hidmic

Feature request

Feature description

Currently and by default, most DDS-based ROS middlewares lookup and choose a suitable network interface on the machine that's hosting them. It makes for easy configuration of multi-machine ROS systems, but it may also result in undesired cross-talk. This is specially true in CI setups, where multiple tests running in parallel may inadvertently interact with each other.

Isolation via ROS_DOMAIN_ID, though possible, poses a maintenance burden as IDs must be carefully allocated and assigned by other means. Additionally, the set of available domain IDs is a rather limited one (see RTI Connext documentation, this relevant eProsima Fast-RTPS ticket and the RTPS standard).

Both burden and limitation are acceptable when a ROS system is intended to span several machines in a network, but when that's not the case it's an unnecessary source of problems. Providing an easy way for users to force DDS-based middlewares to use loopback would preclude all of these issues.

Implementation considerations

From a UX perspective, negative ROS_DOMAIN_IDs could provide the means to externally enable this restriction (credits to @dirk-thomas). ROS_DOMAIN_IDs sign would act as a flag:

  • if it's a positive number, a suitable network interface will be chosen (just like it is today);
  • if it's negative, loopback will be used instead.

Meanwhile, the actual domain ID would become the magnitude (i.e. the absolute value) of the ROS_DOMAIN_ID number. For instance, ROS_DOMAIN_ID=-1 would read as "Use 1 for a domain ID over loopback" while ROS_DOMAIN_ID=1 would read as "Use 1 for a domain ID over a suitable network interface".

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions