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
8f20b95d
Commit
8f20b95d
authored
15 years ago
by
Brandon Heller
Browse files
Options
Downloads
Patches
Plain Diff
Auto-install run and clean scripts
Also remove usused imports and outdated doc text.
parent
a6b47322
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_clean.py
+4
-2
4 additions, 2 deletions
bin/mn_clean.py
mininet/net.py
+6
-55
6 additions, 55 deletions
mininet/net.py
setup.py
+16
-8
16 additions, 8 deletions
setup.py
with
26 additions
and
65 deletions
mininet/
clean
up
→
bin/mn_
clean
.py
+
4
−
2
View file @
8f20b95d
#!/usr/bin/python
#!/usr/bin/env python
"""
Mininet Cleanup
@author Bob Lantz (rlantz@cs.stanford.edu)
"""
Unfortunately, Mininet and OpenFlow don
'
t always clean up
properly after themselves. Until they do (or until cleanup
functionality is integrated into the python code), this
...
...
This diff is collapsed.
Click to expand it.
mininet/net.py
+
6
−
55
View file @
8f20b95d
#!/usr/bin/python
"""
Mininet: A simple networking testbed for OpenFlow!
"""
Mininet: A simple networking testbed for OpenFlow!
@author Bob Lantz (rlantz@cs.stanford.edu)
@author Brandon Heller (brandonh@stanford.edu)
Mininet creates scalable OpenFlow test networks by using
process-based virtualization and network namespaces.
...
...
@@ -16,7 +17,7 @@
A parent shell (and possibly some child processes) in a namespace
Hosts have a network interface which is configured via ifconfig/ip
link/etc.
with data network IP addresses (e.g. 192.168.123.2 )
link/etc.
This version supports both the kernel and user space datapaths
from the OpenFlow reference implementation.
...
...
@@ -43,40 +44,14 @@
Switch nodes are named s0-sN
Interfaces are named {nodename}-eth0 .. {nodename}-ethN,
Thoughts/TBD:
It should be straightforward to add a function to read
OpenFlowVMS spec files, but I haven
'
t done so yet.
For the moment, specifying configurations and tests in Python
is straightforward and relatively concise.
Soon, we may want to split the various subsystems (core,
topology/network, cli, tests, etc.) into multiple modules.
Currently nox support is in nox.py.
We
'
d like to support OpenVSwitch as well as the reference
implementation.
Bob Lantz
rlantz@cs.stanford.edu
History:
11/19/09 Initial revision (user datapath only)
11/19/09 Mininet demo at OpenFlow SWAI meeting
12/08/09 Kernel datapath support complete
12/09/09 Moved controller and switch routines into classes
12/12/09 Added subdivided network driver workflow
12/13/09 Added support for custom controller and switch classes
"""
import
os
import
re
from
subprocess
import
call
import
sys
from
time
import
sleep
#flush = sys.stdout.flush
#import os, re, signal, sys, select
from
mininet.logging_mod
import
lg
,
set_loglevel
from
mininet.node
import
Host
,
Controller
,
Switch
,
ControllerParams
from
mininet.topo
import
TreeTopo
from
mininet.logging_mod
import
lg
from
mininet.util
import
quietRun
,
fixLimits
from
mininet.util
import
make_veth_pair
,
move_intf
,
retry
,
MOVEINTF_DELAY
...
...
@@ -517,28 +492,4 @@ def run(self):
else
:
lg
.
error
(
'
CLI: unknown node or command: < %s >
\n
'
%
first
)
#lg.info('*** CLI: command complete\n')
return
'
exited by user command
'
if
__name__
==
'
__main__
'
:
if
len
(
sys
.
argv
)
>
1
:
set_loglevel
(
sys
.
argv
[
1
])
else
:
set_loglevel
(
'
info
'
)
init
()
results
=
{}
lg
.
info
(
"
*** Welcome to Mininet!
\n
"
)
lg
.
info
(
"
*** Look in examples/ for more examples
\n\n
"
)
lg
.
info
(
"
*** Testing Mininet with kernel and user datapath
\n
"
)
for
datapath
in
DATAPATHS
:
k
=
datapath
==
'
kernel
'
controller_params
=
ControllerParams
(
0x0a000000
,
8
)
# 10.0.0.0/8
mn
=
Mininet
(
TreeTopo
(),
Switch
,
Host
,
Controller
,
controller_params
)
mn
.
start
()
dropped
=
mn
.
ping_test
()
results
[
datapath
]
=
"
%i%% dropped
"
%
dropped
mn
.
stop
()
lg
.
info
(
"
*** Test results: %s
\n
"
,
results
)
\ No newline at end of file
return
'
exited by user command
'
\ No newline at end of file
This diff is collapsed.
Click to expand it.
setup.py
+
16
−
8
View file @
8f20b95d
...
...
@@ -2,26 +2,34 @@
'''
Setuptools params
'''
from
setuptools
import
setup
,
find_packages
from
os.path
import
join
scripts
=
[
join
(
'
bin
'
,
filename
)
for
filename
in
[
'
mn_run.py
'
,
'
mn_clean.py
'
]]
modname
=
distname
=
'
mininet
'
setup
(
name
=
'
mininet
'
,
name
=
distname
,
version
=
'
0.0.0
'
,
description
=
'
The OpenFlow-based data center netw
or
k
'
,
description
=
'
Process-based OpenFlow emulat
or
'
,
author
=
'
Bob Lantz
'
,
author_email
=
'
rlantz@cs.stanford.edu
'
,
packages
=
find_packages
(
exclude
=
'
test
'
),
long_description
=
"""
\
Insert longer description here.
"""
,
classifiers
=
[
classifiers
=
[
"
License :: OSI Approved :: GNU General Public License (GPL)
"
,
"
Programming Language :: Python
"
,
"
Development Status :: 4 - Beta
"
,
"
Intended Audience :: Developers
"
,
"
Topic :: Internet
"
,
],
keywords
=
'
networking protocol Internet OpenFlow
'
,
license
=
'
GPL
'
,
install_requires
=
[
],
keywords
=
'
networking protocol Internet OpenFlow
'
,
license
=
'
GPL
'
,
install_requires
=
[
'
setuptools
'
])
],
scripts
=
scripts
,
package_dir
=
{
modname
:
''
})
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