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
95d9a374
Commit
95d9a374
authored
15 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Added README.
Modified cleanup to use dpctl to remove kernel datapaths.
parent
994c68f6
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
README
+80
-0
80 additions, 0 deletions
README
cleanup
+1
-1
1 addition, 1 deletion
cleanup
mininet.py
+11
-7
11 additions, 7 deletions
mininet.py
with
92 additions
and
8 deletions
README
0 → 100644
+
80
−
0
View file @
95d9a374
Mininet: A Simple Virtual Testbed for OpenFlow
aka
How to Squeeze a 1024-node OpenFlow Network onto your Laptop
(Extremely Experimental Development Version 0.1, December 2009)
---
Mininet creates simple OpenFlow test networks by using process-based
virtualization and network namespaces.
Simulated hosts (as well as switches and controllers with the user datapath)
are created as processes in separate network namespaces. This allows a
complete OpenFlow network to be simulated on top of a single Linux kernel.
In order to run Mininet, you must have:
* A Linux 2.6.26 or greater kernel compiled with network namespace support
enabled. (Debian-testing should work.)
* The OpenFlow reference implementation (either the user or kernel datapath
may be used, and the tun or ofdatapath kernel modules must be loaded,
respectively)
* Python, Bash, etc.
* Root privilieges (required for network device access)
* The netns program or equivalent (included as netns.c)
Currently mininet includes:
A simple node infrastructure (Host, Switch, Controller classes) for
creating virtual OpenFlow networks.
A simple network infrastructure (class Network and its descendants
TreeNet, GridNet and LinearNet) for creating scalable topologies and
running experiments (using someNetwork.run( test ) )
Some simple tests which can be run by someNetwork.run( test )
A simple command-line interface which may be invoked on a network
using .run( Cli )
Examples (in examples/ directory) to help you get started.
Notes and Advice:
For scalable configurations, you may need to increase some of your kernel
limits. For example, you could add something like the following to
/etc/sysctl.conf:
# OpenFlow: get rid of ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
# Mininet: Increase open file limit
fs.file-max = 100000
# Mininet: increase network buffer space
net.core.wmem_max = 16777216
net.core.rmem_max = 16777216
net.ipv4.tcp_rmem = 10240 87380 16777216
net.ipv4.tcp_rmem = 10240 87380 16777216
net.core.netdev_max_backlog = 5000
# Mininet: increase arp cache size
net.ipv4.neigh.default.gc_thresh1 = 4096
net.ipv4.neigh.default.gc_thresh2 = 8192
net.ipv4.neigh.default.gc_thresh3 = 16384
# Mininet .... and increase routing table size
net.ipv4.route.max_size=32768
---
Bob Lantz
rlantz@cs.stanford.edu
This diff is collapsed.
Click to expand it.
cleanup
+
1
−
1
View file @
95d9a374
...
...
@@ -12,7 +12,7 @@ echo "Removing excess controllers/ofprotocols/ofdatapaths/pings"
killall
-9
controller ofprotocol ofdatapath ping 2> /dev/null
echo
"Removing excess kernel datapath processes"
ps ax |
grep
'dp[0-9]'
|
awk
'{print $1;}'
| xargs
kill
ps ax |
e
grep
-o
'dp[0-9]
+
'
|
sed
's/dp/nl:/'
| xargs
-l1
echo
dpctl deldp
echo
"Removing vconn junk in /tmp"
rm
-f
/tmp/vconn
*
/tmp/vlogs
*
/tmp/
*
.out /tmp/
*
.log
...
...
This diff is collapsed.
Click to expand it.
mininet.py
+
11
−
7
View file @
95d9a374
...
...
@@ -429,6 +429,17 @@ class Network( object ):
"
Network topology (and test driver) base class.
"
def
__init__
(
self
,
kernel
=
True
,
startAddr
=
(
192
,
168
,
123
,
1
)
):
self
.
kernel
,
self
.
startAddr
=
kernel
,
startAddr
# Check for kernel modules
tun
=
quietRun
(
[
'
sh
'
,
'
-c
'
,
'
lsmod | grep tun
'
]
)
ofdatapath
=
quietRun
(
[
'
sh
'
,
'
-c
'
,
'
lsmod | grep ofdatapath
'
]
)
if
tun
==
''
and
not
kernel
:
print
"
*** Error: kernel module tun not loaded:
"
,
print
"
user datapath not supported
"
exit
(
1
)
if
ofdatapath
==
''
and
kernel
:
print
"
*** Error: ofdatapath not loaded:
"
,
print
"
kernel datapath not supported
"
exit
(
1
)
# In progress: we probably want to decouple creating/starting/stopping
# the network and running tests, since we might wish to run
# multiple tests on the same network. It's not clear if the network
...
...
@@ -736,13 +747,6 @@ def init():
# Perhaps we should do so automatically!
if
os
.
getuid
()
!=
0
:
print
"
*** Mininet must run as root.
"
;
exit
(
1
)
# Check for kernel modules
tun
=
quietRun
(
[
'
sh
'
,
'
-c
'
,
'
lsmod | grep tun
'
]
)
ofdatapath
=
quietRun
(
[
'
sh
'
,
'
-c
'
,
'
lsmod | grep ofdatapath
'
]
)
if
tun
==
''
:
print
"
*** tun not found: user datapath not supported
"
if
ofdatapath
==
''
:
print
"
*** ofdatapath not found: kernel datapath not supported
"
fixLimits
()
if
__name__
==
'
__main__
'
:
...
...
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