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
73360ab9
Commit
73360ab9
authored
15 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Moved TreeTopo to mininet.topolib.
parent
5156b389
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/udpbwtest.py
+1
-24
1 addition, 24 deletions
examples/udpbwtest.py
with
1 addition
and
24 deletions
examples/udpbwtest.py
+
1
−
24
View file @
73360ab9
...
...
@@ -19,32 +19,9 @@
from
mininet.log
import
lg
from
mininet.net
import
init
,
Mininet
from
mininet.node
import
Host
,
KernelSwitch
from
mininet.topo
import
T
opo
,
Node
from
mininet.topo
lib
import
T
reeTopo
from
mininet.util
import
quietRun
class
TreeTopo
(
Topo
):
"
Topology for a tree network with a given depth and fanout.
"
def
__init__
(
self
,
depth
=
1
,
fanout
=
2
):
super
(
TreeTopo
,
self
).
__init__
()
# Build topology
self
.
treeNet
(
1
,
depth
,
fanout
)
# Consider all switches and hosts 'on'
self
.
enable_all
()
def
treeNet
(
self
,
id
,
depth
,
fanout
):
"""
Add a subtree with a given id.
returns: last id added
"""
me
=
id
isSwitch
=
(
depth
>
0
)
self
.
_add_node
(
me
,
Node
(
is_switch
=
isSwitch
)
)
if
isSwitch
:
for
i
in
range
(
0
,
fanout
):
child
=
id
+
1
self
.
_add_edge
(
me
,
child
)
id
=
self
.
treeNet
(
child
,
depth
-
1
,
fanout
)
return
id
# Some useful stuff: buffered readline and host monitoring
def
readline
(
host
,
buffer
):
...
...
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