Skip to content
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

Closed
wants to merge 38 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
f5935cd
Revise ryu adapter
hsiaohsuan1l1l Feb 2, 2016
2bcb1d6
Register event for busylink detection
hsiaohsuan1l1l Feb 2, 2016
f8b752b
Revise busylink detection
hsiaohsuan1l1l Feb 2, 2016
f130ced
Update event and switches for ryu adapter
hsiaohsuan1l1l Feb 2, 2016
7a504c9
Update installation for new version adapter
hsiaohsuan1l1l Feb 2, 2016
904c848
Revise installation for readability
hsiaohsuan1l1l Feb 2, 2016
d5577d3
Revise installation for readability
hsiaohsuan1l1l Feb 2, 2016
16765ff
Update installation for new version adapter
hsiaohsuan1l1l Feb 2, 2016
a517ab4
Merge branch 'adapter' of https://github.com/hsiaohsuan1l1l/OpenADM i…
hsiaohsuan1l1l Feb 2, 2016
dbb84a5
Revise busylink for race condition
hsiaohsuan1l1l Feb 3, 2016
755e186
Revise checking of port feature
hsiaohsuan1l1l Feb 24, 2016
69ab42b
Change the type of space
hsiaohsuan1l1l Mar 1, 2016
fae9f5f
Exclude the strange port
hsiaohsuan1l1l Mar 1, 2016
4b2e7c5
Update event.py
hsiaohsuan1l1l Mar 3, 2016
916fe10
Update switches.py
hsiaohsuan1l1l Mar 3, 2016
f5bc335
Update switches.py
hsiaohsuan1l1l Mar 3, 2016
eec21b7
Update switches.py
hsiaohsuan1l1l Mar 3, 2016
f93a5fb
Update switches.py
hsiaohsuan1l1l Mar 3, 2016
b4e8ef2
Update the mean to calculate capacity
hsiaohsuan1l1l Mar 5, 2016
731c6d9
Update busylink
hsiaohsuan1l1l Mar 5, 2016
ef945a4
Modify the message of busylink
hsiaohsuan1l1l Mar 17, 2016
a0ff762
Modify the message of busylink
hsiaohsuan1l1l Mar 17, 2016
1e44c08
Add controller name to busylink
hsiaohsuan1l1l Mar 24, 2016
769bec7
Merge branch 'master' into adapter
hsiaohsuan1l1l Mar 24, 2016
f32cbaa
Fix duplicated event.py and switches.py
hsiaohsuan1l1l May 10, 2016
3b5a3aa
Fix the hard coded coreIP
hsiaohsuan1l1l May 11, 2016
6489728
Merge branch 'adapter' of https://github.com/hsiaohsuan1l1l/OpenADM i…
hsiaohsuan1l1l May 11, 2016
5cc15a0
Fix dict error in busylink_detect
hsiaohsuan1l1l May 11, 2016
2a2166e
Fix ryu adapter for OpenFlow1.0
hsiaohsuan1l1l May 14, 2016
36af1e9
Remove forwarding functionality in ryu adapter
hsiaohsuan1l1l May 15, 2016
555fb38
Fix type conversion, refer to #102
hsiaohsuan1l1l May 16, 2016
7bfcde9
Fix flow deletion functionality, refer to #102
hsiaohsuan1l1l May 19, 2016
884639f
Fix default value error in ryu adapter, refer to #102
hsiaohsuan1l1l May 19, 2016
61c10ad
Fix the misuse of operator
hsiaohsuan1l1l May 19, 2016
0b31565
Fix dpid type conversion, refer to #102
hsiaohsuan1l1l May 27, 2016
d712836
Increase the size of event queue for 7-level tree topology
hsiaohsuan1l1l May 27, 2016
f484483
Update readme for modification of app manager
hsiaohsuan1l1l May 28, 2016
c541194
Fix dict error in for loop
hsiaohsuan1l1l May 28, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions adapter/ryu/omniui/omniui.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from operator import attrgetter
from ryu.ofproto.ether import ETH_TYPE_LLDP, ETH_TYPE_IPV6
from ryu.lib import hub
from ryu.lib.mac import haddr_to_bin
from ryu.lib.packet import *
from ryu.topology import event, switches

Expand Down Expand Up @@ -100,6 +101,14 @@ def switch_features_handler(self, ev):
ofproto.OFPCML_NO_BUFFER)]
self.add_flow(datapath, 0, match, actions)

def add_flow10(self, datapath, priority, match, actions):
ofproto = datapath.ofproto
parser = datapath.ofproto_parser

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)

Copy link
Member

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.

def add_flow(self, datapath, priority, match, actions):
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
Expand Down Expand Up @@ -447,8 +456,12 @@ def packet_in_handler(self, ev):

# install a flow to avoid packet_in next time
if out_port != ofproto.OFPP_FLOOD:
match = parser.OFPMatch(in_port=in_port, eth_dst=dst, eth_src=src)
self.add_flow(datapath, 1, match, actions)
if ofproto.OFP_VERSION == ofproto_v1_0.OFP_VERSION:
match = parser.OFPMatch(in_port=in_port, dl_dst=haddr_to_bin(dst))
self.add_flow10(datapath, 1, match, actions)
else:
match = parser.OFPMatch(in_port=in_port, eth_dst=dst, eth_src=src)
self.add_flow(datapath, 1, match, actions)

data = None
if msg.buffer_id == ofproto.OFP_NO_BUFFER:
Expand Down