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
c80e18cd
Commit
c80e18cd
authored
15 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Worked once on user, kernel for 1-20 switches.
parent
1bda2d21
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/linearbandwidth.py
+22
-20
22 additions, 20 deletions
examples/linearbandwidth.py
with
22 additions
and
20 deletions
examples/linearbandwidth.py
+
22
−
20
View file @
c80e18cd
...
...
@@ -4,11 +4,11 @@
Test bandwidth (using iperf) on linear networks of varying size,
using both kernel and user datapaths.
We construct a network of N
switche
s and N
+
1
host
s, connected as follows:
We construct a network of N
host
s and N
-
1
switche
s, connected as follows:
h
N
<-> s
0
<-> s
1
.. sN-1
| | |
hN+1 hN+2
hN
+N
h
1
<-> s
N+1
<-> s
N+2
.. sN
+N
-1
|
|
|
h2 h3
hN
Note: by default, the reference controller only supports 16
switches, so this test WILL NOT WORK unless you have recompiled
...
...
@@ -24,7 +24,7 @@
from
mininet.log
import
lg
class
LinearTopo
(
Topo
):
"
Topology for a string of N
switches and 1+N host
s.
"
"
Topology for a string of N
hosts and N-1 switche
s.
"
def
__init__
(
self
,
N
):
...
...
@@ -32,22 +32,22 @@ def __init__( self, N ):
super
(
LinearTopo
,
self
).
__init__
()
# Create switch and host nodes
switches
=
range
(
0
,
N
)
hosts
=
range
(
N
,
2
*
N
+
1
)
for
id
in
switches
:
self
.
_add_node
(
id
,
Node
(
is_switch
=
True
)
)
hosts
=
range
(
1
,
N
+
1
)
switches
=
range
(
N
+
1
,
N
+
N
)
for
id
in
hosts
:
self
.
_add_node
(
id
,
Node
(
is_switch
=
False
)
)
# Connect switches
for
id
in
switches
:
self
.
_add_node
(
id
,
Node
(
is_switch
=
True
)
)
# Wire up switches
for
s
in
switches
[
:
-
1
]:
self
.
_add_edge
(
s
,
s
+
1
)
#
Connect
hosts
#
Wire up
hosts
self
.
_add_edge
(
hosts
[
0
],
switches
[
0
]
)
for
s
in
switches
:
self
.
_add_edge
(
s
,
s
+
N
+
1
)
for
h
in
hosts
[
1
:
]
:
self
.
_add_edge
(
h
,
h
+
N
-
1
)
# Consider all switches and hosts 'on'
self
.
enable_all
()
...
...
@@ -58,18 +58,20 @@ def linearBandwidthTest( lengths ):
datapaths
=
[
'
kernel
'
,
'
user
'
]
results
=
{}
switchCount
=
max
(
lengths
)
hostCount
=
switchCount
+
1
for
datapath
in
datapaths
:
Switch
=
KernelSwitch
if
datapath
==
'
kernel
'
else
UserSwitch
results
[
datapath
]
=
[]
net
=
Mininet
(
topo
=
LinearTopo
(
switch
Count
),
switch
=
Switch
)
net
=
Mininet
(
topo
=
LinearTopo
(
host
Count
),
switch
=
Switch
)
net
.
start
()
print
"
*** testing basic connectivity
"
net
.
ping
(
[
net
.
hosts
[
0
],
net
.
hosts
[
-
1
]
]
)
print
"
*** testing bandwidth
"
for
n
in
lengths
:
print
"
testing h0 <-> h
"
+
`n`
,
;
flush
()
bandwidth
=
net
.
iperf
(
[
net
.
hosts
[
0
],
net
.
hosts
[
n
]
]
)
src
,
dst
=
net
.
hosts
[
0
],
net
.
hosts
[
n
]
print
"
testing
"
,
src
.
name
,
"
<->
"
,
dst
.
name
bandwidth
=
net
.
iperf
(
[
src
,
dst
]
)
print
bandwidth
;
flush
()
results
[
datapath
]
+=
[
(
n
,
bandwidth
)
]
net
.
stop
()
...
...
@@ -90,6 +92,6 @@ def linearBandwidthTest( lengths ):
lg
.
setLogLevel
(
'
info
'
)
init
()
print
"
*** Running linearBandwidthTest
"
linearBandwidthTest
(
[
1
,
10
]
)
linearBandwidthTest
(
[
1
,
10
,
20
]
)
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