The blog for the Industrial IoT.

Back to RTI Blog

News & Events Standards & Consortia Developers/Engineer

Announcing the DDS-XRCE Specification: A Protocol for Sensor Networks Written by Gerardo Pardo-Castellote

August 9, 2018 XRCE stands for eXtremely Resource-Constrained Environments. The new DDS-XRCE protocol was just adopted by the Object Management Group (OMG) to deliver the benefits of the DDS databus to resource-constrained devices. It enables access to DDS data in deployments where it was not previously possible due to limited resources. XRCE primarily targets fielded sensor network applications, such as those found in agriculture, mining, environmental monitoring and underwater robotics. However, the characteristics of the protocol also make it suitable for other resource-constrained applications in areas, such as robotics (e.g., underwater or space robots), and even micro-controller-based applications like those found in motor-controller boards.

These systems exhibit one or more of the following characteristics:

Specifically, DDS-XRCE has been designed to be able to run in systems with the following minimal resources:

These characteristics allow systems to deploy in popular microcontroller platforms, such as STMicroelectronics ultra low power STM32L4) or Arduino Zero.

Why Another Protocol?

The standard wire protocol used by DDS applications is called RTPS which stands for Real-Time Publish-Subscribe protocol.

RTPS is a binary protocol that was built for IoT applications. While it is more efficient than other IoT/IIoT protocols, such as AMQP and MQTT, it still exceeds some of the resources available in extremely resource constrained systems.

RTPS was designed to meet the needs of independent (autonomous) peer-to-peer systems, scale to large (internet-scale) systems, and operate in dynamic environments. It supports open-ended systems where applications can appear and disappear, move to new IP addresses and remain in continuous operation for long periods of time (perhaps years). It was also built to support protocol revisions without breaking interoperability.

To accommodate the above requirements RTPS includes features, such as 16-Byte globally-unique identifiers (GUIDs) for all Endpoints (Writers and Readers) in the system, 8-byte sequence numbers, automatic discovery, propagation of type information, support for protocol and data evolution, etc. These headers and “metadata” cause too much overhead in transports, such as ZigBee that can only carry a 66 Byte payload.

More significantly, a peer-to-peer protocol for autonomous systems requires the “continuous” presence of the different participants to support discovery, maintain liveliness and perform application data exchanges. If participants are not centrally coordinated and can go into sleep cycles or become disconnected, then this type of peer-to-peer communication becomes impractical. When a participant wants to send a message, the destination peer might be sleeping and vice versa. Systems that can undergo sleep-cycles require external Agents that relay the messages. When a participant wakes up, it sends the message to the Agent. The agent stores it and relays it to the destination participant when it wakes up.

The XRCE Architecture

DDS-XRCE is designed as a Client-to-Agent protocol.

The resource-constrained applications that use DDS-XRCE to communicate with each other and also with DDS systems are called XRCE Clients.

XRCE Clients use the DDS-XRCE protocol to communicate with a separate “infrastructure service” application which is called the XRCE Agent. The XRCE Agent is typically deployed on a separate computer node that is not resource constrained, unlike the nodes where the XRCE Clients run. The XRCE Agent node should not be subject to sleep cycles.

The XRCE Agent can communicate back with other XRCE Clients (again using DDS-XRCE) or communicate with DDS Participants using the standard DDSI-RTPS protocol.

The XRCE Agent acts as a relay or proxy between XRCE Clients and DDS Participants. The XRCE Agent appears to other DDS Participants as just another DDS Participant, communicating peer-to-peer in the DDS domain. It is useful to think of the XRCE Agent as a DDS point-of-presence for the XRCE Clients in the DDS domain. It maintains continuous presence (as needed to participate in peer-to-peer communications), representing the XRCE Clients. The XRCE Agent provides many services to the clients:

Each client only needs to discover and communicate with a single XRCE Agent, or perhaps a couple of Agents for redundancy. This avoids the need for clients to separately maintain reliability and security associations with each other.

All this amounts to big savings in resources and network traffic from the point of view of the XRCE Client.

Using XRCE

A typical deployment will mix applications that use XRCE (i.e., operate as XRCE Clients) with others that use native DDS/RTPS (i.e., operate as DDS DomainParticipants). The decision of where to deploy XRCE Clients versus DDS DomainParticipants is dictated by the resources available to each individual application/node.

Let’s look at an archetypical application in the domain of Pollution Monitoring in a Smart City.

To perform the continuous real-time monitoring it is necessary to deploy sensor nodes throughout the city. From the computational platform point of view, a typical deployment may use three types of nodes: Small Nodes

The Small Nodes are battery-powered devices with hardware characteristics similar to an STMicroelectronics ultra low power STM32L4 or an Arduino Zero. These use 32-bit ARM Cortex CPUs with 32 to 320 KB RAM and 128 KB to 1MB of Flash. They both have low-power sleep modes.

Small Nodes would be used to read the the pollution sensors and send it to the rest of the system using low-power networks, such as ZigBee.

Because of the memory and transport constraints and the need to undergo sleep cycles, the Small Nodes would need to use DDS-XRCE.

