-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ryu and Busylink detection #101
Conversation
@@ -5,7 +5,9 @@ Ryu adapter module for OmniUI | |||
###Installation### | |||
1. Download the Ryu Controller | |||
$ `git clone git://github.com/osrg/ryu.git` | |||
$ `cd ryu; sudo python ./setup.py install` | |||
$ `cd OpenADM/adapter/ryu; cp event.py event.py ~/ryu/ryu/topology` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated event.py
I followed the README but I cannot start up Ryu controller:
Please update the installation steps in README as clear as possible if you believe your code is correct, thank you. |
Sorry I make some mistakes, please ignore previous comments. |
self.statistics[link_id] = dict(self.links[link_id]) | ||
self.statistics[link_id]['state'] = self.baseState | ||
# Remove unexisted link info | ||
for link_id in self.statistics: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add/removing elements in a dictionary while iterating through it could lead to runtime error like the following:
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/vagrant/.local/lib/python2.7/site-packages/omniui-1.0.0-py2.7.egg/src/core.py", line 266, in iterate
handler.handler(event)
File "/home/vagrant/.local/lib/python2.7/site-packages/omniui-1.0.0-py2.7.egg/src/floodlight_modules/busylink_detect.py", line 79, in getPort
self.busyLinkDetect()
File "/home/vagrant/.local/lib/python2.7/site-packages/omniui-1.0.0-py2.7.egg/src/floodlight_modules/busylink_detect.py", line 173, in busyLinkDetect
for link_id in self.statistics:
RuntimeError: dictionary changed size during iteration
flowstatsReplyAPI["flows"] = [] | ||
i = 0 | ||
for inflow in flows[key]: | ||
if inflow["priority"] == 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my testing environment, the priority of flows are 65535. So all the flow processing things below this "if" condition are skipped. Therefore this handler posted an empty flows dictionary to Core.
It's recommended that do one thing in a single app. The OpenADM app of Ryu controller, i.e. |
global coreIP | ||
coreIP = '127.0.0.1' | ||
global corePort | ||
corePort = '5567' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve the flexibility further, please load these value from config file so users don't have to modify the code to apply new configuration.
mod = parser.OFPFlowMod(datapath=datapath, match=match, cookie=0, command=ofproto.OFPFC_ADD, idle_timeout=0, | ||
hard_timeout=0, priority=priority, flags=ofproto.OFPFF_SEND_FLOW_REM, actions=actions) | ||
datapath.send_msg(mod) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the flow entries installed by omniui.py
are slightly different from the ones installed by simple_switch.py
. This situation happens on both OpenFlow10 & OpenFlow13. I still recommend you to try to split two functionalities apart (learning switch mechanism and event forwarding). Let the original simple_switch.py
and simple_switch_13.py
do their jobs, unless the same event cannot handled by two or more functions at the same time.
When I tried to add a flow entry, I got the following error which displayed on the console of Ryu controller:
The flow entry I added through web UI is listed below for the purpose of reproducing the error:
P.S. OpenFlow 1.3 |
Under the same input as the above comment, while using OpenFlow 1.0, will bring up following traceback:
It seems that the error was introduced before this PR, maybe open another issue? Update: issue #102 |
I cannot delete any flows, including the flow I added and generated by
|
return | ||
elif (srcp not in self.switches[src]) | (destp not in self.switches[dest]): | ||
print 'Not Ready' | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use logical operator instead of "bitwise or"?
Hosts lose connectivity when Mininet topology is larger than 4-level tree. It seems that the controller (adapter) could not handle that huge number of bursting events. |
838ed1c
to
17837ac
Compare
13ed654
to
c541194
Compare
+2 |
Manually rebased. |
Ryu adapter
Busylink detection
Ryu source code modification (switches.py, event.py)