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
6bc85464
Commit
6bc85464
authored
Jan 25, 2022
by
Hejing Li
Browse files
omnet switch class add (temporal path need to be updated in the future)
parent
7cc2dc25
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
experiments/pyexps/netperf.py
experiments/pyexps/netperf.py
+7
-5
experiments/simbricks/simulators.py
experiments/simbricks/simulators.py
+2
-2
No files found.
experiments/pyexps/netperf.py
View file @
6bc85464
...
@@ -24,9 +24,9 @@ import simbricks.experiments as exp
...
@@ -24,9 +24,9 @@ import simbricks.experiments as exp
import
simbricks.simulators
as
sim
import
simbricks.simulators
as
sim
import
simbricks.nodeconfig
as
node
import
simbricks.nodeconfig
as
node
host_types
=
[
'qemu'
,
'g
em5
'
,
'qt'
]
host_types
=
[
'qemu'
,
'g
t
'
,
'qt'
]
nic_types
=
[
'i
40e
'
,
'cd_bm'
,
'cd_verilator'
]
nic_types
=
[
'i
b
'
,
'cd_bm'
,
'cd_verilator'
]
net_types
=
[
'switch'
,
'ns3'
]
net_types
=
[
'switch'
,
'ns3'
,
'omn'
]
experiments
=
[]
experiments
=
[]
for
host_type
in
host_types
:
for
host_type
in
host_types
:
...
@@ -39,6 +39,8 @@ for host_type in host_types:
...
@@ -39,6 +39,8 @@ for host_type in host_types:
net
=
sim
.
SwitchNet
()
net
=
sim
.
SwitchNet
()
elif
net_type
==
'ns3'
:
elif
net_type
==
'ns3'
:
net
=
sim
.
NS3BridgeNet
()
net
=
sim
.
NS3BridgeNet
()
elif
net_type
==
'omn'
:
net
=
sim
.
OmnetSwitch
()
else
:
else
:
raise
NameError
(
net_type
)
raise
NameError
(
net_type
)
e
.
add_network
(
net
)
e
.
add_network
(
net
)
...
@@ -52,14 +54,14 @@ for host_type in host_types:
...
@@ -52,14 +54,14 @@ for host_type in host_types:
h
.
sync
=
True
h
.
sync
=
True
return
h
return
h
host_class
=
qemu_timing
host_class
=
qemu_timing
elif
host_type
==
'g
em5
'
:
elif
host_type
==
'g
t
'
:
host_class
=
sim
.
Gem5Host
host_class
=
sim
.
Gem5Host
e
.
checkpoint
=
True
e
.
checkpoint
=
True
else
:
else
:
raise
NameError
(
host_type
)
raise
NameError
(
host_type
)
# nic
# nic
if
nic_type
==
'i
40e
'
:
if
nic_type
==
'i
b
'
:
nic_class
=
sim
.
I40eNIC
nic_class
=
sim
.
I40eNIC
nc_class
=
node
.
I40eLinuxNode
nc_class
=
node
.
I40eLinuxNode
elif
nic_type
==
'cd_bm'
:
elif
nic_type
==
'cd_bm'
:
...
...
experiments/simbricks/simulators.py
View file @
6bc85464
...
@@ -518,7 +518,7 @@ class NS3SequencerNet(NetSim):
...
@@ -518,7 +518,7 @@ class NS3SequencerNet(NetSim):
cmd
=
env
.
repodir
+
'/sims/external/ns-3'
+
'/cosim-run.sh sequencer sequencer-single-switch-example '
+
ports
+
' '
+
self
.
opt
cmd
=
env
.
repodir
+
'/sims/external/ns-3'
+
'/cosim-run.sh sequencer sequencer-single-switch-example '
+
ports
+
' '
+
self
.
opt
return
cmd
return
cmd
# fix temp
a
ral path
# fix temp
o
ral path
class
OmnetSwitch
(
NetSim
):
class
OmnetSwitch
(
NetSim
):
def
__init__
(
self
):
def
__init__
(
self
):
super
().
__init__
()
super
().
__init__
()
...
@@ -528,7 +528,7 @@ class OmnetSwitch(NetSim):
...
@@ -528,7 +528,7 @@ class OmnetSwitch(NetSim):
#for (_,n) in self.connect_sockets(env):
#for (_,n) in self.connect_sockets(env):
# ports += '--CosimPort=' + n + ' '
# ports += '--CosimPort=' + n + ' '
cmd
=
'opp_run -u Cmdenv -m -n /OS/endhost-networking/work/sim/hejing/omnetpp-5.7/samples/inet4/src:/OS/endhost-networking/work/sim/hejing/omnetpp-5.7/samples/inet4/examples/:/OS/endhost-networking/work/sim/hejing/omnetpp-5.7/samples/inet4/tutorials/:/OS/endhost-networking/work/sim/hejing/omnetpp-5.7/samples/inet4/showcases/ --image-path=/OS/endhost-networking/work/sim/hejing/omnetpp-5.7/samples/inet4/images --cmdenv-express-mode=
fals
e -l /OS/endhost-networking/work/sim/hejing/omnetpp-5.7/samples/inet4/src/INET -f /OS/endhost-networking/work/sim/hejing/omnetpp-5.7/samples/inet4/examples/ethernet/simbricks/omnetpp.ini'
cmd
=
'opp_run -u Cmdenv -m -n /OS/endhost-networking/work/sim/hejing/omnetpp-5.7/samples/inet4/src:/OS/endhost-networking/work/sim/hejing/omnetpp-5.7/samples/inet4/examples/:/OS/endhost-networking/work/sim/hejing/omnetpp-5.7/samples/inet4/tutorials/:/OS/endhost-networking/work/sim/hejing/omnetpp-5.7/samples/inet4/showcases/ --image-path=/OS/endhost-networking/work/sim/hejing/omnetpp-5.7/samples/inet4/images --cmdenv-express-mode=
tru
e -l /OS/endhost-networking/work/sim/hejing/omnetpp-5.7/samples/inet4/src/INET -f /OS/endhost-networking/work/sim/hejing/omnetpp-5.7/samples/inet4/examples/ethernet/simbricks/omnetpp.ini
--simtime-resolution=-12 -c twoHostoneSwitch
'
print
(
cmd
)
print
(
cmd
)
return
cmd
return
cmd
...
...
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