Commit c2290e7b authored by Marvin Meiers's avatar Marvin Meiers Committed by Antoine Kaufmann
Browse files

experiments: use congestion control algorithm enum for ns3 nodes

parent 1dd38d6c
...@@ -69,7 +69,6 @@ for congestion_control in types_of_congestion_control: ...@@ -69,7 +69,6 @@ for congestion_control in types_of_congestion_control:
queue_size = int(bdp * 2**k_val) queue_size = int(bdp * 2**k_val)
options = { options = {
'ns3::TcpL4Protocol::SocketType': congestion_control.ns3,
'ns3::TcpSocket::SegmentSize': f'{mtu-52}', 'ns3::TcpSocket::SegmentSize': f'{mtu-52}',
'ns3::TcpSocket::SndBufSize': '524288', 'ns3::TcpSocket::SndBufSize': '524288',
'ns3::TcpSocket::RcvBufSize': '524288', 'ns3::TcpSocket::RcvBufSize': '524288',
...@@ -91,6 +90,7 @@ for congestion_control in types_of_congestion_control: ...@@ -91,6 +90,7 @@ for congestion_control in types_of_congestion_control:
host.data_rate = f'{link_rate}Mbps' host.data_rate = f'{link_rate}Mbps'
host.ip = f'192.168.64.{i}/24' host.ip = f'192.168.64.{i}/24'
host.queue_size = f'{queue_size}B' host.queue_size = f'{queue_size}B'
host.congestion_control = congestion_control
app = e2e.E2EPacketSinkApplication('sink') app = e2e.E2EPacketSinkApplication('sink')
app.local_ip = '0.0.0.0:5000' app.local_ip = '0.0.0.0:5000'
app.stop_time = '20s' app.stop_time = '20s'
...@@ -107,6 +107,7 @@ for congestion_control in types_of_congestion_control: ...@@ -107,6 +107,7 @@ for congestion_control in types_of_congestion_control:
host.data_rate = f'{link_rate}Mbps' host.data_rate = f'{link_rate}Mbps'
host.ip = f'192.168.64.{i+num_ns3_hosts+num_simbricks_hosts}/24' host.ip = f'192.168.64.{i+num_ns3_hosts+num_simbricks_hosts}/24'
host.queue_size = f'{queue_size}B' host.queue_size = f'{queue_size}B'
host.congestion_control = congestion_control
app = e2e.E2EBulkSendApplication('sender') app = e2e.E2EBulkSendApplication('sender')
app.remote_ip = f'192.168.64.{i}:5000' app.remote_ip = f'192.168.64.{i}:5000'
app.stop_time = '20s' app.stop_time = '20s'
......
...@@ -68,7 +68,6 @@ for congestion_control in types_of_congestion_control: ...@@ -68,7 +68,6 @@ for congestion_control in types_of_congestion_control:
queue_size = int(bdp * 2**k_val) queue_size = int(bdp * 2**k_val)
options = { options = {
'ns3::TcpL4Protocol::SocketType': congestion_control.ns3,
'ns3::TcpSocket::SegmentSize': f'{mtu-52}', 'ns3::TcpSocket::SegmentSize': f'{mtu-52}',
'ns3::TcpSocket::SndBufSize': '524288', 'ns3::TcpSocket::SndBufSize': '524288',
'ns3::TcpSocket::RcvBufSize': '524288', 'ns3::TcpSocket::RcvBufSize': '524288',
...@@ -110,6 +109,7 @@ for congestion_control in types_of_congestion_control: ...@@ -110,6 +109,7 @@ for congestion_control in types_of_congestion_control:
host.data_rate = f'{link_rate}Mbps' host.data_rate = f'{link_rate}Mbps'
host.ip = f'192.168.64.{i}/24' host.ip = f'192.168.64.{i}/24'
host.queue_size = f'{queue_size}B' host.queue_size = f'{queue_size}B'
host.congestion_control = congestion_control
app = e2e.E2EPacketSinkApplication('sink') app = e2e.E2EPacketSinkApplication('sink')
app.local_ip = '0.0.0.0:5000' app.local_ip = '0.0.0.0:5000'
app.stop_time = '20s' app.stop_time = '20s'
...@@ -126,6 +126,7 @@ for congestion_control in types_of_congestion_control: ...@@ -126,6 +126,7 @@ for congestion_control in types_of_congestion_control:
host.data_rate = f'{link_rate}Mbps' host.data_rate = f'{link_rate}Mbps'
host.ip = f'192.168.64.{i+num_ns3_hosts+num_simbricks_hosts}/24' host.ip = f'192.168.64.{i+num_ns3_hosts+num_simbricks_hosts}/24'
host.queue_size = f'{queue_size}B' host.queue_size = f'{queue_size}B'
host.congestion_control = congestion_control
app = e2e.E2EBulkSendApplication('sender') app = e2e.E2EBulkSendApplication('sender')
app.remote_ip = f'192.168.64.{i}:5000' app.remote_ip = f'192.168.64.{i}:5000'
app.stop_time = '20s' app.stop_time = '20s'
......
...@@ -286,16 +286,19 @@ class E2ESimpleNs3Host(E2EHost): ...@@ -286,16 +286,19 @@ class E2ESimpleNs3Host(E2EHost):
self.data_rate = "" self.data_rate = ""
self.queue_size = "" self.queue_size = ""
self.delay = "" self.delay = ""
# todo change this to an enum self.congestion_control: CongestionControl = None
self.congestion_control = ""
self.ip = "" self.ip = ""
def ns3_config(self) -> str: def ns3_config(self) -> str:
if self.congestion_control is None:
cc = ""
else:
cc = self.congestion_control.ns3
self.mapping.update({ self.mapping.update({
"DataRate": self.data_rate, "DataRate": self.data_rate,
"QueueSize": self.queue_size, "QueueSize": self.queue_size,
"Delay": self.delay, "Delay": self.delay,
"CongestionControl": self.congestion_control, "CongestionControl": cc,
"Ip": self.ip, "Ip": self.ip,
}) })
return super().ns3_config() return super().ns3_config()
......
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