Rosanswers logo


I was experimenting with the environment variable ROS_DOMAIN_ID.

In several places in the ROS2 tutorials, it is suggested to set it to a value in the range 0-100.

Moreover I found this issue on FastRTPS, where they specify a limit of 232 https://github.com/eProsima/Fast-RTPS/issues/223

That limit is also present in the Opensplice and Connext documentations.

However with FastRTPS, differently from the other DDS, I am able to use way bigger values. The only limit I got is the one of the unsigned long which is used by RCL to store this environment variable.

OpenSplice and Connext throw a runtime error when I use a value higher than 232.

FastRTPS allows me to communicate with a different machine under the same network using much bigger values.

What is going on? Is there a sort of overflow which causes me to use the same ports that I would use with a much lower domain id ?

Thank you

Originally posted by alsora on ROS Answers with karma: 1322 on 2019-03-12

Post score: 1


1 Answer 1


Rosanswers logo

It's used to calculate a UDP port, so it could be that it is wrapping around and reusing ports if the number is in the right range.

I'd recommend using only values between 0 and 232 or perhaps lower. If you think a number you're using should not work, but is, I'd recommend opening an issue against Fast-RTPS. The issue you linked was that it was not working in certain ranges, which was expected. What you have is that it is working outside of the range you think it should, which may still be a bug.

Originally posted by William with karma: 17335 on 2019-03-12

This answer was ACCEPTED on the original site

Post score: 3

Original comments

Comment by alsora on 2019-03-13:
Opened this issue https://github.com/ros2/rmw_fastrtps/issues/261


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.