Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mininet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olaf Bergmann
mininet
Commits
89cc29b4
Commit
89cc29b4
authored
10 years ago
by
lantz
Browse files
Options
Downloads
Plain Diff
Merge pull request #367 from cdburkard/devel/Ryu
add Ryu controller support to Mininet
parents
dedb06b2
686a9993
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/mn
+2
-1
2 additions, 1 deletion
bin/mn
mininet/node.py
+21
-0
21 additions, 0 deletions
mininet/node.py
util/install.sh
+36
-2
36 additions, 2 deletions
util/install.sh
with
59 additions
and
3 deletions
bin/mn
+
2
−
1
View file @
89cc29b4
...
...
@@ -25,7 +25,7 @@ from mininet.cli import CLI
from
mininet.log
import
lg
,
LEVELS
,
info
,
debug
,
warn
,
error
from
mininet.net
import
Mininet
,
MininetWithControlNet
,
VERSION
from
mininet.node
import
(
Host
,
CPULimitedHost
,
Controller
,
OVSController
,
NOX
,
RemoteController
,
DefaultController
,
RYU
,
NOX
,
RemoteController
,
DefaultController
,
UserSwitch
,
OVSSwitch
,
OVSLegacyKernelSwitch
,
IVSSwitch
)
from
mininet.nodelib
import
LinuxBridge
...
...
@@ -74,6 +74,7 @@ CONTROLLERS = { 'ref': Controller,
'
nox
'
:
NOX
,
'
remote
'
:
RemoteController
,
'
default
'
:
DefaultController
,
'
ryu
'
:
RYU
,
'
none
'
:
lambda
name
:
None
}
LINKDEF
=
'
default
'
...
...
This diff is collapsed.
Click to expand it.
mininet/node.py
+
21
−
0
View file @
89cc29b4
...
...
@@ -1347,6 +1347,27 @@ def __init__( self, name, *noxArgs, **kwargs ):
cdir
=
noxCoreDir
,
**
kwargs
)
class
RYU
(
Controller
):
"
Controller to run Ryu application
"
def
__init__
(
self
,
name
,
*
ryuArgs
,
**
kwargs
):
"""
Init.
name: name to give controller.
ryuArgs: arguments and modules to pass to Ryu
"""
homeDir
=
quietRun
(
'
printenv HOME
'
).
strip
(
'
\r\n
'
)
ryuCoreDir
=
'
%s/ryu/ryu/app/
'
%
homeDir
if
not
ryuArgs
:
warn
(
'
warning: no Ryu modules specified;
'
'
running simple_switch only
\n
'
)
ryuArgs
=
[
ryuCoreDir
+
'
simple_switch.py
'
]
elif
type
(
ryuArgs
)
not
in
(
list
,
tuple
):
ryuArgs
=
[
ryuArgs
]
Controller
.
__init__
(
self
,
name
,
command
=
'
ryu-manager
'
,
cargs
=
'
--ofp-tcp-listen-port %s
'
+
'
'
.
join
(
ryuArgs
),
cdir
=
ryuCoreDir
,
**
kwargs
)
class
RemoteController
(
Controller
):
"
Controller running outside of Mininet
'
s control.
"
...
...
This diff is collapsed.
Click to expand it.
util/install.sh
+
36
−
2
View file @
89cc29b4
...
...
@@ -383,6 +383,38 @@ function ivs {
sudo
make
install
}
# Install RYU
function
ryu
{
echo
"Installing RYU..."
# install Ryu dependencies"
$install
autoconf automake g++ libtool python make
if
[
"
$DIST
"
=
"Ubuntu"
]
;
then
$install
libxml2 libxslt-dev python-pip python-dev
sudo
pip
install
gevent
elif
[
"
$DIST
"
=
"Debian"
]
;
then
$install
libxml2 libxslt-dev python-pip python-dev
sudo
pip
install
gevent
fi
# if needed, update python-six
SIX_VER
=
`
pip show six |
grep
Version |
awk
'{print $2}'
`
if
version_ge 1.7.0
$SIX_VER
;
then
echo
"Installing python-six version 1.7.0..."
sudo
pip
install
-I
six
==
1.7.0
fi
# fetch RYU
cd
$BUILD_DIR
/
git clone git://github.com/osrg/ryu.git ryu
cd
ryu
# install ryu
sudo
python ./setup.py
install
# Add symbolic link to /usr/bin
sudo ln
-s
./bin/ryu-manager /usr/local/bin/ryu-manager
}
# Install NOX with tutorial files
function
nox
{
echo
"Installing NOX w/tutorial files..."
...
...
@@ -645,7 +677,7 @@ function vm_clean {
}
function
usage
{
printf
'\nUsage: %s [-abcdfhikmnprtvVwx03]\n\n'
$(
basename
$0
)
>
&2
printf
'\nUsage: %s [-abcdfhikmnprtvVwx
y
03]\n\n'
$(
basename
$0
)
>
&2
printf
'This install script attempts to install useful packages\n'
>
&2
printf
'for Mininet. It should (hopefully) work on Ubuntu 11.10+\n'
>
&2
...
...
@@ -672,6 +704,7 @@ function usage {
printf
--
' -v: install Open (V)switch\n'
>
&2
printf
--
' -V <version>: install a particular version of Open (V)switch on Ubuntu\n'
>
&2
printf
--
' -w: install OpenFlow (W)ireshark dissector\n'
>
&2
printf
--
' -y: install R(y)u Controller\n'
>
&2
printf
--
' -x: install NO(X) Classic OpenFlow controller\n'
>
&2
printf
--
' -0: (default) -0[fx] installs OpenFlow 1.0 versions\n'
>
&2
printf
--
' -3: -3[fx] installs OpenFlow 1.3 versions\n'
>
&2
...
...
@@ -684,7 +717,7 @@ if [ $# -eq 0 ]
then
all
else
while
getopts
'abcdefhikmnprs:tvV:wx03'
OPTION
while
getopts
'abcdefhikmnprs:tvV:wx
y
03'
OPTION
do
case
$OPTION
in
a
)
all
;;
...
...
@@ -717,6 +750,7 @@ else
1.3
)
nox13
;;
*
)
echo
"Invalid OpenFlow version
$OF_VERSION
"
;;
esac
;;
y
)
ryu
;;
0
)
OF_VERSION
=
1.0
;;
3
)
OF_VERSION
=
1.3
;;
?
)
usage
;;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment