aboutsummaryrefslogtreecommitdiffstats
path: root/vicn/resource/ns3
diff options
context:
space:
mode:
Diffstat (limited to 'vicn/resource/ns3')
-rw-r--r--vicn/resource/ns3/emulated_channel.py12
-rw-r--r--vicn/resource/ns3/emulated_lte_channel.py10
2 files changed, 10 insertions, 12 deletions
diff --git a/vicn/resource/ns3/emulated_channel.py b/vicn/resource/ns3/emulated_channel.py
index 08d7a14b..5f61960c 100644
--- a/vicn/resource/ns3/emulated_channel.py
+++ b/vicn/resource/ns3/emulated_channel.py
@@ -69,7 +69,7 @@ class EmulatedChannel(Channel, Application):
ap = Attribute(Node, description = 'AP', key = True)
stations = Attribute(Node, description = 'List of stations',
multiplicity = Multiplicity.OneToMany, key = True)
- control_port = Attribute(Integer,
+ control_port = Attribute(Integer,
description = 'Control port for the simulation')
# Overloaded attributes
@@ -141,7 +141,7 @@ class EmulatedChannel(Channel, Application):
managed = False)
self._ap_if = VethPair(node = self.ap,
name = 'vh-' + ap.name + '-' + self.name,
- device_name = 'vh-' + ap.name + '-' + self.name,
+ device_name = 'vh-' + ap.name + '-' + self.name,
host = host,
owner = self)
self._ap_bridged = self._ap_if.host
@@ -152,7 +152,7 @@ class EmulatedChannel(Channel, Application):
interfaces.append(self._ap_if)
# Add a tap interface for the AP...
- self._ap_tap = TapDevice(node = self.node,
+ self._ap_tap = TapDevice(node = self.node,
owner = self,
device_name = 'tap-' + ap.name + '-' + self.name,
up = True,
@@ -165,11 +165,11 @@ class EmulatedChannel(Channel, Application):
await wait_resources(interfaces)
# NOTE: only set channel after the resource is created or it might
- # create loops which, at this time, are not handled
+ # create loops which, at this time, are not handled
self._ap_if.set('channel', self)
# Add interfaces to bridge
- vlan = AddressManager().get('vlan', self, tag='ap')
+ vlan = AddressManager().get('vlan', self, tag='ap')
# AS the container has created the VethPair already without Vlan, we
# need to delete and recreate it
@@ -181,8 +181,6 @@ class EmulatedChannel(Channel, Application):
task = self.node.bridge._add_interface(self._ap_tap, vlan = vlan)
await run_task(task, self._state.manager)
- print('/!\ pass information to the running simulation')
-
@inline_task
def _get_ap(self):
return {'ap': None}
diff --git a/vicn/resource/ns3/emulated_lte_channel.py b/vicn/resource/ns3/emulated_lte_channel.py
index 8c7382cb..39370228 100644
--- a/vicn/resource/ns3/emulated_lte_channel.py
+++ b/vicn/resource/ns3/emulated_lte_channel.py
@@ -61,7 +61,7 @@ class EmulatedLteChannel(EmulatedChannel):
# ... and each station
if not station.managed:
sta_if = None
- else:
+ else:
if isinstance(station, LxcContainer):
host = NetDevice(node = station.node,
device_name='vhh-' + station.name + '-' + self.name,
@@ -103,8 +103,8 @@ class EmulatedLteChannel(EmulatedChannel):
task = self.node.bridge._remove_interface(bridged_sta)
await run_task(task, self._state.manager)
-
- task = self.node.bridge._add_interface(bridged_sta,
+
+ task = self.node.bridge._add_interface(bridged_sta,
vlan = vlan)
await run_task(task, self._state.manager)
@@ -178,8 +178,8 @@ class EmulatedLteChannel(EmulatedChannel):
# Coma-separated list of stations' IP/netmask len
'sta-ips' : ','.join(sta_ips),
# Base station IP/netmask len
- 'bs-ip' : AddressManager().get_ip(self._ap_if) +
- DEFAULT_NETMASK,
+ 'bs-ip' : AddressManager().get_ip(self._ap_if) + '/' +
+ str(DEFAULT_NETMASK),
'txBuffer' : '800000',
'isFading' : 'true' if DEFAULT_FADING_ENABLED else 'false',
}