What is DDS? The communication foundation behind ROS2
Atlasbot · 16/8/2026 · 11 min read
Previous articles have mentioned many times: ROS2 does not need roscore, supports flexible QoS, nodes find each other on their own. All of these capabilities didn't come from ROS2 itself — they come from DDS (Data Distribution Service), an industrial pub/sub middleware standard that existed long before ROS2, used in aviation, defense, and finance.
Key concepts
Instead of writing its own network protocol (like ROS1 did with TCPROS), the ROS2 development team chose to build on the existing DDS platform — inheriting two core features:
- Distributed Discovery — each DDS process advertises its presence on the network (via multicast), parties find each other without the need for a "central directory" — which is why ROS2 does not need
roscore - Configurable QoS — DDS pre-defines dozens of QoS policies (Reliability, Durability, History...), ROS2 only exposes an easy-to-use subset via its API (see QoS article)
RMW — abstract class that allows changing DDS
ROS2 is not locked to a specific DDS brand. The RMW (ROS Middleware interface) layer stands between the client library (rclcpp/rclpy) and the actual underlying DDS, allowing plugging in between various implementations (Fast DDS, Cyclone DDS, Connext...) without needing to modify the application code — just change the environment variable RMW_IMPLEMENTATION.
In short: ROS2 = client library (
rclpy/rclcpp) + RMW (abstract layer) + a concrete DDS implementation running underneath. Understanding DDS explains why ROS2 doesn't need a central station, and why QoS is so flexible — both are inherent features of DDS, not homemade ROS2.
How it works
Application Code (your node)
│
rclpy / rclcpp
│
RMW ← abstraction layer, interchangeable DDS implementation
│
┌──────────┼──────────┐
Fast DDS Cyclone DDS Connext DDS ← choose 1 of many implementations
Check and change the DDS implementation in use:
echo $RMW_IMPLEMENTATION # See which implementation you are using (the default is usually Fast DDS)
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp # Change to Cyclone DDS
A common practical concept: ROS_DOMAIN_ID — a "channel" number that isolates different ROS2 networks running on the same physical network (for example, two robots in the same lab, each robot has its own domain ID to not "see" each other's nodes, avoid conflicts or unwanted automatic interactions) — this is directly a mechanism of DDS, ROS2 only exposes back through environment variables.
Technical details
Formulas
ROS_DOMAIN_ID isn't just an abstract number — the RTPS (DDS wire-level protocol) standard converts it to actual UDP ports for discovery, according to the fixed formula:
Basic discovery port = 7400 + 250 × domain_id
Example: ROS_DOMAIN_ID = 0 (default)
Port = 7400 + 250 × 0 = 7400
VD: ROS_DOMAIN_ID = 5
Ports = 7400 + 250 × 5 = 8650
This is the reason why 2 different domain IDs actually use completely different network port ranges — not just a software convention, but true isolation at the network layer, explaining why 2 robots with different domain IDs never accidentally "see" each other even though they are on the same WiFi network.
Parameters
| Parameters | Value |
|---|---|
The range ROS_DOMAIN_ID is actually valid | 0 – 101 (some systems support up to 232) |
| Default value when unset | 0 |
| ROS2 Default DDS (Humble/Jazzy) | Fast DDS (eProsima) |
| Lighter DDS, popular for resource-constrained embedded devices | Cyclone DDS |
Protocol
The actual wired protocol that every DDS implementation (Fast DDS, Cyclone DDS, Connext...) must follow is RTPS (Real-Time Publish-Subscribe Protocol) — a separate OMG standard from the DDS API, which specifies the exact format of bytes sent over UDP for data discovery and transfer. Thanks to the same RTPS compliance, nodes using Fast DDS can theoretically still communicate with nodes using Cyclone DDS — although in practice some vendor-specific extensions may cause slight differences, so best practice is still to synchronize with the same DDS implementation across the system.
Practical applications
On Jetson or other resource-constrained embedded computers in AMR, many engineering teams choose to switch from Fast DDS (default) to Cyclone DDS because the memory/CPU footprint is lighter as the number of nodes and topics increases — just change the RMW_IMPLEMENTATION environment variable, without needing to change a single line of application code, directly demonstrating the value of the abstraction layer RMW mentioned above. When operating multiple AMR robots in the same factory, assigning a separate ROS_DOMAIN_ID to each robot (eg: robot 1 uses domain 1, robot 2 uses domain 2) is a mandatory network setup step to avoid robots accidentally receiving each other's control commands.
Practical example
$ export ROS_DOMAIN_ID=5
$ ros2 daemon stop && ros2 daemon start # Restart the daemon to apply the new domain
$ ros2 topic list
Output:
/parameter_events
/rosout
(only topics from nodes in domain 5 are visible; nodes in other domains are invisible even on the same network)
If you change ROS_DOMAIN_ID and still see a node in "another domain" appearing in ros2 topic list, double check that all related terminals/nodes have actually been properly sourced to the new environment variable — forgetting export in even 1 terminal is a common cause of the "domain ID not isolated as expected" phenomenon.
Common mistakes
- Domain ID overlaps between multiple robots on the same network — as mentioned in the Practical Application section, causing nodes of different robots to accidentally "see" and mistakenly interact with each other — always check
echo $ROS_DOMAIN_IDmatches the plan before operating multiple robots. - Change
RMW_IMPLEMENTATIONis not consistent across the system — one machine uses Fast DDS, another machine uses Cyclone DDS may have subtle compatibility issues even though both are RTPS compliant — it is recommended to agree on 1 DDS implementation for the entire robot system. - Firewall blocks multicast/UDP causing discovery to not work — DDS's default discovery mechanism is based on UDP multicast, some enterprise networks/routers block this type of traffic — which results in nodes never "seeing" each other even though they have the same domain ID and the same physical network.
- Too many nodes/participants exceeding resource limits on weak embedded devices — each DDS node takes up certain system resources (file descriptor, memory), running too many small nodes on a limited RAM embedded board can cause DDS initialization errors — consider using Composition (multi-component node, see advanced ROS2 section) to combine many components into fewer processes.
Conclusion
DDS is the true foundation behind most of ROS2's "magical" features — distributed discovery without the need for a central station, flexible QoS, and the ability to change middleware implementations without changing application code thanks to the RMW layer. Understanding the UDP port formula by domain ID and the role of RTPS helps accurately debug network problems at the deepest level when conventional fixes are ineffective. The next article in this section is about TF/TF2 — the system for managing coordinate systems in robots, one of the packages that uses DDS/Topic the most in the entire ROS2 ecosystem.
Get new articles and lessons by email
When a new technical article or course module is published, Atlas Robotics sends you a short email. No spam.
Unsubscribe any time with the link in each email. See our Privacy policy.