... | ... | @@ -1120,28 +1120,26 @@ The middleware is supported in fact, but failed to load. |
|
|
|
|
|
**Problem**
|
|
|
|
|
|
I'm using MAL-DDS, and I have two network cards (NICs) installed. MAL uses the wrong one, i.e. my network traffic goes into the "office" network, but should go into the "control" network.
|
|
|
I'm using MAL-DDS (or MAL-MUDPI), and I have two network cards (NICs) installed. MAL uses the wrong one, i.e. my network traffic goes into the "office" network, but should go into the "control" network.
|
|
|
|
|
|
**Background**
|
|
|
|
|
|
As multicast addresses are by definition not associated with hardware (ie they map to MAC addresses which have no corresponding Ethernet card), there is no means for the OS to resolve which NIC the IGMP subscription should be sent down. Thus the NIC must be specified, or the default is used (which is the office network).
|
|
|
|
|
|
Therefore, DDS allows you to specify which NIC you want to use for outgoing traffic.
|
|
|
The multicast middlewares (DDS and MUDPI) supported by the MAL allow you to specify which NIC you want to use for outgoing traffic. Thus, this boils down to configuring the middleware.
|
|
|
|
|
|
Therefore, this boils down to configuring DDS.
|
|
|
|
|
|
**Solution**
|
|
|
|
|
|
1. Get the XML file shown in Solution #1 on this page:
|
|
|
|
|
|
<https://community.rti.com/howto/control-or-restrict-network-interfaces-nics-used-discovery-and-data-distribution>
|
|
|
|
|
|
2. Continue with this article:
|
|
|
|
|
|
[KB: Configuring DDS](https://gitlab.eso.org/ecs/eltsw-docs/-/wikis/KnowledgeBase/CII#configuring-dds-cii-mal-dds)
|
|
|
**Solution (DDS)**
|
|
|
|
|
|
Get the XML file shown in Solution #1 on this page: <https://community.rti.com/howto/control-or-restrict-network-interfaces-nics-used-discovery-and-data-distribution>, and continue with this article:
|
|
|
[KB: Configuring DDS](https://gitlab.eso.org/ecs/eltsw-docs/-/wikis/KnowledgeBase/CII#configuring-dds-mal-dds)
|
|
|
|
|
|
**Solution (MUDPI)**
|
|
|
|
|
|
Set the "mudpi.ps.interfaceName" mal property when creating the MAL:
|
|
|
```
|
|
|
auto &factory = ::elt::mal::loadMalForUri("mudpi.ps://",
|
|
|
{ {"mudpi.ps.interfaceName","192.168.100.165"} } );
|
|
|
```
|
|
|
|
|
|
--------------------------------------------------------------------------
|
|
|
--------------------------------------------------------------------------
|
... | ... | @@ -1154,47 +1152,58 @@ Some of the middlewares usable through MAL offer a variety of configuration opti |
|
|
|
|
|
This article explains how to define and use configuration for the DDS middleware.
|
|
|
|
|
|
**Background**
|
|
|
|
|
|
To configure DDS, the following 3 things are necessary:
|
|
|
|
|
|
i\) put the desired config into an external XML file
|
|
|
|
|
|
ii\) define the FASTRTPS_DEFAULT_PROFILES_FILE (Connext: NDDS_QOS_PROFILES) environment variable, so DDS finds the XML file
|
|
|
|
|
|
iii\) pass 2 keys to the MAL factory, so DDS finds the right profile in the XML file
|
|
|
**Solution**
|
|
|
|
|
|
*(For a discussion about making this easier, see [ECII-77](https://jira.eso.org/browse/ECII-77))*
|
|
|
To configure DDS, 3 things are necessary:
|
|
|
|
|
|
**Solution**
|
|
|
- put the desired config into an external XML file (see Fast DDS documentation/examples)
|
|
|
|
|
|
1. Create the XML file.
|
|
|
- set the FASTRTPS_DEFAULT_PROFILES_FILE (Connext: NDDS_QOS_PROFILES) environment variable, so DDS finds the XML file
|
|
|
|
|
|
Examples are easily found in the "Fast DDS" documentation and user forums.
|
|
|
- pass 2 properties to the MAL factory, so DDS finds the right profile in the XML file
|
|
|
|
|
|
2. In your code, let MAL load the DDS-specific properties.
|
|
|
|
|
|
Example (C++):
|
|
|
**Example: How to restrict DDS traffic to your own host**
|
|
|
|
|
|
XML file (see https://fast-dds.docs.eprosima.com/en/latest/fastdds/discovery/general_disc_settings.html)
|
|
|
```xml
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
<dds>
|
|
|
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
|
|
|
<topic profile_name = "MyApp_Default"/>
|
|
|
<participant profile_name="MyApp_Default">
|
|
|
<rtps>
|
|
|
<builtin>
|
|
|
<discovery_config>
|
|
|
<ignoreParticipantFlags>FILTER_DIFFERENT_HOST</ignoreParticipantFlags>
|
|
|
</discovery_config>
|
|
|
</builtin>
|
|
|
</rtps>
|
|
|
</participant>
|
|
|
</profiles>
|
|
|
</dds>
|
|
|
```
|
|
|
|
|
|
Code (C++)
|
|
|
```cpp
|
|
|
auto publisher = factory.getPublisher<elt::telem::Temperature>(uri, {
|
|
|
std::make_shared<mal::ps::qos::Latency>(std::chrono::milliseconds(100)),
|
|
|
std::make_shared<mal::ps::qos::Deadline>(std::chrono::seconds(1)) }, {
|
|
|
{"dds.domain", "100"}, { "dds.qos.profile.library", “test"}, { "dds.qos.profile.name", “UDPv4_properties"}} });
|
|
|
// Create DDS-MAL with custom mal properties
|
|
|
|
|
|
In the case of Fast DDS, the "profile.library" value can be set to a dummy value, since it will not be used.
|
|
|
// With Fast DDS, the profile.library prop *must* be same as the env var!
|
|
|
char* env_var = std::getenv("FASTRTPS_DEFAULT_PROFILES_FILE");
|
|
|
const ::elt::mal::Mal::Properties malprops { {"dds.qos.profile.library", env_var},
|
|
|
{"dds.qos.profile.name", "MyApp_Default"} };
|
|
|
auto &factory = ::elt::mal::loadMalForUri ("dds.ps://", malprops);
|
|
|
|
|
|
// Publishers created from here on will have the setting applied
|
|
|
auto malpub = factory.getPublisher<AltAz> (pubsuburi, qos, {});
|
|
|
```
|
|
|
|
|
|
3. Before running your code:
|
|
|
|
|
|
Before running your code:
|
|
|
```
|
|
|
FASTRTPS_DEFAULT_PROFILES_FILE=\<path of XML file>
|
|
|
export FASTRTPS_DEFAULT_PROFILES_FILE=<path of XML file>
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------
|
|
|
--------------------------------------------------------------------------
|
|
|
--------------------------------------------------------------------------
|
... | ... | |