Ask Your Question
0

Limit the Ephemeral Port Range that ROS uses to make XMLRPC Socket Connection

asked 2016-10-08 08:43:20 -0600

I am working on a project that will require two Robot Operating System (ROS) nodes running in separate containers on separate hosts on separate LANs to communicate over a router. The issue I am having is that ROS uses XMLRPC to open up a dynamic ephemeral port on the host to establish a socket connection between publisher & subscriber nodes. The Docker container that each of the ROS nodes run in has a local port range in the proc/sys/net/ipv4/ip_local_port_range from 32768-60999. I will need to bind the container port to the local host port in order for the two ROS nodes to communicate. Unfortunately, this will require that I bind 28231 ports at docker run command in order to ensure that ROS dynamically chooses an exposed and binded port to communicate over the network. I would like to limit the ephemeral port range that ROS uses to create XMLRPC connection between publisher & subscriber to allow for efficient use of ROS and docker, especially when quickly spinning up new containers for high availability. Below are what I have done thus far:

run docker swarm on each of the hosts to communicate over the docker overlay bridge in Dockerfile--EXPOSE 32768-33768 bind to host--docker run -it --rm -p 32768-33768:32768-33768

looking in the proc/sys/net/ipv4/ip_local_port_range the ephemeral port range is read only from 32768-60999

I am running ubuntu 14.04 LTS, Docker v1.12, ROS Indigo Base

Any help in limiting the Ephemeral Port Range that ROS uses to make XMLRPC Socket Connection between publisher & subscriber?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-10-15 00:27:47 -0600

updated 2016-10-15 00:41:14 -0600

I haven't yet had the chance to do a lot with docker swarm and ROS since the Software Defined Network overhaul in docker/libkv a while ago, been a bit busy. But from what I remember is that you could attach two containers running from separate host (if the docker engines on those host are part of the same swarm) to a new SDNetwork you define. This is network attaching is done in the deployment example in the docs on the DockerHub ROS repo, but for only for one engine.
https://hub.docker.com/_/ros/

If you want to achieve the same effect but with containers running on separate engines, you need to express this to the docker swarm master that is launching the containers on the swarm cluster. https://docs.docker.com/swarm/networking/ https://docs.docker.com/engine/reference/commandline/network_connect/

There should be no need to muck about with manual port mapping.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2016-10-08 08:43:20 -0600

Seen: 533 times

Last updated: Oct 15 '16
{"cc_re__cc_re__cc_by_sa_3_0_le": ["ce-among-diffierent-tags-melodic-images-in-docker-hub/\">The difference among diffierent tags melodic images in docker hub</a> </p> <p> <a href=\"/question/303171/connection-between-ros-in-docker-with-external-ros-master-another-pc-the-baxter-case/\">Connection between ROS in Docker with external ROS MASTER (another PC): The Baxter case</a> </p> </div> </div> <div class=\"box\"> </div> </div> </div> <!-- template footer.html --> <div id=\"ground\"> <div class=\"content-wrapper\"> <div class=\"copyright\"> <a href=\"http://creativecommons.org/licenses/by-sa/3.0/legalcode\"> <img\n                            class=\"license-logo\"\n                            src=\"/m/default/media/images/cc-by-sa.png?v=28\"\n                            title=\"cc-by-sa\"\n                            alt=\"cc-by-sa\"\n                        /> </a>\n                \n                ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a <a href=\"http://creativecommons.org/licenses/by-sa/3.0/legalcode\">Creative Commons Attribution Share Alike 3.0</", "ss=\"content-wrapper\"> <div class=\"copyright\"> <a href=\"http://creativecommons.org/licenses/by-sa/3.0/legalcode\"> <img\n                            class=\"license-logo\"\n                            src=\"/m/default/media/images/cc-by-sa.png?v=28\"\n                            title=\"cc-by-sa\"\n                            alt=\"cc-by-sa\"\n                        /> </a>\n                \n                ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a <a href=\"http://creativecommons.org/licenses/by-sa/3.0/legalcode\">Creative Commons Attribution Share Alike 3.0</a> license.\n\n            </div> <div class=\"footer-links\" > <a href=\"/about/\">about</a><span class=\"link-separator\"> |</span> <a href=\"/faq/\">faq</a><span class=\"link-separator\"> |</span> <a href=\"/help/\" title=\"help\">help</a> <span class=\"link-separator\"> |</span> <a href=\"/privacy/\">privacy policy</a><span class=\"link-separator\"> |</span> <a href=\"/terms/\">terms of service</a> </div> <div class=\"powered-link\"> <a href=\"http://askbot.com\" target=\"_b"], "copyright__copyright__copyright": ["ing the containers on the swarm cluster. https://docs.docker.com/swarm/networking/ https://docs.docker.com/engine/reference/commandline/network_connect/\n\nThere should be no need to muck about with manual port mapping.\n\nedit flag offensive delete link more\n\nYour Answer\n\nPlease start posting anonymously - your entry will be published after you log in or create a new account.\n\nAdd Answer\n\nQuestion Tools\n\n2 followers\n\nStats\n\nAsked: 2016-10-08 08:43:20 -0600\n\nSeen: 533 times\n\nLast updated: Oct 15 '16"]}