A ROS 2 Domain ID is an integer identifier (0-232) set via the ROS_DOMAIN_ID environment variable that logically segments a network, creating isolated ROS 2 communication domains. Nodes sharing the same Domain ID can discover and communicate with each other, forming a single ROS graph, while nodes with different IDs are completely invisible to one another, even on the same physical network. This mechanism provides essential network-level isolation for multi-robot systems or development environments.
Glossary
ROS 2 Domain ID

What is ROS 2 Domain ID?
A core networking concept in ROS 2 that isolates robotic systems on shared physical networks.
The default Domain ID is 0. Changing this value is a fundamental step for deploying multiple independent robotic systems on a shared network segment, such as in a lab or warehouse, preventing accidental cross-talk. It also enables safe parallel development and testing by isolating a developer's local ROS graph from other active systems. The Domain ID is a foundational layer of the ROS 2 DDS-based architecture, acting as a filter during the node discovery process managed by the underlying Data Distribution Service middleware.
Key Features and Characteristics
The ROS 2 Domain ID is a fundamental network isolation mechanism. Its primary features define how it segments communication, its practical configuration, and its role in system architecture.
Network Segmentation via Integer ID
A ROS 2 Domain ID is a simple integer (0-232) that creates a logical partition on a network. Nodes sharing the same Domain ID can discover and communicate with each other, forming a single ROS Graph. Nodes with different IDs are completely invisible to one another, as if they were on separate physical networks. This segmentation is enforced at the Data Distribution Service (DDS) middleware layer, which handles all discovery and data exchange.
- Default Value: The default domain ID is
0(ROS_DOMAIN_ID=0). - Range: Valid IDs range from
0to232(as defined by the DDS RTPS protocol). - Isolation Principle: No discovery packets, topics, services, or actions are transmitted between domains.
Configuration via Environment Variable
The domain ID for a ROS 2 node is set exclusively through the ROS_DOMAIN_ID environment variable. This variable must be set before the node process is launched and is read during the node's initialization. The value is not a node parameter and cannot be changed at runtime.
- Setting the Variable:
export ROS_DOMAIN_ID=42 - Process-Specific: Each terminal/session can have its own
ROS_DOMAIN_ID, allowing a single machine to host nodes in multiple domains. - Launch File Integration: The variable is typically set in shell scripts or within launch files using the
envargument to configure entire subprocess trees.
Primary Use Case: Logical Isolation
The core purpose is to run multiple independent ROS 2 systems on the same physical network without interference. This is critical for:
- Development and Testing: Isolating a developer's experimental robot graph from the production system running on the same lab network.
- Multi-Robot Fleets: Operating several identical robots in the same space, where each robot must only communicate with its own onboard nodes.
- Simulation vs. Reality: Running a high-fidelity simulation (in one domain) alongside a physical robot (in another) on the same workstation without cross-talk.
- Security Sandboxing: Containing systems to prevent accidental or malicious command of physical hardware.
Interaction with DDS and Multicast
Domain ID isolation is implemented by the underlying DDS implementation. The ID modifies the multicast addresses and ports used for node discovery and data traffic.
- Multicast Groups: DDS uses specific IP multicast groups (e.g., 239.255.0.1) for discovery. The Domain ID alters the final octet of this address.
- Port Calculation: Data ports are also offset by the domain ID, ensuring complete network stack separation.
- Implication: For domains to function correctly, the network infrastructure must support and route the required multicast traffic, which can be a consideration in restricted enterprise environments.
Limitations and Considerations
While powerful for isolation, Domain IDs have specific constraints:
- No Inter-Domain Communication: By design, there is no built-in ROS mechanism for communication across domains. Bridging requires external tools like a custom ROS Bridge or shared non-ROS interfaces (e.g., sockets).
- Not a Security Feature: Domain isolation is a logical convenience, not a security boundary. It prevents accidental communication but does not provide authentication or encryption. For secure systems, SROS2 (ROS 2 Security) must be used in conjunction.
- System-Wide Setting: All nodes that need to communicate must be launched with the exact same environment variable value; a single typo (
ROS_DOMAIN_ID=10vs.ROS_DOMAIN_ID=11) creates two isolated systems.
Best Practices for System Design
Effective use of Domain IDs involves deliberate system architecture:
- Standardize IDs: Document and standardize domain IDs across teams (e.g.,
0for production,1-10for developer sandboxes,42for simulation). - Use in CI/CD Pipelines: Set unique domain IDs for each parallel automated test run to prevent interference between simultaneous robot simulations.
- Combine with Namespaces: For complex multi-robot systems, use Domain IDs for physical robot isolation, and ROS namespaces (
/robot1,/robot2) for logical organization within a single robot's graph. - Verify with CLI Tools: Use
ros2 topic listandros2 node listto confirm node visibility is constrained to the intended domain.
ROS 2 Domain ID vs. Other Isolation Methods
A comparison of the primary methods for isolating ROS 2 communication graphs, highlighting the operational trade-offs for development, testing, and production.
| Feature / Metric | Domain ID (ROS_DOMAIN_ID) | Network Namespace / VLAN | Separate Physical Network | ROS 2 Security (SROS 2) |
|---|---|---|---|---|
Primary Isolation Layer | Application (DDS Discovery) | OSI Layer 3 (IP) | OSI Layer 1/2 (Physical/Data Link) | Application (Authentication/Encryption) |
Configuration Complexity | Trivial (Single Integer) | Moderate (OS/VLAN config) | High (Hardware wiring & config) | High (PKI, policy files) |
Runtime Overhead | Negligible | Low (Kernel routing) | None | High (Cryptographic ops) |
Supports Multiple Graphs on Single Host | ||||
Supports Cross-Subnet Communication | ||||
Prevents Accidental Cross-Talk | ||||
Prevents Malicious Interference | ||||
Typical Use Case | Development, CI/CD, logical separation | Testing, multi-tenant hosts | Production, safety-critical systems | Production, untrusted networks |
Frequently Asked Questions
A ROS 2 Domain ID is a network segmentation integer that isolates ROS 2 graphs, preventing nodes in different domains from discovering or communicating with each other. Below are common questions about its function, configuration, and use cases.
A ROS 2 Domain ID is an integer (0-232) used to logically segment a network, ensuring that ROS 2 nodes can only discover and communicate with other nodes sharing the same ID. It is set via the ROS_DOMAIN_ID environment variable. This mechanism prevents interference between separate robotic systems or development teams operating on the same physical network, such as in a shared lab or on a common Wi-Fi network. The Domain ID is a core part of the Data Distribution Service (DDS) discovery protocol that underpins ROS 2.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
The ROS 2 Domain ID is a core networking primitive. Understanding these related concepts is essential for designing scalable, secure, and interoperable multi-robot systems.
ROS Graph
The ROS Graph is the runtime network representation of all communicating entities in a ROS system. It is a peer-to-peer graph of nodes, connected by topics, services, and actions. The Domain ID acts as a fundamental isolation boundary for the entire graph.
- Graph Discovery: Tools like
rqt_graphandros2 topic listonly show entities within the same domain. - Segmentation: Setting different
ROS_DOMAIN_IDvalues creates completely separate, non-intersecting ROS graphs, even on the same physical network. - Use Case: This allows multiple independent robots or development teams to operate on the same network hardware without interference.
ROS Bridge (ros1_bridge)
A ROS Bridge, specifically the ros1_bridge, is a bidirectional gateway that translates messages and services between ROS 1 (roscore) and ROS 2 (DDS) networks. It operates within the domain paradigm of ROS 2.
- Function: It runs as a ROS 2 node that discovers data on one middleware system and republishes it on the other.
- Domain Context: The ROS 2 side of the bridge obeys the
ROS_DOMAIN_IDsetting. The ROS 1 side connects to a specified ROS Master. - Primary Use: Facilitates incremental migration from ROS 1 to ROS 2 by allowing components from both versions to coexist and communicate.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us