RTI Connext DDS Micro
Version 2.4.8
|
This user-guide explains the configuration of the built-in UDP transport.
This document describes the built-in RTI Connext DDS Micro UDP transport and how to configure it.
The built-in UDP transport (UDP) is a fairly generic UDPv4 transport. The major functionality supported is:
The built-in UDP transport is a RTI Connext DDS Micro component that is automatically registered when the DDS_DomainParticipantFactory_get_instance() method is called. In order to change the UDP configuration it is necessary to first unregister the transport as shown below:
When a component is registered, the registration takes the properties and a listener as the 3rd and 4th parameters. In general, it is up to the caller to manage the memory for the properties and the listeners. There is no guarantee that a component makes a copy.
The following code-snippet shows how to register the UDP transport with new parameters.
It should be noted that the UDP transport can be registered with any name, but all transport QoS policies and initial peers must refer to this name. If a transport is referred to and it does not exist an error message is logged.
While it is possible to register multiple UDP transports, it is not possible to use multiple UDP transports within the same participant. The reason is that UDP port allocation is not synchronized between transports.
The UDP transport creates one receive thread for each unique UDP receive address and port. Thus, by default three UDP threads are created:
Additional threads may be created depending on the transport configuration for a domain-participant, data-reader and data-writer. The UDP transport creates threads based on the following criteria:
For example, if a data-reader specifies its own multicast receive address, a new receive thread will be created.
All threads in the UDP transport share the same thread settings. It is important to note that all the UDP properties must be set before the UDP transport is registered. RTI Connext DDS Micro preregisters the UDP transport with default settings when the DomainParticipantFactory is initialized. To change the UDP thread settings, use the following code.
All the configuration of the UDP transport is done via the struct UDP_InterfaceFactoryProperty structure:
The allow_interface string sequence determines which interfaces are allowed to be used for communication. Each string element is the name of a network interface, such as "en0" or "eth1".
If this sequence is empty, all interface names pass the allow test. The default value is empty. Thus, all interfaces are allowed.
The deny_interface string sequence determines which interfaces are not allowed to be used for communication. Each string element is the name of a network interface, such as "en0" or "eth1".
If this sequence is empty, the test is false. That is the interface is allowed. Note that the deny list is checked after the allow list. Thus, if an interface appears in both, it is denied. The default value is empty, thus no interfaces are denied.
The max_send_buffer_size is the maximum size of the send socket buffer and it must be at least as big as the largest sample. Typically this buffer should be a multiple of the maximum number of samples that can be sent at any given time. The default value is 8KB.
The max_receive_buffer_size is the maximum size of the receive socket buffer and it must be at least as big as the largest sample. Typically this buffer should be a multiple of the maximum number of samples that can be received at any given time. The default value is 8KB.
The max_message_size is the maximum size of the message which can be received including any packet overhead. The default value is 8KB. Note that RTI Connext DDS Micro does not support fragmentation.
The Time-To-Live (TTL) value is only used for multicast. It limits the number of hops a packet can pass through before it is dropped by a router. The default value is 1.
RTI Connext DDS Micro supports firewalls with NAT. However, this feature has limited use and only supports translation between a private and public IP address. UDP ports are not translated. Furthermore, because RTI Connext DDS Micro does not support any hole punching technique or WAN server, this feature is only useful when the private and public address mapping is static and known in advance. For example, to test between an Android emulator and the host, the following configuration can be used:
The if_table provides a method to manually configure which interfaces are available for use, for example when using IP stacks that do not support reading interface lists. The following example shows how to manually configure the interfaces.
The multicast_interface may be used to select a particular network interface to be used to send multicast packets. The default value is any interface(that is, the OS selects the interface).
The is_default_interface flag is used to indicate that this RTI Connext DDS Micro network transport shall be used if no other transport is found. The default value is RTI_TRUE.
Normally, the UDP transport will try to read out the interface list (on platforms that support it). Setting disable_auto_interface_config to RTI_FALSE will prevent the UDP transport from reading the interface list.
The recv_thread field is used to configure all the receive threads. Please refer to Threading Model for details.