Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
c17f80d9
Commit
c17f80d9
authored
Nov 15, 2020
by
Hejing Li
Browse files
simulators.py: add ns3-bridge class
parent
bba4e2bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
22 deletions
+12
-22
experiments/modes/simulators.py
experiments/modes/simulators.py
+10
-0
experiments/pyexps/qemu_tcp_single.py
experiments/pyexps/qemu_tcp_single.py
+2
-22
No files found.
experiments/modes/simulators.py
View file @
c17f80d9
...
@@ -189,6 +189,16 @@ class NS3DumbbellNet(NetSim):
...
@@ -189,6 +189,16 @@ class NS3DumbbellNet(NetSim):
return
cmd
return
cmd
class
NS3BridgeNet
(
NetSim
):
def
run_cmd
(
self
,
env
):
ports
=
''
for
n
in
self
.
nics
:
ports
+=
'--CosimPort='
+
env
.
nic_eth_path
(
n
)
+
' '
cmd
=
env
.
repodir
+
'/ns-3'
+
'/cosim-run.sh cosim cosim-bridge-example '
+
ports
+
' '
+
self
.
opt
print
(
cmd
)
return
cmd
class
NS3SequencerNet
(
NetSim
):
class
NS3SequencerNet
(
NetSim
):
def
run_cmd
(
self
,
env
):
def
run_cmd
(
self
,
env
):
...
...
experiments/pyexps/qemu_tcp_single.py
View file @
c17f80d9
...
@@ -12,7 +12,6 @@ import modes.nodeconfig as node
...
@@ -12,7 +12,6 @@ import modes.nodeconfig as node
kinds_of_host
=
[
'qemu'
]
kinds_of_host
=
[
'qemu'
]
kinds_of_nic
=
[
'cv'
,
'cb'
,
'ib'
]
kinds_of_nic
=
[
'cv'
,
'cb'
,
'ib'
]
#kinds_of_nic = ['ib']
kinds_of_net
=
[
'wire'
,
'switch'
,
'dumbbell'
,
'bridge'
]
kinds_of_net
=
[
'wire'
,
'switch'
,
'dumbbell'
,
'bridge'
]
kinds_of_app
=
[
'TCPs'
]
kinds_of_app
=
[
'TCPs'
]
...
@@ -26,9 +25,8 @@ for n in kinds_of_net:
...
@@ -26,9 +25,8 @@ for n in kinds_of_net:
net_class
=
sim
.
SwitchNet
net_class
=
sim
.
SwitchNet
if
n
==
'dumbbell'
:
if
n
==
'dumbbell'
:
net_class
=
sim
.
NS3DumbbellNet
net_class
=
sim
.
NS3DumbbellNet
#if n == 'bridge':
if
n
==
'bridge'
:
# net = sim.NS3BridgeNet()
net
=
sim
.
NS3BridgeNet
()
#continue
# set nic sim
# set nic sim
...
@@ -64,21 +62,3 @@ for n in kinds_of_net:
...
@@ -64,21 +62,3 @@ for n in kinds_of_net:
print
(
e
.
name
)
print
(
e
.
name
)
experiments
.
append
(
e
)
experiments
.
append
(
e
)
"""
e = exp.Experiment('qemu-i40e-pair')
net = sim.SwitchNet()
e.add_network(net)
servers = sim.create_basic_hosts(e, 1, 'server', net, sim.I40eNIC, sim.QemuHost,
node.I40eLinuxNode, node.IperfTCPServer)
clients = sim.create_basic_hosts(e, 2, 'client', net, sim.I40eNIC, sim.QemuHost,
node.I40eLinuxNode, node.IperfTCPClient, ip_start = 2)
for c in clients:
c.wait = True
c.node_config.app.server_ip = servers[0].node_config.ip
experiments = [e]
"""
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