Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
c630f625
Commit
c630f625
authored
Jun 16, 2015
by
Brenden Blanco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use netperf for testing, update comments
Signed-off-by:
Brenden Blanco
<
bblanco@plumgrid.com
>
parent
2cea0cd6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
examples/tc_neighbor_sharing.py
examples/tc_neighbor_sharing.py
+6
-3
No files found.
examples/tc_neighbor_sharing.py
View file @
c630f625
...
@@ -66,6 +66,7 @@ class SharedNetSimulation(object):
...
@@ -66,6 +66,7 @@ class SharedNetSimulation(object):
ns_ipdb
=
IPDB
(
nl
=
NetNS
(
name
))
ns_ipdb
=
IPDB
(
nl
=
NetNS
(
name
))
ipdb
.
create
(
ifname
=
"%sa"
%
name
,
kind
=
"veth"
,
peer
=
"%sb"
%
name
).
commit
()
ipdb
.
create
(
ifname
=
"%sa"
%
name
,
kind
=
"veth"
,
peer
=
"%sb"
%
name
).
commit
()
with
ipdb
.
interfaces
[
"%sb"
%
name
]
as
v
:
with
ipdb
.
interfaces
[
"%sb"
%
name
]
as
v
:
# move half of veth into namespace
v
.
net_ns_fd
=
ns_ipdb
.
nl
.
netns
v
.
net_ns_fd
=
ns_ipdb
.
nl
.
netns
with
ipdb
.
interfaces
[
"%sa"
%
name
]
as
v
:
with
ipdb
.
interfaces
[
"%sa"
%
name
]
as
v
:
v
.
up
()
v
.
up
()
...
@@ -80,7 +81,7 @@ class SharedNetSimulation(object):
...
@@ -80,7 +81,7 @@ class SharedNetSimulation(object):
parent
=
"ffff:"
,
action
=
"ok"
,
classid
=
1
)
parent
=
"ffff:"
,
action
=
"ok"
,
classid
=
1
)
self
.
ipdbs
.
append
(
ns_ipdb
)
self
.
ipdbs
.
append
(
ns_ipdb
)
self
.
namespaces
.
append
(
ns_ipdb
.
nl
)
self
.
namespaces
.
append
(
ns_ipdb
.
nl
)
cmd
=
[
"
iperf"
,
"-s"
,
"-B"
,
ipaddr
.
split
(
"/"
)[
0
]
]
cmd
=
[
"
netserver"
,
"-D"
]
self
.
processes
.
append
(
NSPopen
(
ns_ipdb
.
nl
.
netns
,
cmd
))
self
.
processes
.
append
(
NSPopen
(
ns_ipdb
.
nl
.
netns
,
cmd
))
return
(
ns_ipdb
,
ifc
)
return
(
ns_ipdb
,
ifc
)
...
@@ -110,8 +111,10 @@ class SharedNetSimulation(object):
...
@@ -110,8 +111,10 @@ class SharedNetSimulation(object):
try
:
try
:
sim
=
SharedNetSimulation
()
sim
=
SharedNetSimulation
()
sim
.
start
()
sim
.
start
()
print
(
"Network ready. Create a shell in the wan0 namespace and test with iperf"
)
print
(
"Network ready. Create a shell in the wan0 namespace and test with netperf"
)
print
(
" e.g.: ip netns exec wan0 iperf -t 2 -c 172.16.1.100"
)
print
(
" (Neighbors are 172.16.1.100-%d, and LAN clients are 172.16.1.150-%d)"
%
(
100
+
num_neighbors
-
1
,
150
+
num_locals
-
1
))
print
(
" e.g.: ip netns exec wan0 netperf -H 172.16.1.100 -l 2"
)
input
(
"Press enter when finished: "
)
input
(
"Press enter when finished: "
)
finally
:
finally
:
if
"sim"
in
locals
():
sim
.
release
()
if
"sim"
in
locals
():
sim
.
release
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment