The RTPS protocol and multicast communications
Vortex Café uses the standard RTPS protocol to interoperably exchange data accross the network. The RTPS protocol is designed to take advantage of multicast communications for both:
- automatic discovery
- efficient data diffusion to several subscribers
But, in some environments, multicast communications are not supported by the underlying network. In other cases, multicast communications are available, but not very well supported. In particular, we often faced bad multicast support in :
- Wifi networks
- Android devices
In such environments, we observed that few multicast messages are correctly routed. But, when the number of messages increases, the number of lost datagrams also increases to an unmanageable ratio.
That’s why we may want to configure the RTPS protocol to use no multicast at all or to use mutlicast only when necessary.
Automatic discovery cannot occur without multicast. When multicast is not available, some minimum static peer configuration is needed. But, when available, an RTPS implementation can provide automatic discovery with a minimal usage of multicast. Indeed, a very small number of multicast messages can be used for initial peers discovery and unicast communication be used for any further discovery or data exchanges.
Data diffusion to several subscribers, even if less efficient, can transparently be achieved with unicast communications only.
Configuration of multicast usage in Vortex Café.
The usage of multicast communications by Vortex Café implementation can be configured with the help of the following configuration option :
This option accepts 5 values :
Whatever value is used, Vortex Café remains interoperable and can communicate with any remote standard RTPS implementation.
When ddsi.discovery.udp.allowMulticast option is set to none, Vortex Café will use no multicast communications at all. Therefor some minimal peers configuration (ddsi.discovery.udp.peers option) is needed for DDS applications to discover each other and communicate.
When ddsi.discovery.udp.allowMulticast option is set to minimal, Vortex Café will use multicast communications for the bare minimum, only when necessary. More precisely, Vortex Café will use multicast communications to discover remote peers. Discovery of entities (writers and readers) and data exchanges will use unicast communications. This configuration value is typically used in environments where multicast communications are available but poorly supported.
When ddsi.discovery.udp.allowMulticast option is set to discovery, Vortex Café will use multicast communications for all discovery exchanges (when apporpriate). Data diffusion will use unicast communications. This configuration value is typically used in environments where multicast communications, even if poorly supported, are good enough to provide efficient peers and entities discovery, but not for data diffusion.
When ddsi.discovery.udp.allowMulticast option is set to publications, Vortex Café will use multicast communications for all discovery exchanges and will also use multicast communications to emit data to remote subscribers. But it will force remote DDS peers to send data to itself through unicast. This configuration value is typically used in devices that can properly send multicast packets but have problems receiving a large number of multicast packets. This is the case in some android devices.
When ddsi.discovery.udp.allowMulticast option is set to full, Vortex Café will use multicast communications whenever appropriate. This is the default value and should typically be used in environments where multicast communications are fully supported.