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
Show file tree
Hide file tree
Changes from 25 commits
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
4 changes: 3 additions & 1 deletion adapter/ryu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ~/ryu/ryu/topology`
$ `cp switches.py ~/ryu/ryu/topology`
$ `cd ~/ryu; sudo python ./setup.py install`

###Execution###
**Ryu 1.0**
Expand Down
178 changes: 178 additions & 0 deletions adapter/ryu/event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import logging
from ryu.controller import handler
from ryu.controller import event

LOG = logging.getLogger(__name__)


class EventSwitchBase(event.EventBase):
def __init__(self, switch):
super(EventSwitchBase, self).__init__()
self.switch = switch

def __str__(self):
return '%s<dpid=%s, %s ports>' % \
(self.__class__.__name__,
self.switch.dp.id, len(self.switch.ports))


class EventSwitchEnter(EventSwitchBase):
def __init__(self, switch):
super(EventSwitchEnter, self).__init__(switch)


class EventSwitchLeave(EventSwitchBase):
def __init__(self, switch):
super(EventSwitchLeave, self).__init__(switch)


class EventSwitchReconnected(EventSwitchBase):
def __init__(self, switch):
super(EventSwitchReconnected, self).__init__(switch)


class EventPortBase(event.EventBase):
def __init__(self, port):
super(EventPortBase, self).__init__()
self.port = port

def __str__(self):
return '%s<%s>' % (self.__class__.__name__, self.port)


class EventPortAdd(EventPortBase):
def __init__(self, port):
super(EventPortAdd, self).__init__(port)


class EventPortDelete(EventPortBase):
def __init__(self, port):
super(EventPortDelete, self).__init__(port)


class EventPortModify(EventPortBase):
def __init__(self, port):
super(EventPortModify, self).__init__(port)


class EventSwitchRequest(event.EventRequestBase):
# If dpid is None, reply all list
def __init__(self, dpid=None):
super(EventSwitchRequest, self).__init__()
self.dst = 'switches'
self.dpid = dpid

def __str__(self):
return 'EventSwitchRequest<src=%s, dpid=%s>' % \
(self.src, self.dpid)


class EventSwitchReply(event.EventReplyBase):
def __init__(self, dst, switches):
super(EventSwitchReply, self).__init__(dst)
self.switches = switches

def __str__(self):
return 'EventSwitchReply<dst=%s, %s>' % \
(self.dst, self.switches)


class EventLinkBase(event.EventBase):
def __init__(self, link):
super(EventLinkBase, self).__init__()
self.link = link

def __str__(self):
return '%s<%s>' % (self.__class__.__name__, self.link)


class EventLinkAdd(EventLinkBase):
def __init__(self, link):
super(EventLinkAdd, self).__init__(link)


class EventLinkDelete(EventLinkBase):
def __init__(self, link):
super(EventLinkDelete, self).__init__(link)


class EventLinkRequest(event.EventRequestBase):
# If dpid is None, reply all list
def __init__(self, dpid=None):
super(EventLinkRequest, self).__init__()
self.dst = 'switches'
self.dpid = dpid

def __str__(self):
return 'EventLinkRequest<src=%s, dpid=%s>' % \
(self.src, self.dpid)


class EventLinkReply(event.EventReplyBase):
def __init__(self, dst, dpid, links):
super(EventLinkReply, self).__init__(dst)
self.dpid = dpid
self.links = links

def __str__(self):
return 'EventLinkReply<dst=%s, dpid=%s, links=%s>' % \
(self.dst, self.dpid, len(self.links))


class EventHostRequest(event.EventRequestBase):
# if dpid is None, replay all hosts
def __init__(self, dpid=None):
super(EventHostRequest, self).__init__()
self.dst = 'switches'
self.dpid = dpid

def __str__(self):
return 'EventHostRequest<src=%s, dpid=%s>' % \
(self.src, self.dpid)


class EventHostReply(event.EventReplyBase):
def __init__(self, dst, dpid, hosts):
super(EventHostReply, self).__init__(dst)
self.dpid = dpid
self.hosts = hosts

def __str__(self):
return 'EventHostReply<dst=%s, dpid=%s, hosts=%s>' % \
(self.dst, self.dpid, len(self.hosts))


class EventHostBase(event.EventBase):
def __init__(self, host):
super(EventHostBase, self).__init__()
self.host = host

def __str__(self):
return '%s<%s>' % (self.__class__.__name__, self.host)


class EventHostAdd(EventHostBase):
def __init__(self, host):
super(EventHostAdd, self).__init__(host)


class EventHostDelete(EventHostBase):
def __init__(self, host):
super(EventHostDelete, self).__init__(host)

handler.register_service('ryu.topology.switches')
Loading