"socket_addr": self.simulation.remote_socket,
}
- (reply, err), proc = self.simulation.node.execute(command)
+ (reply, err), proc = self.simulation.node.execute(command)
if (err and proc.poll()) or reply.strip() == "":
- msg = " Couldn't connect to remote socket %s" % (
- self.simulation.remote_socket)
+ msg = (" Couldn't connect to remote socket %s - REPLY: %s "
+ "- ERROR: %s ") % (
+ self.simulation.remote_socket, reply, err)
self.simulation.error(msg, reply, err)
raise RuntimeError(msg)
"Space-separated list of packages required to run the application",
flags = Flags.Design)
- files = Attribute("files",
- "Semi-colon separated list of 'key=value' pairs to set as "
- "DCE files (AddFile). The key should be a path to a local file "
- "and the key is the path to be set in DCE for that file" ,
- flags = Flags.Design)
-
- stdinfile = Attribute("stdinFile",
- "File to set as StdinFile. The value shoudl be either an empty "
- "or a path to a local file ",
- flags = Flags.Design)
-
- starttime = Attribute("StartTime",
- "Time at which the application will start",
- default = "+0.0ns",
- flags = Flags.Reserved | Flags.Construct)
-
- stoptime = Attribute("StopTime",
- "Time at which the application will stop",
- default = "+0.0ns",
- flags = Flags.Reserved | Flags.Construct)
-
cls._register_attribute(sources)
cls._register_attribute(build)
cls._register_attribute(depends)
- cls._register_attribute(files)
- cls._register_attribute(stoptime)
- cls._register_attribute(starttime)
- cls._register_attribute(stdinfile)
def _instantiate_object(self):
command = []
if scmd:
command.append(scmd)
- # Upload files to the remote machine. These files will
- # be added to the DceApplication by invoking dce.AddFile()
- files = self.get("files") or ""
- if files:
- upfiles = []
- for files in map(str.strip, files.split(";")):
- localpath, dcepath = env.split("=")
- upfiles.append(localpath)
-
- if upfiles:
- fcmd = self.siumlation.upload_files(files = upfiles)
- if fcmd:
- command.append(fcmd)
-
- # Upload files to the remote machine. These files will
- # be added to the DceApplication by invoking dce.AddFile()
- stdinfile = self.get("stdinFile")
- if stdinfile and stdinfile != "":
- stdincmd = self.siumlation.upload_files(files = stdinfile)
- if stdincmd:
- command.append(stdincmd)
-
-
# Upload instructions to build the binary
build = self.get("build")
if build:
import time
import threading
+## TODO: Clean up DCE part. All that is DCE specific should go
+## in the linux ns3dceapplication.py
+
@clsinit_copy
class LinuxNS3Simulation(LinuxApplication, NS3Simulation):
_rtype = "LinuxNS3Simulation"
cls._register_attribute(attr_maxslrc)
attr_rtsctsthreshold = Attribute("RtsCtsThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
cls._register_attribute(attr_rtsctsthreshold)
attr_fragmentationthreshold = Attribute("FragmentationThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
cls._register_attribute(attr_maxslrc)
attr_rtsctsthreshold = Attribute("RtsCtsThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
cls._register_attribute(attr_rtsctsthreshold)
attr_fragmentationthreshold = Attribute("FragmentationThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
cls._register_attribute(attr_maxslrc)
attr_rtsctsthreshold = Attribute("RtsCtsThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
cls._register_attribute(attr_rtsctsthreshold)
attr_fragmentationthreshold = Attribute("FragmentationThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
cls._register_attribute(attr_maxslrc)
attr_rtsctsthreshold = Attribute("RtsCtsThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
cls._register_attribute(attr_rtsctsthreshold)
attr_fragmentationthreshold = Attribute("FragmentationThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
--- /dev/null
+#
+# NEPI, a framework to manage network experiments
+# Copyright (C) 2014 INRIA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from nepi.execution.attribute import Attribute, Flags, Types
+from nepi.execution.trace import Trace, TraceAttr
+from nepi.execution.resource import ResourceManager, clsinit_copy, \
+ ResourceState, reschedule_delay
+from nepi.resources.ns3.ns3errormodel import NS3BaseErrorModel
+
+@clsinit_copy
+class NS3BinaryErrorModel(NS3BaseErrorModel):
+ _rtype = "ns3::BinaryErrorModel"
+
+ @classmethod
+ def _register_attributes(cls):
+
+ attr_isenabled = Attribute("IsEnabled",
+ "Whether this ErrorModel is enabled or not.",
+ type = Types.Bool,
+ default = "True",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_isenabled)
+
+
+
+ @classmethod
+ def _register_traces(cls):
+ pass
+
+ def __init__(self, ec, guid):
+ super(NS3BinaryErrorModel, self).__init__(ec, guid)
+ self._home = "ns3-binary-error-model-%s" % self.guid
--- /dev/null
+#
+# NEPI, a framework to manage network experiments
+# Copyright (C) 2014 INRIA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from nepi.execution.attribute import Attribute, Flags, Types
+from nepi.execution.trace import Trace, TraceAttr
+from nepi.execution.resource import ResourceManager, clsinit_copy, \
+ ResourceState, reschedule_delay
+from nepi.resources.ns3.ns3errormodel import NS3BaseErrorModel
+
+@clsinit_copy
+class NS3BinaryErrorSixlowModel(NS3BaseErrorModel):
+ _rtype = "ns3::BinaryErrorSixlowModel"
+
+ @classmethod
+ def _register_attributes(cls):
+
+ attr_isenabled = Attribute("IsEnabled",
+ "Whether this ErrorModel is enabled or not.",
+ type = Types.Bool,
+ default = "True",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_isenabled)
+
+
+
+ @classmethod
+ def _register_traces(cls):
+ pass
+
+ def __init__(self, ec, guid):
+ super(NS3BinaryErrorSixlowModel, self).__init__(ec, guid)
+ self._home = "ns3-binary-error-sixlow-model-%s" % self.guid
cls._register_attribute(attr_maxslrc)
attr_rtsctsthreshold = Attribute("RtsCtsThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
cls._register_attribute(attr_rtsctsthreshold)
attr_fragmentationthreshold = Attribute("FragmentationThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
cls._register_attribute(attr_maxslrc)
attr_rtsctsthreshold = Attribute("RtsCtsThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
cls._register_attribute(attr_rtsctsthreshold)
attr_fragmentationthreshold = Attribute("FragmentationThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
--- /dev/null
+#
+# NEPI, a framework to manage network experiments
+# Copyright (C) 2014 INRIA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from nepi.execution.attribute import Attribute, Flags, Types
+from nepi.execution.trace import Trace, TraceAttr
+from nepi.execution.resource import ResourceManager, clsinit_copy, \
+ ResourceState, reschedule_delay
+from nepi.resources.ns3.ns3channel import NS3BaseChannel
+
+@clsinit_copy
+class NS3ErrorChannelSixlow(NS3BaseChannel):
+ _rtype = "ns3::ErrorChannelSixlow"
+
+ @classmethod
+ def _register_attributes(cls):
+
+ attr_id = Attribute("Id",
+ "The id (unique integer) of this Channel.",
+ type = Types.Integer,
+ default = "0",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.NoWrite)
+
+ cls._register_attribute(attr_id)
+
+
+
+ @classmethod
+ def _register_traces(cls):
+ pass
+
+ def __init__(self, ec, guid):
+ super(NS3ErrorChannelSixlow, self).__init__(ec, guid)
+ self._home = "ns3-error-channel-sixlow-%s" % self.guid
cls._register_attribute(attr_systemloss)
- attr_mindistance = Attribute("MinDistance",
- "The distance under which the propagation model refuses to give results (m)",
+ attr_minloss = Attribute("MinLoss",
+ "The minimum value (dB) of the total loss, used at short ranges. Note: ",
type = Types.Double,
- default = "0.5",
+ default = "0",
allowed = None,
range = None,
flags = Flags.Reserved | Flags.Construct)
- cls._register_attribute(attr_mindistance)
+ cls._register_attribute(attr_minloss)
cls._register_attribute(attr_maxslrc)
attr_rtsctsthreshold = Attribute("RtsCtsThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
cls._register_attribute(attr_rtsctsthreshold)
attr_fragmentationthreshold = Attribute("FragmentationThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
--- /dev/null
+#
+# NEPI, a framework to manage network experiments
+# Copyright (C) 2014 INRIA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from nepi.execution.attribute import Attribute, Flags, Types
+from nepi.execution.trace import Trace, TraceAttr
+from nepi.execution.resource import ResourceManager, clsinit_copy, \
+ ResourceState, reschedule_delay
+from nepi.resources.ns3.ns3propagationlossmodel import NS3BasePropagationLossModel
+
+@clsinit_copy
+class NS3ItuR1411LosPropagationLossModel(NS3BasePropagationLossModel):
+ _rtype = "ns3::ItuR1411LosPropagationLossModel"
+
+ @classmethod
+ def _register_attributes(cls):
+ pass
+
+ @classmethod
+ def _register_traces(cls):
+ pass
+
+ def __init__(self, ec, guid):
+ super(NS3ItuR1411LosPropagationLossModel, self).__init__(ec, guid)
+ self._home = "ns3-itu-r1411los-propagation-loss-model-%s" % self.guid
--- /dev/null
+#
+# NEPI, a framework to manage network experiments
+# Copyright (C) 2014 INRIA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from nepi.execution.attribute import Attribute, Flags, Types
+from nepi.execution.trace import Trace, TraceAttr
+from nepi.execution.resource import ResourceManager, clsinit_copy, \
+ ResourceState, reschedule_delay
+from nepi.resources.ns3.ns3propagationlossmodel import NS3BasePropagationLossModel
+
+@clsinit_copy
+class NS3ItuR1411NlosOverRooftopPropagationLossModel(NS3BasePropagationLossModel):
+ _rtype = "ns3::ItuR1411NlosOverRooftopPropagationLossModel"
+
+ @classmethod
+ def _register_attributes(cls):
+
+ attr_environment = Attribute("Environment",
+ "Environment Scenario",
+ type = Types.Enumerate,
+ default = "Urban",
+ allowed = ["Urban","SubUrban","OpenAreas"],
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_environment)
+
+ attr_citysize = Attribute("CitySize",
+ "Dimension of the city",
+ type = Types.Enumerate,
+ default = "Large",
+ allowed = ["Small","Medium","Large"],
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_citysize)
+
+ attr_rooftoplevel = Attribute("RooftopLevel",
+ "The height of the rooftop level in meters",
+ type = Types.Double,
+ default = "20",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_rooftoplevel)
+
+ attr_streetsorientation = Attribute("StreetsOrientation",
+ "The orientation of streets in degrees [0,90] with respect to the direction of propagation",
+ type = Types.Double,
+ default = "45",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_streetsorientation)
+
+ attr_streetswidth = Attribute("StreetsWidth",
+ "The width of streets",
+ type = Types.Double,
+ default = "20",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_streetswidth)
+
+ attr_buildingsextend = Attribute("BuildingsExtend",
+ "The distance over which the buildings extend",
+ type = Types.Double,
+ default = "80",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_buildingsextend)
+
+ attr_buildingseparation = Attribute("BuildingSeparation",
+ "The separation between buildings",
+ type = Types.Double,
+ default = "50",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_buildingseparation)
+
+
+
+ @classmethod
+ def _register_traces(cls):
+ pass
+
+ def __init__(self, ec, guid):
+ super(NS3ItuR1411NlosOverRooftopPropagationLossModel, self).__init__(ec, guid)
+ self._home = "ns3-itu-r1411nlos-over-rooftop-propagation-loss-model-%s" % self.guid
--- /dev/null
+#
+# NEPI, a framework to manage network experiments
+# Copyright (C) 2014 INRIA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from nepi.execution.attribute import Attribute, Flags, Types
+from nepi.execution.trace import Trace, TraceAttr
+from nepi.execution.resource import ResourceManager, clsinit_copy, \
+ ResourceState, reschedule_delay
+from nepi.resources.ns3.ns3propagationlossmodel import NS3BasePropagationLossModel
+
+@clsinit_copy
+class NS3Kun2600MhzPropagationLossModel(NS3BasePropagationLossModel):
+ _rtype = "ns3::Kun2600MhzPropagationLossModel"
+
+ @classmethod
+ def _register_attributes(cls):
+ pass
+
+ @classmethod
+ def _register_traces(cls):
+ pass
+
+ def __init__(self, ec, guid):
+ super(NS3Kun2600MhzPropagationLossModel, self).__init__(ec, guid)
+ self._home = "ns3-kun2600mhz-propagation-loss-model-%s" % self.guid
cls._register_attribute(attr_ulearfcn)
+ attr_csgid = Attribute("CsgId",
+ "The Closed Subscriber Group (CSG) identity that this eNodeB belongs to",
+ type = Types.Integer,
+ default = "0",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_csgid)
+
+ attr_csgindication = Attribute("CsgIndication",
+ "If true, only UEs which are members of the CSG (i.e. same CSG ID) can gain access to the eNodeB, therefore enforcing closed access mode. Otherwise, the eNodeB operates as a non-CSG cell and implements open access mode.",
+ type = Types.Bool,
+ default = "False",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_csgindication)
+
attr_mtu = Attribute("Mtu",
"The MAC-level Maximum Transmission Unit",
type = Types.Integer,
--- /dev/null
+#
+# NEPI, a framework to manage network experiments
+# Copyright (C) 2014 INRIA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from nepi.execution.attribute import Attribute, Flags, Types
+from nepi.execution.trace import Trace, TraceAttr
+from nepi.execution.resource import ResourceManager, clsinit_copy, \
+ ResourceState, reschedule_delay
+from nepi.resources.ns3.ns3netdevice import NS3BaseNetDevice
+
+@clsinit_copy
+class NS3LteUeNetDevice(NS3BaseNetDevice):
+ _rtype = "ns3::LteUeNetDevice"
+
+ @classmethod
+ def _register_attributes(cls):
+
+ attr_imsi = Attribute("Imsi",
+ "International Mobile Subscriber Identity assigned to this UE",
+ type = Types.Integer,
+ default = "0",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_imsi)
+
+ attr_dlearfcn = Attribute("DlEarfcn",
+ "Downlink E-UTRA Absolute Radio Frequency Channel Number (EARFCN) as per 3GPP 36.101 Section 5.7.3. ",
+ type = Types.Integer,
+ default = "100",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_dlearfcn)
+
+ attr_csgid = Attribute("CsgId",
+ "The Closed Subscriber Group (CSG) identity that this UE is associated with, i.e., giving the UE access to cells which belong to this particular CSG. This restriction only applies to initial cell selection and EPC-enabled simulation. This does not revoke the UE\'s access to non-CSG cells. ",
+ type = Types.Integer,
+ default = "0",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_csgid)
+
+ attr_mtu = Attribute("Mtu",
+ "The MAC-level Maximum Transmission Unit",
+ type = Types.Integer,
+ default = "30000",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_mtu)
+
+
+
+ @classmethod
+ def _register_traces(cls):
+ pass
+
+ def __init__(self, ec, guid):
+ super(NS3LteUeNetDevice, self).__init__(ec, guid)
+ self._home = "ns3-lte-ue-net-device-%s" % self.guid
cls._register_attribute(attr_maxslrc)
attr_rtsctsthreshold = Attribute("RtsCtsThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
cls._register_attribute(attr_rtsctsthreshold)
attr_fragmentationthreshold = Attribute("FragmentationThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
--- /dev/null
+#
+# NEPI, a framework to manage network experiments
+# Copyright (C) 2014 INRIA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from nepi.execution.attribute import Attribute, Flags, Types
+from nepi.execution.trace import Trace, TraceAttr
+from nepi.execution.resource import ResourceManager, clsinit_copy, \
+ ResourceState, reschedule_delay
+from nepi.resources.ns3.ns3wifimac import NS3BaseWifiMac
+
+@clsinit_copy
+class NS3OcbWifiMac(NS3BaseWifiMac):
+ _rtype = "ns3::OcbWifiMac"
+
+ @classmethod
+ def _register_attributes(cls):
+
+ attr_qossupported = Attribute("QosSupported",
+ "This Boolean attribute is set to enable 802.11e/WMM-style QoS support at this STA",
+ type = Types.Bool,
+ default = "False",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_qossupported)
+
+ attr_htsupported = Attribute("HtSupported",
+ "This Boolean attribute is set to enable 802.11n support at this STA",
+ type = Types.Bool,
+ default = "False",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_htsupported)
+
+ attr_ctstoselfsupported = Attribute("CtsToSelfSupported",
+ "Use CTS to Self when using a rate that is not in the basic set rate",
+ type = Types.Bool,
+ default = "False",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_ctstoselfsupported)
+
+ attr_ctstimeout = Attribute("CtsTimeout",
+ "When this timeout expires, the RTS/CTS handshake has failed.",
+ type = Types.String,
+ default = "+75000.0ns",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_ctstimeout)
+
+ attr_acktimeout = Attribute("AckTimeout",
+ "When this timeout expires, the DATA/ACK handshake has failed.",
+ type = Types.String,
+ default = "+75000.0ns",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_acktimeout)
+
+ attr_basicblockacktimeout = Attribute("BasicBlockAckTimeout",
+ "When this timeout expires, the BASIC_BLOCK_ACK_REQ/BASIC_BLOCK_ACK handshake has failed.",
+ type = Types.String,
+ default = "+281000.0ns",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_basicblockacktimeout)
+
+ attr_compressedblockacktimeout = Attribute("CompressedBlockAckTimeout",
+ "When this timeout expires, the COMPRESSED_BLOCK_ACK_REQ/COMPRESSED_BLOCK_ACK handshake has failed.",
+ type = Types.String,
+ default = "+107000.0ns",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_compressedblockacktimeout)
+
+ attr_sifs = Attribute("Sifs",
+ "The value of the SIFS constant.",
+ type = Types.String,
+ default = "+16000.0ns",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_sifs)
+
+ attr_eifsnodifs = Attribute("EifsNoDifs",
+ "The value of EIFS-DIFS",
+ type = Types.String,
+ default = "+60000.0ns",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_eifsnodifs)
+
+ attr_slot = Attribute("Slot",
+ "The duration of a Slot.",
+ type = Types.String,
+ default = "+9000.0ns",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_slot)
+
+ attr_pifs = Attribute("Pifs",
+ "The value of the PIFS constant.",
+ type = Types.String,
+ default = "+25000.0ns",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_pifs)
+
+ attr_rifs = Attribute("Rifs",
+ "The value of the RIFS constant.",
+ type = Types.String,
+ default = "+2000.0ns",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_rifs)
+
+ attr_maxpropagationdelay = Attribute("MaxPropagationDelay",
+ "The maximum propagation delay. Unused for now.",
+ type = Types.String,
+ default = "+3333.0ns",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_maxpropagationdelay)
+
+ attr_ssid = Attribute("Ssid",
+ "The ssid we want to belong to.",
+ type = Types.String,
+ default = "default",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_ssid)
+
+
+
+ @classmethod
+ def _register_traces(cls):
+
+ txokheader = Trace("TxOkHeader", "The header of successfully transmitted packet")
+
+ cls._register_trace(txokheader)
+
+ txerrheader = Trace("TxErrHeader", "The header of unsuccessfully transmitted packet")
+
+ cls._register_trace(txerrheader)
+
+ mactx = Trace("MacTx", "A packet has been received from higher layers and is being processed in preparation for queueing for transmission.")
+
+ cls._register_trace(mactx)
+
+ mactxdrop = Trace("MacTxDrop", "A packet has been dropped in the MAC layer before being queued for transmission.")
+
+ cls._register_trace(mactxdrop)
+
+ macpromiscrx = Trace("MacPromiscRx", "A packet has been received by this device, has been passed up from the physical layer and is being forwarded up the local protocol stack. This is a promiscuous trace,")
+
+ cls._register_trace(macpromiscrx)
+
+ macrx = Trace("MacRx", "A packet has been received by this device, has been passed up from the physical layer and is being forwarded up the local protocol stack. This is a non-promiscuous trace,")
+
+ cls._register_trace(macrx)
+
+ macrxdrop = Trace("MacRxDrop", "A packet has been dropped in the MAC layer after it has been passed up from the physical layer.")
+
+ cls._register_trace(macrxdrop)
+
+
+
+ def __init__(self, ec, guid):
+ super(NS3OcbWifiMac, self).__init__(ec, guid)
+ self._home = "ns3-ocb-wifi-mac-%s" % self.guid
--- /dev/null
+#
+# NEPI, a framework to manage network experiments
+# Copyright (C) 2014 INRIA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from nepi.execution.attribute import Attribute, Flags, Types
+from nepi.execution.trace import Trace, TraceAttr
+from nepi.execution.resource import ResourceManager, clsinit_copy, \
+ ResourceState, reschedule_delay
+from nepi.resources.ns3.ns3propagationlossmodel import NS3BasePropagationLossModel
+
+@clsinit_copy
+class NS3OkumuraHataPropagationLossModel(NS3BasePropagationLossModel):
+ _rtype = "ns3::OkumuraHataPropagationLossModel"
+
+ @classmethod
+ def _register_attributes(cls):
+
+ attr_frequency = Attribute("Frequency",
+ "The propagation frequency in Hz",
+ type = Types.Double,
+ default = "2.16e+09",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_frequency)
+
+ attr_environment = Attribute("Environment",
+ "Environment Scenario",
+ type = Types.Enumerate,
+ default = "Urban",
+ allowed = ["Urban","SubUrban","OpenAreas"],
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_environment)
+
+ attr_citysize = Attribute("CitySize",
+ "Dimension of the city",
+ type = Types.Enumerate,
+ default = "Large",
+ allowed = ["Small","Medium","Large"],
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_citysize)
+
+
+
+ @classmethod
+ def _register_traces(cls):
+ pass
+
+ def __init__(self, ec, guid):
+ super(NS3OkumuraHataPropagationLossModel, self).__init__(ec, guid)
+ self._home = "ns3-okumura-hata-propagation-loss-model-%s" % self.guid
cls._register_attribute(attr_maxslrc)
attr_rtsctsthreshold = Attribute("RtsCtsThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
cls._register_attribute(attr_rtsctsthreshold)
attr_fragmentationthreshold = Attribute("FragmentationThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
attr_remoteipv6 = Attribute("RemoteIpv6",
"The Ipv6Address of the outbound packets",
type = Types.String,
- default = "0000:0000:0000:0000:0000:0000:0000:0000",
+ default = "::",
allowed = None,
range = None,
flags = Flags.Reserved | Flags.Construct)
attr_localipv6 = Attribute("LocalIpv6",
"Local Ipv6Address of the sender",
type = Types.String,
- default = "0000:0000:0000:0000:0000:0000:0000:0000",
+ default = "::",
allowed = None,
range = None,
flags = Flags.Reserved | Flags.Construct)
cls._register_attribute(attr_maxslrc)
attr_rtsctsthreshold = Attribute("RtsCtsThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
cls._register_attribute(attr_rtsctsthreshold)
attr_fragmentationthreshold = Attribute("FragmentationThreshold",
- "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.",
+ "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.",
type = Types.Integer,
default = "2346",
allowed = None,
--- /dev/null
+#
+# NEPI, a framework to manage network experiments
+# Copyright (C) 2014 INRIA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from nepi.execution.attribute import Attribute, Flags, Types
+from nepi.execution.trace import Trace, TraceAttr
+from nepi.execution.resource import ResourceManager, clsinit_copy, \
+ ResourceState, reschedule_delay
+from nepi.resources.ns3.ns3netdevice import NS3BaseNetDevice
+
+@clsinit_copy
+class NS3SixLowPanNetDevice(NS3BaseNetDevice):
+ _rtype = "ns3::SixLowPanNetDevice"
+
+ @classmethod
+ def _register_attributes(cls):
+
+ attr_rfc6282 = Attribute("Rfc6282",
+ "Use RFC6282 (IPHC) if true, RFC4944 (HC1) otherwise.",
+ type = Types.Bool,
+ default = "True",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_rfc6282)
+
+ attr_omitudpchecksum = Attribute("OmitUdpChecksum",
+ "Omit the UDP checksum in IPHC compression.",
+ type = Types.Bool,
+ default = "True",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_omitudpchecksum)
+
+ attr_fragmentreassemblylistsize = Attribute("FragmentReassemblyListSize",
+ "The maximum size of the reassembly buffer (in packets). Zero meaning infinite.",
+ type = Types.Integer,
+ default = "0",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_fragmentreassemblylistsize)
+
+ attr_fragmentexpirationtimeout = Attribute("FragmentExpirationTimeout",
+ "When this timeout expires, the fragments will be cleared from the buffer.",
+ type = Types.String,
+ default = "+60000000000.0ns",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_fragmentexpirationtimeout)
+
+ attr_compressionthreshold = Attribute("CompressionThreshold",
+ "The minimum MAC layer payload size.",
+ type = Types.Integer,
+ default = "0",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_compressionthreshold)
+
+ attr_forceethertype = Attribute("ForceEtherType",
+ "Force a specific EtherType in L2 frames.",
+ type = Types.Bool,
+ default = "False",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_forceethertype)
+
+ attr_ethertype = Attribute("EtherType",
+ "The specific EtherType to be used in L2 frames.",
+ type = Types.Integer,
+ default = "65535",
+ allowed = None,
+ range = None,
+ flags = Flags.Reserved | Flags.Construct)
+
+ cls._register_attribute(attr_ethertype)
+
+
+
+ @classmethod
+ def _register_traces(cls):
+
+ tx = Trace("Tx", "Send - packet (including 6LoWPAN header), SixLoWPanNetDevice Ptr, interface index.")
+
+ cls._register_trace(tx)
+
+ rx = Trace("Rx", "Receive - packet (including 6LoWPAN header), SixLoWPanNetDevice Ptr, interface index.")
+
+ cls._register_trace(rx)
+
+ drop = Trace("Drop", "Drop - DropReason, packet (including 6LoWPAN header), SixLoWPanNetDevice Ptr, interface index.")
+
+ cls._register_trace(drop)
+
+
+
+ def __init__(self, ec, guid):
+ super(NS3SixLowPanNetDevice, self).__init__(ec, guid)
+ self._home = "ns3-six-low-pan-net-device-%s" % self.guid
cls._register_attribute(attr_remoteport)
attr_maxpacketsize = Attribute("MaxPacketSize",
- "The maximum size of a packet.",
+ "The maximum size of a packet (including the SeqTsHeader, 12 bytes).",
type = Types.Integer,
default = "1024",
allowed = None,
from nepi.execution.trace import Trace, TraceAttr
from nepi.execution.resource import ResourceManager, clsinit_copy, \
ResourceState, reschedule_delay
-from nepi.resources.ns3.ns3netdevice import NS3BaseNetDevice
+from nepi.resources.ns3.ns3wifinetdevice import NS3BaseWifiNetDevice
@clsinit_copy
-class NS3WifiNetDevice(NS3BaseNetDevice):
+class NS3WifiNetDevice(NS3BaseWifiNetDevice):
_rtype = "ns3::WifiNetDevice"
@classmethod
from nepi.execution.trace import Trace, TraceAttr
from nepi.execution.resource import ResourceManager, clsinit_copy, \
ResourceState, reschedule_delay
-from nepi.resources.ns3.ns3channel import NS3BaseChannel
+from nepi.resources.ns3.ns3wifichannel import NS3BaseWifiChannel
@clsinit_copy
-class NS3YansWifiChannel(NS3BaseChannel):
+class NS3YansWifiChannel(NS3BaseWifiChannel):
_rtype = "ns3::YansWifiChannel"
@classmethod
def _wait_rms(self):
""" Returns True if dependent RMs are not yer READY, False otherwise"""
for rm in self._rms_to_wait:
- if rm and rm.state < ResourceState.READY:
+ if rm.state < ResourceState.READY:
return True
return False
--- /dev/null
+#
+# NEPI, a framework to manage network experiments
+# Copyright (C) 2014 INRIA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Author: Alina Quereilhac <alina.quereilhac@inria.fr>
+
+from nepi.execution.attribute import Attribute, Flags, Types
+from nepi.execution.resource import clsinit_copy, ResourceState, reschedule_delay
+from nepi.resources.ns3.ns3dceapplication import NS3BaseDceApplication
+
+import os
+
+@clsinit_copy
+class NS3BaseCCNDceApplication(NS3BaseDceApplication):
+ _rtype = "abstract::ns3::CCNDceApplication"
+
+ @classmethod
+ def _register_attributes(cls):
+ files = Attribute("files",
+ "Semi-colon separated list of 'key=value' pairs to set as "
+ "DCE files (AddFile). The key should be a path to a local file "
+ "and the key is the path to be set in DCE for that file" ,
+ flags = Flags.Design)
+
+ stdinfile = Attribute("stdinFile",
+ "File to set as StdinFile. The value shoudl be either an empty "
+ "or a path to a local file ",
+ flags = Flags.Design)
+
+ cls._register_attribute(files)
+ cls._register_attribute(stdinfile)
+
+ def _instantiate_object(self):
+ pass
+
+ def _connect_object(self):
+ node = self.node
+ if node.uuid not in self.connected:
+ self._connected.add(node.uuid)
+
+ # Preventing concurrent access to the DceApplicationHelper
+ # from different DceApplication RMs
+ with self.simulation.dce_application_lock:
+ self.simulation.invoke(
+ self.simulation.ccn_client_helper_uuid,
+ "ResetArguments")
+
+ self.simulation.invoke(
+ self.simulation.ccn_client_helper_uuid,
+ "ResetEnvironment")
+
+ self.simulation.invoke(
+ self.simulation.ccn_client_helper_uuid,
+ "SetBinary", self.get("binary"))
+
+ self.simulation.invoke(
+ self.simulation.ccn_client_helper_uuid,
+ "SetStackSize", self.get("stackSize"))
+
+ arguments = self.get("arguments")
+ if arguments:
+ for arg in map(str.strip, arguments.split(";")):
+ self.simulation.invoke(
+ self.simulation.ccn_client_helper_uuid,
+ "AddArgument", arg)
+
+ environment = self.get("environment")
+ if environment:
+ for env in map(str.strip, environment.split(";")):
+ key, val = env.split("=")
+ self.simulation.invoke(
+ self.simulation.ccn_client_helper_uuid,
+ "AddEnvironment", key, val)
+
+ if self.has_attribute("files"):
+ files = self.get("files")
+ if files:
+ for files in map(str.strip, files.split(";")):
+ remotepath, dcepath = files.split("=")
+ localpath = "${SHARE}/" + os.path.basename(remotepath)
+ self.simulation.invoke(
+ self.simulation.ccn_client_helper_uuid,
+ "AddFile", localpath, dcepath)
+
+ if self.has_attribute("stdinFile"):
+ stdinfile = self.get("stdinFile")
+ if stdinfile:
+ if stdinfile != "":
+ stdinfile = "${SHARE}/" + os.path.basename(stdinfile)
+
+ self.simulation.invoke(
+ self.simulation.ccn_client_helper_uuid,
+ "SetStdinFile", stdinfile)
+
+ apps_uuid = self.simulation.invoke(
+ self.simulation.ccn_client_helper_uuid,
+ "InstallInNode", self.node.uuid)
+
+ self._uuid = self.simulation.invoke(apps_uuid, "Get", 0)
+
+ if self.has_changed("StartTime"):
+ self.simulation.ns3_set(self.uuid, "StartTime", self.get("StartTime"))
+
+ if self.has_changed("StopTime"):
+ self.simulation.ns3_set(self.uuid, "StopTime", self.get("StopTime"))
+
+
"DCE environment variables.",
flags = Flags.Design)
+ starttime = Attribute("StartTime",
+ "Time at which the application will start",
+ default = "+0.0ns",
+ flags = Flags.Reserved | Flags.Construct)
+
+ stoptime = Attribute("StopTime",
+ "Time at which the application will stop",
+ default = "+0.0ns",
+ flags = Flags.Reserved | Flags.Construct)
+
cls._register_attribute(binary)
cls._register_attribute(stack_size)
cls._register_attribute(arguments)
cls._register_attribute(environment)
+ cls._register_attribute(stoptime)
+ cls._register_attribute(starttime)
@property
def node(self):
self.simulation.dce_application_helper_uuid,
"SetStackSize", self.get("stackSize"))
- arguments = self.get("arguments") or ""
- for arg in map(str.strip, arguments.split(";")):
- self.simulation.invoke(
- self.simulation.dce_application_helper_uuid,
- "AddArgument", arg)
-
- environment = self.get("environment") or ""
- for env in map(str.strip, environment.split(";")):
- key, val = env.split("=")
- self.simulation.invoke(
- self.simulation.dce_application_helper_uuid,
- "AddEnvironment", key, val)
-
- if self.has_attribute("files"):
- files = self.get("files") or ""
- for files in map(str.strip, files.split(";")):
- remotepath, dcepath = env.split("=")
- localpath = "${SHARE}/" + os.path.basename(remotepath)
+ arguments = self.get("arguments")
+ if arguments:
+ for arg in map(str.strip, arguments.split(";")):
self.simulation.invoke(
self.simulation.dce_application_helper_uuid,
- "AddFile", localpath, dcepath)
-
- if self.has_attribute("stdinFile"):
- stdinfile = self.get("stdinFile")
- if stdinfile:
- if stdinfile != "":
- stdinfile = "${SHARE}/" + os.path.basename(stdinfile)
-
+ "AddArgument", arg)
+
+ environment = self.get("environment")
+ if environment:
+ for env in map(str.strip, environment.split(";")):
+ key, val = env.split("=")
self.simulation.invoke(
self.simulation.dce_application_helper_uuid,
- "SetStdinFile", stdinfile)
+ "AddEnvironment", key, val)
apps_uuid = self.simulation.invoke(
self.simulation.dce_application_helper_uuid,
self.simulation.invoke(self.uuid, "Attach", channel.uuid)
self._connected.add(channel.uuid)
- queue = self.queue
# Verify that the device has a queue. If no queue is added a segfault
# error occurs
- if queue and queue.uuid not in self.connected:
- self._connected.add(queue.uuid)
+ queue = self.queue
+
if device.uuid not in self.connected:
self.simulation.invoke(device.uuid, "SetQueue", self.uuid)
self._connected.add(device.uuid)
+ device._connected.add(self.uuid)
ns3_wrapper.logger.debug("CREATE %s %s" % (clazzname, str(args)))
uuid = ns3_wrapper.create(clazzname, *args)
+
+ #ns3_wrapper.logger.debug("%s = CREATE " % str(uuid))
return uuid
if msg_type == NS3WrapperMessage.FACTORY:
ns3_wrapper.logger.debug("FACTORY %s %s" % (type_name, str(kwargs)))
uuid = ns3_wrapper.factory(type_name, **kwargs)
+
+ #ns3_wrapper.logger.debug("%s = FACTORY " % str(uuid))
return uuid
if msg_type == NS3WrapperMessage.INVOKE:
#
# Author: Alina Quereilhac <alina.quereilhac@inria.fr>
+#
+# Instructions. Run with:
+#
+# PYTHONPATH=$PYTHONPATH:~/repos/nepi/src python src/nepi/resources/ns3/resource_manager_generator.py
+#
+
# Force the load of ns3 libraries
from nepi.resources.ns3.ns3wrapper import load_ns3_module
import re
adapted_types = ["ns3::Node",
- "ns3::Application",
- #"ns3::DceApplication",
- "ns3::NetDevice",
- "ns3::Channel",
- "ns3::Queue",
"ns3::Icmpv4L4Protocol",
"ns3::ArpL3Protocol",
"ns3::Ipv4L3Protocol",
"ns3::WifiPhy",
"ns3::WifiMac",
"ns3::ErrorModel",
- "ns3::ErrorRateModel"]
+ "ns3::ErrorRateModel",
+ "ns3::Application",
+ #"ns3::DceApplication",
+ "ns3::NetDevice",
+ "ns3::Channel",
+ "ns3::Queue"]
base_types = ["ns3::IpL4Protocol"]
class LinuxNS3DceApplicationTest(unittest.TestCase):
def setUp(self):
- #self.fedora_host = "nepi2.pl.sophia.inria.fr"
- self.fedora_host = "planetlabpc1.upf.edu"
+ self.fedora_host = "nepi2.pl.sophia.inria.fr"
+ #self.fedora_host = "planetlabpc1.upf.edu"
self.fedora_user = "inria_nepi"
self.fedora_identity = "%s/.ssh/id_rsa_planetlab" % (os.environ['HOME'])
"cd iputils-s20101006/ && "
"sed -i 's/CFLAGS=/CFLAGS+=/g' Makefile && "
"make CFLAGS=-fPIC LDFLAGS=-pie ping && "
- "cp ping ${BIN_DCE} ")
+ "cp ping ${BIN_DCE} && cd - ")
ec.set (ping, "binary", "ping")
ec.set (ping, "stackSize", 1<<20)
ec.set (ping, "arguments", "-c 10;-s 1000;10.0.0.2")
ec.register_connection(chan, p2p2)
### create applications
- ccnd1 = ec.register_resource("ns3::LinuxDceApplication")
+ ccnd1 = ec.register_resource("ns3::LinuxCCNDceApplication")
ec.set(ccnd1, "depends", "libpcap0.8-dev openjdk-6-jdk ant1.8 autoconf "
"libssl-dev libexpat-dev libpcap-dev libecryptfs0 libxml2-utils auto"
"make gawk gcc g++ git-core pkg-config libpcre3-dev openjdk-6-jre-lib")
ec.set (ccnd1, "sources", "http://www.ccnx.org/releases/ccnx-0.7.2.tar.gz")
- ec.set (ccnd1, "build", "tar xvjf ${SRC}/iputils-s20101006.tar.bz2 && "
- "tar zxf ${SRC}/ccnx-0.7.2.tar.gz && "
+ ec.set (ccnd1, "build", "tar zxf ${SRC}/ccnx-0.7.2.tar.gz && "
"cd ccnx-0.7.2 && "
- " INSTALL_BASE=${BIN_DCE} ./configure && "
+ " INSTALL_BASE=${BIN_DCE}/.. ./configure && "
" make MORE_LDLIBS=-pie && "
- " make install ")
+ " make install && cd -")
ec.set (ccnd1, "binary", "ccndstart")
ec.set (ccnd1, "stackSize", 1<<20)
ec.set (ccnd1, "StartTime", "1s")
ec.set (ccnd1, "StopTime", "20s")
ec.register_connection(ccnd1, nsnode1)
- ccnkill1 = ec.register_resource("ns3::LinuxDceApplication")
+ ccnkill1 = ec.register_resource("ns3::LinuxCCNDceApplication")
ec.set (ccnkill1, "binary", "ccnsmoketest")
ec.set (ccnkill1, "arguments", "kill")
ec.set (ccnkill1, "stdinFile", "")
os.path.dirname(os.path.realpath(__file__)),
"repoFile1")
- ccnr = ec.register_resource("ns3::LinuxDceApplication")
+ ccnr = ec.register_resource("ns3::LinuxCCNDceApplication")
ec.set (ccnr, "binary", "ccnr")
ec.set (ccnr, "environment", "CCNR_DIRECTORY=/REPO/")
ec.set (ccnr, "files", "%s=/REPO/repoFile1" % repofile)
ec.set (ccnr, "StopTime", "120s")
ec.register_connection(ccnr, nsnode1)
- ccndc1 = ec.register_resource("ns3::LinuxDceApplication")
+ ccndc1 = ec.register_resource("ns3::LinuxCCNDceApplication")
ec.set (ccndc1, "binary", "ccndc")
ec.set (ccndc1, "arguments", "-v;add;ccnx:/;udp;10.0.0.2")
ec.set (ccndc1, "stackSize", 1<<20)
ec.set (ccndc1, "StopTime", "120s")
ec.register_connection(ccndc1, nsnode1)
- ccnd2 = ec.register_resource("ns3::LinuxDceApplication")
+ ccnd2 = ec.register_resource("ns3::LinuxCCNDceApplication")
ec.set (ccnd2, "binary", "ccndstart")
ec.set (ccnd2, "stackSize", 1<<20)
ec.set (ccnd2, "StartTime", "1s")
ec.set (ccnd2, "StopTime", "120s")
ec.register_connection(ccnd2, nsnode2)
- ccndc2 = ec.register_resource("ns3::LinuxDceApplication")
+ ccndc2 = ec.register_resource("ns3::LinuxCCNDceApplication")
ec.set (ccndc2, "binary", "ccndc")
ec.set (ccndc2, "arguments", "-v;add;ccnx:/;udp;10.0.0.1")
ec.set (ccndc2, "stackSize", 1<<20)
ec.set (ccndc2, "StopTime", "120s")
ec.register_connection(ccndc2, nsnode2)
- ccnpeek = ec.register_resource("ns3::LinuxDceApplication")
+ ccnpeek = ec.register_resource("ns3::LinuxCCNDceApplication")
ec.set (ccnpeek, "binary", "ccnpeek")
ec.set (ccnpeek, "arguments", "ccnx:/test/bunny.ts")
ec.set (ccnpeek, "stdinFile", "")
ec.set (ccnpeek, "StopTime", "120s")
ec.register_connection(ccnpeek, nsnode2)
- ccncat = ec.register_resource("ns3::LinuxDceApplication")
+ ccncat = ec.register_resource("ns3::LinuxCCNDceApplication")
ec.set (ccncat, "binary", "ccncat")
ec.set (ccncat, "arguments", "ccnx:/test/bunny.ts")
ec.set (ccncat, "stdinFile", "")
ec.set (ccncat, "StopTime", "120s")
ec.register_connection(ccncat, nsnode2)
- ccnkill2 = ec.register_resource("ns3::LinuxDceApplication")
+ ccnkill2 = ec.register_resource("ns3::LinuxCCNDceApplication")
ec.set (ccnkill2, "binary", "ccnsmoketest")
ec.set (ccnkill2, "arguments", "kill")
ec.set (ccnkill2, "stdinFile", "")
ec.deploy()
- ec.wait_finished([ping])
+ ec.wait_finished([ccncat, ccnkill1, ccnkill2])
print ec.trace(ccncat, "cmdline")
"""
self.assertTrue(cmdline.find(expected) > -1, cmdline)
"""
- print ec.trace(cccat, "status")
+ print ec.trace(ccncat, "status")
"""
expected = "Start Time: NS3 Time: 1s ("
status = ec.trace(ping, "status")
ec.shutdown()
-
-
if __name__ == '__main__':
unittest.main()
sources = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"ns-3.18-user.tar.gz")
ec.set(simu, "sources", sources)
+ ec.set(simu, "pybindgenVersion", "834")
ec.register_connection(simu, node)
nsnode1 = add_ns3_node(ec, simu)