Caution: The ros_comm6 is an test implementation of the IPv6 Protocol for ROS. For the original ros_comm documentation please refer to ros_comm.
Documentation
(Package Documentation / Stack Documentation can be wrong due to ros_comm)
The ros_comm6 is an test implementation of the IPv6 Protocol for ROS. Please refer to the documentation of ros_comm.
With ros_comm6 we are introducing an IPv6 enabled variant of the ros_comm stack.
It features an IPv6 enabled master as well as IPv6 enabled client libraries for C++ and Python. The roswtf utility has also been modified to support IPv6.
You can find the code for the stack at:
https://svn.vmi.ei.tum.de/vmi-ros-pkg/trunk/ros_comm6/
The IPv6 features of the stack are enabled by setting the environment variable ROS_IPv6 to 'on'. The master then starts to listen on IPv4 and IPv6 addresses and nodes try to connect using IPv6. Nodes using IPv4 will still be able to connect to servers and publishers using IPv6.
IPv6 capable subscribers are currently not able to connect to publishers using IPv4, but is on our TODO list. (Trying to connect to all available addresses, until a successful connection can be made)
Installation
To use the stack a few steps have to be performed (it is assumed that you already have a working ROS setup under '/opt/ros/fuerte'):
- Execute the following commands to get the source and setup the environment:
mkdir ros-v6 roslocate info ros_comm6 > ros-v6/ros_comm6.rosinstall cd ros-v6/ rosinstall . ros_comm6.rosinstall /opt/ros/fuerte/ source setup.bash
- Execute the following commands to compile the stack:
cd ros_comm6/ mkdir build cd build/ cmake .. -DCMAKE_INSTALL_PREFIX=/opt/ros/fuerte make -j6
- Install the new stack on top of the regular ros_comm stack (This will replace your normal ros_comm stack. To remove ros_comm6, you have to reinstall ros_comm again):
sudo make install
- Make sure that your hostname also points to '::1'. Add the following line to '/etc/hosts':
::1 <Your hostname>
If your $ROS_MASTER_URI equals to 'http://localhost:11311', you might also have to add the following line to '/etc/hosts':
::1 localhost
- Add the following line to your .bashrc or other startup scripts:
export ROS_IPV6=on
The code is currently tested using Linux. Your mileage on Windows or other Unix distributions might vary. This especially affects the dual stack behaviour. (The IPV6_V6ONLY socket option is currently not modified).
We have tested the stack in a small test environment at our lab. Yet most of the code is probably untested, as it handles a lot of corner cases and configuration parameters. If you run into any problems using the stack please contact us or send us a patch.
Implementation Details
As ROS is using hostnames for the addressing in its RPC interface, no changes are necessary here. Masters and publishers simply open IPv6 sockets and subscribers try to connect to them using IPv6.
For the C++ library this is straight forward. The Python library on the other hand is using the SimpleXMLRPCServer library for its RPC interface. This library only opens sockets listening on IPv4 interfaces. The code to make it work anyway is using private members of the library and duplicates code from the library inside ROS. As long, as this is not addressed in the python library, we are stuck with this hack.
ROS also has extensive functionality for deciding which interface/IP address to use. This code had to be modified to account for the new addresses available with IPv6. It might be the most error prone code in this stack right now.
Changelog
2012-07-25 Tobias Schneider <schneider.tobias@mytum.de>
- Fixed error when no IPv4 address is configured.
2012-07-25 Tobias Schneider <schneider.tobias@mytum.de>
- Merged ros_comm 1.8.15 back in.
2012-07-20 Tobias Schneider <schneider.tobias@mytum.de>
- Rearranged the includes to favour directories from the source.
2012-07-19 Tobias Schneider <schneider.tobias@mytum.de>
- Fixed error when testing if hostname is local.
- Check for ipv6 before connecting to the parameter server.
2012-06-14 Tobias Schneider <schneider.tobias@mytum.de>
- Fixed segfault when no ROS_IPV6 environment variable is defined.
Known Bugs
- Problems when resolving an IPv6 address within ROS_IP. Python will try to unpack the IP-Adresse as there is a colon (:) in between.
- Try to explicitly set the ROS_HOSTNAME to localhost