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
16c57ddb
Commit
16c57ddb
authored
15 years ago
by
Brandon Heller
Browse files
Options
Downloads
Patches
Plain Diff
Enable controller-less setups
parent
4804237f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/mn_run.py
+3
-1
3 additions, 1 deletion
bin/mn_run.py
mininet/net.py
+9
-8
9 additions, 8 deletions
mininet/net.py
mininet/node.py
+8
-5
8 additions, 5 deletions
mininet/node.py
with
20 additions
and
14 deletions
bin/mn_run.py
+
3
−
1
View file @
16c57ddb
...
...
@@ -30,9 +30,11 @@
HOSTS
=
{
'
process
'
:
Host
}
CONTROLLER_DEF
=
'
ref
'
# a and b are the name and inNamespace params.
CONTROLLERS
=
{
'
ref
'
:
Controller
,
'
nox_dump
'
:
lambda
a
,
b
:
NOX
(
a
,
b
,
'
packetdump
'
),
'
nox_pysw
'
:
lambda
a
,
b
:
NOX
(
a
,
b
,
'
pyswitch
'
)}
'
nox_pysw
'
:
lambda
a
,
b
:
NOX
(
a
,
b
,
'
pyswitch
'
),
'
none
'
:
lambda
a
,
b
:
None
}
# optional tests to run
TESTS
=
[
'
cli
'
,
'
build
'
,
'
ping_all
'
,
'
ping_pair
'
,
'
iperf
'
,
'
all
'
]
...
...
This diff is collapsed.
Click to expand it.
mininet/net.py
+
9
−
8
View file @
16c57ddb
...
...
@@ -161,7 +161,8 @@ def _add_controller(self, controller):
@param controller Controller class
'''
controller
=
self
.
controller
(
'
c0
'
,
not
self
.
kernel
)
self
.
controllers
[
'
c0
'
]
=
controller
if
controller
:
# allow controller-less setups
self
.
controllers
[
'
c0
'
]
=
controller
# Control network support:
#
...
...
@@ -290,15 +291,14 @@ def build(self, xterms, cleanup):
def
start
(
self
):
'''
Start controller and switches
\n
'''
lg
.
info
(
'
*** Starting controller
\n
'
)
self
.
controllers
[
'
c0
'
].
start
()
#for controller in self.controllers:
# controller.start()
for
cname
,
cnode
in
self
.
controllers
.
iteritems
():
cnode
.
start
()
lg
.
info
(
'
*** Starting %s switches
\n
'
%
len
(
self
.
topo
.
switches
()))
for
switch_dpid
in
self
.
topo
.
switches
():
switch
=
self
.
nodes
[
switch_dpid
]
#lg.info('switch = %s' % switch)
lg
.
info
(
'
0x%x
'
%
switch_dpid
)
switch
.
start
(
self
.
controllers
[
'
c0
'
]
)
switch
.
start
(
self
.
controllers
)
lg
.
info
(
'
\n
'
)
def
stop
(
self
):
...
...
@@ -316,8 +316,8 @@ def stop(self):
switch
.
stop
()
lg
.
info
(
'
\n
'
)
lg
.
info
(
'
*** Stopping controller
\n
'
)
#
for c
ontroller
in self.controllers.iterite
r
ms():
self
.
controllers
[
'
c0
'
]
.
stop
()
for
c
name
,
cnode
in
self
.
controllers
.
iteritems
():
cnode
.
stop
()
lg
.
info
(
'
*** Test complete
\n
'
)
def
run
(
self
,
test
,
**
params
):
...
...
@@ -448,7 +448,8 @@ def __init__(self, mininet):
self
.
nodemap
=
{}
# map names to Node objects
for
node
in
self
.
mn
.
nodes
.
values
():
self
.
nodemap
[
node
.
name
]
=
node
self
.
nodemap
[
'
c0
'
]
=
self
.
mn
.
controllers
[
'
c0
'
]
for
cname
,
cnode
in
self
.
mn
.
controllers
.
iteritems
():
self
.
nodemap
[
cname
]
=
cnode
self
.
nodelist
=
self
.
nodemap
.
values
()
self
.
run
()
...
...
This diff is collapsed.
Click to expand it.
mininet/node.py
+
8
−
5
View file @
16c57ddb
...
...
@@ -253,13 +253,16 @@ def __init__(self, name, datapath = None):
self
.
dp
=
datapath
Node
.
__init__
(
self
,
name
,
inNamespace
=
(
datapath
==
None
))
def
_startUserDatapath
(
self
,
controller
):
def
_startUserDatapath
(
self
,
controller
s
):
'''
Start OpenFlow reference user datapath.
Log to /tmp/sN-{ofd,ofp}.log.
@param controller
C
ontroller object
.
@param controller
s dict of c
ontroller
names to
object
s
'''
if
'
c0
'
not
in
controller
:
raise
Exception
(
'
User datapath start() requires controller c0
'
)
controller
=
controllers
[
'
c0
'
]
ofdlog
=
'
/tmp/
'
+
self
.
name
+
'
-ofd.log
'
ofplog
=
'
/tmp/
'
+
self
.
name
+
'
-ofp.log
'
self
.
cmd
(
'
ifconfig lo up
'
)
...
...
@@ -302,13 +305,13 @@ def _stopKernelDatapath(self):
quietRun
(
'
ip link del
'
+
intf
)
lg
.
info
(
'
.
'
)
def
start
(
self
,
controller
):
def
start
(
self
,
controller
s
):
'''
Start datapath.
@param controller
C
ontroller object
@param controller
s dict of c
ontroller
names to
object
s
'''
if
self
.
dp
is
None
:
self
.
_startUserDatapath
(
controller
)
self
.
_startUserDatapath
(
controller
s
)
else
:
self
.
_startKernelDatapath
()
...
...
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