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
79c944ae
Commit
79c944ae
authored
10 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Remove obsolete OVSLegacyKernelSwitch
parent
a23c6a28
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
+1
-2
1 addition, 2 deletions
bin/mn
mininet/node.py
+18
-58
18 additions, 58 deletions
mininet/node.py
mininet/test/test_switchdpidassignment.py
+1
-8
1 addition, 8 deletions
mininet/test/test_switchdpidassignment.py
with
20 additions
and
68 deletions
bin/mn
+
1
−
2
View file @
79c944ae
...
@@ -28,7 +28,7 @@ from mininet.node import ( Host, CPULimitedHost, Controller, OVSController,
...
@@ -28,7 +28,7 @@ from mininet.node import ( Host, CPULimitedHost, Controller, OVSController,
RYU
,
NOX
,
RemoteController
,
findController
,
RYU
,
NOX
,
RemoteController
,
findController
,
DefaultController
,
DefaultController
,
UserSwitch
,
OVSSwitch
,
OVSBridge
,
UserSwitch
,
OVSSwitch
,
OVSBridge
,
OVSLegacyKernelSwitch
,
IVSSwitch
)
IVSSwitch
)
from
mininet.nodelib
import
LinuxBridge
from
mininet.nodelib
import
LinuxBridge
from
mininet.link
import
Link
,
TCLink
,
OVSLink
from
mininet.link
import
Link
,
TCLink
,
OVSLink
from
mininet.topo
import
SingleSwitchTopo
,
LinearTopo
,
SingleSwitchReversedTopo
from
mininet.topo
import
SingleSwitchTopo
,
LinearTopo
,
SingleSwitchReversedTopo
...
@@ -62,7 +62,6 @@ SWITCHES = { 'user': UserSwitch,
...
@@ -62,7 +62,6 @@ SWITCHES = { 'user': UserSwitch,
'
ovsbr
'
:
OVSBridge
,
'
ovsbr
'
:
OVSBridge
,
# Keep ovsk for compatibility with 2.0
# Keep ovsk for compatibility with 2.0
'
ovsk
'
:
OVSSwitch
,
'
ovsk
'
:
OVSSwitch
,
'
ovsl
'
:
OVSLegacyKernelSwitch
,
'
ivs
'
:
IVSSwitch
,
'
ivs
'
:
IVSSwitch
,
'
lxbr
'
:
LinuxBridge
,
'
lxbr
'
:
LinuxBridge
,
'
default
'
:
OVSSwitch
}
'
default
'
:
OVSSwitch
}
...
...
This diff is collapsed.
Click to expand it.
mininet/node.py
+
18
−
58
View file @
79c944ae
...
@@ -23,20 +23,26 @@
...
@@ -23,20 +23,26 @@
UserSwitch: a switch using the user-space switch from the OpenFlow
UserSwitch: a switch using the user-space switch from the OpenFlow
reference implementation.
reference implementation.
KernelSwitch: a switch using the kernel switch from the OpenFlow reference
OVSSwitch: a switch using the Open vSwitch OpenFlow-compatible switch
implementation.
OVSSwitch: a switch using the OpenVSwitch OpenFlow-compatible switch
implementation (openvswitch.org).
implementation (openvswitch.org).
OVSBridge: an Ethernet bridge implemented using Open vSwitch.
Supports STP.
IVSSwitch: OpenFlow switch using the Indigo Virtual Switch.
Controller: superclass for OpenFlow controllers. The default controller
Controller: superclass for OpenFlow controllers. The default controller
is controller(8) from the reference implementation.
is controller(8) from the reference implementation.
OVSController: The test controller from Open vSwitch.
NOXController: a controller node using NOX (noxrepo.org).
NOXController: a controller node using NOX (noxrepo.org).
RYU: The Ryu controller.
RemoteController: a remote controller node, which may use any
RemoteController: a remote controller node, which may use any
arbitrary OpenFlow-compatible controller, and which is not
arbitrary OpenFlow-compatible controller, and which is not
created or managed by
m
ininet.
created or managed by
M
ininet.
Future enhancements:
Future enhancements:
...
@@ -57,7 +63,7 @@
...
@@ -57,7 +63,7 @@
from
mininet.log
import
info
,
error
,
warn
,
debug
from
mininet.log
import
info
,
error
,
warn
,
debug
from
mininet.util
import
(
quietRun
,
errRun
,
errFail
,
moveIntf
,
isShellBuiltin
,
from
mininet.util
import
(
quietRun
,
errRun
,
errFail
,
moveIntf
,
isShellBuiltin
,
numCores
,
retry
,
mountCgroups
)
numCores
,
retry
,
mountCgroups
)
from
mininet.moduledeps
import
moduleDeps
,
pathCheck
,
OVS_KMOD
,
OF_KMOD
,
TUN
from
mininet.moduledeps
import
moduleDeps
,
pathCheck
,
TUN
from
mininet.link
import
Link
,
Intf
,
TCIntf
,
OVSIntf
from
mininet.link
import
Link
,
Intf
,
TCIntf
,
OVSIntf
from
re
import
findall
from
re
import
findall
from
distutils.version
import
StrictVersion
from
distutils.version
import
StrictVersion
...
@@ -1003,56 +1009,6 @@ def stop( self, deleteIntfs=True ):
...
@@ -1003,56 +1009,6 @@ def stop( self, deleteIntfs=True ):
self
.
cmd
(
'
kill %ofprotocol
'
)
self
.
cmd
(
'
kill %ofprotocol
'
)
super
(
UserSwitch
,
self
).
stop
(
deleteIntfs
)
super
(
UserSwitch
,
self
).
stop
(
deleteIntfs
)
class
OVSLegacyKernelSwitch
(
Switch
):
"""
Open VSwitch legacy kernel-space switch using ovs-openflowd.
Currently only works in the root namespace.
"""
def
__init__
(
self
,
name
,
dp
=
None
,
**
kwargs
):
"""
Init.
name: name for switch
dp: netlink id (0, 1, 2, ...)
defaultMAC: default MAC as unsigned int; random value if None
"""
Switch
.
__init__
(
self
,
name
,
**
kwargs
)
self
.
dp
=
dp
if
dp
else
self
.
name
self
.
intf
=
self
.
dp
if
self
.
inNamespace
:
error
(
"
OVSKernelSwitch currently only works
"
"
in the root namespace.
\n
"
)
exit
(
1
)
@classmethod
def
setup
(
cls
):
"
Ensure any dependencies are loaded; if not, try to load them.
"
pathCheck
(
'
ovs-dpctl
'
,
'
ovs-openflowd
'
,
moduleName
=
'
Open vSwitch (openvswitch.org)
'
)
moduleDeps
(
subtract
=
OF_KMOD
,
add
=
OVS_KMOD
)
def
start
(
self
,
controllers
):
"
Start up kernel datapath.
"
ofplog
=
'
/tmp/
'
+
self
.
name
+
'
-ofp.log
'
# Delete local datapath if it exists;
# then create a new one monitoring the given interfaces
self
.
cmd
(
'
ovs-dpctl del-dp
'
+
self
.
dp
)
self
.
cmd
(
'
ovs-dpctl add-dp
'
+
self
.
dp
)
intfs
=
[
str
(
i
)
for
i
in
self
.
intfList
()
if
not
i
.
IP
()
]
self
.
cmd
(
'
ovs-dpctl
'
,
'
add-if
'
,
self
.
dp
,
'
'
.
join
(
intfs
)
)
# Run protocol daemon
clist
=
'
,
'
.
join
(
[
'
tcp:%s:%d
'
%
(
c
.
IP
(),
c
.
port
)
for
c
in
controllers
]
)
self
.
cmd
(
'
ovs-openflowd
'
+
self
.
dp
+
'
'
+
clist
+
'
--fail=secure
'
+
self
.
opts
+
'
--datapath-id=
'
+
self
.
dpid
+
'
1>
'
+
ofplog
+
'
2>
'
+
ofplog
+
'
&
'
)
self
.
execed
=
False
def
stop
(
self
,
deleteIntfs
=
True
):
"""
Terminate kernel datapath.
"
deleteIntfs: delete interfaces? (True)
"""
quietRun
(
'
ovs-dpctl del-dp
'
+
self
.
dp
)
self
.
cmd
(
'
kill %ovs-openflowd
'
)
super
(
OVSLegacyKernelSwitch
,
self
).
stop
(
deleteIntfs
)
class
OVSSwitch
(
Switch
):
class
OVSSwitch
(
Switch
):
"
Open vSwitch switch. Depends on ovs-vsctl.
"
"
Open vSwitch switch. Depends on ovs-vsctl.
"
...
@@ -1289,11 +1245,14 @@ def batchShutdown( cls, switches, run=errRun ):
...
@@ -1289,11 +1245,14 @@ def batchShutdown( cls, switches, run=errRun ):
class
OVSBridge
(
OVSSwitch
):
class
OVSBridge
(
OVSSwitch
):
"
OVSBridge is an OVSSwitch in standalone/bridge mode
"
"
OVSBridge is an OVSSwitch in standalone/bridge mode
"
def
__init__
(
self
,
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
"""
stp: enable Spanning Tree Protocol (False)
see OVSSwitch for other options
"""
kwargs
.
update
(
failMode
=
'
standalone
'
)
kwargs
.
update
(
failMode
=
'
standalone
'
)
OVSSwitch
.
__init__
(
self
,
args
,
**
kwargs
)
OVSSwitch
.
__init__
(
self
,
*
args
,
**
kwargs
)
def
start
(
self
,
controllers
):
def
start
(
self
,
controllers
):
"
Start bridge, ignoring controllers argument
"
OVSSwitch
.
start
(
self
,
controllers
=
[]
)
OVSSwitch
.
start
(
self
,
controllers
=
[]
)
def
connected
(
self
):
def
connected
(
self
):
...
@@ -1510,6 +1469,7 @@ def __init__( self, name, *ryuArgs, **kwargs ):
...
@@ -1510,6 +1469,7 @@ def __init__( self, name, *ryuArgs, **kwargs ):
cdir
=
ryuCoreDir
,
cdir
=
ryuCoreDir
,
**
kwargs
)
**
kwargs
)
class
RemoteController
(
Controller
):
class
RemoteController
(
Controller
):
"
Controller running outside of Mininet
'
s control.
"
"
Controller running outside of Mininet
'
s control.
"
...
...
This diff is collapsed.
Click to expand it.
mininet/test/test_switchdpidassignment.py
+
1
−
8
View file @
79c944ae
...
@@ -8,8 +8,7 @@
...
@@ -8,8 +8,7 @@
from
mininet.net
import
Mininet
from
mininet.net
import
Mininet
from
mininet.node
import
Host
,
Controller
from
mininet.node
import
Host
,
Controller
from
mininet.node
import
(
UserSwitch
,
OVSSwitch
,
OVSLegacyKernelSwitch
,
from
mininet.node
import
(
UserSwitch
,
OVSSwitch
,
IVSSwitch
)
IVSSwitch
)
from
mininet.topo
import
Topo
from
mininet.topo
import
Topo
from
mininet.log
import
setLogLevel
from
mininet.log
import
setLogLevel
from
mininet.util
import
quietRun
from
mininet.util
import
quietRun
...
@@ -81,12 +80,6 @@ class testSwitchOVSUser( TestSwitchDpidAssignmentOVS ):
...
@@ -81,12 +80,6 @@ class testSwitchOVSUser( TestSwitchDpidAssignmentOVS ):
"
Test dpid assignnment of OVS User Switch.
"
"
Test dpid assignnment of OVS User Switch.
"
switchClass
=
OVSUser
switchClass
=
OVSUser
@unittest.skipUnless
(
quietRun
(
'
which ovs-openflowd
'
),
'
OVS Legacy Kernel switch is not installed
'
)
class
testSwitchOVSLegacyKernel
(
TestSwitchDpidAssignmentOVS
):
"
Test dpid assignnment of OVS Legacy Kernel Switch.
"
switchClass
=
OVSLegacyKernelSwitch
@unittest.skipUnless
(
quietRun
(
'
which ivs-ctl
'
),
@unittest.skipUnless
(
quietRun
(
'
which ivs-ctl
'
),
'
IVS switch is not installed
'
)
'
IVS switch is not installed
'
)
class
testSwitchIVS
(
TestSwitchDpidAssignmentOVS
):
class
testSwitchIVS
(
TestSwitchDpidAssignmentOVS
):
...
...
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