Battery-Powered Medium Nodes

Medium Nodes may use a solar-cell to recharge the battery. They have enough power to run more powerful CPU and connect to a 4G or WiFi network. However they still need to undergo sleep cycles in order to not drain the battery at times the solar cell is not charging it. A typical CPU may be similar to a Raspberry-Pi model 2: ARM Cortex-A7 quad core 32 bit CPU running at 900 MHz and 1 GB RAM.

The CPU, memory, and network resources of these nodes would allow them to run a DDS DomainParticipant and be a full peer on the DDS Domain. However the need to undergo deep sleep cycles would dictate that they also use DDS-XRCE.

Grid-Powered Medium Nodes

The grid-connected medium Nodes are like the battery operated nodes except they run on the Grid. They have all the required resources and do not need to undergo deep sleep cycles, therefore the nodes would be DDS DomainParticipants, run RTPS and appear as peers in the DDS domain. They may deploy Connext DDS Micro or even Connext DDS Pro.

XRCE Agent Configuration

Once a decision has been made regarding which applications will run as XRCE Clients, there are various ways to configure the required XRCE Agents.

A simple option is to use DDS-XML to the XRCE Agent (or Agents). That way the Agent will already know different kinds of applications that may be run on the sensor nodes. This makes the XRCE Client applications simpler and also saves on network traffic.

An example configuration for a Gases monitor node is described in the following DDS-XML file:

XML for the GasesMonitor Node

XRCE Client Code

The programming language API used by the XRCE Client is not defined as part of the DDS-XRCE specification. This was done to facilitate the creation of various simplified APIs that can be tailored to specific needs of applications and devices, including FPGAs. Therefore, the details may vary across vendors.

The following pseudo-code illustrates the main steps needed for a client to connect to an Agent and send data. They assume the Agent has been configured with the XML description of the “GasesMonitor” node shown above. Note that this example C API requires no dynamic memory allocation and no additional threads.

This code also relies on code-generated from the “Gases Node” XML file that creates the type definition for EnvSensors_GasesType as well as the function EnvSensors_GasesType_Write which knows how to serialize this type.

Alternatively the application could manage the serialization of the data. In this case it would call a more generic function (e.g., XRCE_Write) passing the serialized data in a buffer and its length as shown below:

XRCE_Write(&writer, sensorDataSerialized, serializedDataLength);

Dynamic Systems

XRCE does not require the application to be pre-configured in the XRCE Agent. XRCE Clients also have API calls that allow them to create the necessary resources in the Agent and use it to write or read data. For more details, see the links under References.

The new DDS-XRCE protocol specification enables sensor networks and other resource-constrained systems to connect to the DDS databus.

Are you interested? Do you have applications that can benefit from XRCE? Please post any questions you may have to this blog, or email email@example.com

The ultimate reference for the protocol is the OMG Specification available here and here.

You can find a technical overview of the specification in this presentation.
[null, null, null, null, null, null, {"document_url": "https://www.rti.com/blog/announcing-the-dds-xrce-specification-a-protocol-for-sensor-networks", "unformatted_src": "https://www.rti.com/hs-fs/hubfs/Hubspot%20Blog%20Graphics/RTI_Blog_Latest-Resource-Module_Getting-Started_V0_500x500_0817.jpg?t=1539539485608&width=500&name=RTI_Blog_Latest-Resource-Module_Getting-Started_V0_500x500_0817.jpg", "src": "https://www.rti.com/hs-fs/hubfs/Hubspot%20Blog%20Graphics/RTI_Blog_Latest-Resource-Module_Getting-Started_V0_500x500_0817.jpg?t=1539539485608&width=500&name=RTI_Blog_Latest-Resource-Module_Getting-Started_V0_500x500_0817.jpg", "formatted_filename": "RTI Blog Latest Resource Module Getting Started V", "alt_text": "RTI_Blog_Latest-Resource-Module_Getting-Started_V0_500x500_0817.jpg", "rendered_width": 500}, null, {"document_url": "https://www.rti.com/blog/announcing-the-dds-xrce-specification-a-protocol-for-sensor-networks", "unformatted_src": "https://no-cache.hubspot.com/cta/default/1754418/9829b50b-072f-4950-a8c8-1aa769657ed6.png", "src": "https://no-cache.hubspot.com/cta/default/1754418/9829b50b-072f-4950-a8c8-1aa769657ed6.png", "formatted_filename": "b b f a c aa ed", "alt_text": "Ready, Set, Go!"}, null, {"document_url": "https://www.rti.com/blog/announcing-the-dds-xrce-specification-a-protocol-for-sensor-networks", "unformatted_src": "https://no-cache.hubspot.com/cta/default/1754418/2c3076e6-6a98-41e0-bdcd-07250f419774.png", "src": "https://no-cache.hubspot.com/cta/default/1754418/2c3076e6-6a98-41e0-bdcd-07250f419774.png", "formatted_filename": "c e a e bdcd f", "alt_text": "Free Trial"}, null]