How to capture traffic if my Connext DDS applications are communicating through shared memory

Wireshark and tcpdump are very powerful tools which you can use to capture traffic. They may come in handy when debugging issues with your DDS applications. These tools can capture all kinds of packets: RTPS, UDP, TCP, IP… However, they cannot capture traffic if your applications are communicating through shared memory. This article will describe two different methods to capture this traffic.

Method 1. Change the transport to UDPv4

If you want to debug your applications which are communicating through shared memory, one of the approaches to capture RTPS packets would be to change the transport to UDPv4. By default, the transport mask is UDPv4|SHMEM. This way, if the applications are in the same machine, they will communicate through shared memory. The transport can be changed to UDPv4 by simply using the following snippet. After applying this QoS, the applications will communicate through the loopback interface:


However, there is a side effect if you change the transport your applications use: the behavior in shared memory and UDPv4 is different. This way, if you want to debug your applications using this method, you won’t be capturing exactly the same traffic that was being sent through shared memory.

Method 2. Send all the traffic to a UDP socket apart from shared memory

Note: The following is an experimental feature that should not be used in production for versions prior to RTI Connext DDS Professional 6.0.0. For RTI Connext DDS Professional 6.0.0 and future versionsyou have the enable_udp_debugging QoS policy available. Both are recommended only for debugging purposes.

This approach will let your applications continue communicating through shared memory. There is a functionality in the shared memory transport which will copy all the outgoing traffic to a UDP socket. By default, the traffic will be sent to the first available NIC, through the port 7399 and to the IP multicast address Both the port and the IP address can be changed by configuring the DomainParticipant QoS.

These are the instructions you will need to follow to enable this functionality:

1. Create a disabled participant. This can be easily done by applying the following QoS settings:


2. Enable the CONTENT verbosity for the builtin shared memory transport. To do this, you will need to add this include:

#include "transport/transport_log.h"

Call this API after creating the DomainParticipant:


3. Enable the DomainParticipant:


4. Start a capture over all the interfaces. However, the first interface with a valid IPv4 address should be enough.

5. Set the following filter to analyze the capture if you are using the default address and port:  udp.port == 7399

In order to change the default IP address and the port, you can use this snippet:

            <!-- Force traffic destination address to be -->
            <!--      Use "," instead of "." for the IP address      -->
            <!-- Force the port to be to be 12345 -->


You will find an example attached: In this example, you will see how to configure your applications so they can use Method 2 described above. All the necessary information to generate code, compile, and run the example is in the README.txt file.