Commit e7521bb1 authored by Hejing Li's avatar Hejing Li
Browse files

homa ns3 msggen app use tcp

parent 031efdeb
......@@ -54,7 +54,7 @@ net = sim.NS3E2ENet()
net.opt = ' '.join([f'--{o[0]}={o[1]}' for o in options.items()])
net.add_component(topology)
net.wait = True
net.init_network()
e.add_network(net)
net.init_network()
experiments = [e]
......@@ -385,6 +385,33 @@ class E2EMsgGenApplication(E2EApplication):
})
return super().ns3_config()
class E2EMsgGenApplicationTCP(E2EApplication):
def __init__(self, idd: str) -> None:
super().__init__(idd)
self.type = "MsgGeneratorTCP"
self.port = 3000
self.remotes = []
self.cdf = {0.5: 1, 1.0: 2}
self.max_msg = 0
self.load = 0.5
self.avg_msg_size_pkts = 1.0
def ns3_config(self) -> str:
els = [f'{{{p},{i}}}' for p,i in self.cdf.items()]
cdf = '+'.join(els)
print(cdf)
self.mapping.update({
"Port": self.port,
"RemoteClients": ','.join(self.remotes),
"MsgSizeCDF": cdf,
"MaxMsg": self.max_msg,
"Load": self.load,
"AvgMsgSizePkts": self.avg_msg_size_pkts,
})
return super().ns3_config()
class E2EProbe(E2EComponent):
......
......@@ -346,12 +346,12 @@ def add_homa_bg(topo, subnet='10.42.0.0/16', **kwargs):
s_host.data_rate = params['link_rate']
s_host.ip = ip + prefix
s_host.queue_size = params['link_queue_size']
s_app = e2e.E2EMsgGenApplication('msggen')
s_app = e2e.E2EMsgGenApplicationTCP('msggen')
s_app.stop_time = params['app_stop_time']
s_app.remotes = remotes
s_host.add_component(s_app)
#s_probe = e2e.E2EPeriodicSampleProbe('probe', 'Rx')
#s_probe.interval = '100ms'
#s_probe.file = f'sink-rx-{i}'
#s_app.add_component(s_probe)
# s_probe = e2e.E2EPeriodicSampleProbe('probe', 'Rx')
# s_probe.interval = '100ms'
# s_probe.file = f'sink-rx-{i}'
# s_app.add_component(s_probe)
topo.add_host_r(s_host)
Subproject commit a5ddaf005d4112e50bcbf30acb9417288c2294de
Subproject commit 96f18501910fb9d952e361427a4b690a0fa8254a
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