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
3236d33b
Commit
3236d33b
authored
11 years ago
by
Andrew Ferguson
Browse files
Options
Downloads
Patches
Plain Diff
allow user switch to be used with TCIntf's
parent
6c22e057
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
mininet/node.py
+27
-0
27 additions, 0 deletions
mininet/node.py
with
27 additions
and
0 deletions
mininet/node.py
+
27
−
0
View file @
3236d33b
...
...
@@ -49,6 +49,7 @@
import
signal
import
select
from
subprocess
import
Popen
,
PIPE
,
STDOUT
from
time
import
sleep
from
mininet.log
import
info
,
error
,
warn
,
debug
from
mininet.util
import
(
quietRun
,
errRun
,
errFail
,
moveIntf
,
isShellBuiltin
,
...
...
@@ -816,6 +817,28 @@ def dpctl( self, *args ):
return
self
.
cmd
(
'
dpctl
'
+
'
'
.
join
(
args
)
+
'
tcp:127.0.0.1:%i
'
%
self
.
listenPort
)
@staticmethod
def
TCReapply
(
intf
):
"""
Unfortunately user switch and Mininet are fighting
over tc queuing disciplines. To resolve the conflict,
we re-create the user switch
'
s configuration, but as a
leaf of the TCIntf-created configuration.
"""
if
type
(
intf
)
is
TCIntf
:
ifspeed
=
10000000000
# 10 Gbps
minspeed
=
ifspeed
*
0.001
res
=
intf
.
config
(
**
intf
.
params
)
parent
=
res
[
'
parent
'
]
# Re-add qdisc, root, and default classes user switch created, but
# with new parent, as setup by Mininet's TCIntf
intf
.
tc
(
"
%s qdisc add dev %s
"
+
parent
+
"
handle 1: htb default 0xfffe
"
)
intf
.
tc
(
"
%s class add dev %s classid 1:0xffff parent 1: htb rate
"
+
str
(
ifspeed
)
)
intf
.
tc
(
"
%s class add dev %s classid 1:0xfffe parent 1:0xffff
"
+
"
htb rate
"
+
str
(
minspeed
)
+
"
ceil
"
+
str
(
ifspeed
)
)
def
start
(
self
,
controllers
):
"""
Start OpenFlow reference user datapath.
Log to /tmp/sN-{ofd,ofp}.log.
...
...
@@ -834,6 +857,10 @@ def start( self, controllers ):
'
'
+
clist
+
'
--fail=closed
'
+
self
.
opts
+
'
1>
'
+
ofplog
+
'
2>
'
+
ofplog
+
'
&
'
)
sleep
(
1
)
# Allow ofdatapath to start before re-arranging qdisc's
for
intf
in
self
.
intfList
():
if
not
intf
.
IP
():
self
.
TCReapply
(
intf
)
def
stop
(
self
):
"
Stop OpenFlow reference user datapath.
"
...
...
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