Jump to content
OpenSplice DDS Forum
Sign in to follow this  
rodro_jesus

Using unicast communications in Ubuntu

Recommended Posts

Dear all,

 

I´m a newbie regarding DDS so apologies if these questions are too obvious for all of you.

 

I started using OpenSpliceDDS one week ago and I am running the examples that are provided in the zip file that is obtained from the website for Linux distributions. There are several examples to study and execute, and I am particularly interested in NetworkPartitions. While I have been able to execute it without using the instructions (compiling Chatter and MessageBoard and executing them after setting the environment variables present in release.com), I was wondering how could I create a unicast connection between the two entities that are shown in the example, which is something that I have failed to do. I have tried two solutions:

 

1. Exporting the network1.xml configuration file present in the example (as said in the instructions, export OSPL_URI=file://$OSPL_HOME/examples/dcps/NetworkPartitions/etc/network1.xml). It did not work.

2. Modifying the configuration file ospl.xml located in /home/[path]/HDE/x86.linux/etc/config in the general properties part (changing AllowMulticast to false, EnableMulticastLoopback to false and NetworkInterfaceAddress to my IP for local tests). It did not work either. 

 

<General>
         <NetworkInterfaceAddress>AUTO</NetworkInterfaceAddress>
         <AllowMulticast>true</AllowMulticast>
         <EnableMulticastLoopback>true</EnableMulticastLoopback>
         <CoexistWithNativeNetworking>false</CoexistWithNativeNetworking>
      </General>

 

 

What should I do to create the unicast connection? For this example I already know the IP addreses (or address if requested locally)  that will be used in the communcation.

 

Kind regards.

Share this post


Link to post
Share on other sites

Hi,

 

As explained in the (bundled) deployment manual ( 4.7.1.1.9.2 and 4.7.1.1.5.6) you have to specify your unicast-peers when you set AllowMulticast to false.

 

something like:

 

   ...

      <Discovery>
         <Peers>
            <Peer address="machine_A_address"/>
            <Peer address="machine_B_address"/>
            <Peer address="machine_C_address"/>
         </Peers>
      </Discovery>

Share this post


Link to post
Share on other sites

Dear Hans,

 

Thank you very much for your prompt answer. Let me be more precise in what I am trying to do.

 

I am trying to run the NetworkPartitions example that is available for Linux environments, but I would like to do so by using unicast messaging rather than multi or broadcast. In addition to that, the files that are available for configuration (network1, network2, ddsie1, ddsie2) are not working in my environment (not sure why, perhaps because of the range of the IP addresses in my network, the network has as IP 192.168.1.100 and 192.168.1.111 as broadcast, so up to 10 pieces of equipment can be added).

 

Therefore, I am using the configuration file below, as there are two PCs connected to a router, namely, PCA and PCB. PCA runs the Chatter part of the NetworkPartitions example, whereas PCB runs the MessageBoard. My issues come because the program is working even though when (I think) it should not. By using the attached configuration file the communications work, but I suspect that broadcast/multicast is still used, because if I write the IP of a nonexistent device it still works, or even if I remove the discovery section and leave everything as false, communications still work! I am running this configuration file by exporting it (export OSPL_URI=file://$OSPL_HOME/examples/dcps/NetworkPartitions/etc/ospl1.xml) before executing the Chatter at the Chatter end, should I run it in both sides? PCA has 192.168.1.102 as IP and PCB 192.168.1.104

<OpenSplice>
   <Domain>
      <Name>ospl_sp_ddsi</Name>
      <Id>0</Id>
      <SingleProcess>true</SingleProcess>
      <Service name="ddsi2">
         <Command>ddsi2</Command>
      </Service>
      <Service name="durability">
         <Command>durability</Command>
      </Service>
      <Service enabled="false" name="cmsoap">
         <Command>cmsoap</Command>
      </Service>
   </Domain>
   <DDSI2Service name="ddsi2">
        <Discovery>
         <Peers>
            <Peer address="192.168.1.104"/>
         </Peers>
      </Discovery>
      <General>
         <NetworkInterfaceAddress>AUTO</NetworkInterfaceAddress>
         <AllowMulticast>false</AllowMulticast>
         <EnableMulticastLoopback>false</EnableMulticastLoopback>
         <CoexistWithNativeNetworking>false</CoexistWithNativeNetworking>
      </General>
      <Compatibility>
<!-- see the release notes and/or the OpenSplice configurator on DDSI interoperability -->
         <StandardsConformance>lax</StandardsConformance>
<!-- the following one is necessary only for TwinOaks CoreDX DDS compatibility -->
<!-- <ExplicitlyPublishQosSetToDefault>true</ExplicitlyPublishQosSetToDefault> -->
      </Compatibility>
   </DDSI2Service>
   <DurabilityService name="durability">
      <Network>
         <Alignment>
            <TimeAlignment>false</TimeAlignment>
            <RequestCombinePeriod>
               <Initial>2.5</Initial>
               <Operational>0.1</Operational>
            </RequestCombinePeriod>
         </Alignment>
         <WaitForAttachment maxWaitCount="10">
            <ServiceName>ddsi2</ServiceName>
         </WaitForAttachment>
      </Network>
      <NameSpaces>
         <NameSpace name="defaultNamespace">
            <Partition>*</Partition>
         </NameSpace>
         <Policy alignee="Initial" aligner="true" durability="Durable" nameSpace="defaultNamespace"/>
      </NameSpaces>
   </DurabilityService>
   <TunerService name="cmsoap">
      <Server>
         <PortNr>Auto</PortNr>
      </Server>
   </TunerService>
</OpenSplice>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×