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
f0ce6f50
Commit
f0ce6f50
authored
10 years ago
by
cody burkard
Browse files
Options
Downloads
Patches
Plain Diff
measure loss with udp iperf
parent
12095a12
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/intfOptions.py
+4
-5
4 additions, 5 deletions
examples/intfOptions.py
examples/test/test_intfOptions.py
+7
-10
7 additions, 10 deletions
examples/test/test_intfOptions.py
with
11 additions
and
15 deletions
examples/intfOptions.py
+
4
−
5
View file @
f0ce6f50
...
...
@@ -13,7 +13,7 @@
def
intfOptions
():
"
run various traffic control commands on a single interface
"
net
=
Mininet
()
net
=
Mininet
(
autoStaticArp
=
True
)
net
.
addController
(
'
c0
'
)
h1
=
net
.
addHost
(
'
h1
'
)
h2
=
net
.
addHost
(
'
h2
'
)
...
...
@@ -32,13 +32,12 @@ def intfOptions():
info
(
'
\n
*** Configuring one intf with loss of 50%
\n
'
)
link1
.
intf1
.
config
(
loss
=
50
)
info
(
'
\n
*** Running 20 pings to test
\n
'
)
info
(
net
.
hosts
[
0
].
cmd
(
'
ping -c 20 -i .2 10.0.0.2
'
)
)
info
(
'
\n
'
)
net
.
iperf
(
(
h1
,
h2
),
l4Type
=
'
UDP
'
)
info
(
'
\n
*** Configuring one intf with delay of 15ms
\n
'
)
link1
.
intf1
.
config
(
delay
=
'
15ms
'
)
info
(
'
\n
*** Run a ping to confirm delay
'
)
info
(
'
\n
*** Run a ping to confirm delay
\n
'
)
net
.
pingPairFull
()
info
(
'
\n
*** Done testing
\n
'
)
...
...
This diff is collapsed.
Click to expand it.
examples/test/test_intfOptions.py
+
7
−
10
View file @
f0ce6f50
...
...
@@ -15,7 +15,7 @@ def testIntfOptions( self ):
p
=
pexpect
.
spawn
(
'
python -m mininet.examples.intfOptions
'
)
tolerance
=
.
8
opts
=
[
"
Results: \[
'
([\d\.]+) .bits/sec
"
,
"
(\d+) packets transmitted, (\d+) received, (\d+)% packet loss, time (\d+)ms
"
,
"
Results: \[
'
10M
'
,
'
([\d\.]+) .bits/sec
"
,
"
h(\d+)->h(\d+): (\d)/(\d), rtt min/avg/max/mdev ([\d\.]+)/([\d\.]+)/([\d\.]+)/([\d\.]+) ms
"
,
pexpect
.
EOF
]
while
True
:
...
...
@@ -25,17 +25,14 @@ def testIntfOptions( self ):
self
.
assertGreaterEqual
(
bw
,
float
(
5
*
tolerance
)
)
self
.
assertLessEqual
(
bw
,
float
(
5
+
5
*
(
1
-
tolerance
)
)
)
elif
index
==
1
:
loss
=
int
(
p
.
match
.
group
(
3
)
)
msg
=
(
"
testing packet loss at 50%
\n
"
,
"
this test will sometimes fail
\n
"
,
"
ran 20 pings accross network
\n
"
,
"
packet loss is %d%%
\n\n
"
%
loss
)
self
.
assertGreaterEqual
(
loss
,
50
*
.
8
,
msg
)
self
.
assertLessEqual
(
loss
,
50
+
50
*
(
1
-
tolerance
),
msg
)
BW
=
10
measuredBw
=
float
(
p
.
match
.
group
(
1
)
)
loss
=
(
measuredBw
/
BW
)
*
100
self
.
assertGreaterEqual
(
loss
,
50
*
tolerance
)
self
.
assertLessEqual
(
loss
,
50
+
50
*
(
1
-
tolerance
)
)
elif
index
==
2
:
delay
=
float
(
p
.
match
.
group
(
6
)
)
self
.
assertGreaterEqual
(
delay
,
15
*
.
8
)
self
.
assertGreaterEqual
(
delay
,
15
*
tolerance
)
self
.
assertLessEqual
(
delay
,
15
+
15
*
(
1
-
tolerance
)
)
else
:
break
...
...
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