NS3Client: replacing socat for ssh
authorAlina Quereilhac <alina.quereilhac@inria.fr>
Mon, 17 Feb 2014 18:18:42 +0000 (19:18 +0100)
committerAlina Quereilhac <alina.quereilhac@inria.fr>
Mon, 17 Feb 2014 18:18:42 +0000 (19:18 +0100)
102 files changed:
src/nepi/resources/linux/node.py
src/nepi/resources/linux/ns3/ns3client.py
src/nepi/resources/linux/ns3/ns3simulation.py
src/nepi/resources/ns3/classes/aarf_wifi_manager.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/aarfcd_wifi_manager.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/adhoc_wifi_mac.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/aloha_noack_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/amrr_wifi_manager.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/ap_wifi_mac.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/arf_wifi_manager.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/arp_l3protocol.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/base_station_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/bridge_channel.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/bridge_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/bulk_send_application.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/burst_error_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/cara_wifi_manager.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/constant_acceleration_mobility_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/constant_position_mobility_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/constant_rate_wifi_manager.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/constant_speed_propagation_delay_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/constant_velocity_mobility_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/cost231propagation_loss_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/csma_channel.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/csma_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/drop_tail_queue.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/emu_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/error_channel.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/error_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/fd_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/fixed_rss_loss_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/friis_propagation_loss_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/gauss_markov_mobility_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/hierarchical_mobility_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/hybrid_buildings_propagation_loss_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/icmpv4l4protocol.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/ideal_wifi_manager.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/ipv4l3protocol.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/jakes_propagation_loss_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/list_error_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/log_distance_propagation_loss_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/loopback_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/lte_enb_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/lte_simple_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/matrix_propagation_loss_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/mesh_point_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/mesh_wifi_interface_mac.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/minstrel_wifi_manager.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/multi_model_spectrum_channel.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/nakagami_propagation_loss_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/nist_error_rate_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/node.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/non_communicating_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/oh_buildings_propagation_loss_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/on_off_application.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/onoe_wifi_manager.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/packet_sink.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/ping6.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/point_to_point_channel.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/point_to_point_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/point_to_point_remote_channel.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/radvd.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/random_direction2d_mobility_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/random_propagation_delay_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/random_propagation_loss_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/random_walk2d_mobility_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/random_waypoint_mobility_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/range_propagation_loss_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/rate_error_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/receive_list_error_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/red_queue.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/rraa_wifi_manager.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/simple_channel.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/simple_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/single_model_spectrum_channel.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/sta_wifi_mac.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/steady_state_random_waypoint_mobility_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/subscriber_station_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/tap_bridge.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/three_log_distance_propagation_loss_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/two_ray_ground_propagation_loss_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/uan_channel.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/udp_client.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/udp_echo_client.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/udp_echo_server.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/udp_server.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/udp_trace_client.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/v4ping.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/virtual_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/waypoint_mobility_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/wifi_net_device.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/yans_error_rate_model.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/yans_wifi_channel.py [new file with mode: 0644]
src/nepi/resources/ns3/classes/yans_wifi_phy.py [new file with mode: 0644]
src/nepi/resources/ns3/ns3application.py
src/nepi/resources/ns3/ns3base.py
src/nepi/resources/ns3/ns3ipv4l3protocol.py
src/nepi/resources/ns3/ns3route.py [new file with mode: 0644]
src/nepi/resources/ns3/ns3wrapper.py
src/nepi/util/sshfuncs.py
test/resources/linux/ns3/ns3client.py
test/resources/linux/ns3/ns3simulation.py

index edfa0ca..ff104aa 100644 (file)
@@ -422,38 +422,6 @@ class LinuxNode(ResourceManager):
             
         return self.execute(cmd, with_lock = True)
 
-    def socat(self, local_socket_name, 
-        remote_socket_name,
-        sudo = False,
-        identity = None,
-        server_key = None,
-        env = None,
-        tty = False,
-        connect_timeout = 30,
-        retry = 3,
-        strict_host_checking = True):
-        """ Connectes a local and a remote UNIX socket through SSH using socat """ 
-
-        if self.localhost:
-            return (None, None), None
-        else:
-            return sshfuncs.socat(
-                local_socket_name,
-                remote_socket_name,
-                host = self.get("hostname"),
-                user = self.get("username"),
-                port = self.get("port"),
-                agent = True,
-                sudo = sudo,
-                identity = self.get("identity"),
-                server_key = self.get("serverKey"),
-                env = env,
-                tty = tty,
-                retry = retry,
-                connect_timeout = connect_timeout,
-                strict_host_checking = strict_host_checking
-                )
-
     def execute(self, command,
             sudo = False,
             env = None,
index 465c0ec..882c1f3 100644 (file)
@@ -20,7 +20,9 @@
 import base64
 import cPickle
 import errno
+import os
 import socket
+import time
 import weakref
 
 from optparse import OptionParser, SUPPRESS_HELP
@@ -34,24 +36,12 @@ class LinuxNS3Client(NS3Client):
         self._simulation = weakref.ref(simulation)
 
         self._socat_proc = None
-        self.connect_client()
 
     @property
     def simulation(self):
         return self._simulation()
 
-    def connect_client(self):
-        if self.simulation.node.get("hostname") in ['localhost', '127.0.0.1']:
-            return
-
-        (out, err), self._socat_proc = self.simulation.node.socat(
-                self.simulation.local_socket,
-                self.simulation.remote_socket) 
-
     def send_msg(self, msg_type, *args, **kwargs):
-        sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
-        sock.connect(self.simulation.local_socket)
-
         msg = [msg_type, args, kwargs]
 
         def encode(item):
@@ -59,10 +49,38 @@ class LinuxNS3Client(NS3Client):
             return base64.b64encode(item)
 
         encoded = "|".join(map(encode, msg))
-        sock.send("%s\n" % encoded)
-       
-        reply = sock.recv(1024)
-        return cPickle.loads(base64.b64decode(reply))
+
+        if self.simulation.node.get("hostname") in ['localhost', '127.0.0.1']:
+            sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+            sock.connect(self.simulation.remote_socket)
+            sock.send("%s\n" % encoded)
+            reply = sock.recv(1024)
+            sock.close()
+
+        else:
+            command = ( "python -c 'import socket;"
+                "sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM);"
+                "sock.connect(\"%(socket_addr)s\");"
+                "msg = \"%(encoded_message)s\\n\";"
+                "sock.send(msg);"
+                "reply = sock.recv(1024);"
+                "sock.close();"
+                "print reply'") % {
+                    "encoded_message": encoded,
+                    "socket_addr": self.simulation.remote_socket,
+                    }
+
+            (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)
+                self.simulation.error(msg, reply, err)
+                raise RuntimeError(msg)
+                   
+        reply = cPickle.loads(base64.b64decode(reply))
+
+        return reply
 
     def create(self, *args, **kwargs):
         return self.send_msg(NS3WrapperMessage.CREATE, *args, **kwargs)
@@ -89,23 +107,10 @@ class LinuxNS3Client(NS3Client):
         return self.send_msg(NS3WrapperMessage.STOP, *args, **kwargs)
 
     def shutdown(self, *args, **kwargs):
-        ret = None
-
-        try:
-            ret = self.send_msg(NS3WrapperMessage.SHUTDOWN, *args, **kwargs)
-        except:
-            pass
-
-        try:
-            if self._socat_proc:
-                self._socat_proc.kill()
-        except:
-            pass
-
         try:
-            os.remove(self.simulation.local_socket)
+            return self.send_msg(NS3WrapperMessage.SHUTDOWN, *args, **kwargs)
         except:
             pass
 
-        return ret
+        return None
 
index 5b41c14..a7780b0 100644 (file)
@@ -24,7 +24,8 @@ from nepi.execution.resource import ResourceManager, clsinit_copy, \
 from nepi.resources.linux.application import LinuxApplication
 from nepi.util.timefuncs import tnow, tdiffsec
 from nepi.resources.ns3.ns3simulation import NS3Simulation
-from nepi.resources.ns3.ns3wrapper import SIMULATOR_UUID, GLOBAL_VALUE_UUID
+from nepi.resources.ns3.ns3wrapper import SIMULATOR_UUID, GLOBAL_VALUE_UUID, \
+        IPV4_GLOBAL_ROUTING_HELPER_UUID
 from nepi.resources.linux.ns3.ns3client import LinuxNS3Client
 
 import os
@@ -88,6 +89,12 @@ class LinuxNS3Simulation(LinuxApplication, NS3Simulation):
             default = "834", 
             flags = Flags.Design)
 
+        populate_routing_tables = Attribute("populateRoutingTables",
+            "Invokes  Ipv4GlobalRoutingHelper.PopulateRoutingTables() ",
+            default = False,
+            type = Types.Bool,
+            flags = Flags.Design)
+
         cls._register_attribute(impl_type)
         cls._register_attribute(sched_type)
         cls._register_attribute(check_sum)
@@ -96,6 +103,7 @@ class LinuxNS3Simulation(LinuxApplication, NS3Simulation):
         cls._register_attribute(build_mode)
         cls._register_attribute(ns3_version)
         cls._register_attribute(pybindgen_version)
+        cls._register_attribute(populate_routing_tables)
 
     def __init__(self, ec, guid):
         LinuxApplication.__init__(self, ec, guid)
@@ -113,13 +121,6 @@ class LinuxNS3Simulation(LinuxApplication, NS3Simulation):
     def remote_socket(self):
         return os.path.join(self.run_home, self.socket_name)
 
-    @property
-    def local_socket(self):
-        if self.node.get('hostname') in ['localhost', '127.0.0.01']:
-            return self.remote_socket
-
-        return os.path.join("/", "tmp", self.socket_name)
-
     def trace(self, name, attr = TraceAttr.ALL, block = 512, offset = 0):
         self._client.flush() 
         return LinuxApplication.trace(self, name, attr, block, offset)
@@ -234,15 +235,6 @@ class LinuxNS3Simulation(LinuxApplication, NS3Simulation):
 
             # Create client
             self._client = LinuxNS3Client(self)
-           
-            # Wait until local socket is created
-            for i in [1, 5, 15, 30, 60]:
-                if os.path.exists(self.local_socket):
-                    break
-                time.sleep(i)
-
-            if not os.path.exists(self.local_socket):
-                raise RuntimeError("Problem starting socat")
 
             self.configure()
             
@@ -255,6 +247,9 @@ class LinuxNS3Simulation(LinuxApplication, NS3Simulation):
         self.info("Starting")
 
         if self.state == ResourceState.READY:
+            if self.get("populateRoutingTables") == True:
+                self.invoke(IPV4_GLOBAL_ROUTING_HELPER_UUID, "PopulateRoutingTables")
+
             self._client.start() 
 
             self.set_started()
