Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute cycloneDDS example across network #462

Open
CristianChachaLeon opened this issue Jul 13, 2023 · 4 comments
Open

Execute cycloneDDS example across network #462

CristianChachaLeon opened this issue Jul 13, 2023 · 4 comments
Assignees

Comments

@CristianChachaLeon
Copy link

  • Operating System:
    PC1: Ubuntu 18.04
    PC2: Ubuntu 18.04
  • Installation type:
    from source
  • Version or commit hash:
    lastest

Steps to reproduce issue

PC1 and PC2 are connect LAN in the same network

  1. Create a docker container with ubuntu 18.04 in PC1
  2. install cyclonedds in docker container
  3. Install cyclonedds in PC2
  4. Execute ./helloWordSuscribe inside de docker (PC1)
  5. Execute ./helloWordPublisher in PC2

Expected behavior

Communication succesfull

Actual behavior

No comunication between applicacition examples

@eboasson
Copy link
Collaborator

Historically there's been a lot of trouble with docker not supporting multicast properly, so that would be my first guess, especially since it looks like you're on a somewhat older software stack. (Examples aplenty on the internet.) The other classic Cyclone DDS problem is it choosing the "wrong" network interface in a multi-hosted machine.

I would start out by trying to what happens when you disable multicast and list the peers for unicast discovery. https://husarion.com/tutorials/other-tutorials/husarnet-cyclone-dds/#configure-cyclone-dds is a good guide, though that utilizes IPv6 which I expect is relevant for you. Adapting from it, this would be a good starting point (I expect you'll have to change "eth0", "PC1" and "PC2"):

<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/etc/cyclonedds.xsd">
  <Domain id="any">
    <General>
      <NetworkInterfaceAddress>eth0</NetworkInterfaceAddress>
      <AllowMulticast>false</AllowMulticast>
    </General>
    <Discovery>
      <ParticipantIndex>auto</ParticipantIndex>
      <Peers>
        <Peer address="PC1"/>
        <Peer address="PC2"/>
      </Peers>
    </Discovery>
  </Domain>
</CycloneDDS>

@CristianChachaLeon
Copy link
Author

Hello @eboasson , thanks for your quick response.

I've used the suggested settings, but it seems there's still no communication. In my case I use IPv4 for both PC1 and PC2.

I'm afraid that the docker configuration is not correct and this avoids discovering PC2 hellowordPublisher application example

@eboasson
Copy link
Collaborator

eboasson commented Aug 1, 2023

@CristianChachaLeon, I'm afraid you'll really have to provide some information. I don't even do docker myself, but I can try.

The first step is to find out Cyclone is really doing by getting a pair of log files. Those files not the easiest to read, but I know how to do it. They do not always provide enough information, but often they do.

To get them, add this in your XML:

<Tracing>
  <Category>trace</Category>
</Tracing>

This'll write a file named cyclonedds.log. If you want to run multiple processes in the same working directory, that becomes a mess, and in that case I'd advise to add <OutputFile>cdds.log.${CYCLONEDDS_PID}</OutputFile> to the "Tracing" section.

If you're curious what they say, there is some documentation, but I expect you'll quickly decide it is better if I take a look. The easiest way is to attach them to a GitHub comment.

@ksuszka
Copy link

ksuszka commented Sep 26, 2023

@CristianChachaLeon by default docker isolates containers in their own network. How did you set up the network between those docker containers? Did you use --net=host?
To check if this is a docker network issue try to run both containers with --net=host, this will eliminate docker network isolation. If this works, then you can play with docker network configuration if some form of isolation is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants