dipo dipo - 1 year ago 94
Python Question

ryu controller not forwarding packets

i'm trying to make a simple sdn network with ryu and openVswitch, but my ryu controller seems to not work properly.

I'm just trying to ping two hosts, but when i execute the command

ryu-manager simple_switch_13.py

(which is a prebuilt script) the controller does nothing and the packets are not forwarded by the datapath, it doesn't even flood them.

When i stop the ryu-manager it gives this traceback:

Traceback (most recent call last):
File "/usr/bin/ryu-manager", line 9, in <module>
load_entry_point('ryu==3.19', 'console_scripts', 'ryu-manager')()
File "/usr/lib/python2.7/dist-packages/ryu/cmd/manager.py", line 99, in main
File "/usr/lib/python2.7/dist-packages/ryu/lib/hub.py", line 89, in joinall
File "/usr/lib/python2.7/dist-packages/eventlet/greenthread.py", line 175, in wait
return self._exit_event.wait()
File "/usr/lib/python2.7/dist-packages/eventlet/event.py", line 121, in wait
return hubs.get_hub().switch()
File "/usr/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 294, in switch
return self.greenlet.switch()
File "/usr/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 346, in run
File "/usr/lib/python2.7/dist-packages/eventlet/hubs/poll.py", line 85, in wait
presult = self.do_poll(seconds)
File "/usr/lib/python2.7/dist-packages/eventlet/hubs/epolls.py", line 62, in do_poll
return self.poll.poll(seconds)

I don't think the problem is in the code, since simple_switch_13.py is a prebuilt script. Does anyone know what i'm doing wrong?
You can find an example of simple_switch_13.py here.

If i miss to say something please ask me, thank you.

Answer Source

At last i solved the problem, i think it was soomething i missed in the datapath configuration, since i didn't change the code. I'll post it here if somebody will need it:

ifconfig eth0 add FC00:1::2/64 up
ifconfig eth1 up
ifconfig eth2 add FC02:1::2/64 up

/etc/init.d/openvswitch-switch start

ovs-vsctl add-br br1
ovs-vsctl add-port br1 eth1
ovs-vsctl set-controller br1 tcp:
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download