diff --git a/src/nepi/resources/ns3/classes/aarf_wifi_manager.py b/src/nepi/resources/ns3/classes/aarf_wifi_manager.py
new file mode 100644 (file)
index 0000000..d737f3a
--- /dev/null
@@ -0,0 +1,177 @@
+#
+#    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.ns3wifiremotestationmanager import NS3BaseWifiRemoteStationManager 
+
+@clsinit_copy
+class NS3AarfWifiManager(NS3BaseWifiRemoteStationManager):
+    _rtype = "ns3::AarfWifiManager"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_successk = Attribute("SuccessK",
+            "Multiplication factor for the success threshold in the AARF algorithm.",
+            type = Types.Double,
+            default = "2",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_successk)
+
+        attr_timerk = Attribute("TimerK",
+            "Multiplication factor for the timer threshold in the AARF algorithm.",
+            type = Types.Double,
+            default = "2",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_timerk)
+
+        attr_maxsuccessthreshold = Attribute("MaxSuccessThreshold",
+            "Maximum value of the success threshold in the AARF algorithm.",
+            type = Types.Integer,
+            default = "60",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxsuccessthreshold)
+
+        attr_mintimerthreshold = Attribute("MinTimerThreshold",
+            "The minimum value for the \'timer\' threshold in the AARF algorithm.",
+            type = Types.Integer,
+            default = "15",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mintimerthreshold)
+
+        attr_minsuccessthreshold = Attribute("MinSuccessThreshold",
+            "The minimum value for the success threshold in the AARF algorithm.",
+            type = Types.Integer,
+            default = "10",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_minsuccessthreshold)
+
+        attr_islowlatency = Attribute("IsLowLatency",
+            "If true, we attempt to modelize a so-called low-latency device: a device where decisions about tx parameters can be made on a per-packet basis and feedback about the transmission of each packet is obtained before sending the next. Otherwise, we modelize a  high-latency device, that is a device where we cannot update our decision about tx parameters after every packet transmission.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_islowlatency)
+
+        attr_maxssrc = Attribute("MaxSsrc",
+            "The maximum number of retransmission attempts for an RTS. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxssrc)
+
+        attr_maxslrc = Attribute("MaxSlrc",
+            "The maximum number of retransmission attempts for a DATA packet. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_fragmentationthreshold)
+
+        attr_nonunicastmode = Attribute("NonUnicastMode",
+            "Wifi mode used for non-unicast transmissions.",
+            type = Types.String,
+            default = "Invalid-WifiMode",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_nonunicastmode)
+
+        attr_defaulttxpowerlevel = Attribute("DefaultTxPowerLevel",
+            "Default power level to be used for transmissions. This is the power level that is used by all those WifiManagers that do notimplement TX power control.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_defaulttxpowerlevel)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactxrtsfailed = Trace("MacTxRtsFailed", "The transmission of a RTS by the MAC layer has failed")
+
+        cls._register_trace(mactxrtsfailed)
+
+        mactxdatafailed = Trace("MacTxDataFailed", "The transmission of a data packet by the MAC layer has failed")
+
+        cls._register_trace(mactxdatafailed)
+
+        mactxfinalrtsfailed = Trace("MacTxFinalRtsFailed", "The transmission of a RTS has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinalrtsfailed)
+
+        mactxfinaldatafailed = Trace("MacTxFinalDataFailed", "The transmission of a data packet has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinaldatafailed)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3AarfWifiManager, self).__init__(ec, guid)
+        self._home = "ns3-aarf-wifi-manager-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/aarfcd_wifi_manager.py b/src/nepi/resources/ns3/classes/aarfcd_wifi_manager.py
new file mode 100644 (file)
index 0000000..625662f
--- /dev/null
@@ -0,0 +1,217 @@
+#
+#    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.ns3wifiremotestationmanager import NS3BaseWifiRemoteStationManager 
+
+@clsinit_copy
+class NS3AarfcdWifiManager(NS3BaseWifiRemoteStationManager):
+    _rtype = "ns3::AarfcdWifiManager"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_successk = Attribute("SuccessK",
+            "Multiplication factor for the success threshold in the AARF algorithm.",
+            type = Types.Double,
+            default = "2",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_successk)
+
+        attr_timerk = Attribute("TimerK",
+            "Multiplication factor for the timer threshold in the AARF algorithm.",
+            type = Types.Double,
+            default = "2",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_timerk)
+
+        attr_maxsuccessthreshold = Attribute("MaxSuccessThreshold",
+            "Maximum value of the success threshold in the AARF algorithm.",
+            type = Types.Integer,
+            default = "60",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxsuccessthreshold)
+
+        attr_mintimerthreshold = Attribute("MinTimerThreshold",
+            "The minimum value for the \'timer\' threshold in the AARF algorithm.",
+            type = Types.Integer,
+            default = "15",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mintimerthreshold)
+
+        attr_minsuccessthreshold = Attribute("MinSuccessThreshold",
+            "The minimum value for the success threshold in the AARF algorithm.",
+            type = Types.Integer,
+            default = "10",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_minsuccessthreshold)
+
+        attr_minrtswnd = Attribute("MinRtsWnd",
+            "Minimum value for Rts window of Aarf-CD",
+            type = Types.Integer,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_minrtswnd)
+
+        attr_maxrtswnd = Attribute("MaxRtsWnd",
+            "Maximum value for Rts window of Aarf-CD",
+            type = Types.Integer,
+            default = "40",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxrtswnd)
+
+        attr_turnoffrtsafterratedecrease = Attribute("TurnOffRtsAfterRateDecrease",
+            "If true the RTS mechanism will be turned off when the rate will be decreased",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_turnoffrtsafterratedecrease)
+
+        attr_turnonrtsafterrateincrease = Attribute("TurnOnRtsAfterRateIncrease",
+            "If true the RTS mechanism will be turned on when the rate will be increased",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_turnonrtsafterrateincrease)
+
+        attr_islowlatency = Attribute("IsLowLatency",
+            "If true, we attempt to modelize a so-called low-latency device: a device where decisions about tx parameters can be made on a per-packet basis and feedback about the transmission of each packet is obtained before sending the next. Otherwise, we modelize a  high-latency device, that is a device where we cannot update our decision about tx parameters after every packet transmission.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_islowlatency)
+
+        attr_maxssrc = Attribute("MaxSsrc",
+            "The maximum number of retransmission attempts for an RTS. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxssrc)
+
+        attr_maxslrc = Attribute("MaxSlrc",
+            "The maximum number of retransmission attempts for a DATA packet. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_fragmentationthreshold)
+
+        attr_nonunicastmode = Attribute("NonUnicastMode",
+            "Wifi mode used for non-unicast transmissions.",
+            type = Types.String,
+            default = "Invalid-WifiMode",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_nonunicastmode)
+
+        attr_defaulttxpowerlevel = Attribute("DefaultTxPowerLevel",
+            "Default power level to be used for transmissions. This is the power level that is used by all those WifiManagers that do notimplement TX power control.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_defaulttxpowerlevel)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactxrtsfailed = Trace("MacTxRtsFailed", "The transmission of a RTS by the MAC layer has failed")
+
+        cls._register_trace(mactxrtsfailed)
+
+        mactxdatafailed = Trace("MacTxDataFailed", "The transmission of a data packet by the MAC layer has failed")
+
+        cls._register_trace(mactxdatafailed)
+
+        mactxfinalrtsfailed = Trace("MacTxFinalRtsFailed", "The transmission of a RTS has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinalrtsfailed)
+
+        mactxfinaldatafailed = Trace("MacTxFinalDataFailed", "The transmission of a data packet has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinaldatafailed)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3AarfcdWifiManager, self).__init__(ec, guid)
+        self._home = "ns3-aarfcd-wifi-manager-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/adhoc_wifi_mac.py b/src/nepi/resources/ns3/classes/adhoc_wifi_mac.py
new file mode 100644 (file)
index 0000000..a53df07
--- /dev/null
@@ -0,0 +1,209 @@
+#
+#    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 NS3AdhocWifiMac(NS3BaseWifiMac):
+    _rtype = "ns3::AdhocWifiMac"
+
+    @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(NS3AdhocWifiMac, self).__init__(ec, guid)
+        self._home = "ns3-adhoc-wifi-mac-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/aloha_noack_net_device.py b/src/nepi/resources/ns3/classes/aloha_noack_net_device.py
new file mode 100644 (file)
index 0000000..b45b431
--- /dev/null
@@ -0,0 +1,77 @@
+#
+#    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 NS3AlohaNoackNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::AlohaNoackNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_address = Attribute("Address",
+            "The MAC address of this device.",
+            type = Types.String,
+            default = "12:34:56:78:90:12",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_address)
+
+        attr_mtu = Attribute("Mtu",
+            "The Maximum Transmission Unit",
+            type = Types.Integer,
+            default = "1500",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mtu)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactx = Trace("MacTx", "Trace source indicating a packet has arrived for transmission by this device")
+
+        cls._register_trace(mactx)
+
+        mactxdrop = Trace("MacTxDrop", "Trace source indicating a packet has been dropped by the device before 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)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3AlohaNoackNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-aloha-noack-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/amrr_wifi_manager.py b/src/nepi/resources/ns3/classes/amrr_wifi_manager.py
new file mode 100644 (file)
index 0000000..dfb13f4
--- /dev/null
@@ -0,0 +1,177 @@
+#
+#    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.ns3wifiremotestationmanager import NS3BaseWifiRemoteStationManager 
+
+@clsinit_copy
+class NS3AmrrWifiManager(NS3BaseWifiRemoteStationManager):
+    _rtype = "ns3::AmrrWifiManager"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_updateperiod = Attribute("UpdatePeriod",
+            "The interval between decisions about rate control changes",
+            type = Types.String,
+            default = "+1000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_updateperiod)
+
+        attr_failureratio = Attribute("FailureRatio",
+            "Ratio of minimum erroneous transmissions needed to switch to a lower rate",
+            type = Types.Double,
+            default = "0.333333",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_failureratio)
+
+        attr_successratio = Attribute("SuccessRatio",
+            "Ratio of maximum erroneous transmissions needed to switch to a higher rate",
+            type = Types.Double,
+            default = "0.1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_successratio)
+
+        attr_maxsuccessthreshold = Attribute("MaxSuccessThreshold",
+            "Maximum number of consecutive success periods needed to switch to a higher rate",
+            type = Types.Integer,
+            default = "10",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxsuccessthreshold)
+
+        attr_minsuccessthreshold = Attribute("MinSuccessThreshold",
+            "Minimum number of consecutive success periods needed to switch to a higher rate",
+            type = Types.Integer,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_minsuccessthreshold)
+
+        attr_islowlatency = Attribute("IsLowLatency",
+            "If true, we attempt to modelize a so-called low-latency device: a device where decisions about tx parameters can be made on a per-packet basis and feedback about the transmission of each packet is obtained before sending the next. Otherwise, we modelize a  high-latency device, that is a device where we cannot update our decision about tx parameters after every packet transmission.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_islowlatency)
+
+        attr_maxssrc = Attribute("MaxSsrc",
+            "The maximum number of retransmission attempts for an RTS. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxssrc)
+
+        attr_maxslrc = Attribute("MaxSlrc",
+            "The maximum number of retransmission attempts for a DATA packet. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_fragmentationthreshold)
+
+        attr_nonunicastmode = Attribute("NonUnicastMode",
+            "Wifi mode used for non-unicast transmissions.",
+            type = Types.String,
+            default = "Invalid-WifiMode",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_nonunicastmode)
+
+        attr_defaulttxpowerlevel = Attribute("DefaultTxPowerLevel",
+            "Default power level to be used for transmissions. This is the power level that is used by all those WifiManagers that do notimplement TX power control.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_defaulttxpowerlevel)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactxrtsfailed = Trace("MacTxRtsFailed", "The transmission of a RTS by the MAC layer has failed")
+
+        cls._register_trace(mactxrtsfailed)
+
+        mactxdatafailed = Trace("MacTxDataFailed", "The transmission of a data packet by the MAC layer has failed")
+
+        cls._register_trace(mactxdatafailed)
+
+        mactxfinalrtsfailed = Trace("MacTxFinalRtsFailed", "The transmission of a RTS has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinalrtsfailed)
+
+        mactxfinaldatafailed = Trace("MacTxFinalDataFailed", "The transmission of a data packet has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinaldatafailed)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3AmrrWifiManager, self).__init__(ec, guid)
+        self._home = "ns3-amrr-wifi-manager-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/ap_wifi_mac.py b/src/nepi/resources/ns3/classes/ap_wifi_mac.py
new file mode 100644 (file)
index 0000000..8802aa7
--- /dev/null
@@ -0,0 +1,249 @@
+#
+#    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 NS3ApWifiMac(NS3BaseWifiMac):
+    _rtype = "ns3::ApWifiMac"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_beaconinterval = Attribute("BeaconInterval",
+            "Delay between two beacons",
+            type = Types.String,
+            default = "+102400000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_beaconinterval)
+
+        attr_beaconjitter = Attribute("BeaconJitter",
+            "A uniform random variable to cause the initial beacon starting time (after simulation time 0) to be distributed between 0 and the BeaconInterval.",
+            type = Types.String,
+            default = "ns3::UniformRandomVariable",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_beaconjitter)
+
+        attr_enablebeaconjitter = Attribute("EnableBeaconJitter",
+            "If beacons are enabled, whether to jitter the initial send event.",
+            type = Types.Bool,
+            default = "False",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_enablebeaconjitter)
+
+        attr_beacongeneration = Attribute("BeaconGeneration",
+            "Whether or not beacons are generated.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_beacongeneration)
+
+        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(NS3ApWifiMac, self).__init__(ec, guid)
+        self._home = "ns3-ap-wifi-mac-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/arf_wifi_manager.py b/src/nepi/resources/ns3/classes/arf_wifi_manager.py
new file mode 100644 (file)
index 0000000..9714846
--- /dev/null
@@ -0,0 +1,147 @@
+#
+#    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.ns3wifiremotestationmanager import NS3BaseWifiRemoteStationManager 
+
+@clsinit_copy
+class NS3ArfWifiManager(NS3BaseWifiRemoteStationManager):
+    _rtype = "ns3::ArfWifiManager"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_timerthreshold = Attribute("TimerThreshold",
+            "The \'timer\' threshold in the ARF algorithm.",
+            type = Types.Integer,
+            default = "15",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_timerthreshold)
+
+        attr_successthreshold = Attribute("SuccessThreshold",
+            "The minimum number of sucessfull transmissions to try a new rate.",
+            type = Types.Integer,
+            default = "10",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_successthreshold)
+
+        attr_islowlatency = Attribute("IsLowLatency",
+            "If true, we attempt to modelize a so-called low-latency device: a device where decisions about tx parameters can be made on a per-packet basis and feedback about the transmission of each packet is obtained before sending the next. Otherwise, we modelize a  high-latency device, that is a device where we cannot update our decision about tx parameters after every packet transmission.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_islowlatency)
+
+        attr_maxssrc = Attribute("MaxSsrc",
+            "The maximum number of retransmission attempts for an RTS. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxssrc)
+
+        attr_maxslrc = Attribute("MaxSlrc",
+            "The maximum number of retransmission attempts for a DATA packet. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_fragmentationthreshold)
+
+        attr_nonunicastmode = Attribute("NonUnicastMode",
+            "Wifi mode used for non-unicast transmissions.",
+            type = Types.String,
+            default = "Invalid-WifiMode",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_nonunicastmode)
+
+        attr_defaulttxpowerlevel = Attribute("DefaultTxPowerLevel",
+            "Default power level to be used for transmissions. This is the power level that is used by all those WifiManagers that do notimplement TX power control.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_defaulttxpowerlevel)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactxrtsfailed = Trace("MacTxRtsFailed", "The transmission of a RTS by the MAC layer has failed")
+
+        cls._register_trace(mactxrtsfailed)
+
+        mactxdatafailed = Trace("MacTxDataFailed", "The transmission of a data packet by the MAC layer has failed")
+
+        cls._register_trace(mactxdatafailed)
+
+        mactxfinalrtsfailed = Trace("MacTxFinalRtsFailed", "The transmission of a RTS has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinalrtsfailed)
+
+        mactxfinaldatafailed = Trace("MacTxFinalDataFailed", "The transmission of a data packet has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinaldatafailed)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3ArfWifiManager, self).__init__(ec, guid)
+        self._home = "ns3-arf-wifi-manager-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/arp_l3protocol.py b/src/nepi/resources/ns3/classes/arp_l3protocol.py
new file mode 100644 (file)
index 0000000..d027d52
--- /dev/null
@@ -0,0 +1,55 @@
+#
+#    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.ns3arpl3protocol import NS3BaseArpL3Protocol 
+
+@clsinit_copy
+class NS3ArpL3Protocol(NS3BaseArpL3Protocol):
+    _rtype = "ns3::ArpL3Protocol"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_requestjitter = Attribute("RequestJitter",
+            "The jitter in ms a node is allowed to wait before sending an ARP request. Some jitter aims to prevent collisions. By default, the model will wait for a duration in ms defined by a uniform random-variable between 0 and RequestJitter",
+            type = Types.String,
+            default = "ns3::UniformRandomVariable[Min=0.0|Max=10.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_requestjitter)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        drop = Trace("Drop", "Packet dropped because not enough room in pending queue for a specific cache entry.")
+
+        cls._register_trace(drop)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3ArpL3Protocol, self).__init__(ec, guid)
+        self._home = "ns3-arp-l3protocol-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/base_station_net_device.py b/src/nepi/resources/ns3/classes/base_station_net_device.py
new file mode 100644 (file)
index 0000000..c0130be
--- /dev/null
@@ -0,0 +1,169 @@
+#
+#    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 NS3BaseStationNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::BaseStationNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_initialranginterval = Attribute("InitialRangInterval",
+            "Time between Initial Ranging regions assigned by the BS. Maximum is 2s",
+            type = Types.String,
+            default = "+50000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_initialranginterval)
+
+        attr_dcdinterval = Attribute("DcdInterval",
+            "Time between transmission of DCD messages. Maximum value is 10s.",
+            type = Types.String,
+            default = "+3000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_dcdinterval)
+
+        attr_ucdinterval = Attribute("UcdInterval",
+            "Time between transmission of UCD messages. Maximum value is 10s.",
+            type = Types.String,
+            default = "+3000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ucdinterval)
+
+        attr_intervalt8 = Attribute("IntervalT8",
+            "Wait for DSA/DSC Acknowledge timeout. Maximum 300ms.",
+            type = Types.String,
+            default = "+50000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_intervalt8)
+
+        attr_rangreqoppsize = Attribute("RangReqOppSize",
+            "The ranging opportunity size in symbols",
+            type = Types.Integer,
+            default = "8",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_rangreqoppsize)
+
+        attr_bwreqoppsize = Attribute("BwReqOppSize",
+            "The bandwidth request opportunity size in symbols",
+            type = Types.Integer,
+            default = "2",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_bwreqoppsize)
+
+        attr_maxrangcorrectionretries = Attribute("MaxRangCorrectionRetries",
+            "Number of retries on contention Ranging Requests",
+            type = Types.Integer,
+            default = "16",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxrangcorrectionretries)
+
+        attr_mtu = Attribute("Mtu",
+            "The MAC-level Maximum Transmission Unit",
+            type = Types.Integer,
+            default = "1400",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mtu)
+
+        attr_rtg = Attribute("RTG",
+            "receive/transmit transition gap.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_rtg)
+
+        attr_ttg = Attribute("TTG",
+            "transmit/receive transition gap.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ttg)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        bstx = Trace("BSTx", "A packet has been received from higher layers and is being processed in preparation for queueing for transmission.")
+
+        cls._register_trace(bstx)
+
+        bstxdrop = Trace("BSTxDrop", "A packet has been dropped in the MAC layer before being queued for transmission.")
+
+        cls._register_trace(bstxdrop)
+
+        bspromiscrx = Trace("BSPromiscRx", "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(bspromiscrx)
+
+        bsrx = Trace("BSRx", "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(bsrx)
+
+        bsrxdrop = Trace("BSRxDrop", "A packet has been dropped in the MAC layer after it has been passed up from the physical layer.")
+
+        cls._register_trace(bsrxdrop)
+
+        rx = Trace("Rx", "Receive trace")
+
+        cls._register_trace(rx)
+
+        tx = Trace("Tx", "Transmit trace")
+
+        cls._register_trace(tx)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3BaseStationNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-base-station-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/bridge_channel.py b/src/nepi/resources/ns3/classes/bridge_channel.py
new file mode 100644 (file)
index 0000000..4075f54
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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 NS3BridgeChannel(NS3BaseChannel):
+    _rtype = "ns3::BridgeChannel"
+
+    @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(NS3BridgeChannel, self).__init__(ec, guid)
+        self._home = "ns3-bridge-channel-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/bridge_net_device.py b/src/nepi/resources/ns3/classes/bridge_net_device.py
new file mode 100644 (file)
index 0000000..d1313c4
--- /dev/null
@@ -0,0 +1,70 @@
+#
+#    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 NS3BridgeNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::BridgeNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_mtu = Attribute("Mtu",
+            "The MAC-level Maximum Transmission Unit",
+            type = Types.Integer,
+            default = "1500",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mtu)
+
+        attr_enablelearning = Attribute("EnableLearning",
+            "Enable the learning mode of the Learning Bridge",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_enablelearning)
+
+        attr_expirationtime = Attribute("ExpirationTime",
+            "Time it takes for learned MAC state entry to expire.",
+            type = Types.String,
+            default = "+300000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_expirationtime)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3BridgeNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-bridge-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/bulk_send_application.py b/src/nepi/resources/ns3/classes/bulk_send_application.py
new file mode 100644 (file)
index 0000000..f7db2e9
--- /dev/null
@@ -0,0 +1,105 @@
+#
+#    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.ns3application import NS3BaseApplication 
+
+@clsinit_copy
+class NS3BulkSendApplication(NS3BaseApplication):
+    _rtype = "ns3::BulkSendApplication"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_sendsize = Attribute("SendSize",
+            "The amount of data to send each time.",
+            type = Types.Integer,
+            default = "512",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_sendsize)
+
+        attr_remote = Attribute("Remote",
+            "The address of the destination",
+            type = Types.String,
+            default = "00-00-00",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_remote)
+
+        attr_maxbytes = Attribute("MaxBytes",
+            "The total number of bytes to send. Once these bytes are sent, no data  is sent again. The value zero means that there is no limit.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxbytes)
+
+        attr_protocol = Attribute("Protocol",
+            "The type of protocol to use.",
+            type = Types.String,
+            default = "ns3::TcpSocketFactory",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_protocol)
+
+        attr_starttime = Attribute("StartTime",
+            "Time at which the application will start",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_starttime)
+
+        attr_stoptime = Attribute("StopTime",
+            "Time at which the application will stop",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stoptime)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        tx = Trace("Tx", "A new packet is created and is sent")
+
+        cls._register_trace(tx)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3BulkSendApplication, self).__init__(ec, guid)
+        self._home = "ns3-bulk-send-application-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/burst_error_model.py b/src/nepi/resources/ns3/classes/burst_error_model.py
new file mode 100644 (file)
index 0000000..bac2cb0
--- /dev/null
@@ -0,0 +1,80 @@
+#
+#    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 NS3BurstErrorModel(NS3BaseErrorModel):
+    _rtype = "ns3::BurstErrorModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_errorrate = Attribute("ErrorRate",
+            "The burst error event.",
+            type = Types.Double,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_errorrate)
+
+        attr_burststart = Attribute("BurstStart",
+            "The decision variable attached to this error model.",
+            type = Types.String,
+            default = "ns3::UniformRandomVariable[Min=0.0|Max=1.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_burststart)
+
+        attr_burstsize = Attribute("BurstSize",
+            "The number of packets being corrupted at one drop.",
+            type = Types.String,
+            default = "ns3::UniformRandomVariable[Min=1|Max=4]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_burstsize)
+
+        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(NS3BurstErrorModel, self).__init__(ec, guid)
+        self._home = "ns3-burst-error-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/cara_wifi_manager.py b/src/nepi/resources/ns3/classes/cara_wifi_manager.py
new file mode 100644 (file)
index 0000000..8f336f1
--- /dev/null
@@ -0,0 +1,167 @@
+#
+#    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.ns3wifiremotestationmanager import NS3BaseWifiRemoteStationManager 
+
+@clsinit_copy
+class NS3CaraWifiManager(NS3BaseWifiRemoteStationManager):
+    _rtype = "ns3::CaraWifiManager"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_probethreshold = Attribute("ProbeThreshold",
+            "The number of consecutive transmissions failure to activate the RTS probe.",
+            type = Types.Integer,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_probethreshold)
+
+        attr_failurethreshold = Attribute("FailureThreshold",
+            "The number of consecutive transmissions failure to decrease the rate.",
+            type = Types.Integer,
+            default = "2",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_failurethreshold)
+
+        attr_successthreshold = Attribute("SuccessThreshold",
+            "The minimum number of sucessfull transmissions to try a new rate.",
+            type = Types.Integer,
+            default = "10",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_successthreshold)
+
+        attr_timeout = Attribute("Timeout",
+            "The \'timer\' in the CARA algorithm",
+            type = Types.Integer,
+            default = "15",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_timeout)
+
+        attr_islowlatency = Attribute("IsLowLatency",
+            "If true, we attempt to modelize a so-called low-latency device: a device where decisions about tx parameters can be made on a per-packet basis and feedback about the transmission of each packet is obtained before sending the next. Otherwise, we modelize a  high-latency device, that is a device where we cannot update our decision about tx parameters after every packet transmission.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_islowlatency)
+
+        attr_maxssrc = Attribute("MaxSsrc",
+            "The maximum number of retransmission attempts for an RTS. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxssrc)
+
+        attr_maxslrc = Attribute("MaxSlrc",
+            "The maximum number of retransmission attempts for a DATA packet. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_fragmentationthreshold)
+
+        attr_nonunicastmode = Attribute("NonUnicastMode",
+            "Wifi mode used for non-unicast transmissions.",
+            type = Types.String,
+            default = "Invalid-WifiMode",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_nonunicastmode)
+
+        attr_defaulttxpowerlevel = Attribute("DefaultTxPowerLevel",
+            "Default power level to be used for transmissions. This is the power level that is used by all those WifiManagers that do notimplement TX power control.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_defaulttxpowerlevel)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactxrtsfailed = Trace("MacTxRtsFailed", "The transmission of a RTS by the MAC layer has failed")
+
+        cls._register_trace(mactxrtsfailed)
+
+        mactxdatafailed = Trace("MacTxDataFailed", "The transmission of a data packet by the MAC layer has failed")
+
+        cls._register_trace(mactxdatafailed)
+
+        mactxfinalrtsfailed = Trace("MacTxFinalRtsFailed", "The transmission of a RTS has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinalrtsfailed)
+
+        mactxfinaldatafailed = Trace("MacTxFinalDataFailed", "The transmission of a data packet has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinaldatafailed)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3CaraWifiManager, self).__init__(ec, guid)
+        self._home = "ns3-cara-wifi-manager-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/constant_acceleration_mobility_model.py b/src/nepi/resources/ns3/classes/constant_acceleration_mobility_model.py
new file mode 100644 (file)
index 0000000..662f9e7
--- /dev/null
@@ -0,0 +1,65 @@
+#
+#    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.ns3mobilitymodel import NS3BaseMobilityModel 
+
+@clsinit_copy
+class NS3ConstantAccelerationMobilityModel(NS3BaseMobilityModel):
+    _rtype = "ns3::ConstantAccelerationMobilityModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_position = Attribute("Position",
+            "The current position of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved)
+
+        cls._register_attribute(attr_position)
+
+        attr_velocity = Attribute("Velocity",
+            "The current velocity of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.NoWrite)
+
+        cls._register_attribute(attr_velocity)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        coursechange = Trace("CourseChange", "The value of the position and/or velocity vector changed")
+
+        cls._register_trace(coursechange)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3ConstantAccelerationMobilityModel, self).__init__(ec, guid)
+        self._home = "ns3-constant-acceleration-mobility-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/constant_position_mobility_model.py b/src/nepi/resources/ns3/classes/constant_position_mobility_model.py
new file mode 100644 (file)
index 0000000..03ec389
--- /dev/null
@@ -0,0 +1,65 @@
+#
+#    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.ns3mobilitymodel import NS3BaseMobilityModel 
+
+@clsinit_copy
+class NS3ConstantPositionMobilityModel(NS3BaseMobilityModel):
+    _rtype = "ns3::ConstantPositionMobilityModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_position = Attribute("Position",
+            "The current position of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved)
+
+        cls._register_attribute(attr_position)
+
+        attr_velocity = Attribute("Velocity",
+            "The current velocity of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.NoWrite)
+
+        cls._register_attribute(attr_velocity)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        coursechange = Trace("CourseChange", "The value of the position and/or velocity vector changed")
+
+        cls._register_trace(coursechange)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3ConstantPositionMobilityModel, self).__init__(ec, guid)
+        self._home = "ns3-constant-position-mobility-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/constant_rate_wifi_manager.py b/src/nepi/resources/ns3/classes/constant_rate_wifi_manager.py
new file mode 100644 (file)
index 0000000..decba32
--- /dev/null
@@ -0,0 +1,147 @@
+#
+#    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.ns3wifiremotestationmanager import NS3BaseWifiRemoteStationManager 
+
+@clsinit_copy
+class NS3ConstantRateWifiManager(NS3BaseWifiRemoteStationManager):
+    _rtype = "ns3::ConstantRateWifiManager"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_datamode = Attribute("DataMode",
+            "The transmission mode to use for every data packet transmission",
+            type = Types.String,
+            default = "OfdmRate6Mbps",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_datamode)
+
+        attr_controlmode = Attribute("ControlMode",
+            "The transmission mode to use for every control packet transmission.",
+            type = Types.String,
+            default = "OfdmRate6Mbps",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_controlmode)
+
+        attr_islowlatency = Attribute("IsLowLatency",
+            "If true, we attempt to modelize a so-called low-latency device: a device where decisions about tx parameters can be made on a per-packet basis and feedback about the transmission of each packet is obtained before sending the next. Otherwise, we modelize a  high-latency device, that is a device where we cannot update our decision about tx parameters after every packet transmission.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_islowlatency)
+
+        attr_maxssrc = Attribute("MaxSsrc",
+            "The maximum number of retransmission attempts for an RTS. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxssrc)
+
+        attr_maxslrc = Attribute("MaxSlrc",
+            "The maximum number of retransmission attempts for a DATA packet. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_fragmentationthreshold)
+
+        attr_nonunicastmode = Attribute("NonUnicastMode",
+            "Wifi mode used for non-unicast transmissions.",
+            type = Types.String,
+            default = "Invalid-WifiMode",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_nonunicastmode)
+
+        attr_defaulttxpowerlevel = Attribute("DefaultTxPowerLevel",
+            "Default power level to be used for transmissions. This is the power level that is used by all those WifiManagers that do notimplement TX power control.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_defaulttxpowerlevel)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactxrtsfailed = Trace("MacTxRtsFailed", "The transmission of a RTS by the MAC layer has failed")
+
+        cls._register_trace(mactxrtsfailed)
+
+        mactxdatafailed = Trace("MacTxDataFailed", "The transmission of a data packet by the MAC layer has failed")
+
+        cls._register_trace(mactxdatafailed)
+
+        mactxfinalrtsfailed = Trace("MacTxFinalRtsFailed", "The transmission of a RTS has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinalrtsfailed)
+
+        mactxfinaldatafailed = Trace("MacTxFinalDataFailed", "The transmission of a data packet has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinaldatafailed)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3ConstantRateWifiManager, self).__init__(ec, guid)
+        self._home = "ns3-constant-rate-wifi-manager-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/constant_speed_propagation_delay_model.py b/src/nepi/resources/ns3/classes/constant_speed_propagation_delay_model.py
new file mode 100644 (file)
index 0000000..9722bd4
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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.ns3propagationdelaymodel import NS3BasePropagationDelayModel 
+
+@clsinit_copy
+class NS3ConstantSpeedPropagationDelayModel(NS3BasePropagationDelayModel):
+    _rtype = "ns3::ConstantSpeedPropagationDelayModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_speed = Attribute("Speed",
+            "The speed (m/s)",
+            type = Types.Double,
+            default = "3e+08",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_speed)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3ConstantSpeedPropagationDelayModel, self).__init__(ec, guid)
+        self._home = "ns3-constant-speed-propagation-delay-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/constant_velocity_mobility_model.py b/src/nepi/resources/ns3/classes/constant_velocity_mobility_model.py
new file mode 100644 (file)
index 0000000..e0dfd0f
--- /dev/null
@@ -0,0 +1,65 @@
+#
+#    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.ns3mobilitymodel import NS3BaseMobilityModel 
+
+@clsinit_copy
+class NS3ConstantVelocityMobilityModel(NS3BaseMobilityModel):
+    _rtype = "ns3::ConstantVelocityMobilityModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_position = Attribute("Position",
+            "The current position of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved)
+
+        cls._register_attribute(attr_position)
+
+        attr_velocity = Attribute("Velocity",
+            "The current velocity of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.NoWrite)
+
+        cls._register_attribute(attr_velocity)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        coursechange = Trace("CourseChange", "The value of the position and/or velocity vector changed")
+
+        cls._register_trace(coursechange)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3ConstantVelocityMobilityModel, self).__init__(ec, guid)
+        self._home = "ns3-constant-velocity-mobility-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/cost231propagation_loss_model.py b/src/nepi/resources/ns3/classes/cost231propagation_loss_model.py
new file mode 100644 (file)
index 0000000..2bbbe3d
--- /dev/null
@@ -0,0 +1,90 @@
+#
+#    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 NS3Cost231PropagationLossModel(NS3BasePropagationLossModel):
+    _rtype = "ns3::Cost231PropagationLossModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_lambda = Attribute("Lambda",
+            "The wavelength  (default is 2.3 GHz at 300 000 km/s).",
+            type = Types.Double,
+            default = "0.130435",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_lambda)
+
+        attr_frequency = Attribute("Frequency",
+            "The Frequency  (default is 2.3 GHz).",
+            type = Types.Double,
+            default = "2.3e+09",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_frequency)
+
+        attr_bsantennaheight = Attribute("BSAntennaHeight",
+            " BS Antenna Height (default is 50m).",
+            type = Types.Double,
+            default = "50",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_bsantennaheight)
+
+        attr_ssantennaheight = Attribute("SSAntennaHeight",
+            " SS Antenna Height (default is 3m).",
+            type = Types.Double,
+            default = "3",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ssantennaheight)
+
+        attr_mindistance = Attribute("MinDistance",
+            "The distance under which the propagation model refuses to give results (m) ",
+            type = Types.Double,
+            default = "0.5",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mindistance)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3Cost231PropagationLossModel, self).__init__(ec, guid)
+        self._home = "ns3-cost231propagation-loss-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/csma_channel.py b/src/nepi/resources/ns3/classes/csma_channel.py
new file mode 100644 (file)
index 0000000..d839f32
--- /dev/null
@@ -0,0 +1,70 @@
+#
+#    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 NS3CsmaChannel(NS3BaseChannel):
+    _rtype = "ns3::CsmaChannel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_datarate = Attribute("DataRate",
+            "The transmission data rate to be provided to devices connected to the channel",
+            type = Types.String,
+            default = "4294967295bps",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_datarate)
+
+        attr_delay = Attribute("Delay",
+            "Transmission delay through the channel",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_delay)
+
+        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(NS3CsmaChannel, self).__init__(ec, guid)
+        self._home = "ns3-csma-channel-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/csma_net_device.py b/src/nepi/resources/ns3/classes/csma_net_device.py
new file mode 100644 (file)
index 0000000..b368b27
--- /dev/null
@@ -0,0 +1,129 @@
+#
+#    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 NS3CsmaNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::CsmaNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_address = Attribute("Address",
+            "The MAC address of this device.",
+            type = Types.String,
+            default = "ff:ff:ff:ff:ff:ff",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_address)
+
+        attr_mtu = Attribute("Mtu",
+            "The MAC-level Maximum Transmission Unit",
+            type = Types.Integer,
+            default = "1500",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mtu)
+
+        attr_sendenable = Attribute("SendEnable",
+            "Enable or disable the transmitter section of the device.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_sendenable)
+
+        attr_receiveenable = Attribute("ReceiveEnable",
+            "Enable or disable the receiver section of the device.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_receiveenable)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactx = Trace("MacTx", "Trace source indicating a packet has arrived for transmission by this device")
+
+        cls._register_trace(mactx)
+
+        mactxdrop = Trace("MacTxDrop", "Trace source indicating a packet has been dropped by the device before 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)
+
+        mactxbackoff = Trace("MacTxBackoff", "Trace source indicating a packet has been delayed by the CSMA backoff process")
+
+        cls._register_trace(mactxbackoff)
+
+        phytxbegin = Trace("PhyTxBegin", "Trace source indicating a packet has begun transmitting over the channel")
+
+        cls._register_trace(phytxbegin)
+
+        phytxend = Trace("PhyTxEnd", "Trace source indicating a packet has been completely transmitted over the channel")
+
+        cls._register_trace(phytxend)
+
+        phytxdrop = Trace("PhyTxDrop", "Trace source indicating a packet has been dropped by the device during transmission")
+
+        cls._register_trace(phytxdrop)
+
+        phyrxend = Trace("PhyRxEnd", "Trace source indicating a packet has been completely received by the device")
+
+        cls._register_trace(phyrxend)
+
+        phyrxdrop = Trace("PhyRxDrop", "Trace source indicating a packet has been dropped by the device during reception")
+
+        cls._register_trace(phyrxdrop)
+
+        sniffer = Trace("Sniffer", "Trace source simulating a non-promiscuous packet sniffer attached to the device")
+
+        cls._register_trace(sniffer)
+
+        promiscsniffer = Trace("PromiscSniffer", "Trace source simulating a promiscuous packet sniffer attached to the device")
+
+        cls._register_trace(promiscsniffer)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3CsmaNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-csma-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/drop_tail_queue.py b/src/nepi/resources/ns3/classes/drop_tail_queue.py
new file mode 100644 (file)
index 0000000..550d925
--- /dev/null
@@ -0,0 +1,73 @@
+#
+#    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.ns3queue import NS3BaseQueue 
+
+@clsinit_copy
+class NS3DropTailQueue(NS3BaseQueue):
+    _rtype = "ns3::DropTailQueue"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_maxpackets = Attribute("MaxPackets",
+            "The maximum number of packets accepted by this DropTailQueue.",
+            type = Types.Integer,
+            default = "100",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxpackets)
+
+        attr_maxbytes = Attribute("MaxBytes",
+            "The maximum number of bytes accepted by this DropTailQueue.",
+            type = Types.Integer,
+            default = "6553500",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxbytes)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        enqueue = Trace("Enqueue", "Enqueue a packet in the queue.")
+
+        cls._register_trace(enqueue)
+
+        dequeue = Trace("Dequeue", "Dequeue a packet from the queue.")
+
+        cls._register_trace(dequeue)
+
+        drop = Trace("Drop", "Drop a packet stored in the queue.")
+
+        cls._register_trace(drop)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3DropTailQueue, self).__init__(ec, guid)
+        self._home = "ns3-drop-tail-queue-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/emu_net_device.py b/src/nepi/resources/ns3/classes/emu_net_device.py
new file mode 100644 (file)
index 0000000..09a81c5
--- /dev/null
@@ -0,0 +1,125 @@
+#
+#    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 NS3EmuNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::EmuNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_mtu = Attribute("Mtu",
+            "The MAC-level Maximum Transmission Unit",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mtu)
+
+        attr_address = Attribute("Address",
+            "The ns-3 MAC address of this (virtual) device.",
+            type = Types.String,
+            default = "ff:ff:ff:ff:ff:ff",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_address)
+
+        attr_devicename = Attribute("DeviceName",
+            "The name of the underlying real device (e.g. eth1).",
+            type = Types.String,
+            default = "eth1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_devicename)
+
+        attr_start = Attribute("Start",
+            "The simulation time at which to spin up the device thread.",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_start)
+
+        attr_stop = Attribute("Stop",
+            "The simulation time at which to tear down the device thread.",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stop)
+
+        attr_rxqueuesize = Attribute("RxQueueSize",
+            "Maximum size of the read queue.  This value limits number of packets that have been read from the network into a memory buffer but have not yet been processed by the simulator.",
+            type = Types.Integer,
+            default = "1000",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_rxqueuesize)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactx = Trace("MacTx", "Trace source indicating a packet has arrived for transmission by this device")
+
+        cls._register_trace(mactx)
+
+        mactxdrop = Trace("MacTxDrop", "Trace source indicating a packet has been dropped by the device before 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)
+
+        sniffer = Trace("Sniffer", "Trace source simulating a non-promiscuous packet sniffer attached to the device")
+
+        cls._register_trace(sniffer)
+
+        promiscsniffer = Trace("PromiscSniffer", "Trace source simulating a promiscuous packet sniffer attached to the device")
+
+        cls._register_trace(promiscsniffer)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3EmuNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-emu-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/error_channel.py b/src/nepi/resources/ns3/classes/error_channel.py
new file mode 100644 (file)
index 0000000..1a9e2ad
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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 NS3ErrorChannel(NS3BaseChannel):
+    _rtype = "ns3::ErrorChannel"
+
+    @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(NS3ErrorChannel, self).__init__(ec, guid)
+        self._home = "ns3-error-channel-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/error_net_device.py b/src/nepi/resources/ns3/classes/error_net_device.py
new file mode 100644 (file)
index 0000000..7b59ba8
--- /dev/null
@@ -0,0 +1,44 @@
+#
+#    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 NS3ErrorNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::ErrorNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        pass
+
+    @classmethod
+    def _register_traces(cls):
+        
+        phyrxdrop = Trace("PhyRxDrop", "Trace source indicating a packet has been dropped by the device during reception")
+
+        cls._register_trace(phyrxdrop)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3ErrorNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-error-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/fd_net_device.py b/src/nepi/resources/ns3/classes/fd_net_device.py
new file mode 100644 (file)
index 0000000..62fc602
--- /dev/null
@@ -0,0 +1,115 @@
+#
+#    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 NS3FdNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::FdNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_address = Attribute("Address",
+            "The MAC address of this device.",
+            type = Types.String,
+            default = "ff:ff:ff:ff:ff:ff",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_address)
+
+        attr_start = Attribute("Start",
+            "The simulation time at which to spin up the device thread.",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_start)
+
+        attr_stop = Attribute("Stop",
+            "The simulation time at which to tear down the device thread.",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stop)
+
+        attr_encapsulationmode = Attribute("EncapsulationMode",
+            "The link-layer encapsulation type to use.",
+            type = Types.Enumerate,
+            default = "Dix",  
+            allowed = ["Dix","Llc","DixPi"],
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_encapsulationmode)
+
+        attr_rxqueuesize = Attribute("RxQueueSize",
+            "Maximum size of the read queue.  This value limits number of packets that have been read from the network into a memory buffer but have not yet been processed by the simulator.",
+            type = Types.Integer,
+            default = "1000",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_rxqueuesize)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactx = Trace("MacTx", "Trace source indicating a packet has arrived for transmission by this device")
+
+        cls._register_trace(mactx)
+
+        mactxdrop = Trace("MacTxDrop", "Trace source indicating a packet has been dropped by the device before 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)
+
+        sniffer = Trace("Sniffer", "Trace source simulating a non-promiscuous packet sniffer attached to the device")
+
+        cls._register_trace(sniffer)
+
+        promiscsniffer = Trace("PromiscSniffer", "Trace source simulating a promiscuous packet sniffer attached to the device")
+
+        cls._register_trace(promiscsniffer)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3FdNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-fd-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/fixed_rss_loss_model.py b/src/nepi/resources/ns3/classes/fixed_rss_loss_model.py
new file mode 100644 (file)
index 0000000..518b4c5
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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 NS3FixedRssLossModel(NS3BasePropagationLossModel):
+    _rtype = "ns3::FixedRssLossModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_rss = Attribute("Rss",
+            "The fixed receiver Rss.",
+            type = Types.Double,
+            default = "-150",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_rss)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3FixedRssLossModel, self).__init__(ec, guid)
+        self._home = "ns3-fixed-rss-loss-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/friis_propagation_loss_model.py b/src/nepi/resources/ns3/classes/friis_propagation_loss_model.py
new file mode 100644 (file)
index 0000000..54d2d4f
--- /dev/null
@@ -0,0 +1,70 @@
+#
+#    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 NS3FriisPropagationLossModel(NS3BasePropagationLossModel):
+    _rtype = "ns3::FriisPropagationLossModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_frequency = Attribute("Frequency",
+            "The carrier frequency (in Hz) at which propagation occurs  (default is 5.15 GHz).",
+            type = Types.Double,
+            default = "5.15e+09",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_frequency)
+
+        attr_systemloss = Attribute("SystemLoss",
+            "The system loss",
+            type = Types.Double,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_systemloss)
+
+        attr_mindistance = Attribute("MinDistance",
+            "The distance under which the propagation model refuses to give results (m)",
+            type = Types.Double,
+            default = "0.5",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mindistance)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3FriisPropagationLossModel, self).__init__(ec, guid)
+        self._home = "ns3-friis-propagation-loss-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/gauss_markov_mobility_model.py b/src/nepi/resources/ns3/classes/gauss_markov_mobility_model.py
new file mode 100644 (file)
index 0000000..1d380a7
--- /dev/null
@@ -0,0 +1,155 @@
+#
+#    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.ns3mobilitymodel import NS3BaseMobilityModel 
+
+@clsinit_copy
+class NS3GaussMarkovMobilityModel(NS3BaseMobilityModel):
+    _rtype = "ns3::GaussMarkovMobilityModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_bounds = Attribute("Bounds",
+            "Bounds of the area to cruise.",
+            type = Types.String,
+            default = "-100|100|-100|100|0|100",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_bounds)
+
+        attr_timestep = Attribute("TimeStep",
+            "Change current direction and speed after moving for this time.",
+            type = Types.String,
+            default = "+1000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_timestep)
+
+        attr_alpha = Attribute("Alpha",
+            "A constant representing the tunable parameter in the Gauss-Markov model.",
+            type = Types.Double,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_alpha)
+
+        attr_meanvelocity = Attribute("MeanVelocity",
+            "A random variable used to assign the average velocity.",
+            type = Types.String,
+            default = "ns3::UniformRandomVariable[Min=0.0|Max=1.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_meanvelocity)
+
+        attr_meandirection = Attribute("MeanDirection",
+            "A random variable used to assign the average direction.",
+            type = Types.String,
+            default = "ns3::UniformRandomVariable[Min=0.0|Max=6.283185307]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_meandirection)
+
+        attr_meanpitch = Attribute("MeanPitch",
+            "A random variable used to assign the average pitch.",
+            type = Types.String,
+            default = "ns3::ConstantRandomVariable[Constant=0.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_meanpitch)
+
+        attr_normalvelocity = Attribute("NormalVelocity",
+            "A gaussian random variable used to calculate the next velocity value.",
+            type = Types.String,
+            default = "ns3::NormalRandomVariable[Mean=0.0|Variance=1.0|Bound=10.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_normalvelocity)
+
+        attr_normaldirection = Attribute("NormalDirection",
+            "A gaussian random variable used to calculate the next direction value.",
+            type = Types.String,
+            default = "ns3::NormalRandomVariable[Mean=0.0|Variance=1.0|Bound=10.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_normaldirection)
+
+        attr_normalpitch = Attribute("NormalPitch",
+            "A gaussian random variable used to calculate the next pitch value.",
+            type = Types.String,
+            default = "ns3::NormalRandomVariable[Mean=0.0|Variance=1.0|Bound=10.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_normalpitch)
+
+        attr_position = Attribute("Position",
+            "The current position of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved)
+
+        cls._register_attribute(attr_position)
+
+        attr_velocity = Attribute("Velocity",
+            "The current velocity of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.NoWrite)
+
+        cls._register_attribute(attr_velocity)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        coursechange = Trace("CourseChange", "The value of the position and/or velocity vector changed")
+
+        cls._register_trace(coursechange)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3GaussMarkovMobilityModel, self).__init__(ec, guid)
+        self._home = "ns3-gauss-markov-mobility-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/hierarchical_mobility_model.py b/src/nepi/resources/ns3/classes/hierarchical_mobility_model.py
new file mode 100644 (file)
index 0000000..97ce062
--- /dev/null
@@ -0,0 +1,65 @@
+#
+#    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.ns3mobilitymodel import NS3BaseMobilityModel 
+
+@clsinit_copy
+class NS3HierarchicalMobilityModel(NS3BaseMobilityModel):
+    _rtype = "ns3::HierarchicalMobilityModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_position = Attribute("Position",
+            "The current position of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved)
+
+        cls._register_attribute(attr_position)
+
+        attr_velocity = Attribute("Velocity",
+            "The current velocity of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.NoWrite)
+
+        cls._register_attribute(attr_velocity)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        coursechange = Trace("CourseChange", "The value of the position and/or velocity vector changed")
+
+        cls._register_trace(coursechange)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3HierarchicalMobilityModel, self).__init__(ec, guid)
+        self._home = "ns3-hierarchical-mobility-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/hybrid_buildings_propagation_loss_model.py b/src/nepi/resources/ns3/classes/hybrid_buildings_propagation_loss_model.py
new file mode 100644 (file)
index 0000000..26c12a9
--- /dev/null
@@ -0,0 +1,90 @@
+#
+#    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 NS3HybridBuildingsPropagationLossModel(NS3BasePropagationLossModel):
+    _rtype = "ns3::HybridBuildingsPropagationLossModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_los2nlosthr = Attribute("Los2NlosThr",
+            " Threshold from LoS to NLoS in ITU 1411 [m].",
+            type = Types.Double,
+            default = "200",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_los2nlosthr)
+
+        attr_shadowsigmaoutdoor = Attribute("ShadowSigmaOutdoor",
+            "Standard deviation of the normal distribution used for calculate the shadowing for outdoor nodes",
+            type = Types.Double,
+            default = "7",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_shadowsigmaoutdoor)
+
+        attr_shadowsigmaindoor = Attribute("ShadowSigmaIndoor",
+            "Standard deviation of the normal distribution used for calculate the shadowing for indoor nodes ",
+            type = Types.Double,
+            default = "8",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_shadowsigmaindoor)
+
+        attr_shadowsigmaextwalls = Attribute("ShadowSigmaExtWalls",
+            "Standard deviation of the normal distribution used for calculate the shadowing due to ext walls ",
+            type = Types.Double,
+            default = "5",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_shadowsigmaextwalls)
+
+        attr_internalwallloss = Attribute("InternalWallLoss",
+            "Additional loss for each internal wall [dB]",
+            type = Types.Double,
+            default = "5",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_internalwallloss)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3HybridBuildingsPropagationLossModel, self).__init__(ec, guid)
+        self._home = "ns3-hybrid-buildings-propagation-loss-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/icmpv4l4protocol.py b/src/nepi/resources/ns3/classes/icmpv4l4protocol.py
new file mode 100644 (file)
index 0000000..202137f
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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.ns3icmpv4l4protocol import NS3BaseIcmpv4L4Protocol 
+
+@clsinit_copy
+class NS3Icmpv4L4Protocol(NS3BaseIcmpv4L4Protocol):
+    _rtype = "ns3::Icmpv4L4Protocol"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_protocolnumber = Attribute("ProtocolNumber",
+            "The Ip protocol number.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_protocolnumber)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3Icmpv4L4Protocol, self).__init__(ec, guid)
+        self._home = "ns3-icmpv4l4protocol-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/ideal_wifi_manager.py b/src/nepi/resources/ns3/classes/ideal_wifi_manager.py
new file mode 100644 (file)
index 0000000..e384184
--- /dev/null
@@ -0,0 +1,137 @@
+#
+#    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.ns3wifiremotestationmanager import NS3BaseWifiRemoteStationManager 
+
+@clsinit_copy
+class NS3IdealWifiManager(NS3BaseWifiRemoteStationManager):
+    _rtype = "ns3::IdealWifiManager"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_berthreshold = Attribute("BerThreshold",
+            "The maximum Bit Error Rate acceptable at any transmission mode",
+            type = Types.Double,
+            default = "1e-05",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_berthreshold)
+
+        attr_islowlatency = Attribute("IsLowLatency",
+            "If true, we attempt to modelize a so-called low-latency device: a device where decisions about tx parameters can be made on a per-packet basis and feedback about the transmission of each packet is obtained before sending the next. Otherwise, we modelize a  high-latency device, that is a device where we cannot update our decision about tx parameters after every packet transmission.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_islowlatency)
+
+        attr_maxssrc = Attribute("MaxSsrc",
+            "The maximum number of retransmission attempts for an RTS. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxssrc)
+
+        attr_maxslrc = Attribute("MaxSlrc",
+            "The maximum number of retransmission attempts for a DATA packet. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_fragmentationthreshold)
+
+        attr_nonunicastmode = Attribute("NonUnicastMode",
+            "Wifi mode used for non-unicast transmissions.",
+            type = Types.String,
+            default = "Invalid-WifiMode",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_nonunicastmode)
+
+        attr_defaulttxpowerlevel = Attribute("DefaultTxPowerLevel",
+            "Default power level to be used for transmissions. This is the power level that is used by all those WifiManagers that do notimplement TX power control.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_defaulttxpowerlevel)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactxrtsfailed = Trace("MacTxRtsFailed", "The transmission of a RTS by the MAC layer has failed")
+
+        cls._register_trace(mactxrtsfailed)
+
+        mactxdatafailed = Trace("MacTxDataFailed", "The transmission of a data packet by the MAC layer has failed")
+
+        cls._register_trace(mactxdatafailed)
+
+        mactxfinalrtsfailed = Trace("MacTxFinalRtsFailed", "The transmission of a RTS has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinalrtsfailed)
+
+        mactxfinaldatafailed = Trace("MacTxFinalDataFailed", "The transmission of a data packet has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinaldatafailed)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3IdealWifiManager, self).__init__(ec, guid)
+        self._home = "ns3-ideal-wifi-manager-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/ipv4l3protocol.py b/src/nepi/resources/ns3/classes/ipv4l3protocol.py
new file mode 100644 (file)
index 0000000..8c7228d
--- /dev/null
@@ -0,0 +1,115 @@
+#
+#    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.ns3ipv4l3protocol import NS3BaseIpv4L3Protocol 
+
+@clsinit_copy
+class NS3Ipv4L3Protocol(NS3BaseIpv4L3Protocol):
+    _rtype = "ns3::Ipv4L3Protocol"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_defaulttos = Attribute("DefaultTos",
+            "The TOS value set by default on all outgoing packets generated on this node.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_defaulttos)
+
+        attr_defaultttl = Attribute("DefaultTtl",
+            "The TTL value set by default on all outgoing packets generated on this node.",
+            type = Types.Integer,
+            default = "64",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_defaultttl)
+
+        attr_fragmentexpirationtimeout = Attribute("FragmentExpirationTimeout",
+            "When this timeout expires, the fragments will be cleared from the buffer.",
+            type = Types.String,
+            default = "+30000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_fragmentexpirationtimeout)
+
+        attr_ipforward = Attribute("IpForward",
+            "Globally enable or disable IP forwarding for all current and future Ipv4 devices.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ipforward)
+
+        attr_weakesmodel = Attribute("WeakEsModel",
+            "RFC1122 term for whether host accepts datagram with a dest. address on another interface",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_weakesmodel)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        tx = Trace("Tx", "Send ipv4 packet to outgoing interface.")
+
+        cls._register_trace(tx)
+
+        rx = Trace("Rx", "Receive ipv4 packet from incoming interface.")
+
+        cls._register_trace(rx)
+
+        drop = Trace("Drop", "Drop ipv4 packet")
+
+        cls._register_trace(drop)
+
+        sendoutgoing = Trace("SendOutgoing", "A newly-generated packet by this node is about to be queued for transmission")
+
+        cls._register_trace(sendoutgoing)
+
+        unicastforward = Trace("UnicastForward", "A unicast IPv4 packet was received by this node and is being forwarded to another node")
+
+        cls._register_trace(unicastforward)
+
+        localdeliver = Trace("LocalDeliver", "An IPv4 packet was received by/for this node, and it is being forward up the stack")
+
+        cls._register_trace(localdeliver)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3Ipv4L3Protocol, self).__init__(ec, guid)
+        self._home = "ns3-ipv4l3protocol-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/jakes_propagation_loss_model.py b/src/nepi/resources/ns3/classes/jakes_propagation_loss_model.py
new file mode 100644 (file)
index 0000000..af4729c
--- /dev/null
@@ -0,0 +1,39 @@
+#
+#    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 NS3JakesPropagationLossModel(NS3BasePropagationLossModel):
+    _rtype = "ns3::JakesPropagationLossModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        pass
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3JakesPropagationLossModel, self).__init__(ec, guid)
+        self._home = "ns3-jakes-propagation-loss-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/list_error_model.py b/src/nepi/resources/ns3/classes/list_error_model.py
new file mode 100644 (file)
index 0000000..a607117
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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 NS3ListErrorModel(NS3BaseErrorModel):
+    _rtype = "ns3::ListErrorModel"
+
+    @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(NS3ListErrorModel, self).__init__(ec, guid)
+        self._home = "ns3-list-error-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/log_distance_propagation_loss_model.py b/src/nepi/resources/ns3/classes/log_distance_propagation_loss_model.py
new file mode 100644 (file)
index 0000000..5f3c5fd
--- /dev/null
@@ -0,0 +1,70 @@
+#
+#    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 NS3LogDistancePropagationLossModel(NS3BasePropagationLossModel):
+    _rtype = "ns3::LogDistancePropagationLossModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_exponent = Attribute("Exponent",
+            "The exponent of the Path Loss propagation model",
+            type = Types.Double,
+            default = "3",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_exponent)
+
+        attr_referencedistance = Attribute("ReferenceDistance",
+            "The distance at which the reference loss is calculated (m)",
+            type = Types.Double,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_referencedistance)
+
+        attr_referenceloss = Attribute("ReferenceLoss",
+            "The reference loss at reference distance (dB). (Default is Friis at 1m with 5.15 GHz)",
+            type = Types.Double,
+            default = "46.6777",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_referenceloss)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3LogDistancePropagationLossModel, self).__init__(ec, guid)
+        self._home = "ns3-log-distance-propagation-loss-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/loopback_net_device.py b/src/nepi/resources/ns3/classes/loopback_net_device.py
new file mode 100644 (file)
index 0000000..a9e6162
--- /dev/null
@@ -0,0 +1,39 @@
+#
+#    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 NS3LoopbackNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::LoopbackNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        pass
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3LoopbackNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-loopback-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/lte_enb_net_device.py b/src/nepi/resources/ns3/classes/lte_enb_net_device.py
new file mode 100644 (file)
index 0000000..f1ac832
--- /dev/null
@@ -0,0 +1,100 @@
+#
+#    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 NS3LteEnbNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::LteEnbNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_ulbandwidth = Attribute("UlBandwidth",
+            "Uplink Transmission Bandwidth Configuration in number of Resource Blocks",
+            type = Types.Integer,
+            default = "25",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ulbandwidth)
+
+        attr_dlbandwidth = Attribute("DlBandwidth",
+            "Downlink Transmission Bandwidth Configuration in number of Resource Blocks",
+            type = Types.Integer,
+            default = "25",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_dlbandwidth)
+
+        attr_cellid = Attribute("CellId",
+            "Cell Identifier",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_cellid)
+
+        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_ulearfcn = Attribute("UlEarfcn",
+            "Uplink E-UTRA Absolute Radio Frequency Channel Number (EARFCN) as per 3GPP 36.101 Section 5.7.3. ",
+            type = Types.Integer,
+            default = "18100",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ulearfcn)
+
+        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(NS3LteEnbNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-lte-enb-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/lte_simple_net_device.py b/src/nepi/resources/ns3/classes/lte_simple_net_device.py
new file mode 100644 (file)
index 0000000..b38a7e9
--- /dev/null
@@ -0,0 +1,44 @@
+#
+#    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 NS3LteSimpleNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::LteSimpleNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        pass
+
+    @classmethod
+    def _register_traces(cls):
+        
+        phyrxdrop = Trace("PhyRxDrop", "Trace source indicating a packet has been dropped by the device during reception")
+
+        cls._register_trace(phyrxdrop)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3LteSimpleNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-lte-simple-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/matrix_propagation_loss_model.py b/src/nepi/resources/ns3/classes/matrix_propagation_loss_model.py
new file mode 100644 (file)
index 0000000..4d14e14
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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 NS3MatrixPropagationLossModel(NS3BasePropagationLossModel):
+    _rtype = "ns3::MatrixPropagationLossModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_defaultloss = Attribute("DefaultLoss",
+            "The default value for propagation loss, dB.",
+            type = Types.Double,
+            default = "1.79769e+308",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_defaultloss)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3MatrixPropagationLossModel, self).__init__(ec, guid)
+        self._home = "ns3-matrix-propagation-loss-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/mesh_point_device.py b/src/nepi/resources/ns3/classes/mesh_point_device.py
new file mode 100644 (file)
index 0000000..945952a
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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 NS3MeshPointDevice(NS3BaseNetDevice):
+    _rtype = "ns3::MeshPointDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_mtu = Attribute("Mtu",
+            "The MAC-level Maximum Transmission Unit",
+            type = Types.Integer,
+            default = "65535",  
+            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(NS3MeshPointDevice, self).__init__(ec, guid)
+        self._home = "ns3-mesh-point-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/mesh_wifi_interface_mac.py b/src/nepi/resources/ns3/classes/mesh_wifi_interface_mac.py
new file mode 100644 (file)
index 0000000..b736081
--- /dev/null
@@ -0,0 +1,239 @@
+#
+#    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 NS3MeshWifiInterfaceMac(NS3BaseWifiMac):
+    _rtype = "ns3::MeshWifiInterfaceMac"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_beaconinterval = Attribute("BeaconInterval",
+            "Beacon Interval",
+            type = Types.String,
+            default = "+500000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_beaconinterval)
+
+        attr_randomstart = Attribute("RandomStart",
+            "Window when beacon generating starts (uniform random) in seconds",
+            type = Types.String,
+            default = "+500000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_randomstart)
+
+        attr_beacongeneration = Attribute("BeaconGeneration",
+            "Enable/Disable Beaconing.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_beacongeneration)
+
+        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(NS3MeshWifiInterfaceMac, self).__init__(ec, guid)
+        self._home = "ns3-mesh-wifi-interface-mac-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/minstrel_wifi_manager.py b/src/nepi/resources/ns3/classes/minstrel_wifi_manager.py
new file mode 100644 (file)
index 0000000..3818645
--- /dev/null
@@ -0,0 +1,177 @@
+#
+#    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.ns3wifiremotestationmanager import NS3BaseWifiRemoteStationManager 
+
+@clsinit_copy
+class NS3MinstrelWifiManager(NS3BaseWifiRemoteStationManager):
+    _rtype = "ns3::MinstrelWifiManager"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_updatestatistics = Attribute("UpdateStatistics",
+            "The interval between updating statistics table ",
+            type = Types.String,
+            default = "+100000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_updatestatistics)
+
+        attr_lookaroundrate = Attribute("LookAroundRate",
+            "the percentage to try other rates",
+            type = Types.Double,
+            default = "10",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_lookaroundrate)
+
+        attr_ewma = Attribute("EWMA",
+            "EWMA level",
+            type = Types.Double,
+            default = "75",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ewma)
+
+        attr_samplecolumn = Attribute("SampleColumn",
+            "The number of columns used for sampling",
+            type = Types.Double,
+            default = "10",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_samplecolumn)
+
+        attr_packetlength = Attribute("PacketLength",
+            "The packet length used for calculating mode TxTime",
+            type = Types.Double,
+            default = "1200",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_packetlength)
+
+        attr_islowlatency = Attribute("IsLowLatency",
+            "If true, we attempt to modelize a so-called low-latency device: a device where decisions about tx parameters can be made on a per-packet basis and feedback about the transmission of each packet is obtained before sending the next. Otherwise, we modelize a  high-latency device, that is a device where we cannot update our decision about tx parameters after every packet transmission.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_islowlatency)
+
+        attr_maxssrc = Attribute("MaxSsrc",
+            "The maximum number of retransmission attempts for an RTS. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxssrc)
+
+        attr_maxslrc = Attribute("MaxSlrc",
+            "The maximum number of retransmission attempts for a DATA packet. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_fragmentationthreshold)
+
+        attr_nonunicastmode = Attribute("NonUnicastMode",
+            "Wifi mode used for non-unicast transmissions.",
+            type = Types.String,
+            default = "Invalid-WifiMode",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_nonunicastmode)
+
+        attr_defaulttxpowerlevel = Attribute("DefaultTxPowerLevel",
+            "Default power level to be used for transmissions. This is the power level that is used by all those WifiManagers that do notimplement TX power control.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_defaulttxpowerlevel)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactxrtsfailed = Trace("MacTxRtsFailed", "The transmission of a RTS by the MAC layer has failed")
+
+        cls._register_trace(mactxrtsfailed)
+
+        mactxdatafailed = Trace("MacTxDataFailed", "The transmission of a data packet by the MAC layer has failed")
+
+        cls._register_trace(mactxdatafailed)
+
+        mactxfinalrtsfailed = Trace("MacTxFinalRtsFailed", "The transmission of a RTS has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinalrtsfailed)
+
+        mactxfinaldatafailed = Trace("MacTxFinalDataFailed", "The transmission of a data packet has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinaldatafailed)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3MinstrelWifiManager, self).__init__(ec, guid)
+        self._home = "ns3-minstrel-wifi-manager-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/multi_model_spectrum_channel.py b/src/nepi/resources/ns3/classes/multi_model_spectrum_channel.py
new file mode 100644 (file)
index 0000000..c8d6e64
--- /dev/null
@@ -0,0 +1,65 @@
+#
+#    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 NS3MultiModelSpectrumChannel(NS3BaseChannel):
+    _rtype = "ns3::MultiModelSpectrumChannel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_maxlossdb = Attribute("MaxLossDb",
+            "If a single-frequency PropagationLossModel is used, this value represents the maximum loss in dB for which transmissions will be passed to the receiving PHY. Signals for which the PropagationLossModel returns a loss bigger than this value will not be propagated to the receiver. This parameter is to be used to reduce the computational load by not propagating signals that are far beyond the interference range. Note that the default value corresponds to considering all signals for reception. Tune this value with care. ",
+            type = Types.Double,
+            default = "1e+09",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxlossdb)
+
+        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):
+        
+        pathloss = Trace("PathLoss", "This trace is fired whenever a new path loss value is calculated. The first and second parameters to the trace are pointers respectively to the TX and RX SpectrumPhy instances, whereas the third parameters is the loss value in dB. Note that the loss value reported by this trace is the single-frequency loss value obtained by evaluating only the TX and RX AntennaModels and the PropagationLossModel. In particular, note that SpectrumPropagationLossModel (even if present) is never used to evaluate the loss value reported in this trace. ")
+
+        cls._register_trace(pathloss)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3MultiModelSpectrumChannel, self).__init__(ec, guid)
+        self._home = "ns3-multi-model-spectrum-channel-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/nakagami_propagation_loss_model.py b/src/nepi/resources/ns3/classes/nakagami_propagation_loss_model.py
new file mode 100644 (file)
index 0000000..371a895
--- /dev/null
@@ -0,0 +1,110 @@
+#
+#    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 NS3NakagamiPropagationLossModel(NS3BasePropagationLossModel):
+    _rtype = "ns3::NakagamiPropagationLossModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_distance1 = Attribute("Distance1",
+            "Beginning of the second distance field. Default is 80m.",
+            type = Types.Double,
+            default = "80",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_distance1)
+
+        attr_distance2 = Attribute("Distance2",
+            "Beginning of the third distance field. Default is 200m.",
+            type = Types.Double,
+            default = "200",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_distance2)
+
+        attr_m0 = Attribute("m0",
+            "m0 for distances smaller than Distance1. Default is 1.5.",
+            type = Types.Double,
+            default = "1.5",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_m0)
+
+        attr_m1 = Attribute("m1",
+            "m1 for distances smaller than Distance2. Default is 0.75.",
+            type = Types.Double,
+            default = "0.75",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_m1)
+
+        attr_m2 = Attribute("m2",
+            "m2 for distances greater than Distance2. Default is 0.75.",
+            type = Types.Double,
+            default = "0.75",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_m2)
+
+        attr_erlangrv = Attribute("ErlangRv",
+            "Access to the underlying ErlangRandomVariable",
+            type = Types.String,
+            default = "ns3::ErlangRandomVariable",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_erlangrv)
+
+        attr_gammarv = Attribute("GammaRv",
+            "Access to the underlying GammaRandomVariable",
+            type = Types.String,
+            default = "ns3::GammaRandomVariable",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_gammarv)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3NakagamiPropagationLossModel, self).__init__(ec, guid)
+        self._home = "ns3-nakagami-propagation-loss-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/nist_error_rate_model.py b/src/nepi/resources/ns3/classes/nist_error_rate_model.py
new file mode 100644 (file)
index 0000000..5a433b4
--- /dev/null
@@ -0,0 +1,39 @@
+#
+#    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.ns3errorratemodel import NS3BaseErrorRateModel 
+
+@clsinit_copy
+class NS3NistErrorRateModel(NS3BaseErrorRateModel):
+    _rtype = "ns3::NistErrorRateModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        pass
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3NistErrorRateModel, self).__init__(ec, guid)
+        self._home = "ns3-nist-error-rate-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/node.py b/src/nepi/resources/ns3/classes/node.py
new file mode 100644 (file)
index 0000000..f758192
--- /dev/null
@@ -0,0 +1,60 @@
+#
+#    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.ns3node import NS3BaseNode 
+
+@clsinit_copy
+class NS3Node(NS3BaseNode):
+    _rtype = "ns3::Node"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_id = Attribute("Id",
+            "The id (unique integer) of this Node.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.NoWrite)
+
+        cls._register_attribute(attr_id)
+
+        attr_systemid = Attribute("SystemId",
+            "The systemId of this node: a unique integer used for parallel simulations.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved)
+
+        cls._register_attribute(attr_systemid)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3Node, self).__init__(ec, guid)
+        self._home = "ns3-node-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/non_communicating_net_device.py b/src/nepi/resources/ns3/classes/non_communicating_net_device.py
new file mode 100644 (file)
index 0000000..4fb08e7
--- /dev/null
@@ -0,0 +1,39 @@
+#
+#    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 NS3NonCommunicatingNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::NonCommunicatingNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        pass
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3NonCommunicatingNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-non-communicating-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/oh_buildings_propagation_loss_model.py b/src/nepi/resources/ns3/classes/oh_buildings_propagation_loss_model.py
new file mode 100644 (file)
index 0000000..530d9ae
--- /dev/null
@@ -0,0 +1,80 @@
+#
+#    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 NS3OhBuildingsPropagationLossModel(NS3BasePropagationLossModel):
+    _rtype = "ns3::OhBuildingsPropagationLossModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_shadowsigmaoutdoor = Attribute("ShadowSigmaOutdoor",
+            "Standard deviation of the normal distribution used for calculate the shadowing for outdoor nodes",
+            type = Types.Double,
+            default = "7",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_shadowsigmaoutdoor)
+
+        attr_shadowsigmaindoor = Attribute("ShadowSigmaIndoor",
+            "Standard deviation of the normal distribution used for calculate the shadowing for indoor nodes ",
+            type = Types.Double,
+            default = "8",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_shadowsigmaindoor)
+
+        attr_shadowsigmaextwalls = Attribute("ShadowSigmaExtWalls",
+            "Standard deviation of the normal distribution used for calculate the shadowing due to ext walls ",
+            type = Types.Double,
+            default = "5",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_shadowsigmaextwalls)
+
+        attr_internalwallloss = Attribute("InternalWallLoss",
+            "Additional loss for each internal wall [dB]",
+            type = Types.Double,
+            default = "5",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_internalwallloss)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3OhBuildingsPropagationLossModel, self).__init__(ec, guid)
+        self._home = "ns3-oh-buildings-propagation-loss-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/on_off_application.py b/src/nepi/resources/ns3/classes/on_off_application.py
new file mode 100644 (file)
index 0000000..ffae8e9
--- /dev/null
@@ -0,0 +1,135 @@
+#
+#    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.ns3application import NS3BaseApplication 
+
+@clsinit_copy
+class NS3OnOffApplication(NS3BaseApplication):
+    _rtype = "ns3::OnOffApplication"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_datarate = Attribute("DataRate",
+            "The data rate in on state.",
+            type = Types.String,
+            default = "500000bps",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_datarate)
+
+        attr_packetsize = Attribute("PacketSize",
+            "The size of packets sent in on state",
+            type = Types.Integer,
+            default = "512",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_packetsize)
+
+        attr_remote = Attribute("Remote",
+            "The address of the destination",
+            type = Types.String,
+            default = "00-00-00",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_remote)
+
+        attr_ontime = Attribute("OnTime",
+            "A RandomVariableStream used to pick the duration of the \'On\' state.",
+            type = Types.String,
+            default = "ns3::ConstantRandomVariable[Constant=1.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ontime)
+
+        attr_offtime = Attribute("OffTime",
+            "A RandomVariableStream used to pick the duration of the \'Off\' state.",
+            type = Types.String,
+            default = "ns3::ConstantRandomVariable[Constant=1.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_offtime)
+
+        attr_maxbytes = Attribute("MaxBytes",
+            "The total number of bytes to send. Once these bytes are sent, no packet is sent again, even in on state. The value zero means that there is no limit.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxbytes)
+
+        attr_protocol = Attribute("Protocol",
+            "The type of protocol to use.",
+            type = Types.String,
+            default = "ns3::UdpSocketFactory",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_protocol)
+
+        attr_starttime = Attribute("StartTime",
+            "Time at which the application will start",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_starttime)
+
+        attr_stoptime = Attribute("StopTime",
+            "Time at which the application will stop",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stoptime)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        tx = Trace("Tx", "A new packet is created and is sent")
+
+        cls._register_trace(tx)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3OnOffApplication, self).__init__(ec, guid)
+        self._home = "ns3-on-off-application-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/onoe_wifi_manager.py b/src/nepi/resources/ns3/classes/onoe_wifi_manager.py
new file mode 100644 (file)
index 0000000..606b3e8
--- /dev/null
@@ -0,0 +1,157 @@
+#
+#    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.ns3wifiremotestationmanager import NS3BaseWifiRemoteStationManager 
+
+@clsinit_copy
+class NS3OnoeWifiManager(NS3BaseWifiRemoteStationManager):
+    _rtype = "ns3::OnoeWifiManager"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_updateperiod = Attribute("UpdatePeriod",
+            "The interval between decisions about rate control changes",
+            type = Types.String,
+            default = "+1000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_updateperiod)
+
+        attr_raisethreshold = Attribute("RaiseThreshold",
+            "Attempt to raise the rate if we hit that threshold",
+            type = Types.Integer,
+            default = "10",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_raisethreshold)
+
+        attr_addcreditthreshold = Attribute("AddCreditThreshold",
+            "Add credit threshold",
+            type = Types.Integer,
+            default = "10",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_addcreditthreshold)
+
+        attr_islowlatency = Attribute("IsLowLatency",
+            "If true, we attempt to modelize a so-called low-latency device: a device where decisions about tx parameters can be made on a per-packet basis and feedback about the transmission of each packet is obtained before sending the next. Otherwise, we modelize a  high-latency device, that is a device where we cannot update our decision about tx parameters after every packet transmission.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_islowlatency)
+
+        attr_maxssrc = Attribute("MaxSsrc",
+            "The maximum number of retransmission attempts for an RTS. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxssrc)
+
+        attr_maxslrc = Attribute("MaxSlrc",
+            "The maximum number of retransmission attempts for a DATA packet. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_fragmentationthreshold)
+
+        attr_nonunicastmode = Attribute("NonUnicastMode",
+            "Wifi mode used for non-unicast transmissions.",
+            type = Types.String,
+            default = "Invalid-WifiMode",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_nonunicastmode)
+
+        attr_defaulttxpowerlevel = Attribute("DefaultTxPowerLevel",
+            "Default power level to be used for transmissions. This is the power level that is used by all those WifiManagers that do notimplement TX power control.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_defaulttxpowerlevel)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactxrtsfailed = Trace("MacTxRtsFailed", "The transmission of a RTS by the MAC layer has failed")
+
+        cls._register_trace(mactxrtsfailed)
+
+        mactxdatafailed = Trace("MacTxDataFailed", "The transmission of a data packet by the MAC layer has failed")
+
+        cls._register_trace(mactxdatafailed)
+
+        mactxfinalrtsfailed = Trace("MacTxFinalRtsFailed", "The transmission of a RTS has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinalrtsfailed)
+
+        mactxfinaldatafailed = Trace("MacTxFinalDataFailed", "The transmission of a data packet has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinaldatafailed)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3OnoeWifiManager, self).__init__(ec, guid)
+        self._home = "ns3-onoe-wifi-manager-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/packet_sink.py b/src/nepi/resources/ns3/classes/packet_sink.py
new file mode 100644 (file)
index 0000000..701c8d0
--- /dev/null
@@ -0,0 +1,85 @@
+#
+#    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.ns3application import NS3BaseApplication 
+
+@clsinit_copy
+class NS3PacketSink(NS3BaseApplication):
+    _rtype = "ns3::PacketSink"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_local = Attribute("Local",
+            "The Address on which to Bind the rx socket.",
+            type = Types.String,
+            default = "00-00-00",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_local)
+
+        attr_protocol = Attribute("Protocol",
+            "The type id of the protocol to use for the rx socket.",
+            type = Types.String,
+            default = "ns3::UdpSocketFactory",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_protocol)
+
+        attr_starttime = Attribute("StartTime",
+            "Time at which the application will start",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_starttime)
+
+        attr_stoptime = Attribute("StopTime",
+            "Time at which the application will stop",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stoptime)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        rx = Trace("Rx", "A packet has been received")
+
+        cls._register_trace(rx)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3PacketSink, self).__init__(ec, guid)
+        self._home = "ns3-packet-sink-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/ping6.py b/src/nepi/resources/ns3/classes/ping6.py
new file mode 100644 (file)
index 0000000..7986532
--- /dev/null
@@ -0,0 +1,110 @@
+#
+#    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.ns3application import NS3BaseApplication 
+
+@clsinit_copy
+class NS3Ping6(NS3BaseApplication):
+    _rtype = "ns3::Ping6"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_maxpackets = Attribute("MaxPackets",
+            "The maximum number of packets the application will send",
+            type = Types.Integer,
+            default = "100",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxpackets)
+
+        attr_interval = Attribute("Interval",
+            "The time to wait between packets",
+            type = Types.String,
+            default = "+1000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_interval)
+
+        attr_remoteipv6 = Attribute("RemoteIpv6",
+            "The Ipv6Address of the outbound packets",
+            type = Types.String,
+            default = "0000:0000:0000:0000:0000:0000:0000:0000",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_remoteipv6)
+
+        attr_localipv6 = Attribute("LocalIpv6",
+            "Local Ipv6Address of the sender",
+            type = Types.String,
+            default = "0000:0000:0000:0000:0000:0000:0000:0000",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_localipv6)
+
+        attr_packetsize = Attribute("PacketSize",
+            "Size of packets generated",
+            type = Types.Integer,
+            default = "100",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_packetsize)
+
+        attr_starttime = Attribute("StartTime",
+            "Time at which the application will start",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_starttime)
+
+        attr_stoptime = Attribute("StopTime",
+            "Time at which the application will stop",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stoptime)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3Ping6, self).__init__(ec, guid)
+        self._home = "ns3-ping6-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/point_to_point_channel.py b/src/nepi/resources/ns3/classes/point_to_point_channel.py
new file mode 100644 (file)
index 0000000..e943fc7
--- /dev/null
@@ -0,0 +1,65 @@
+#
+#    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 NS3PointToPointChannel(NS3BaseChannel):
+    _rtype = "ns3::PointToPointChannel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_delay = Attribute("Delay",
+            "Transmission delay through the channel",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_delay)
+
+        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):
+        
+        txrxpointtopoint = Trace("TxRxPointToPoint", "Trace source indicating transmission of packet from the PointToPointChannel, used by the Animation interface.")
+
+        cls._register_trace(txrxpointtopoint)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3PointToPointChannel, self).__init__(ec, guid)
+        self._home = "ns3-point-to-point-channel-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/point_to_point_net_device.py b/src/nepi/resources/ns3/classes/point_to_point_net_device.py
new file mode 100644 (file)
index 0000000..699a785
--- /dev/null
@@ -0,0 +1,125 @@
+#
+#    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 NS3PointToPointNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::PointToPointNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_mtu = Attribute("Mtu",
+            "The MAC-level Maximum Transmission Unit",
+            type = Types.Integer,
+            default = "1500",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mtu)
+
+        attr_address = Attribute("Address",
+            "The MAC address of this device.",
+            type = Types.String,
+            default = "ff:ff:ff:ff:ff:ff",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_address)
+
+        attr_datarate = Attribute("DataRate",
+            "The default data rate for point to point links",
+            type = Types.String,
+            default = "32768bps",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_datarate)
+
+        attr_interframegap = Attribute("InterframeGap",
+            "The time to wait between packet (frame) transmissions",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_interframegap)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactx = Trace("MacTx", "Trace source indicating a packet has arrived for transmission by this device")
+
+        cls._register_trace(mactx)
+
+        mactxdrop = Trace("MacTxDrop", "Trace source indicating a packet has been dropped by the device before 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)
+
+        phytxbegin = Trace("PhyTxBegin", "Trace source indicating a packet has begun transmitting over the channel")
+
+        cls._register_trace(phytxbegin)
+
+        phytxend = Trace("PhyTxEnd", "Trace source indicating a packet has been completely transmitted over the channel")
+
+        cls._register_trace(phytxend)
+
+        phytxdrop = Trace("PhyTxDrop", "Trace source indicating a packet has been dropped by the device during transmission")
+
+        cls._register_trace(phytxdrop)
+
+        phyrxend = Trace("PhyRxEnd", "Trace source indicating a packet has been completely received by the device")
+
+        cls._register_trace(phyrxend)
+
+        phyrxdrop = Trace("PhyRxDrop", "Trace source indicating a packet has been dropped by the device during reception")
+
+        cls._register_trace(phyrxdrop)
+
+        sniffer = Trace("Sniffer", "Trace source simulating a non-promiscuous packet sniffer attached to the device")
+
+        cls._register_trace(sniffer)
+
+        promiscsniffer = Trace("PromiscSniffer", "Trace source simulating a promiscuous packet sniffer attached to the device")
+
+        cls._register_trace(promiscsniffer)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3PointToPointNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-point-to-point-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/point_to_point_remote_channel.py b/src/nepi/resources/ns3/classes/point_to_point_remote_channel.py
new file mode 100644 (file)
index 0000000..2c3ccf1
--- /dev/null
@@ -0,0 +1,65 @@
+#
+#    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 NS3PointToPointRemoteChannel(NS3BaseChannel):
+    _rtype = "ns3::PointToPointRemoteChannel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_delay = Attribute("Delay",
+            "Transmission delay through the channel",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_delay)
+
+        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):
+        
+        txrxpointtopoint = Trace("TxRxPointToPoint", "Trace source indicating transmission of packet from the PointToPointChannel, used by the Animation interface.")
+
+        cls._register_trace(txrxpointtopoint)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3PointToPointRemoteChannel, self).__init__(ec, guid)
+        self._home = "ns3-point-to-point-remote-channel-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/radvd.py b/src/nepi/resources/ns3/classes/radvd.py
new file mode 100644 (file)
index 0000000..d9ac187
--- /dev/null
@@ -0,0 +1,70 @@
+#
+#    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.ns3application import NS3BaseApplication 
+
+@clsinit_copy
+class NS3Radvd(NS3BaseApplication):
+    _rtype = "ns3::Radvd"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_advertisementjitter = Attribute("AdvertisementJitter",
+            "Uniform variable to provide jitter between min and max values of AdvInterval",
+            type = Types.String,
+            default = "ns3::UniformRandomVariable",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_advertisementjitter)
+
+        attr_starttime = Attribute("StartTime",
+            "Time at which the application will start",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_starttime)
+
+        attr_stoptime = Attribute("StopTime",
+            "Time at which the application will stop",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stoptime)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3Radvd, self).__init__(ec, guid)
+        self._home = "ns3-radvd-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/random_direction2d_mobility_model.py b/src/nepi/resources/ns3/classes/random_direction2d_mobility_model.py
new file mode 100644 (file)
index 0000000..6d2e75d
--- /dev/null
@@ -0,0 +1,95 @@
+#
+#    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.ns3mobilitymodel import NS3BaseMobilityModel 
+
+@clsinit_copy
+class NS3RandomDirection2dMobilityModel(NS3BaseMobilityModel):
+    _rtype = "ns3::RandomDirection2dMobilityModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_bounds = Attribute("Bounds",
+            "The 2d bounding area",
+            type = Types.String,
+            default = "-100|100|-100|100",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_bounds)
+
+        attr_speed = Attribute("Speed",
+            "A random variable to control the speed (m/s).",
+            type = Types.String,
+            default = "ns3::UniformRandomVariable[Min=1.0|Max=2.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_speed)
+
+        attr_pause = Attribute("Pause",
+            "A random variable to control the pause (s).",
+            type = Types.String,
+            default = "ns3::ConstantRandomVariable[Constant=2.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_pause)
+
+        attr_position = Attribute("Position",
+            "The current position of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved)
+
+        cls._register_attribute(attr_position)
+
+        attr_velocity = Attribute("Velocity",
+            "The current velocity of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.NoWrite)
+
+        cls._register_attribute(attr_velocity)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        coursechange = Trace("CourseChange", "The value of the position and/or velocity vector changed")
+
+        cls._register_trace(coursechange)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3RandomDirection2dMobilityModel, self).__init__(ec, guid)
+        self._home = "ns3-random-direction2d-mobility-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/random_propagation_delay_model.py b/src/nepi/resources/ns3/classes/random_propagation_delay_model.py
new file mode 100644 (file)
index 0000000..30a5f29
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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.ns3propagationdelaymodel import NS3BasePropagationDelayModel 
+
+@clsinit_copy
+class NS3RandomPropagationDelayModel(NS3BasePropagationDelayModel):
+    _rtype = "ns3::RandomPropagationDelayModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_variable = Attribute("Variable",
+            "The random variable which generates random delays (s).",
+            type = Types.String,
+            default = "ns3::UniformRandomVariable",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_variable)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3RandomPropagationDelayModel, self).__init__(ec, guid)
+        self._home = "ns3-random-propagation-delay-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/random_propagation_loss_model.py b/src/nepi/resources/ns3/classes/random_propagation_loss_model.py
new file mode 100644 (file)
index 0000000..05f0228
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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 NS3RandomPropagationLossModel(NS3BasePropagationLossModel):
+    _rtype = "ns3::RandomPropagationLossModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_variable = Attribute("Variable",
+            "The random variable used to pick a loss everytime CalcRxPower is invoked.",
+            type = Types.String,
+            default = "ns3::ConstantRandomVariable[Constant=1.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_variable)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3RandomPropagationLossModel, self).__init__(ec, guid)
+        self._home = "ns3-random-propagation-loss-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/random_walk2d_mobility_model.py b/src/nepi/resources/ns3/classes/random_walk2d_mobility_model.py
new file mode 100644 (file)
index 0000000..ee4095a
--- /dev/null
@@ -0,0 +1,125 @@
+#
+#    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.ns3mobilitymodel import NS3BaseMobilityModel 
+
+@clsinit_copy
+class NS3RandomWalk2dMobilityModel(NS3BaseMobilityModel):
+    _rtype = "ns3::RandomWalk2dMobilityModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_bounds = Attribute("Bounds",
+            "Bounds of the area to cruise.",
+            type = Types.String,
+            default = "0|0|100|100",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_bounds)
+
+        attr_time = Attribute("Time",
+            "Change current direction and speed after moving for this delay.",
+            type = Types.String,
+            default = "+1000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_time)
+
+        attr_distance = Attribute("Distance",
+            "Change current direction and speed after moving for this distance.",
+            type = Types.Double,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_distance)
+
+        attr_mode = Attribute("Mode",
+            "The mode indicates the condition used to change the current speed and direction",
+            type = Types.Enumerate,
+            default = "Distance",  
+            allowed = ["Distance","Time"],
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mode)
+
+        attr_direction = Attribute("Direction",
+            "A random variable used to pick the direction (gradients).",
+            type = Types.String,
+            default = "ns3::UniformRandomVariable[Min=0.0|Max=6.283184]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_direction)
+
+        attr_speed = Attribute("Speed",
+            "A random variable used to pick the speed (m/s).",
+            type = Types.String,
+            default = "ns3::UniformRandomVariable[Min=2.0|Max=4.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_speed)
+
+        attr_position = Attribute("Position",
+            "The current position of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved)
+
+        cls._register_attribute(attr_position)
+
+        attr_velocity = Attribute("Velocity",
+            "The current velocity of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.NoWrite)
+
+        cls._register_attribute(attr_velocity)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        coursechange = Trace("CourseChange", "The value of the position and/or velocity vector changed")
+
+        cls._register_trace(coursechange)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3RandomWalk2dMobilityModel, self).__init__(ec, guid)
+        self._home = "ns3-random-walk2d-mobility-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/random_waypoint_mobility_model.py b/src/nepi/resources/ns3/classes/random_waypoint_mobility_model.py
new file mode 100644 (file)
index 0000000..6ca4a27
--- /dev/null
@@ -0,0 +1,85 @@
+#
+#    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.ns3mobilitymodel import NS3BaseMobilityModel 
+
+@clsinit_copy
+class NS3RandomWaypointMobilityModel(NS3BaseMobilityModel):
+    _rtype = "ns3::RandomWaypointMobilityModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_speed = Attribute("Speed",
+            "A random variable used to pick the speed of a random waypoint model.",
+            type = Types.String,
+            default = "ns3::UniformRandomVariable[Min=0.3|Max=0.7]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_speed)
+
+        attr_pause = Attribute("Pause",
+            "A random variable used to pick the pause of a random waypoint model.",
+            type = Types.String,
+            default = "ns3::ConstantRandomVariable[Constant=2.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_pause)
+
+        attr_position = Attribute("Position",
+            "The current position of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved)
+
+        cls._register_attribute(attr_position)
+
+        attr_velocity = Attribute("Velocity",
+            "The current velocity of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.NoWrite)
+
+        cls._register_attribute(attr_velocity)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        coursechange = Trace("CourseChange", "The value of the position and/or velocity vector changed")
+
+        cls._register_trace(coursechange)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3RandomWaypointMobilityModel, self).__init__(ec, guid)
+        self._home = "ns3-random-waypoint-mobility-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/range_propagation_loss_model.py b/src/nepi/resources/ns3/classes/range_propagation_loss_model.py
new file mode 100644 (file)
index 0000000..529e520
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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 NS3RangePropagationLossModel(NS3BasePropagationLossModel):
+    _rtype = "ns3::RangePropagationLossModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_maxrange = Attribute("MaxRange",
+            "Maximum Transmission Range (meters)",
+            type = Types.Double,
+            default = "250",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxrange)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3RangePropagationLossModel, self).__init__(ec, guid)
+        self._home = "ns3-range-propagation-loss-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/rate_error_model.py b/src/nepi/resources/ns3/classes/rate_error_model.py
new file mode 100644 (file)
index 0000000..2d56a34
--- /dev/null
@@ -0,0 +1,80 @@
+#
+#    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 NS3RateErrorModel(NS3BaseErrorModel):
+    _rtype = "ns3::RateErrorModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_errorunit = Attribute("ErrorUnit",
+            "The error unit",
+            type = Types.Enumerate,
+            default = "ERROR_UNIT_BYTE",  
+            allowed = ["ERROR_UNIT_BIT","ERROR_UNIT_BYTE","ERROR_UNIT_PACKET"],
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_errorunit)
+
+        attr_errorrate = Attribute("ErrorRate",
+            "The error rate.",
+            type = Types.Double,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_errorrate)
+
+        attr_ranvar = Attribute("RanVar",
+            "The decision variable attached to this error model.",
+            type = Types.String,
+            default = "ns3::UniformRandomVariable[Min=0.0|Max=1.0]",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ranvar)
+
+        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(NS3RateErrorModel, self).__init__(ec, guid)
+        self._home = "ns3-rate-error-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/receive_list_error_model.py b/src/nepi/resources/ns3/classes/receive_list_error_model.py
new file mode 100644 (file)
index 0000000..2f1652c
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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 NS3ReceiveListErrorModel(NS3BaseErrorModel):
+    _rtype = "ns3::ReceiveListErrorModel"
+
+    @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(NS3ReceiveListErrorModel, self).__init__(ec, guid)
+        self._home = "ns3-receive-list-error-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/red_queue.py b/src/nepi/resources/ns3/classes/red_queue.py
new file mode 100644 (file)
index 0000000..d68166e
--- /dev/null
@@ -0,0 +1,173 @@
+#
+#    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.ns3queue import NS3BaseQueue 
+
+@clsinit_copy
+class NS3RedQueue(NS3BaseQueue):
+    _rtype = "ns3::RedQueue"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_meanpktsize = Attribute("MeanPktSize",
+            "Average of packet size",
+            type = Types.Integer,
+            default = "500",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_meanpktsize)
+
+        attr_idlepktsize = Attribute("IdlePktSize",
+            "Average packet size used during idle times. Used when m_cautions = 3",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_idlepktsize)
+
+        attr_wait = Attribute("Wait",
+            "True for waiting between dropped packets",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_wait)
+
+        attr_gentle = Attribute("Gentle",
+            "True to increases dropping probability slowly when average queue exceeds maxthresh",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_gentle)
+
+        attr_minth = Attribute("MinTh",
+            "Minimum average length threshold in packets/bytes",
+            type = Types.Double,
+            default = "5",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_minth)
+
+        attr_maxth = Attribute("MaxTh",
+            "Maximum average length threshold in packets/bytes",
+            type = Types.Double,
+            default = "15",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxth)
+
+        attr_queuelimit = Attribute("QueueLimit",
+            "Queue limit in bytes/packets",
+            type = Types.Integer,
+            default = "25",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_queuelimit)
+
+        attr_qw = Attribute("QW",
+            "Queue weight related to the exponential weighted moving average (EWMA)",
+            type = Types.Double,
+            default = "0.002",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_qw)
+
+        attr_linterm = Attribute("LInterm",
+            "The maximum probability of dropping a packet",
+            type = Types.Double,
+            default = "50",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_linterm)
+
+        attr_ns1compat = Attribute("Ns1Compat",
+            "NS-1 compatibility",
+            type = Types.Bool,
+            default = "False",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ns1compat)
+
+        attr_linkbandwidth = Attribute("LinkBandwidth",
+            "The RED link bandwidth",
+            type = Types.String,
+            default = "1500000bps",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_linkbandwidth)
+
+        attr_linkdelay = Attribute("LinkDelay",
+            "The RED link delay",
+            type = Types.String,
+            default = "+20000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_linkdelay)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        enqueue = Trace("Enqueue", "Enqueue a packet in the queue.")
+
+        cls._register_trace(enqueue)
+
+        dequeue = Trace("Dequeue", "Dequeue a packet from the queue.")
+
+        cls._register_trace(dequeue)
+
+        drop = Trace("Drop", "Drop a packet stored in the queue.")
+
+        cls._register_trace(drop)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3RedQueue, self).__init__(ec, guid)
+        self._home = "ns3-red-queue-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/rraa_wifi_manager.py b/src/nepi/resources/ns3/classes/rraa_wifi_manager.py
new file mode 100644 (file)
index 0000000..1553b8a
--- /dev/null
@@ -0,0 +1,367 @@
+#
+#    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.ns3wifiremotestationmanager import NS3BaseWifiRemoteStationManager 
+
+@clsinit_copy
+class NS3RraaWifiManager(NS3BaseWifiRemoteStationManager):
+    _rtype = "ns3::RraaWifiManager"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_basic = Attribute("Basic",
+            "If true the RRAA-BASIC algorithm will be used, otherwise the RRAA wil be used",
+            type = Types.Bool,
+            default = "False",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_basic)
+
+        attr_timeout = Attribute("Timeout",
+            "Timeout for the RRAA BASIC loss estimaton block (s)",
+            type = Types.String,
+            default = "+50000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_timeout)
+
+        attr_ewndfor54mbps = Attribute("ewndFor54mbps",
+            "ewnd parameter for 54 Mbs data mode",
+            type = Types.Integer,
+            default = "40",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ewndfor54mbps)
+
+        attr_ewndfor48mbps = Attribute("ewndFor48mbps",
+            "ewnd parameter for 48 Mbs data mode",
+            type = Types.Integer,
+            default = "40",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ewndfor48mbps)
+
+        attr_ewndfor36mbps = Attribute("ewndFor36mbps",
+            "ewnd parameter for 36 Mbs data mode",
+            type = Types.Integer,
+            default = "40",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ewndfor36mbps)
+
+        attr_ewndfor24mbps = Attribute("ewndFor24mbps",
+            "ewnd parameter for 24 Mbs data mode",
+            type = Types.Integer,
+            default = "40",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ewndfor24mbps)
+
+        attr_ewndfor18mbps = Attribute("ewndFor18mbps",
+            "ewnd parameter for 18 Mbs data mode",
+            type = Types.Integer,
+            default = "20",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ewndfor18mbps)
+
+        attr_ewndfor12mbps = Attribute("ewndFor12mbps",
+            "ewnd parameter for 12 Mbs data mode",
+            type = Types.Integer,
+            default = "20",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ewndfor12mbps)
+
+        attr_ewndfor9mbps = Attribute("ewndFor9mbps",
+            "ewnd parameter for 9 Mbs data mode",
+            type = Types.Integer,
+            default = "10",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ewndfor9mbps)
+
+        attr_ewndfor6mbps = Attribute("ewndFor6mbps",
+            "ewnd parameter for 6 Mbs data mode",
+            type = Types.Integer,
+            default = "6",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ewndfor6mbps)
+
+        attr_porifor48mbps = Attribute("poriFor48mbps",
+            "Pori parameter for 48 Mbs data mode",
+            type = Types.Double,
+            default = "0.047",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_porifor48mbps)
+
+        attr_porifor36mbps = Attribute("poriFor36mbps",
+            "Pori parameter for 36 Mbs data mode",
+            type = Types.Double,
+            default = "0.115",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_porifor36mbps)
+
+        attr_porifor24mbps = Attribute("poriFor24mbps",
+            "Pori parameter for 24 Mbs data mode",
+            type = Types.Double,
+            default = "0.1681",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_porifor24mbps)
+
+        attr_porifor18mbps = Attribute("poriFor18mbps",
+            "Pori parameter for 18 Mbs data mode",
+            type = Types.Double,
+            default = "0.1325",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_porifor18mbps)
+
+        attr_porifor12mbps = Attribute("poriFor12mbps",
+            "Pori parameter for 12 Mbs data mode",
+            type = Types.Double,
+            default = "0.1861",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_porifor12mbps)
+
+        attr_porifor9mbps = Attribute("poriFor9mbps",
+            "Pori parameter for 9 Mbs data mode",
+            type = Types.Double,
+            default = "0.1434",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_porifor9mbps)
+
+        attr_porifor6mbps = Attribute("poriFor6mbps",
+            "Pori parameter for 6 Mbs data mode",
+            type = Types.Double,
+            default = "0.5",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_porifor6mbps)
+
+        attr_pmtlfor54mbps = Attribute("pmtlFor54mbps",
+            "Pmtl parameter for 54 Mbs data mode",
+            type = Types.Double,
+            default = "0.094",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_pmtlfor54mbps)
+
+        attr_pmtlfor48mbps = Attribute("pmtlFor48mbps",
+            "Pmtl parameter for 48 Mbs data mode",
+            type = Types.Double,
+            default = "0.23",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_pmtlfor48mbps)
+
+        attr_pmtlfor36mbps = Attribute("pmtlFor36mbps",
+            "Pmtl parameter for 36 Mbs data mode",
+            type = Types.Double,
+            default = "0.3363",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_pmtlfor36mbps)
+
+        attr_pmtlfor24mbps = Attribute("pmtlFor24mbps",
+            "Pmtl parameter for 24 Mbs data mode",
+            type = Types.Double,
+            default = "0.265",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_pmtlfor24mbps)
+
+        attr_pmtlfor18mbps = Attribute("pmtlFor18mbps",
+            "Pmtl parameter for 18 Mbs data mode",
+            type = Types.Double,
+            default = "0.3722",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_pmtlfor18mbps)
+
+        attr_pmtlfor12mbps = Attribute("pmtlFor12mbps",
+            "Pmtl parameter for 12 Mbs data mode",
+            type = Types.Double,
+            default = "0.2868",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_pmtlfor12mbps)
+
+        attr_pmtlfor9mbps = Attribute("pmtlFor9mbps",
+            "Pmtl parameter for 9 Mbs data mode",
+            type = Types.Double,
+            default = "0.3932",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_pmtlfor9mbps)
+
+        attr_islowlatency = Attribute("IsLowLatency",
+            "If true, we attempt to modelize a so-called low-latency device: a device where decisions about tx parameters can be made on a per-packet basis and feedback about the transmission of each packet is obtained before sending the next. Otherwise, we modelize a  high-latency device, that is a device where we cannot update our decision about tx parameters after every packet transmission.",
+            type = Types.Bool,
+            default = "True",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_islowlatency)
+
+        attr_maxssrc = Attribute("MaxSsrc",
+            "The maximum number of retransmission attempts for an RTS. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxssrc)
+
+        attr_maxslrc = Attribute("MaxSlrc",
+            "The maximum number of retransmission attempts for a DATA packet. This value will not have any effect on some rate control algorithms.",
+            type = Types.Integer,
+            default = "7",  
+            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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        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.",
+            type = Types.Integer,
+            default = "2346",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_fragmentationthreshold)
+
+        attr_nonunicastmode = Attribute("NonUnicastMode",
+            "Wifi mode used for non-unicast transmissions.",
+            type = Types.String,
+            default = "Invalid-WifiMode",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_nonunicastmode)
+
+        attr_defaulttxpowerlevel = Attribute("DefaultTxPowerLevel",
+            "Default power level to be used for transmissions. This is the power level that is used by all those WifiManagers that do notimplement TX power control.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_defaulttxpowerlevel)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactxrtsfailed = Trace("MacTxRtsFailed", "The transmission of a RTS by the MAC layer has failed")
+
+        cls._register_trace(mactxrtsfailed)
+
+        mactxdatafailed = Trace("MacTxDataFailed", "The transmission of a data packet by the MAC layer has failed")
+
+        cls._register_trace(mactxdatafailed)
+
+        mactxfinalrtsfailed = Trace("MacTxFinalRtsFailed", "The transmission of a RTS has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinalrtsfailed)
+
+        mactxfinaldatafailed = Trace("MacTxFinalDataFailed", "The transmission of a data packet has exceeded the maximum number of attempts")
+
+        cls._register_trace(mactxfinaldatafailed)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3RraaWifiManager, self).__init__(ec, guid)
+        self._home = "ns3-rraa-wifi-manager-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/simple_channel.py b/src/nepi/resources/ns3/classes/simple_channel.py
new file mode 100644 (file)
index 0000000..37a9c42
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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 NS3SimpleChannel(NS3BaseChannel):
+    _rtype = "ns3::SimpleChannel"
+
+    @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(NS3SimpleChannel, self).__init__(ec, guid)
+        self._home = "ns3-simple-channel-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/simple_net_device.py b/src/nepi/resources/ns3/classes/simple_net_device.py
new file mode 100644 (file)
index 0000000..293394a
--- /dev/null
@@ -0,0 +1,44 @@
+#
+#    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 NS3SimpleNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::SimpleNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        pass
+
+    @classmethod
+    def _register_traces(cls):
+        
+        phyrxdrop = Trace("PhyRxDrop", "Trace source indicating a packet has been dropped by the device during reception")
+
+        cls._register_trace(phyrxdrop)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3SimpleNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-simple-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/single_model_spectrum_channel.py b/src/nepi/resources/ns3/classes/single_model_spectrum_channel.py
new file mode 100644 (file)
index 0000000..3328562
--- /dev/null
@@ -0,0 +1,65 @@
+#
+#    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 NS3SingleModelSpectrumChannel(NS3BaseChannel):
+    _rtype = "ns3::SingleModelSpectrumChannel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_maxlossdb = Attribute("MaxLossDb",
+            "If a single-frequency PropagationLossModel is used, this value represents the maximum loss in dB for which transmissions will be passed to the receiving PHY. Signals for which the PropagationLossModel returns a loss bigger than this value will not be propagated to the receiver. This parameter is to be used to reduce the computational load by not propagating signals that are far beyond the interference range. Note that the default value corresponds to considering all signals for reception. Tune this value with care. ",
+            type = Types.Double,
+            default = "1e+09",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxlossdb)
+
+        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):
+        
+        pathloss = Trace("PathLoss", "This trace is fired whenever a new path loss value is calculated. The first and second parameters to the trace are pointers respectively to the TX and RX SpectrumPhy instances, whereas the third parameters is the loss value in dB. Note that the loss value reported by this trace is the single-frequency loss value obtained by evaluating only the TX and RX AntennaModels and the PropagationLossModel. In particular, note that SpectrumPropagationLossModel (even if present) is never used to evaluate the loss value reported in this trace. ")
+
+        cls._register_trace(pathloss)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3SingleModelSpectrumChannel, self).__init__(ec, guid)
+        self._home = "ns3-single-model-spectrum-channel-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/sta_wifi_mac.py b/src/nepi/resources/ns3/classes/sta_wifi_mac.py
new file mode 100644 (file)
index 0000000..3b2288f
--- /dev/null
@@ -0,0 +1,247 @@
+#
+#    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 NS3StaWifiMac(NS3BaseWifiMac):
+    _rtype = "ns3::StaWifiMac"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_proberequesttimeout = Attribute("ProbeRequestTimeout",
+            "The interval between two consecutive probe request attempts.",
+            type = Types.String,
+            default = "+50000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_proberequesttimeout)
+
+        attr_assocrequesttimeout = Attribute("AssocRequestTimeout",
+            "The interval between two consecutive assoc request attempts.",
+            type = Types.String,
+            default = "+500000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_assocrequesttimeout)
+
+        attr_maxmissedbeacons = Attribute("MaxMissedBeacons",
+            "Number of beacons which much be consecutively missed before we attempt to restart association.",
+            type = Types.Integer,
+            default = "10",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxmissedbeacons)
+
+        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):
+        
+        assoc = Trace("Assoc", "Associated with an access point.")
+
+        cls._register_trace(assoc)
+
+        deassoc = Trace("DeAssoc", "Association with an access point lost.")
+
+        cls._register_trace(deassoc)
+
+        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(NS3StaWifiMac, self).__init__(ec, guid)
+        self._home = "ns3-sta-wifi-mac-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/steady_state_random_waypoint_mobility_model.py b/src/nepi/resources/ns3/classes/steady_state_random_waypoint_mobility_model.py
new file mode 100644 (file)
index 0000000..65b99b6
--- /dev/null
@@ -0,0 +1,155 @@
+#
+#    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.ns3mobilitymodel import NS3BaseMobilityModel 
+
+@clsinit_copy
+class NS3SteadyStateRandomWaypointMobilityModel(NS3BaseMobilityModel):
+    _rtype = "ns3::SteadyStateRandomWaypointMobilityModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_minspeed = Attribute("MinSpeed",
+            "Minimum speed value, [m/s]",
+            type = Types.Double,
+            default = "0.3",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_minspeed)
+
+        attr_maxspeed = Attribute("MaxSpeed",
+            "Maximum speed value, [m/s]",
+            type = Types.Double,
+            default = "0.7",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxspeed)
+
+        attr_minpause = Attribute("MinPause",
+            "Minimum pause value, [s]",
+            type = Types.Double,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_minpause)
+
+        attr_maxpause = Attribute("MaxPause",
+            "Maximum pause value, [s]",
+            type = Types.Double,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxpause)
+
+        attr_minx = Attribute("MinX",
+            "Minimum X value of traveling region, [m]",
+            type = Types.Double,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_minx)
+
+        attr_maxx = Attribute("MaxX",
+            "Maximum X value of traveling region, [m]",
+            type = Types.Double,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxx)
+
+        attr_miny = Attribute("MinY",
+            "Minimum Y value of traveling region, [m]",
+            type = Types.Double,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_miny)
+
+        attr_maxy = Attribute("MaxY",
+            "Maximum Y value of traveling region, [m]",
+            type = Types.Double,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxy)
+
+        attr_z = Attribute("Z",
+            "Z value of traveling region (fixed), [m]",
+            type = Types.Double,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_z)
+
+        attr_position = Attribute("Position",
+            "The current position of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved)
+
+        cls._register_attribute(attr_position)
+
+        attr_velocity = Attribute("Velocity",
+            "The current velocity of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.NoWrite)
+
+        cls._register_attribute(attr_velocity)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        coursechange = Trace("CourseChange", "The value of the position and/or velocity vector changed")
+
+        cls._register_trace(coursechange)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3SteadyStateRandomWaypointMobilityModel, self).__init__(ec, guid)
+        self._home = "ns3-steady-state-random-waypoint-mobility-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/subscriber_station_net_device.py b/src/nepi/resources/ns3/classes/subscriber_station_net_device.py
new file mode 100644 (file)
index 0000000..18441c2
--- /dev/null
@@ -0,0 +1,215 @@
+#
+#    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 NS3SubscriberStationNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::SubscriberStationNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_lostdlmapinterval = Attribute("LostDlMapInterval",
+            "Time since last received DL-MAP message before downlink synchronization is considered lost. Maximum is 600ms",
+            type = Types.String,
+            default = "+500000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_lostdlmapinterval)
+
+        attr_lostulmapinterval = Attribute("LostUlMapInterval",
+            "Time since last received UL-MAP before uplink synchronization is considered lost, maximum is 600.",
+            type = Types.String,
+            default = "+500000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_lostulmapinterval)
+
+        attr_maxdcdinterval = Attribute("MaxDcdInterval",
+            "Maximum time between transmission of DCD messages. Maximum is 10s",
+            type = Types.String,
+            default = "+10000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxdcdinterval)
+
+        attr_maxucdinterval = Attribute("MaxUcdInterval",
+            "Maximum time between transmission of UCD messages. Maximum is 10s",
+            type = Types.String,
+            default = "+10000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxucdinterval)
+
+        attr_intervalt1 = Attribute("IntervalT1",
+            "Wait for DCD timeout. Maximum is 5*maxDcdInterval",
+            type = Types.String,
+            default = "+50000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_intervalt1)
+
+        attr_intervalt2 = Attribute("IntervalT2",
+            "Wait for broadcast ranging timeout, i.e., wait for initial ranging opportunity. Maximum is 5*Ranging interval",
+            type = Types.String,
+            default = "+10000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_intervalt2)
+
+        attr_intervalt3 = Attribute("IntervalT3",
+            "ranging Response reception timeout following the transmission of a ranging request. Maximum is 200ms",
+            type = Types.String,
+            default = "+200000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_intervalt3)
+
+        attr_intervalt7 = Attribute("IntervalT7",
+            "wait for DSA/DSC/DSD Response timeout. Maximum is 1s",
+            type = Types.String,
+            default = "+100000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_intervalt7)
+
+        attr_intervalt12 = Attribute("IntervalT12",
+            "Wait for UCD descriptor.Maximum is 5*MaxUcdInterval",
+            type = Types.String,
+            default = "+10000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_intervalt12)
+
+        attr_intervalt20 = Attribute("IntervalT20",
+            "Time the SS searches for preambles on a given channel. Minimum is 2 MAC frames",
+            type = Types.String,
+            default = "+500000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_intervalt20)
+
+        attr_intervalt21 = Attribute("IntervalT21",
+            "time the SS searches for (decodable) DL-MAP on a given channel",
+            type = Types.String,
+            default = "+10000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_intervalt21)
+
+        attr_maxcontentionrangingretries = Attribute("MaxContentionRangingRetries",
+            "Number of retries on contention Ranging Requests",
+            type = Types.Integer,
+            default = "16",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxcontentionrangingretries)
+
+        attr_mtu = Attribute("Mtu",
+            "The MAC-level Maximum Transmission Unit",
+            type = Types.Integer,
+            default = "1400",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mtu)
+
+        attr_rtg = Attribute("RTG",
+            "receive/transmit transition gap.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_rtg)
+
+        attr_ttg = Attribute("TTG",
+            "transmit/receive transition gap.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ttg)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        sstxdrop = Trace("SSTxDrop", "A packet has been dropped in the MAC layer before being queued for transmission.")
+
+        cls._register_trace(sstxdrop)
+
+        sspromiscrx = Trace("SSPromiscRx", "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(sspromiscrx)
+
+        ssrx = Trace("SSRx", "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(ssrx)
+
+        ssrxdrop = Trace("SSRxDrop", "A packet has been dropped in the MAC layer after it has been passed up from the physical layer.")
+
+        cls._register_trace(ssrxdrop)
+
+        rx = Trace("Rx", "Receive trace")
+
+        cls._register_trace(rx)
+
+        tx = Trace("Tx", "Transmit trace")
+
+        cls._register_trace(tx)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3SubscriberStationNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-subscriber-station-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/tap_bridge.py b/src/nepi/resources/ns3/classes/tap_bridge.py
new file mode 100644 (file)
index 0000000..8438d28
--- /dev/null
@@ -0,0 +1,120 @@
+#
+#    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 NS3TapBridge(NS3BaseNetDevice):
+    _rtype = "ns3::TapBridge"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_mtu = Attribute("Mtu",
+            "The MAC-level Maximum Transmission Unit",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mtu)
+
+        attr_devicename = Attribute("DeviceName",
+            "The name of the tap device to create.",
+            type = Types.String,
+            default = "",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_devicename)
+
+        attr_gateway = Attribute("Gateway",
+            "The IP address of the default gateway to assign to the host machine, when in ConfigureLocal mode.",
+            type = Types.String,
+            default = "255.255.255.255",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_gateway)
+
+        attr_ipaddress = Attribute("IpAddress",
+            "The IP address to assign to the tap device, when in ConfigureLocal mode.  This address will override the discovered IP address of the simulated device.",
+            type = Types.String,
+            default = "255.255.255.255",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ipaddress)
+
+        attr_macaddress = Attribute("MacAddress",
+            "The MAC address to assign to the tap device, when in ConfigureLocal mode.  This address will override the discovered MAC address of the simulated device.",
+            type = Types.String,
+            default = "ff:ff:ff:ff:ff:ff",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_macaddress)
+
+        attr_netmask = Attribute("Netmask",
+            "The network mask to assign to the tap device, when in ConfigureLocal mode.  This address will override the discovered MAC address of the simulated device.",
+            type = Types.String,
+            default = "255.255.255.255",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_netmask)
+
+        attr_start = Attribute("Start",
+            "The simulation time at which to spin up the tap device read thread.",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_start)
+
+        attr_stop = Attribute("Stop",
+            "The simulation time at which to tear down the tap device read thread.",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stop)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3TapBridge, self).__init__(ec, guid)
+        self._home = "ns3-tap-bridge-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/three_log_distance_propagation_loss_model.py b/src/nepi/resources/ns3/classes/three_log_distance_propagation_loss_model.py
new file mode 100644 (file)
index 0000000..620d904
--- /dev/null
@@ -0,0 +1,110 @@
+#
+#    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 NS3ThreeLogDistancePropagationLossModel(NS3BasePropagationLossModel):
+    _rtype = "ns3::ThreeLogDistancePropagationLossModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_distance0 = Attribute("Distance0",
+            "Beginning of the first (near) distance field",
+            type = Types.Double,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_distance0)
+
+        attr_distance1 = Attribute("Distance1",
+            "Beginning of the second (middle) distance field.",
+            type = Types.Double,
+            default = "200",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_distance1)
+
+        attr_distance2 = Attribute("Distance2",
+            "Beginning of the third (far) distance field.",
+            type = Types.Double,
+            default = "500",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_distance2)
+
+        attr_exponent0 = Attribute("Exponent0",
+            "The exponent for the first field.",
+            type = Types.Double,
+            default = "1.9",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_exponent0)
+
+        attr_exponent1 = Attribute("Exponent1",
+            "The exponent for the second field.",
+            type = Types.Double,
+            default = "3.8",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_exponent1)
+
+        attr_exponent2 = Attribute("Exponent2",
+            "The exponent for the third field.",
+            type = Types.Double,
+            default = "3.8",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_exponent2)
+
+        attr_referenceloss = Attribute("ReferenceLoss",
+            "The reference loss at distance d0 (dB). (Default is Friis at 1m with 5.15 GHz)",
+            type = Types.Double,
+            default = "46.6777",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_referenceloss)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3ThreeLogDistancePropagationLossModel, self).__init__(ec, guid)
+        self._home = "ns3-three-log-distance-propagation-loss-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/two_ray_ground_propagation_loss_model.py b/src/nepi/resources/ns3/classes/two_ray_ground_propagation_loss_model.py
new file mode 100644 (file)
index 0000000..0dfadb8
--- /dev/null
@@ -0,0 +1,80 @@
+#
+#    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 NS3TwoRayGroundPropagationLossModel(NS3BasePropagationLossModel):
+    _rtype = "ns3::TwoRayGroundPropagationLossModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_frequency = Attribute("Frequency",
+            "The carrier frequency (in Hz) at which propagation occurs  (default is 5.15 GHz).",
+            type = Types.Double,
+            default = "5.15e+09",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_frequency)
+
+        attr_systemloss = Attribute("SystemLoss",
+            "The system loss",
+            type = Types.Double,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_systemloss)
+
+        attr_mindistance = Attribute("MinDistance",
+            "The distance under which the propagation model refuses to give results (m)",
+            type = Types.Double,
+            default = "0.5",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mindistance)
+
+        attr_heightabovez = Attribute("HeightAboveZ",
+            "The height of the antenna (m) above the node\'s Z coordinate",
+            type = Types.Double,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_heightabovez)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3TwoRayGroundPropagationLossModel, self).__init__(ec, guid)
+        self._home = "ns3-two-ray-ground-propagation-loss-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/uan_channel.py b/src/nepi/resources/ns3/classes/uan_channel.py
new file mode 100644 (file)
index 0000000..4683b78
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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 NS3UanChannel(NS3BaseChannel):
+    _rtype = "ns3::UanChannel"
+
+    @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(NS3UanChannel, self).__init__(ec, guid)
+        self._home = "ns3-uan-channel-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/udp_client.py b/src/nepi/resources/ns3/classes/udp_client.py
new file mode 100644 (file)
index 0000000..e242eb6
--- /dev/null
@@ -0,0 +1,110 @@
+#
+#    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.ns3application import NS3BaseApplication 
+
+@clsinit_copy
+class NS3UdpClient(NS3BaseApplication):
+    _rtype = "ns3::UdpClient"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_maxpackets = Attribute("MaxPackets",
+            "The maximum number of packets the application will send",
+            type = Types.Integer,
+            default = "100",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxpackets)
+
+        attr_interval = Attribute("Interval",
+            "The time to wait between packets",
+            type = Types.String,
+            default = "+1000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_interval)
+
+        attr_remoteaddress = Attribute("RemoteAddress",
+            "The destination Address of the outbound packets",
+            type = Types.String,
+            default = "00-00-00",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_remoteaddress)
+
+        attr_remoteport = Attribute("RemotePort",
+            "The destination port of the outbound packets",
+            type = Types.Integer,
+            default = "100",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_remoteport)
+
+        attr_packetsize = Attribute("PacketSize",
+            "Size of packets generated. The minimum packet size is 12 bytes which is the size of the header carrying the sequence number and the time stamp.",
+            type = Types.Integer,
+            default = "1024",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_packetsize)
+
+        attr_starttime = Attribute("StartTime",
+            "Time at which the application will start",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_starttime)
+
+        attr_stoptime = Attribute("StopTime",
+            "Time at which the application will stop",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stoptime)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3UdpClient, self).__init__(ec, guid)
+        self._home = "ns3-udp-client-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/udp_echo_client.py b/src/nepi/resources/ns3/classes/udp_echo_client.py
new file mode 100644 (file)
index 0000000..9293b07
--- /dev/null
@@ -0,0 +1,115 @@
+#
+#    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.ns3application import NS3BaseApplication 
+
+@clsinit_copy
+class NS3UdpEchoClient(NS3BaseApplication):
+    _rtype = "ns3::UdpEchoClient"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_maxpackets = Attribute("MaxPackets",
+            "The maximum number of packets the application will send",
+            type = Types.Integer,
+            default = "100",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxpackets)
+
+        attr_interval = Attribute("Interval",
+            "The time to wait between packets",
+            type = Types.String,
+            default = "+1000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_interval)
+
+        attr_remoteaddress = Attribute("RemoteAddress",
+            "The destination Address of the outbound packets",
+            type = Types.String,
+            default = "00-00-00",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_remoteaddress)
+
+        attr_remoteport = Attribute("RemotePort",
+            "The destination port of the outbound packets",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_remoteport)
+
+        attr_packetsize = Attribute("PacketSize",
+            "Size of echo data in outbound packets",
+            type = Types.Integer,
+            default = "100",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_packetsize)
+
+        attr_starttime = Attribute("StartTime",
+            "Time at which the application will start",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_starttime)
+
+        attr_stoptime = Attribute("StopTime",
+            "Time at which the application will stop",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stoptime)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        tx = Trace("Tx", "A new packet is created and is sent")
+
+        cls._register_trace(tx)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3UdpEchoClient, self).__init__(ec, guid)
+        self._home = "ns3-udp-echo-client-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/udp_echo_server.py b/src/nepi/resources/ns3/classes/udp_echo_server.py
new file mode 100644 (file)
index 0000000..cd73643
--- /dev/null
@@ -0,0 +1,70 @@
+#
+#    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.ns3application import NS3BaseApplication 
+
+@clsinit_copy
+class NS3UdpEchoServer(NS3BaseApplication):
+    _rtype = "ns3::UdpEchoServer"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_port = Attribute("Port",
+            "Port on which we listen for incoming packets.",
+            type = Types.Integer,
+            default = "9",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_port)
+
+        attr_starttime = Attribute("StartTime",
+            "Time at which the application will start",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_starttime)
+
+        attr_stoptime = Attribute("StopTime",
+            "Time at which the application will stop",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stoptime)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3UdpEchoServer, self).__init__(ec, guid)
+        self._home = "ns3-udp-echo-server-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/udp_server.py b/src/nepi/resources/ns3/classes/udp_server.py
new file mode 100644 (file)
index 0000000..86b109b
--- /dev/null
@@ -0,0 +1,80 @@
+#
+#    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.ns3application import NS3BaseApplication 
+
+@clsinit_copy
+class NS3UdpServer(NS3BaseApplication):
+    _rtype = "ns3::UdpServer"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_port = Attribute("Port",
+            "Port on which we listen for incoming packets.",
+            type = Types.Integer,
+            default = "100",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_port)
+
+        attr_packetwindowsize = Attribute("PacketWindowSize",
+            "The size of the window used to compute the packet loss. This value should be a multiple of 8.",
+            type = Types.Integer,
+            default = "32",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_packetwindowsize)
+
+        attr_starttime = Attribute("StartTime",
+            "Time at which the application will start",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_starttime)
+
+        attr_stoptime = Attribute("StopTime",
+            "Time at which the application will stop",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stoptime)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3UdpServer, self).__init__(ec, guid)
+        self._home = "ns3-udp-server-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/udp_trace_client.py b/src/nepi/resources/ns3/classes/udp_trace_client.py
new file mode 100644 (file)
index 0000000..6263666
--- /dev/null
@@ -0,0 +1,90 @@
+#
+#    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.ns3application import NS3BaseApplication 
+
+@clsinit_copy
+class NS3UdpTraceClient(NS3BaseApplication):
+    _rtype = "ns3::UdpTraceClient"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_remoteaddress = Attribute("RemoteAddress",
+            "The destination Address of the outbound packets",
+            type = Types.String,
+            default = "00-00-00",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_remoteaddress)
+
+        attr_remoteport = Attribute("RemotePort",
+            "The destination port of the outbound packets",
+            type = Types.Integer,
+            default = "100",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_remoteport)
+
+        attr_maxpacketsize = Attribute("MaxPacketSize",
+            "The maximum size of a packet.",
+            type = Types.Integer,
+            default = "1024",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_maxpacketsize)
+
+        attr_starttime = Attribute("StartTime",
+            "Time at which the application will start",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_starttime)
+
+        attr_stoptime = Attribute("StopTime",
+            "Time at which the application will stop",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stoptime)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3UdpTraceClient, self).__init__(ec, guid)
+        self._home = "ns3-udp-trace-client-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/v4ping.py b/src/nepi/resources/ns3/classes/v4ping.py
new file mode 100644 (file)
index 0000000..c9a0958
--- /dev/null
@@ -0,0 +1,105 @@
+#
+#    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.ns3application import NS3BaseApplication 
+
+@clsinit_copy
+class NS3V4Ping(NS3BaseApplication):
+    _rtype = "ns3::V4Ping"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_remote = Attribute("Remote",
+            "The address of the machine we want to ping.",
+            type = Types.String,
+            default = "102.102.102.102",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_remote)
+
+        attr_verbose = Attribute("Verbose",
+            "Produce usual output.",
+            type = Types.Bool,
+            default = "False",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_verbose)
+
+        attr_interval = Attribute("Interval",
+            "Wait  interval  seconds between sending each packet.",
+            type = Types.String,
+            default = "+1000000000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_interval)
+
+        attr_size = Attribute("Size",
+            "The number of data bytes to be sent, real packet will be 8 (ICMP) + 20 (IP) bytes longer.",
+            type = Types.Integer,
+            default = "56",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_size)
+
+        attr_starttime = Attribute("StartTime",
+            "Time at which the application will start",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_starttime)
+
+        attr_stoptime = Attribute("StopTime",
+            "Time at which the application will stop",
+            type = Types.String,
+            default = "+0.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stoptime)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        rtt = Trace("Rtt", "The rtt calculated by the ping.")
+
+        cls._register_trace(rtt)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3V4Ping, self).__init__(ec, guid)
+        self._home = "ns3-v4ping-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/virtual_net_device.py b/src/nepi/resources/ns3/classes/virtual_net_device.py
new file mode 100644 (file)
index 0000000..a57f363
--- /dev/null
@@ -0,0 +1,71 @@
+#
+#    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 NS3VirtualNetDevice(NS3BaseNetDevice):
+    _rtype = "ns3::VirtualNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_mtu = Attribute("Mtu",
+            "The MAC-level Maximum Transmission Unit",
+            type = Types.Integer,
+            default = "1500",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_mtu)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        mactx = Trace("MacTx", "Trace source indicating a packet has arrived for transmission by this device")
+
+        cls._register_trace(mactx)
+
+        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)
+
+        sniffer = Trace("Sniffer", "Trace source simulating a non-promiscuous packet sniffer attached to the device")
+
+        cls._register_trace(sniffer)
+
+        promiscsniffer = Trace("PromiscSniffer", "Trace source simulating a promiscuous packet sniffer attached to the device")
+
+        cls._register_trace(promiscsniffer)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3VirtualNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-virtual-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/waypoint_mobility_model.py b/src/nepi/resources/ns3/classes/waypoint_mobility_model.py
new file mode 100644 (file)
index 0000000..116ab45
--- /dev/null
@@ -0,0 +1,95 @@
+#
+#    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.ns3mobilitymodel import NS3BaseMobilityModel 
+
+@clsinit_copy
+class NS3WaypointMobilityModel(NS3BaseMobilityModel):
+    _rtype = "ns3::WaypointMobilityModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_waypointsleft = Attribute("WaypointsLeft",
+            "The number of waypoints remaining.",
+            type = Types.Integer,
+            default = "0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.NoWrite)
+
+        cls._register_attribute(attr_waypointsleft)
+
+        attr_lazynotify = Attribute("LazyNotify",
+            "Only call NotifyCourseChange when position is calculated.",
+            type = Types.Bool,
+            default = "False",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_lazynotify)
+
+        attr_initialpositioniswaypoint = Attribute("InitialPositionIsWaypoint",
+            "Calling SetPosition with no waypoints creates a waypoint.",
+            type = Types.Bool,
+            default = "False",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_initialpositioniswaypoint)
+
+        attr_position = Attribute("Position",
+            "The current position of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved)
+
+        cls._register_attribute(attr_position)
+
+        attr_velocity = Attribute("Velocity",
+            "The current velocity of the mobility model.",
+            type = Types.String,
+            default = "0:0:0",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.NoWrite)
+
+        cls._register_attribute(attr_velocity)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        coursechange = Trace("CourseChange", "The value of the position and/or velocity vector changed")
+
+        cls._register_trace(coursechange)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3WaypointMobilityModel, self).__init__(ec, guid)
+        self._home = "ns3-waypoint-mobility-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/wifi_net_device.py b/src/nepi/resources/ns3/classes/wifi_net_device.py
new file mode 100644 (file)
index 0000000..92dd859
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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.ns3wifinetdevice import NS3BaseWifiNetDevice 
+
+@clsinit_copy
+class NS3WifiNetDevice(NS3BaseWifiNetDevice):
+    _rtype = "ns3::WifiNetDevice"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_mtu = Attribute("Mtu",
+            "The MAC-level Maximum Transmission Unit",
+            type = Types.Integer,
+            default = "2296",  
+            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(NS3WifiNetDevice, self).__init__(ec, guid)
+        self._home = "ns3-wifi-net-device-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/yans_error_rate_model.py b/src/nepi/resources/ns3/classes/yans_error_rate_model.py
new file mode 100644 (file)
index 0000000..0e119dd
--- /dev/null
@@ -0,0 +1,39 @@
+#
+#    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.ns3errorratemodel import NS3BaseErrorRateModel 
+
+@clsinit_copy
+class NS3YansErrorRateModel(NS3BaseErrorRateModel):
+    _rtype = "ns3::YansErrorRateModel"
+
+    @classmethod
+    def _register_attributes(cls):
+        pass
+
+    @classmethod
+    def _register_traces(cls):
+        pass
+
+    def __init__(self, ec, guid):
+        super(NS3YansErrorRateModel, self).__init__(ec, guid)
+        self._home = "ns3-yans-error-rate-model-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/yans_wifi_channel.py b/src/nepi/resources/ns3/classes/yans_wifi_channel.py
new file mode 100644 (file)
index 0000000..314d391
--- /dev/null
@@ -0,0 +1,50 @@
+#
+#    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.ns3wifichannel import NS3BaseWifiChannel 
+
+@clsinit_copy
+class NS3YansWifiChannel(NS3BaseWifiChannel):
+    _rtype = "ns3::YansWifiChannel"
+
+    @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(NS3YansWifiChannel, self).__init__(ec, guid)
+        self._home = "ns3-yans-wifi-channel-%s" % self.guid
diff --git a/src/nepi/resources/ns3/classes/yans_wifi_phy.py b/src/nepi/resources/ns3/classes/yans_wifi_phy.py
new file mode 100644 (file)
index 0000000..2c6ad1c
--- /dev/null
@@ -0,0 +1,253 @@
+#
+#    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.ns3wifiphy import NS3BaseWifiPhy 
+
+@clsinit_copy
+class NS3YansWifiPhy(NS3BaseWifiPhy):
+    _rtype = "ns3::YansWifiPhy"
+
+    @classmethod
+    def _register_attributes(cls):
+        
+        attr_energydetectionthreshold = Attribute("EnergyDetectionThreshold",
+            "The energy of a received signal should be higher than this threshold (dbm) to allow the PHY layer to detect the signal.",
+            type = Types.Double,
+            default = "-96",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_energydetectionthreshold)
+
+        attr_ccamode1threshold = Attribute("CcaMode1Threshold",
+            "The energy of a received signal should be higher than this threshold (dbm) to allow the PHY layer to declare CCA BUSY state",
+            type = Types.Double,
+            default = "-99",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ccamode1threshold)
+
+        attr_txgain = Attribute("TxGain",
+            "Transmission gain (dB).",
+            type = Types.Double,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_txgain)
+
+        attr_rxgain = Attribute("RxGain",
+            "Reception gain (dB).",
+            type = Types.Double,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_rxgain)
+
+        attr_txpowerlevels = Attribute("TxPowerLevels",
+            "Number of transmission power levels available between TxPowerStart and TxPowerEnd included.",
+            type = Types.Integer,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_txpowerlevels)
+
+        attr_txpowerend = Attribute("TxPowerEnd",
+            "Maximum available transmission level (dbm).",
+            type = Types.Double,
+            default = "16.0206",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_txpowerend)
+
+        attr_txpowerstart = Attribute("TxPowerStart",
+            "Minimum available transmission level (dbm).",
+            type = Types.Double,
+            default = "16.0206",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_txpowerstart)
+
+        attr_rxnoisefigure = Attribute("RxNoiseFigure",
+            "Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver. According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), this is \"the difference in decibels (dB) between the noise output of the actual receiver to the noise output of an  ideal receiver with the same overall gain and bandwidth when the receivers  are connected to sources at the standard noise temperature T0 (usually 290 K)\". For",
+            type = Types.Double,
+            default = "7",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_rxnoisefigure)
+
+        attr_channelswitchdelay = Attribute("ChannelSwitchDelay",
+            "Delay between two short frames transmitted on different frequencies.",
+            type = Types.String,
+            default = "+250000.0ns",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_channelswitchdelay)
+
+        attr_channelnumber = Attribute("ChannelNumber",
+            "Channel center frequency = Channel starting frequency + 5 MHz * nch",
+            type = Types.Integer,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_channelnumber)
+
+        attr_frequency = Attribute("Frequency",
+            "The operating frequency.",
+            type = Types.Integer,
+            default = "2407",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_frequency)
+
+        attr_transmitters = Attribute("Transmitters",
+            "The number of transmitters.",
+            type = Types.Integer,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_transmitters)
+
+        attr_recievers = Attribute("Recievers",
+            "The number of recievers.",
+            type = Types.Integer,
+            default = "1",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_recievers)
+
+        attr_shortguardenabled = Attribute("ShortGuardEnabled",
+            "Whether or not short guard interval is enabled.",
+            type = Types.Bool,
+            default = "False",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_shortguardenabled)
+
+        attr_ldpcenabled = Attribute("LdpcEnabled",
+            "Whether or not LDPC is enabled.",
+            type = Types.Bool,
+            default = "False",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_ldpcenabled)
+
+        attr_stbcenabled = Attribute("STBCEnabled",
+            "Whether or not STBC is enabled.",
+            type = Types.Bool,
+            default = "False",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_stbcenabled)
+
+        attr_greenfieldenabled = Attribute("GreenfieldEnabled",
+            "Whether or not STBC is enabled.",
+            type = Types.Bool,
+            default = "False",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_greenfieldenabled)
+
+        attr_channelbonding = Attribute("ChannelBonding",
+            "Whether 20MHz or 40MHz.",
+            type = Types.Bool,
+            default = "False",  
+            allowed = None,
+            range = None,    
+            flags = Flags.Reserved | Flags.Construct)
+
+        cls._register_attribute(attr_channelbonding)
+
+
+
+    @classmethod
+    def _register_traces(cls):
+        
+        phytxbegin = Trace("PhyTxBegin", "Trace source indicating a packet has begun transmitting over the channel medium")
+
+        cls._register_trace(phytxbegin)
+
+        phytxend = Trace("PhyTxEnd", "Trace source indicating a packet has been completely transmitted over the channel. NOTE: the only official WifiPhy implementation available to this date (YansWifiPhy) never fires this trace source.")
+
+        cls._register_trace(phytxend)
+
+        phytxdrop = Trace("PhyTxDrop", "Trace source indicating a packet has been dropped by the device during transmission")
+
+        cls._register_trace(phytxdrop)
+
+        phyrxbegin = Trace("PhyRxBegin", "Trace source indicating a packet has begun being received from the channel medium by the device")
+
+        cls._register_trace(phyrxbegin)
+
+        phyrxend = Trace("PhyRxEnd", "Trace source indicating a packet has been completely received from the channel medium by the device")
+
+        cls._register_trace(phyrxend)
+
+        phyrxdrop = Trace("PhyRxDrop", "Trace source indicating a packet has been dropped by the device during reception")
+
+        cls._register_trace(phyrxdrop)
+
+        monitorsnifferrx = Trace("MonitorSnifferRx", "Trace source simulating a wifi device in monitor mode sniffing all received frames")
+
+        cls._register_trace(monitorsnifferrx)
+
+        monitorsniffertx = Trace("MonitorSnifferTx", "Trace source simulating the capability of a wifi device in monitor mode to sniff all frames being transmitted")
+
+        cls._register_trace(monitorsniffertx)
+
+
+
+    def __init__(self, ec, guid):
+        super(NS3YansWifiPhy, self).__init__(ec, guid)
+        self._home = "ns3-yans-wifi-phy-%s" % self.guid
index cbb76b4..db6096b 100644 (file)
@@ -17,7 +17,8 @@
 #
 # Author: Alina Quereilhac <alina.quereilhac@inria.fr>
 
-from nepi.execution.resource import clsinit_copy, ResourceState
+from nepi.execution.resource import clsinit_copy, ResourceState, \
+        reschedule_delay
 from nepi.resources.ns3.ns3base import NS3Base
 
 @clsinit_copy
@@ -55,6 +56,13 @@ class NS3BaseApplication(NS3Base):
             self.simulation.invoke(self.uuid, "Stop")
             self.set_stopped()
 
+    def do_start(self):
+        if self.simulation.state < ResourceState.STARTED:
+            self.debug("---- RESCHEDULING START ----" )
+            self.ec.schedule(reschedule_delay, self.start)
+        else:
+            super(NS3BaseApplication, self).do_start()
+
     @property
     def state(self):
         if self._state == ResourceState.STARTED:
index e6816bf..f38915f 100644 (file)
 
 from nepi.execution.resource import ResourceManager, clsinit_copy, \
         ResourceState, reschedule_delay
-
 from nepi.execution.attribute import Flags
 from nepi.execution.trace import TraceAttr
 
-reschedule_delay = "1s"
-
 @clsinit_copy
 class NS3Base(ResourceManager):
     _rtype = "abstract::ns3::Object"
index 5eb3f45..5d53943 100644 (file)
@@ -28,6 +28,7 @@ class NS3BaseIpv4L3Protocol(NS3Base):
         super(NS3BaseIpv4L3Protocol, self).__init__(ec, guid)
         self.list_routing_uuid = None
         self.static_routing_uuid = None
+        self.global_routing_uuid = None
 
     @property
     def node(self):
@@ -55,7 +56,11 @@ class NS3BaseIpv4L3Protocol(NS3Base):
 
         self.static_routing_uuid = simulation.create("Ipv4StaticRouting")
         simulation.invoke(self.list_routing_uuid, "AddRoutingProtocol", 
-                self.static_routing_uuid, 1)
+                self.static_routing_uuid, 0)
+
+        self.global_routing_uuid = simulation.create("Ipv4GlobalRouting")
+        simulation.invoke(self.list_routing_uuid, "AddRoutingProtocol", 
+                self.global_routing_uuid, -10)
 
     def _connect_object(self):
         pass
diff --git a/src/nepi/resources/ns3/ns3route.py b/src/nepi/resources/ns3/ns3route.py
new file mode 100644 (file)
index 0000000..bb61368
--- /dev/null
@@ -0,0 +1,93 @@
+#
+#    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
+from nepi.execution.resource import clsinit_copy
+from nepi.execution.trace import Trace
+from nepi.resources.ns3.ns3base import NS3Base
+
+import ipaddr
+
+@clsinit_copy
+class NS3Route(NS3Base):
+    _rtype = "ns3::Route"
+
+    @classmethod
+    def _register_attributes(cls):
+        network = Attribute("network", "Destination network address",
+                flags = Flags.Design)
+
+        prefix = Attribute("prefix", "Network prefix for the network",
+                flags = Flags.Design)
+
+        nexthop = Attribute("nexthop", "Address of next hop in the route",
+                flags = Flags.Design)
+
+        cls._register_attribute(network)
+        cls._register_attribute(prefix)
+        cls._register_attribute(nexthop)
+
+    def __init__(self, ec, guid):
+        super(NS3Route, self).__init__(ec, guid)
+
+    @property
+    def node(self):
+        from nepi.resources.ns3.ns3node import NS3BaseNode
+        nodes = self.get_connected(NS3BaseNode.get_rtype())
+
+        if not nodes: 
+            msg = "Device not connected to node"
+            self.error(msg)
+            raise RuntimeError, msg
+
+        return nodes[0]
+
+    @property
+    def _rms_to_wait(self):
+        # Wait for all network devices connected to the node to be ready
+        # before configuring the routes, else the route might refer to a
+        # non yet existing interface
+
+        rms = set()
+        rms.update(self.node.devices)
+        return rms
+
+    def _instantiate_object(self):
+        pass
+
+    def _configure_object(self):
+        network = self.get("network")
+        prefix = self.get("prefix")
+        nexthop = self.get("nexthop")
+        ipv4_uuid = self.node.ipv4.uuid
+
+        ret = self.simulation.invoke(ipv4_uuid, "addStaticRoute", network, 
+            prefix, nexthop)
+
+        if not ret: 
+            msg = "Could not configure route %s/%s hop: %s" % (network, prefix, 
+                    nexthop)
+            self.error(msg)
+            raise RuntimeError, msg
+
+    def _connect_object(self):
+        node = self.node
+        if node and node.uuid not in self.connected:
+            self._connected.add(node.uuid)
+
index 69e2b86..b7ed192 100644 (file)
@@ -28,6 +28,7 @@ SINGLETON = "singleton::"
 SIMULATOR_UUID = "singleton::Simulator"
 CONFIG_UUID = "singleton::Config"
 GLOBAL_VALUE_UUID = "singleton::GlobalValue"
+IPV4_GLOBAL_ROUTING_HELPER_UUID = "singleton::Ipv4GlobalRoutingHelper"
 
 def load_ns3_module():
     import ctypes
index 458af49..81bf5f9 100644 (file)
@@ -206,78 +206,6 @@ def eintr_retry(func):
             return func(*p, **kw)
     return rv
 
-def socat(local_socket_name, remote_socket_name,
-        host, user,
-        port = None, 
-        agent = True,
-        sudo = False,
-        identity = None,
-        server_key = None,
-        env = None,
-        tty = False,
-        connect_timeout = 30,
-        retry = 3,
-        strict_host_checking = True):
-    """
-    Executes a remote command, returns ((stdout,stderr),process)
-    """
-    
-    tmp_known_hosts = None
-    hostip = gethostbyname(host)
-
-
-    args = ["socat"]
-    args.append("UNIX-LISTEN:%s,unlink-early,fork" % local_socket_name)
-
-    ssh_args = ['ssh', '-C',
-            # Don't bother with localhost. Makes test easier
-            '-o', 'NoHostAuthenticationForLocalhost=yes',
-            '-o', 'ConnectTimeout=%d' % (int(connect_timeout),),
-            '-o', 'ConnectionAttempts=3',
-            '-o', 'ServerAliveInterval=30',
-            '-o', 'TCPKeepAlive=yes',
-            '-l', user, hostip or host]
-
-    if not strict_host_checking:
-        # Do not check for Host key. Unsafe.
-        ssh_args.extend(['-o', 'StrictHostKeyChecking=no'])
-
-    if agent:
-        ssh_args.append('-A')
-
-    if port:
-        ssh_args.append('-p%d' % port)
-
-    if identity:
-        ssh_args.extend(('-i', identity))
-
-    if tty:
-        ssh_args.append('-t')
-        ssh_args.append('-t')
-
-    if server_key:
-        # Create a temporary server key file
-        tmp_known_hosts = make_server_key_args(server_key, host, port)
-        ssh_args.extend(['-o', 'UserKnownHostsFile=%s' % (tmp_known_hosts.name,)])
-
-    ssh_cmd = " ".join(ssh_args)
-
-    exec_cmd = "EXEC:'%s socat STDIO UNIX-CONNECT\:%s'" % (ssh_cmd, 
-            remote_socket_name)
-
-    args.append(exec_cmd)
-    
-    log_msg = " socat - host %s - command %s " % (host, " ".join(args))
-
-    return _retry_rexec(args, log_msg, 
-            stdout = None,
-            stdin = None,
-            stderr = None,
-            env = env, 
-            retry = retry, 
-            tmp_known_hosts = tmp_known_hosts,
-            blocking = False)
-
 def rexec(command, host, user, 
         port = None, 
         agent = True,
index afe7586..8fad928 100644 (file)
@@ -44,7 +44,7 @@ class DummySimulation(object):
         self.node = dict({'hostname': 'localhost'})
 
     @property
-    def local_socket(self):
+    def remote_socket(self):
         return self.socket_name
 
 class LinuxNS3ClientTest(unittest.TestCase):
index 030422f..25a11b2 100644 (file)
@@ -51,10 +51,12 @@ def add_ns3_node(ec, simu):
 
     return node
 
-def add_point2point_device(ec, node, address, prefix):
+def add_point2point_device(ec, node, address = None,  prefix = None):
     dev = ec.register_resource("ns3::PointToPointNetDevice")
-    ec.set(dev, "ip", address)
-    ec.set(dev, "prefix", prefix)
+    if address:
+       ec.set(dev, "ip", address)
+    if prefix:
+       ec.set(dev, "prefix", prefix)
     ec.register_connection(node, dev)
 
     queue = ec.register_resource("ns3::DropTailQueue")
@@ -62,10 +64,12 @@ def add_point2point_device(ec, node, address, prefix):
 
     return dev
 
-def add_csma_device(ec, node, address, prefix):
+def add_csma_device(ec, node, address = None, prefix = None):
     dev = ec.register_resource("ns3::CsmaNetDevice")
-    ec.set(dev, "ip", address)
-    ec.set(dev, "prefix", prefix)
+    if address:
+        ec.set(dev, "ip", address)
+    if prefix:
+        ec.set(dev, "prefix", prefix)
     ec.register_connection(node, dev)
 
     queue = ec.register_resource("ns3::DropTailQueue")
@@ -73,11 +77,13 @@ def add_csma_device(ec, node, address, prefix):
 
     return dev
 
-def add_wifi_device(ec, node, address, prefix
+def add_wifi_device(ec, node, address = None, prefix = None
         access_point = False):
     dev = ec.register_resource("ns3::WifiNetDevice")
-    ec.set(dev, "ip", address)
-    ec.set(dev, "prefix", prefix)
+    if address:
+        ec.set(dev, "ip", address)
+    if prefix:
+        ec.set(dev, "prefix", prefix)
     ec.register_connection(node, dev)
 
     phy = ec.register_resource("ns3::YansWifiPhy")
@@ -577,30 +583,30 @@ class LinuxNS3ClientTest(unittest.TestCase):
 
         # Add routes - n1 - n6
         r1 = ec.register_resource("ns3::Route")
-        ec.set(r1, "Network", "10.0.2.0")
-        ec.set(r1, "Prefix", "30")
-        ec.set(r1, "Nexthop", "10.0.0.2")
+        ec.set(r1, "network", "10.0.2.0")
+        ec.set(r1, "prefix", "30")
+        ec.set(r1, "nexthop", "10.0.0.2")
         ec.register_connection(r1, nsnode1)
 
         # Add routes - n2 - n6
         r2 = ec.register_resource("ns3::Route")
-        ec.set(r2, "Network", "10.0.2.0")
-        ec.set(r2, "Prefix", "30")
-        ec.set(r2, "Nexthop", "10.0.1.4")
+        ec.set(r2, "network", "10.0.2.0")
+        ec.set(r2, "prefix", "30")
+        ec.set(r2, "nexthop", "10.0.1.4")
         ec.register_connection(r2, nsnode2)
 
         # Add routes - n5 - n1
         r5 = ec.register_resource("ns3::Route")
-        ec.set(r5, "Network", "10.0.0.0")
-        ec.set(r5, "Prefix", "30")
-        ec.set(r5, "Nexthop", "10.0.1.1")
+        ec.set(r5, "network", "10.0.0.0")
+        ec.set(r5, "prefix", "30")
+        ec.set(r5, "nexthop", "10.0.1.1")
         ec.register_connection(r5, nsnode5)
 
         # Add routes - n6 - n1
         r6 = ec.register_resource("ns3::Route")
-        ec.set(r6, "Network", "10.0.0.0")
-        ec.set(r6, "Prefix", "30")
-        ec.set(r6, "Nexthop", "10.0.2.1")
+        ec.set(r6, "network", "10.0.0.0")
+        ec.set(r6, "prefix", "30")
+        ec.set(r6, "nexthop", "10.0.2.1")
         ec.register_connection(r6, nsnode6)
 
         ### create pinger
@@ -623,6 +629,93 @@ class LinuxNS3ClientTest(unittest.TestCase):
 
         ec.shutdown()
 
+    def ztest_automatic_routing(self):
+        """ 
+        network topology:
+                                n4
+                                |
+           n1 -- p2p -- n2 -- csma -- n5 -- p2p -- n6
+           |                    | 
+           ping n6              n3
+           
+
+        """
+        ec = ExperimentController(exp_id = "test-ns3-auto-routes")
+        
+        node = ec.register_resource("LinuxNode")
+        ec.set(node, "hostname", self.fedora_host)
+        ec.set(node, "username", self.fedora_user)
+        ec.set(node, "identity", self.fedora_identity)
+        ec.set(node, "cleanProcesses", True)
+        #ec.set(node, "cleanHome", True)
+
+        simu = ec.register_resource("LinuxNS3Simulation")
+        ec.set(simu, "verbose", True)
+        ec.set(simu, "populateRoutingTables", True)
+        ec.register_connection(simu, node)
+
+        nsnode1 = add_ns3_node(ec, simu)
+        p2p12 = add_point2point_device(ec, nsnode1, "10.0.0.1", "30")
+
+        nsnode2 = add_ns3_node(ec, simu)
+        p2p21 = add_point2point_device(ec, nsnode2, "10.0.0.2", "30")
+        csma2 = add_csma_device(ec, nsnode2, "10.0.1.1", "24")
+
+        nsnode3 = add_ns3_node(ec, simu)
+        csma3 = add_csma_device(ec, nsnode3, "10.0.1.2", "24")
+
+        nsnode4 = add_ns3_node(ec, simu)
+        csma4 = add_csma_device(ec, nsnode4, "10.0.1.3", "24")
+
+        nsnode5 = add_ns3_node(ec, simu)
+        p2p56 = add_point2point_device(ec, nsnode5, "10.0.2.1", "30")
+        csma5 = add_csma_device(ec, nsnode5, "10.0.1.4", "24")
+
+        nsnode6 = add_ns3_node(ec, simu)
+        p2p65 = add_point2point_device(ec, nsnode6, "10.0.2.2", "30")
+
+        # P2P chan1
+        p2p_chan1 = ec.register_resource("ns3::PointToPointChannel")
+        ec.set(p2p_chan1, "Delay", "0s")
+        ec.register_connection(p2p_chan1, p2p12)
+        ec.register_connection(p2p_chan1, p2p21)
+
+        # CSMA chan
+        csma_chan = ec.register_resource("ns3::CsmaChannel")
+        ec.set(csma_chan, "Delay", "0s")
+        ec.register_connection(csma_chan, csma2)
+        ec.register_connection(csma_chan, csma3)
+        ec.register_connection(csma_chan, csma4)
+        ec.register_connection(csma_chan, csma5)
+
+        # P2P chan2
+        p2p_chan2 = ec.register_resource("ns3::PointToPointChannel")
+        ec.set(p2p_chan2, "Delay", "0s")
+        ec.register_connection(p2p_chan2, p2p56)
+        ec.register_connection(p2p_chan2, p2p65)
+
+        ### create pinger
+        ping = ec.register_resource("ns3::V4Ping")
+        ec.set (ping, "Remote", "10.0.1.2")
+        ec.set (ping, "Interval", "1s")
+        ec.set (ping, "Verbose", True)
+        ec.set (ping, "StartTime", "1s")
+        ec.set (ping, "StopTime", "21s")
+        ec.register_connection(ping, nsnode1)
+
+        ec.deploy()
+
+        ec.wait_finished([ping])
+        
+        stdout = ec.trace(simu, "stdout")
+
+        print stdout
+
+        expected = "20 packets transmitted, 20 received, 0% packet loss"
+        self.assertTrue(stdout.find(expected) > -1)
+
+        ec.shutdown()
+
 
 if __name__ == '__main__':
     unittest.main()