Subscriber as docker container in Windows fails to communicate to Publisher in Linux

9 posts / 0 new
Last post
Offline
Last seen: 6 years 8 months ago
Joined: 02/01/2018
Posts: 4
Subscriber as docker container in Windows fails to communicate to Publisher in Linux

Our subscriber is running on a windows OS and its QoS is pointed to the IP of the Publisher running as docker container in Linux VM.

As docker creates its own private network 172.X.X.X , my subscriber fails to join the subnet mask as the publisher is, hence its losing the data packets.

RTI DDS version - 5.3.0.2

Docker for Windows - 17.12.0-ce

Please suggest if there a way to fix this through QoS or any other setting.

Thanks

Organization:
israel's picture
Offline
Last seen: 6 years 6 months ago
Joined: 08/05/2016
Posts: 8

Hi Vidya,

 

Docker for Windows is not something that we have tried with RTI Connext DDS.

First, I would like to confirm your scenario:

  • One Docker container (a Linux container) running on Windows (using Docker for Windows).
  • One Docker container running on a Linux VM.

 

Please, could you check this article from our KB? I think it could help you:

https://community.rti.com/kb/how-use-rti-connext-dds-communicate-across-docker-containers-using-host-driver

 

Best,

Israel

Offline
Last seen: 6 years 8 months ago
Joined: 02/01/2018
Posts: 4

Hi Israel

We have publisher and subscriber running as docker containers. Publishers are hosted on a Linux VM. Subscribers are micro-service docker images built based on alpine Linux OS. The micro-services can be run from Windows, Mac or Linux OS. We wanted to ensure subscriber gets data running from any OS.

RTI-DDS Version: 5.3.0.2

Scenario I: Running Subscriber docker container from Linux VM (Linux Container in Linux)

Both Publisher & Subscriber though running as docker containers in their private network, could join the host network when using –net=host and could successfully communicate & receive data packets. (as pointed by your link above)

Scenario II: Running Subscriber docker container from Windows (Linux Container in Windows 10)

Subscriber running as docker container in their private network, when using –network=host, Windows OS uses Hyper-V technology and maps the private network to 10.X.X.X. Looks like it might need an additional step to perform NAT to join the host network. Subscriber could communicate to the publisher but fails to receive the data packets.

Is there an alternative approach or solution suggested?

Thanks

Vidya

 

 

israel's picture
Offline
Last seen: 6 years 6 months ago
Joined: 08/05/2016
Posts: 8

Hi Vidya,

I am glad to hear that the scenario I is working.

Regarding the scenario II: Docker for Windows is not a configuration that we have tried. I think you will need to add some rules to the Windows Firewall (to not block the traffic to the container) and set the initial peers in your ConnextDDS application. 

In Docker for Windows, the container communicates using a vEthernet adapter whose name is DockerNAT. If you run ipconfig, you will get the IP of the host machine in the Docker network. Could you try to set this IP in the initial peers of the application running in the Docker container?

Since it seems that the issue is the communication between the host machine and the container, this Docker image could help you:

https://github.com/rticommunity/rticonnextdds-docker-debugger

 

Best,

Israel

Offline
Last seen: 6 years 8 months ago
Joined: 02/01/2018
Posts: 4

Hi Israel

I had issues building the docker image rticonnextdds-docker-debugger. Reported the same in the github (https://github.com/rticommunity/rticonnextdds-docker-debugger/issues). Do you have any pointers on it?

Thanks

 

 

 

Offline
Last seen: 6 years 8 months ago
Joined: 02/01/2018
Posts: 4

Hi Israel,

  1. Included the Docker NAT IP in the QOS file
  2. Ensured both Widnows and the VM are on the same subnet mask
  3. Did a OS Ping from & to both Windows PC & the VM (no data loss)
  4. Installed the above rticonnextdds-docker-debugger on both the machines and performed the below,

From Linux VM,

docker run --network=host --name debugger -ti rtidebugger:latest ddsping -w

Running writer...
Sending ping message number 0
Sending ping message number 1
Sending ping message number 2
Sending ping message number 3

From Windows PC,

docker run --network=host --name debugger -ti rtidebugger:latest ddsping -r

Running reader...
No ping was received
No ping was received
No ping was received
No ping was received

Please suggest on further investigation.

Thanks

 

 

Offline
Last seen: 6 years 1 month ago
Joined: 03/19/2018
Posts: 3

Hi Israel,

Even i am using the same version of docker for windows and trying to run publisher as a docker container. But data is not getting published outside the docker container to the host machine. I ran the DDS spy tool to see the data in the same machine but unable to get the data.

we used --network:transparent as a driver, we dont have --network:host in docker for windows. Could you please suggest us to get the data published outside the windows container.

Thanks in advance.

 

Offline
Last seen: 1 year 3 months ago
Joined: 10/22/2018
Posts: 2

Has anybody resolved this issue yet?  I am having the same problem on MacOS.  A publisher running in a Ubuntu container on MacOS Docker unable to communicate with subscriber running as a MacOS application. I understanf the problem there is the same - there is no implementation of host networking on Mac and Windows.  Same setup transferred from Mac to Linix works flawlessly using host networking.  There has to be a solution on mac and windows that works.  I just do not know what it is.  Tried to run bridged network with exposed ports, and that does not seem to do anything.   

Offline
Last seen: 3 years 1 month ago
Joined: 10/15/2021
Posts: 1

Hello,

Are there any updates on this? I would like to have multiple linux based containers be able to communicate while being hosted on a Windows Machine. 

Thanks for the help in advance!

Best,

Andrew