- By https://github.com/mininet/openflow-tutorial/wiki/Create-a-Learning-Switch#Controller_Choice_Ryu_Python, python-gevent, python-routes, python-webob, and python-paramiko should be installed.
- "sudo apt-get update" - update Lunix update packages
- "sudo apt-get install python-pip", "sudo apt-get install python-dev" - install python packages if not yet
- Similarly, install python-gevent, python-routes, python-webob, and python-paramiko.
- I see that somebody also installed python-eventlet, so I just install them in case of need.
- Install RYU: "sudo pip install ryu"
- Test:
mininet@mininet-vm:~$ ryu-manager loading app ryu.controller.ofp_handler instantiating app ryu.controller.ofp_handler of OFPHandler
- Install Ryu GUI interface (optinal)
- "sudo git clone git://github.com/osrg/ryu.git" - download ryu source code
- "sudo pip install flask gevent-websocket" - install needed packages
- Download: https://github.com/yamada-h/ryu/archive/gui-patch-v3-rebase.zip
- Extrat the downloaded file and copy directory "ryu-gui-patch-v3-rebase/ryu/gui/" to "/home/[user]/ryu/ryu/"
- edit "/ryu/ryu/topology/switches.py", and comment these lines:
CONF.register_cli_opts([ cfg.BoolOpt('observe-links', default=False, help='observe link discovery events.'), cfg.BoolOpt('install-lldp-flow', default=True, help='link discovery: explicitly install flow entry ' 'to send lldp packet to controller'), cfg.BoolOpt('explicit-drop', default=True, help='link discovery: explicitly drop lldp packet in') ])
- Start Ryu: "ryu-manager --verbose --observe-links ryu.app.simple_switch ryu.app.rest_topology ryu.app.ofctl_rest ryu.topology.switches"
- ryu.app.simple_switch: a simple learning switch which supports OpenFlow 1.0, ryu.app.simple_switch_13 supports OpenFlow 1.3
- The rest are for GUI
- Start controller:"./ryu/ryu/gui/controller.py" and connect to "127.0.0.1:8000" to see the topology
- Note that the name of switches seems matter when you want to see it in the topology. For example, in my fat tree topology, I tried to set switches' names as their IP. If I set a switch name as "10_0_0_1", it doesn't work; but if set as "10001" it did work! Amazing!
- Enable STP will also eliminate some links.
- See an example: http://dj184dja8.blogspot.tw/2016/04/ryu-mininet-sample-k4-fat-tree.html
- If you confront an import error indicating there is no views.websocket module, please refer to http://dj184dja8.blogspot.tw/2016/05/ryu-gui-installation-problem.html
沒有留言:
張貼留言