# Can't get network_traffic_control to work... [closed]

Hey gang,

I'm trying to use the network_traffic_control package to simulate a degraded comms link between machines in a ROS network so we can tune our code to adapt to the bad comms as needed.

I'm using the following launch file to get the node up:

<launch>
<node name="network_config" type="traffic_control_node.py" pkg="network_traffic_control">
<param name="interface" value="eth0"/>
</node>
</launch>


I run that, then run the Dynamic_reconfigure GUI. I see the parameters come up once I select the node at the top, but if I try to change any of the values (other than Packet size, which works) the GUI's slider/values immediately jump back to 0 and I see the following:

Status: FAIL ('FAIL') errmsg: "Failed to add htb qdisc at root on eth0"

Any ideas what I'm doing wrong here? Has anyone actually used this package? Or would I be better off just talking directly to tc on the linux command line to do this sort of thing (I thought network_traffic_control was mostly just a wrapper around tc)? Do I need to include something in the linux kernel to support this sort of dynamic changes to the network interface?

Edit: Ok, well, I've gotten it to work a LITTLE bit now... First off, you need to be sure to run the node (and the dynamic reconfigure gui) as root/sudo. This makes sense since network_traffic_control largely is a wrapper around "tc" which must be run that way.

Additionally, I can now get the "_egress" parameters to work (although not at all consistently) but the "_ingress" ones never work (they just jump immediately back to the default values.) Looking at the man pages for tc on Ubuntu 12.04, I don't see any reference to being able to differentiate between incoming and outgoing traffic, so I suspect only the egress parameters will work.

I've found it also seems to work more consistently if you reset all the parameters back to default before trying to change them (via the dynamic reconfigure API in code to change them all at once.)

edit retag reopen merge delete