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

experiments: further generalize setting of attributes in e2e framework

parent b94393cf
...@@ -192,7 +192,9 @@ class E2ESimpleChannel(E2ETopologyChannel): ...@@ -192,7 +192,9 @@ class E2ESimpleChannel(E2ETopologyChannel):
super().__init__(idd) super().__init__(idd)
self.type = "Simple" self.type = "Simple"
self.data_rate = "" self.data_rate = ""
self.queue_type = "ns3::DropTailQueue"
self.queue_size = "" self.queue_size = ""
self.channel_type = "ns3::SimpleChannel"
self.delay = "" self.delay = ""
self.left_node: E2ETopologyNode self.left_node: E2ETopologyNode
self.right_node: E2ETopologyNode self.right_node: E2ETopologyNode
...@@ -201,14 +203,31 @@ class E2ESimpleChannel(E2ETopologyChannel): ...@@ -201,14 +203,31 @@ class E2ESimpleChannel(E2ETopologyChannel):
if self.left_node is None or self.right_node is None: if self.left_node is None or self.right_node is None:
raise AttributeError(f"Not all nodes for channel {self.id} given") raise AttributeError(f"Not all nodes for channel {self.id} given")
self.mapping.update({ self.mapping.update({
"DataRate": self.data_rate, "Device-DataRate": self.data_rate,
"QueueSize": self.queue_size, "QueueType": self.queue_type,
"Delay": self.delay, "Queue-MaxSize": self.queue_size,
"ChannelType": self.channel_type,
"Channel-Delay": self.delay,
"LeftNode": self.left_node.id, "LeftNode": self.left_node.id,
"RightNode": self.right_node.id, "RightNode": self.right_node.id,
}) })
return super().ns3_config() return super().ns3_config()
def add_device_attr(self, key: str, value: str) -> None:
if not key.startswith("Device-"):
key = f"Device-{key}"
self.mapping.update({key: value})
def add_queue_attr(self, key: str, value: str) -> None:
if not key.startswith("Queue-"):
key = f"Queue-{key}"
self.mapping.update({key: value})
def add_channel_attr(self, key: str, value: str) -> None:
if not key.startswith("Channel-"):
key = f"Channel-{key}"
self.mapping.update({key: value})
class E2ENetwork(E2EComponent): class E2ENetwork(E2EComponent):
...@@ -293,7 +312,9 @@ class E2ESimpleNs3Host(E2EHost): ...@@ -293,7 +312,9 @@ class E2ESimpleNs3Host(E2EHost):
super().__init__(idd) super().__init__(idd)
self.type = "SimpleNs3" self.type = "SimpleNs3"
self.data_rate = "" self.data_rate = ""
self.queue_type = "ns3::DropTailQueue"
self.queue_size = "" self.queue_size = ""
self.channel_type = "ns3::SimpleChannel"
self.delay = "" self.delay = ""
self.congestion_control: CongestionControl = None self.congestion_control: CongestionControl = None
self.ip = "" self.ip = ""
...@@ -304,14 +325,31 @@ class E2ESimpleNs3Host(E2EHost): ...@@ -304,14 +325,31 @@ class E2ESimpleNs3Host(E2EHost):
else: else:
cc = self.congestion_control.ns3 cc = self.congestion_control.ns3
self.mapping.update({ self.mapping.update({
"DataRate": self.data_rate, "Device-DataRate": self.data_rate,
"QueueSize": self.queue_size, "QueueType": self.queue_type,
"Delay": self.delay, "Queue-MaxSize": self.queue_size,
"ChannelType": self.channel_type,
"Channel-Delay": self.delay,
"CongestionControl": cc, "CongestionControl": cc,
"Ip": self.ip, "Ip": self.ip,
}) })
return super().ns3_config() return super().ns3_config()
def add_device_attr(self, key: str, value: str) -> None:
if not key.startswith("Device-"):
key = f"Device-{key}"
self.mapping.update({key: value})
def add_queue_attr(self, key: str, value: str) -> None:
if not key.startswith("Queue-"):
key = f"Queue-{key}"
self.mapping.update({key: value})
def add_channel_attr(self, key: str, value: str) -> None:
if not key.startswith("Channel-"):
key = f"Channel-{key}"
self.mapping.update({key: value})
class E2EApplication(E2EComponent): class E2EApplication(E2EComponent):
......
Subproject commit 968e0ed2b2a1ef5303975e836481298e4ac60295 Subproject commit bcfb8f13398889473a0965edde8ba1ae13c60496
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