"vscode:/vscode.git/clone" did not exist on "314a75f367a0d41e158edfc2edbb54eb0a1ae235"
Commit 6bc85464 authored by Hejing Li's avatar Hejing Li
Browse files

omnet switch class add (temporal path need to be updated in the future)

parent 7cc2dc25
......@@ -24,9 +24,9 @@ import simbricks.experiments as exp
import simbricks.simulators as sim
import simbricks.nodeconfig as node
host_types = ['qemu', 'gem5', 'qt']
nic_types = ['i40e', 'cd_bm', 'cd_verilator']
net_types = ['switch', 'ns3']
host_types = ['qemu', 'gt', 'qt']
nic_types = ['ib', 'cd_bm', 'cd_verilator']
net_types = ['switch', 'ns3', 'omn']
experiments = []
for host_type in host_types:
......@@ -39,6 +39,8 @@ for host_type in host_types:
net = sim.SwitchNet()
elif net_type == 'ns3':
net = sim.NS3BridgeNet()
elif net_type == 'omn':
net = sim.OmnetSwitch()
else:
raise NameError(net_type)
e.add_network(net)
......@@ -52,14 +54,14 @@ for host_type in host_types:
h.sync = True
return h
host_class = qemu_timing
elif host_type == 'gem5':
elif host_type == 'gt':
host_class = sim.Gem5Host
e.checkpoint = True
else:
raise NameError(host_type)
# nic
if nic_type == 'i40e':
if nic_type == 'ib':
nic_class = sim.I40eNIC
nc_class = node.I40eLinuxNode
elif nic_type == 'cd_bm':
......
......@@ -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
return cmd
# fix temparal path
# fix temporal path
class OmnetSwitch(NetSim):
def __init__(self):
super().__init__()
......@@ -528,7 +528,7 @@ class OmnetSwitch(NetSim):
#for (_,n) in self.connect_sockets(env):
# 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=false -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=true -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)
return cmd
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment