From: Alina Quereilhac Date: Mon, 26 May 2014 09:26:07 +0000 (+0200) Subject: Fixes ns-3/DCE X-Git-Tag: nepi-3.1.0~72 X-Git-Url: http://git.onelab.eu/?p=nepi.git;a=commitdiff_plain;h=a7e76f2c5b9646f44e5cbf6c558ed08b5b73ce28 Fixes ns-3/DCE --- diff --git a/src/nepi/resources/linux/ns3/ns3client.py b/src/nepi/resources/linux/ns3/ns3client.py index 882c1f35..2d98a1ba 100644 --- a/src/nepi/resources/linux/ns3/ns3client.py +++ b/src/nepi/resources/linux/ns3/ns3client.py @@ -70,11 +70,12 @@ class LinuxNS3Client(NS3Client): "socket_addr": self.simulation.remote_socket, } - (reply, err), proc = self.simulation.node.execute(command) + (reply, err), proc = self.simulation.node.execute(command) if (err and proc.poll()) or reply.strip() == "": - msg = " Couldn't connect to remote socket %s" % ( - self.simulation.remote_socket) + msg = (" Couldn't connect to remote socket %s - REPLY: %s " + "- ERROR: %s ") % ( + self.simulation.remote_socket, reply, err) self.simulation.error(msg, reply, err) raise RuntimeError(msg) diff --git a/src/nepi/resources/linux/ns3/ns3dceapplication.py b/src/nepi/resources/linux/ns3/ns3dceapplication.py index ca32b6f9..8d197b9a 100644 --- a/src/nepi/resources/linux/ns3/ns3dceapplication.py +++ b/src/nepi/resources/linux/ns3/ns3dceapplication.py @@ -45,34 +45,9 @@ class NS3LinuxDceApplication(NS3BaseDceApplication): "Space-separated list of packages required to run the application", flags = Flags.Design) - files = Attribute("files", - "Semi-colon separated list of 'key=value' pairs to set as " - "DCE files (AddFile). The key should be a path to a local file " - "and the key is the path to be set in DCE for that file" , - flags = Flags.Design) - - stdinfile = Attribute("stdinFile", - "File to set as StdinFile. The value shoudl be either an empty " - "or a path to a local file ", - flags = Flags.Design) - - starttime = Attribute("StartTime", - "Time at which the application will start", - default = "+0.0ns", - flags = Flags.Reserved | Flags.Construct) - - stoptime = Attribute("StopTime", - "Time at which the application will stop", - default = "+0.0ns", - flags = Flags.Reserved | Flags.Construct) - cls._register_attribute(sources) cls._register_attribute(build) cls._register_attribute(depends) - cls._register_attribute(files) - cls._register_attribute(stoptime) - cls._register_attribute(starttime) - cls._register_attribute(stdinfile) def _instantiate_object(self): command = [] @@ -91,29 +66,6 @@ class NS3LinuxDceApplication(NS3BaseDceApplication): if scmd: command.append(scmd) - # Upload files to the remote machine. These files will - # be added to the DceApplication by invoking dce.AddFile() - files = self.get("files") or "" - if files: - upfiles = [] - for files in map(str.strip, files.split(";")): - localpath, dcepath = env.split("=") - upfiles.append(localpath) - - if upfiles: - fcmd = self.siumlation.upload_files(files = upfiles) - if fcmd: - command.append(fcmd) - - # Upload files to the remote machine. These files will - # be added to the DceApplication by invoking dce.AddFile() - stdinfile = self.get("stdinFile") - if stdinfile and stdinfile != "": - stdincmd = self.siumlation.upload_files(files = stdinfile) - if stdincmd: - command.append(stdincmd) - - # Upload instructions to build the binary build = self.get("build") if build: diff --git a/src/nepi/resources/linux/ns3/ns3simulation.py b/src/nepi/resources/linux/ns3/ns3simulation.py index 9e1ee51f..e026bb81 100644 --- a/src/nepi/resources/linux/ns3/ns3simulation.py +++ b/src/nepi/resources/linux/ns3/ns3simulation.py @@ -32,6 +32,9 @@ import os import time import threading +## TODO: Clean up DCE part. All that is DCE specific should go +## in the linux ns3dceapplication.py + @clsinit_copy class LinuxNS3Simulation(LinuxApplication, NS3Simulation): _rtype = "LinuxNS3Simulation" diff --git a/src/nepi/resources/ns3/classes/aarf_wifi_manager.py b/src/nepi/resources/ns3/classes/aarf_wifi_manager.py index d737f3ae..d78d93de 100644 --- a/src/nepi/resources/ns3/classes/aarf_wifi_manager.py +++ b/src/nepi/resources/ns3/classes/aarf_wifi_manager.py @@ -110,7 +110,7 @@ class NS3AarfWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_maxslrc) attr_rtsctsthreshold = Attribute("RtsCtsThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, @@ -120,7 +120,7 @@ class NS3AarfWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_rtsctsthreshold) attr_fragmentationthreshold = Attribute("FragmentationThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, diff --git a/src/nepi/resources/ns3/classes/aarfcd_wifi_manager.py b/src/nepi/resources/ns3/classes/aarfcd_wifi_manager.py index 625662f7..57aa02fd 100644 --- a/src/nepi/resources/ns3/classes/aarfcd_wifi_manager.py +++ b/src/nepi/resources/ns3/classes/aarfcd_wifi_manager.py @@ -150,7 +150,7 @@ class NS3AarfcdWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_maxslrc) attr_rtsctsthreshold = Attribute("RtsCtsThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, @@ -160,7 +160,7 @@ class NS3AarfcdWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_rtsctsthreshold) attr_fragmentationthreshold = Attribute("FragmentationThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, diff --git a/src/nepi/resources/ns3/classes/amrr_wifi_manager.py b/src/nepi/resources/ns3/classes/amrr_wifi_manager.py index dfb13f45..99c1f9ae 100644 --- a/src/nepi/resources/ns3/classes/amrr_wifi_manager.py +++ b/src/nepi/resources/ns3/classes/amrr_wifi_manager.py @@ -110,7 +110,7 @@ class NS3AmrrWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_maxslrc) attr_rtsctsthreshold = Attribute("RtsCtsThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, @@ -120,7 +120,7 @@ class NS3AmrrWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_rtsctsthreshold) attr_fragmentationthreshold = Attribute("FragmentationThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, diff --git a/src/nepi/resources/ns3/classes/arf_wifi_manager.py b/src/nepi/resources/ns3/classes/arf_wifi_manager.py index 9714846a..577d0911 100644 --- a/src/nepi/resources/ns3/classes/arf_wifi_manager.py +++ b/src/nepi/resources/ns3/classes/arf_wifi_manager.py @@ -80,7 +80,7 @@ class NS3ArfWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_maxslrc) attr_rtsctsthreshold = Attribute("RtsCtsThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, @@ -90,7 +90,7 @@ class NS3ArfWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_rtsctsthreshold) attr_fragmentationthreshold = Attribute("FragmentationThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, diff --git a/src/nepi/resources/ns3/classes/binary_error_model.py b/src/nepi/resources/ns3/classes/binary_error_model.py new file mode 100644 index 00000000..9b6b2b80 --- /dev/null +++ b/src/nepi/resources/ns3/classes/binary_error_model.py @@ -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 . +# + +from nepi.execution.attribute import Attribute, Flags, Types +from nepi.execution.trace import Trace, TraceAttr +from nepi.execution.resource import ResourceManager, clsinit_copy, \ + ResourceState, reschedule_delay +from nepi.resources.ns3.ns3errormodel import NS3BaseErrorModel + +@clsinit_copy +class NS3BinaryErrorModel(NS3BaseErrorModel): + _rtype = "ns3::BinaryErrorModel" + + @classmethod + def _register_attributes(cls): + + attr_isenabled = Attribute("IsEnabled", + "Whether this ErrorModel is enabled or not.", + type = Types.Bool, + default = "True", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_isenabled) + + + + @classmethod + def _register_traces(cls): + pass + + def __init__(self, ec, guid): + super(NS3BinaryErrorModel, self).__init__(ec, guid) + self._home = "ns3-binary-error-model-%s" % self.guid diff --git a/src/nepi/resources/ns3/classes/binary_error_sixlow_model.py b/src/nepi/resources/ns3/classes/binary_error_sixlow_model.py new file mode 100644 index 00000000..ba3f2417 --- /dev/null +++ b/src/nepi/resources/ns3/classes/binary_error_sixlow_model.py @@ -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 . +# + +from nepi.execution.attribute import Attribute, Flags, Types +from nepi.execution.trace import Trace, TraceAttr +from nepi.execution.resource import ResourceManager, clsinit_copy, \ + ResourceState, reschedule_delay +from nepi.resources.ns3.ns3errormodel import NS3BaseErrorModel + +@clsinit_copy +class NS3BinaryErrorSixlowModel(NS3BaseErrorModel): + _rtype = "ns3::BinaryErrorSixlowModel" + + @classmethod + def _register_attributes(cls): + + attr_isenabled = Attribute("IsEnabled", + "Whether this ErrorModel is enabled or not.", + type = Types.Bool, + default = "True", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_isenabled) + + + + @classmethod + def _register_traces(cls): + pass + + def __init__(self, ec, guid): + super(NS3BinaryErrorSixlowModel, self).__init__(ec, guid) + self._home = "ns3-binary-error-sixlow-model-%s" % self.guid diff --git a/src/nepi/resources/ns3/classes/cara_wifi_manager.py b/src/nepi/resources/ns3/classes/cara_wifi_manager.py index 8f336f1d..35df2557 100644 --- a/src/nepi/resources/ns3/classes/cara_wifi_manager.py +++ b/src/nepi/resources/ns3/classes/cara_wifi_manager.py @@ -100,7 +100,7 @@ class NS3CaraWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_maxslrc) attr_rtsctsthreshold = Attribute("RtsCtsThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, @@ -110,7 +110,7 @@ class NS3CaraWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_rtsctsthreshold) attr_fragmentationthreshold = Attribute("FragmentationThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, diff --git a/src/nepi/resources/ns3/classes/constant_rate_wifi_manager.py b/src/nepi/resources/ns3/classes/constant_rate_wifi_manager.py index decba326..7d81a743 100644 --- a/src/nepi/resources/ns3/classes/constant_rate_wifi_manager.py +++ b/src/nepi/resources/ns3/classes/constant_rate_wifi_manager.py @@ -80,7 +80,7 @@ class NS3ConstantRateWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_maxslrc) attr_rtsctsthreshold = Attribute("RtsCtsThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, @@ -90,7 +90,7 @@ class NS3ConstantRateWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_rtsctsthreshold) attr_fragmentationthreshold = Attribute("FragmentationThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, diff --git a/src/nepi/resources/ns3/classes/error_channel_sixlow.py b/src/nepi/resources/ns3/classes/error_channel_sixlow.py new file mode 100644 index 00000000..3e679151 --- /dev/null +++ b/src/nepi/resources/ns3/classes/error_channel_sixlow.py @@ -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 . +# + +from nepi.execution.attribute import Attribute, Flags, Types +from nepi.execution.trace import Trace, TraceAttr +from nepi.execution.resource import ResourceManager, clsinit_copy, \ + ResourceState, reschedule_delay +from nepi.resources.ns3.ns3channel import NS3BaseChannel + +@clsinit_copy +class NS3ErrorChannelSixlow(NS3BaseChannel): + _rtype = "ns3::ErrorChannelSixlow" + + @classmethod + def _register_attributes(cls): + + attr_id = Attribute("Id", + "The id (unique integer) of this Channel.", + type = Types.Integer, + default = "0", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.NoWrite) + + cls._register_attribute(attr_id) + + + + @classmethod + def _register_traces(cls): + pass + + def __init__(self, ec, guid): + super(NS3ErrorChannelSixlow, self).__init__(ec, guid) + self._home = "ns3-error-channel-sixlow-%s" % self.guid diff --git a/src/nepi/resources/ns3/classes/friis_propagation_loss_model.py b/src/nepi/resources/ns3/classes/friis_propagation_loss_model.py index 54d2d4f7..f8bedb44 100644 --- a/src/nepi/resources/ns3/classes/friis_propagation_loss_model.py +++ b/src/nepi/resources/ns3/classes/friis_propagation_loss_model.py @@ -49,15 +49,15 @@ class NS3FriisPropagationLossModel(NS3BasePropagationLossModel): cls._register_attribute(attr_systemloss) - attr_mindistance = Attribute("MinDistance", - "The distance under which the propagation model refuses to give results (m)", + attr_minloss = Attribute("MinLoss", + "The minimum value (dB) of the total loss, used at short ranges. Note: ", type = Types.Double, - default = "0.5", + default = "0", allowed = None, range = None, flags = Flags.Reserved | Flags.Construct) - cls._register_attribute(attr_mindistance) + cls._register_attribute(attr_minloss) diff --git a/src/nepi/resources/ns3/classes/ideal_wifi_manager.py b/src/nepi/resources/ns3/classes/ideal_wifi_manager.py index e384184b..93b19b7b 100644 --- a/src/nepi/resources/ns3/classes/ideal_wifi_manager.py +++ b/src/nepi/resources/ns3/classes/ideal_wifi_manager.py @@ -70,7 +70,7 @@ class NS3IdealWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_maxslrc) attr_rtsctsthreshold = Attribute("RtsCtsThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, @@ -80,7 +80,7 @@ class NS3IdealWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_rtsctsthreshold) attr_fragmentationthreshold = Attribute("FragmentationThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, diff --git a/src/nepi/resources/ns3/classes/itu_r1411los_propagation_loss_model.py b/src/nepi/resources/ns3/classes/itu_r1411los_propagation_loss_model.py new file mode 100644 index 00000000..ffac6539 --- /dev/null +++ b/src/nepi/resources/ns3/classes/itu_r1411los_propagation_loss_model.py @@ -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 . +# + +from nepi.execution.attribute import Attribute, Flags, Types +from nepi.execution.trace import Trace, TraceAttr +from nepi.execution.resource import ResourceManager, clsinit_copy, \ + ResourceState, reschedule_delay +from nepi.resources.ns3.ns3propagationlossmodel import NS3BasePropagationLossModel + +@clsinit_copy +class NS3ItuR1411LosPropagationLossModel(NS3BasePropagationLossModel): + _rtype = "ns3::ItuR1411LosPropagationLossModel" + + @classmethod + def _register_attributes(cls): + pass + + @classmethod + def _register_traces(cls): + pass + + def __init__(self, ec, guid): + super(NS3ItuR1411LosPropagationLossModel, self).__init__(ec, guid) + self._home = "ns3-itu-r1411los-propagation-loss-model-%s" % self.guid diff --git a/src/nepi/resources/ns3/classes/itu_r1411nlos_over_rooftop_propagation_loss_model.py b/src/nepi/resources/ns3/classes/itu_r1411nlos_over_rooftop_propagation_loss_model.py new file mode 100644 index 00000000..8496fcde --- /dev/null +++ b/src/nepi/resources/ns3/classes/itu_r1411nlos_over_rooftop_propagation_loss_model.py @@ -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 . +# + +from nepi.execution.attribute import Attribute, Flags, Types +from nepi.execution.trace import Trace, TraceAttr +from nepi.execution.resource import ResourceManager, clsinit_copy, \ + ResourceState, reschedule_delay +from nepi.resources.ns3.ns3propagationlossmodel import NS3BasePropagationLossModel + +@clsinit_copy +class NS3ItuR1411NlosOverRooftopPropagationLossModel(NS3BasePropagationLossModel): + _rtype = "ns3::ItuR1411NlosOverRooftopPropagationLossModel" + + @classmethod + def _register_attributes(cls): + + attr_environment = Attribute("Environment", + "Environment Scenario", + type = Types.Enumerate, + default = "Urban", + allowed = ["Urban","SubUrban","OpenAreas"], + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_environment) + + attr_citysize = Attribute("CitySize", + "Dimension of the city", + type = Types.Enumerate, + default = "Large", + allowed = ["Small","Medium","Large"], + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_citysize) + + attr_rooftoplevel = Attribute("RooftopLevel", + "The height of the rooftop level in meters", + type = Types.Double, + default = "20", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_rooftoplevel) + + attr_streetsorientation = Attribute("StreetsOrientation", + "The orientation of streets in degrees [0,90] with respect to the direction of propagation", + type = Types.Double, + default = "45", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_streetsorientation) + + attr_streetswidth = Attribute("StreetsWidth", + "The width of streets", + type = Types.Double, + default = "20", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_streetswidth) + + attr_buildingsextend = Attribute("BuildingsExtend", + "The distance over which the buildings extend", + type = Types.Double, + default = "80", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_buildingsextend) + + attr_buildingseparation = Attribute("BuildingSeparation", + "The separation between buildings", + type = Types.Double, + default = "50", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_buildingseparation) + + + + @classmethod + def _register_traces(cls): + pass + + def __init__(self, ec, guid): + super(NS3ItuR1411NlosOverRooftopPropagationLossModel, self).__init__(ec, guid) + self._home = "ns3-itu-r1411nlos-over-rooftop-propagation-loss-model-%s" % self.guid diff --git a/src/nepi/resources/ns3/classes/kun2600mhz_propagation_loss_model.py b/src/nepi/resources/ns3/classes/kun2600mhz_propagation_loss_model.py new file mode 100644 index 00000000..925f3cd2 --- /dev/null +++ b/src/nepi/resources/ns3/classes/kun2600mhz_propagation_loss_model.py @@ -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 . +# + +from nepi.execution.attribute import Attribute, Flags, Types +from nepi.execution.trace import Trace, TraceAttr +from nepi.execution.resource import ResourceManager, clsinit_copy, \ + ResourceState, reschedule_delay +from nepi.resources.ns3.ns3propagationlossmodel import NS3BasePropagationLossModel + +@clsinit_copy +class NS3Kun2600MhzPropagationLossModel(NS3BasePropagationLossModel): + _rtype = "ns3::Kun2600MhzPropagationLossModel" + + @classmethod + def _register_attributes(cls): + pass + + @classmethod + def _register_traces(cls): + pass + + def __init__(self, ec, guid): + super(NS3Kun2600MhzPropagationLossModel, self).__init__(ec, guid) + self._home = "ns3-kun2600mhz-propagation-loss-model-%s" % self.guid diff --git a/src/nepi/resources/ns3/classes/lte_enb_net_device.py b/src/nepi/resources/ns3/classes/lte_enb_net_device.py index f1ac832b..0184c10e 100644 --- a/src/nepi/resources/ns3/classes/lte_enb_net_device.py +++ b/src/nepi/resources/ns3/classes/lte_enb_net_device.py @@ -79,6 +79,26 @@ class NS3LteEnbNetDevice(NS3BaseNetDevice): cls._register_attribute(attr_ulearfcn) + attr_csgid = Attribute("CsgId", + "The Closed Subscriber Group (CSG) identity that this eNodeB belongs to", + type = Types.Integer, + default = "0", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_csgid) + + attr_csgindication = Attribute("CsgIndication", + "If true, only UEs which are members of the CSG (i.e. same CSG ID) can gain access to the eNodeB, therefore enforcing closed access mode. Otherwise, the eNodeB operates as a non-CSG cell and implements open access mode.", + type = Types.Bool, + default = "False", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_csgindication) + attr_mtu = Attribute("Mtu", "The MAC-level Maximum Transmission Unit", type = Types.Integer, diff --git a/src/nepi/resources/ns3/classes/lte_ue_net_device.py b/src/nepi/resources/ns3/classes/lte_ue_net_device.py new file mode 100644 index 00000000..ba6ed701 --- /dev/null +++ b/src/nepi/resources/ns3/classes/lte_ue_net_device.py @@ -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 . +# + +from nepi.execution.attribute import Attribute, Flags, Types +from nepi.execution.trace import Trace, TraceAttr +from nepi.execution.resource import ResourceManager, clsinit_copy, \ + ResourceState, reschedule_delay +from nepi.resources.ns3.ns3netdevice import NS3BaseNetDevice + +@clsinit_copy +class NS3LteUeNetDevice(NS3BaseNetDevice): + _rtype = "ns3::LteUeNetDevice" + + @classmethod + def _register_attributes(cls): + + attr_imsi = Attribute("Imsi", + "International Mobile Subscriber Identity assigned to this UE", + type = Types.Integer, + default = "0", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_imsi) + + attr_dlearfcn = Attribute("DlEarfcn", + "Downlink E-UTRA Absolute Radio Frequency Channel Number (EARFCN) as per 3GPP 36.101 Section 5.7.3. ", + type = Types.Integer, + default = "100", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_dlearfcn) + + attr_csgid = Attribute("CsgId", + "The Closed Subscriber Group (CSG) identity that this UE is associated with, i.e., giving the UE access to cells which belong to this particular CSG. This restriction only applies to initial cell selection and EPC-enabled simulation. This does not revoke the UE\'s access to non-CSG cells. ", + type = Types.Integer, + default = "0", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_csgid) + + attr_mtu = Attribute("Mtu", + "The MAC-level Maximum Transmission Unit", + type = Types.Integer, + default = "30000", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_mtu) + + + + @classmethod + def _register_traces(cls): + pass + + def __init__(self, ec, guid): + super(NS3LteUeNetDevice, self).__init__(ec, guid) + self._home = "ns3-lte-ue-net-device-%s" % self.guid diff --git a/src/nepi/resources/ns3/classes/minstrel_wifi_manager.py b/src/nepi/resources/ns3/classes/minstrel_wifi_manager.py index 38186454..2ebdc02e 100644 --- a/src/nepi/resources/ns3/classes/minstrel_wifi_manager.py +++ b/src/nepi/resources/ns3/classes/minstrel_wifi_manager.py @@ -110,7 +110,7 @@ class NS3MinstrelWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_maxslrc) attr_rtsctsthreshold = Attribute("RtsCtsThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, @@ -120,7 +120,7 @@ class NS3MinstrelWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_rtsctsthreshold) attr_fragmentationthreshold = Attribute("FragmentationThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, diff --git a/src/nepi/resources/ns3/classes/ocb_wifi_mac.py b/src/nepi/resources/ns3/classes/ocb_wifi_mac.py new file mode 100644 index 00000000..cdb1ebc1 --- /dev/null +++ b/src/nepi/resources/ns3/classes/ocb_wifi_mac.py @@ -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 . +# + +from nepi.execution.attribute import Attribute, Flags, Types +from nepi.execution.trace import Trace, TraceAttr +from nepi.execution.resource import ResourceManager, clsinit_copy, \ + ResourceState, reschedule_delay +from nepi.resources.ns3.ns3wifimac import NS3BaseWifiMac + +@clsinit_copy +class NS3OcbWifiMac(NS3BaseWifiMac): + _rtype = "ns3::OcbWifiMac" + + @classmethod + def _register_attributes(cls): + + attr_qossupported = Attribute("QosSupported", + "This Boolean attribute is set to enable 802.11e/WMM-style QoS support at this STA", + type = Types.Bool, + default = "False", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_qossupported) + + attr_htsupported = Attribute("HtSupported", + "This Boolean attribute is set to enable 802.11n support at this STA", + type = Types.Bool, + default = "False", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_htsupported) + + attr_ctstoselfsupported = Attribute("CtsToSelfSupported", + "Use CTS to Self when using a rate that is not in the basic set rate", + type = Types.Bool, + default = "False", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_ctstoselfsupported) + + attr_ctstimeout = Attribute("CtsTimeout", + "When this timeout expires, the RTS/CTS handshake has failed.", + type = Types.String, + default = "+75000.0ns", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_ctstimeout) + + attr_acktimeout = Attribute("AckTimeout", + "When this timeout expires, the DATA/ACK handshake has failed.", + type = Types.String, + default = "+75000.0ns", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_acktimeout) + + attr_basicblockacktimeout = Attribute("BasicBlockAckTimeout", + "When this timeout expires, the BASIC_BLOCK_ACK_REQ/BASIC_BLOCK_ACK handshake has failed.", + type = Types.String, + default = "+281000.0ns", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_basicblockacktimeout) + + attr_compressedblockacktimeout = Attribute("CompressedBlockAckTimeout", + "When this timeout expires, the COMPRESSED_BLOCK_ACK_REQ/COMPRESSED_BLOCK_ACK handshake has failed.", + type = Types.String, + default = "+107000.0ns", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_compressedblockacktimeout) + + attr_sifs = Attribute("Sifs", + "The value of the SIFS constant.", + type = Types.String, + default = "+16000.0ns", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_sifs) + + attr_eifsnodifs = Attribute("EifsNoDifs", + "The value of EIFS-DIFS", + type = Types.String, + default = "+60000.0ns", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_eifsnodifs) + + attr_slot = Attribute("Slot", + "The duration of a Slot.", + type = Types.String, + default = "+9000.0ns", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_slot) + + attr_pifs = Attribute("Pifs", + "The value of the PIFS constant.", + type = Types.String, + default = "+25000.0ns", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_pifs) + + attr_rifs = Attribute("Rifs", + "The value of the RIFS constant.", + type = Types.String, + default = "+2000.0ns", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_rifs) + + attr_maxpropagationdelay = Attribute("MaxPropagationDelay", + "The maximum propagation delay. Unused for now.", + type = Types.String, + default = "+3333.0ns", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_maxpropagationdelay) + + attr_ssid = Attribute("Ssid", + "The ssid we want to belong to.", + type = Types.String, + default = "default", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_ssid) + + + + @classmethod + def _register_traces(cls): + + txokheader = Trace("TxOkHeader", "The header of successfully transmitted packet") + + cls._register_trace(txokheader) + + txerrheader = Trace("TxErrHeader", "The header of unsuccessfully transmitted packet") + + cls._register_trace(txerrheader) + + mactx = Trace("MacTx", "A packet has been received from higher layers and is being processed in preparation for queueing for transmission.") + + cls._register_trace(mactx) + + mactxdrop = Trace("MacTxDrop", "A packet has been dropped in the MAC layer before being queued for transmission.") + + cls._register_trace(mactxdrop) + + macpromiscrx = Trace("MacPromiscRx", "A packet has been received by this device, has been passed up from the physical layer and is being forwarded up the local protocol stack. This is a promiscuous trace,") + + cls._register_trace(macpromiscrx) + + macrx = Trace("MacRx", "A packet has been received by this device, has been passed up from the physical layer and is being forwarded up the local protocol stack. This is a non-promiscuous trace,") + + cls._register_trace(macrx) + + macrxdrop = Trace("MacRxDrop", "A packet has been dropped in the MAC layer after it has been passed up from the physical layer.") + + cls._register_trace(macrxdrop) + + + + def __init__(self, ec, guid): + super(NS3OcbWifiMac, self).__init__(ec, guid) + self._home = "ns3-ocb-wifi-mac-%s" % self.guid diff --git a/src/nepi/resources/ns3/classes/okumura_hata_propagation_loss_model.py b/src/nepi/resources/ns3/classes/okumura_hata_propagation_loss_model.py new file mode 100644 index 00000000..ec267774 --- /dev/null +++ b/src/nepi/resources/ns3/classes/okumura_hata_propagation_loss_model.py @@ -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 . +# + +from nepi.execution.attribute import Attribute, Flags, Types +from nepi.execution.trace import Trace, TraceAttr +from nepi.execution.resource import ResourceManager, clsinit_copy, \ + ResourceState, reschedule_delay +from nepi.resources.ns3.ns3propagationlossmodel import NS3BasePropagationLossModel + +@clsinit_copy +class NS3OkumuraHataPropagationLossModel(NS3BasePropagationLossModel): + _rtype = "ns3::OkumuraHataPropagationLossModel" + + @classmethod + def _register_attributes(cls): + + attr_frequency = Attribute("Frequency", + "The propagation frequency in Hz", + type = Types.Double, + default = "2.16e+09", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_frequency) + + attr_environment = Attribute("Environment", + "Environment Scenario", + type = Types.Enumerate, + default = "Urban", + allowed = ["Urban","SubUrban","OpenAreas"], + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_environment) + + attr_citysize = Attribute("CitySize", + "Dimension of the city", + type = Types.Enumerate, + default = "Large", + allowed = ["Small","Medium","Large"], + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_citysize) + + + + @classmethod + def _register_traces(cls): + pass + + def __init__(self, ec, guid): + super(NS3OkumuraHataPropagationLossModel, self).__init__(ec, guid) + self._home = "ns3-okumura-hata-propagation-loss-model-%s" % self.guid diff --git a/src/nepi/resources/ns3/classes/onoe_wifi_manager.py b/src/nepi/resources/ns3/classes/onoe_wifi_manager.py index 606b3e87..f01a090c 100644 --- a/src/nepi/resources/ns3/classes/onoe_wifi_manager.py +++ b/src/nepi/resources/ns3/classes/onoe_wifi_manager.py @@ -90,7 +90,7 @@ class NS3OnoeWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_maxslrc) attr_rtsctsthreshold = Attribute("RtsCtsThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, @@ -100,7 +100,7 @@ class NS3OnoeWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_rtsctsthreshold) attr_fragmentationthreshold = Attribute("FragmentationThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, diff --git a/src/nepi/resources/ns3/classes/ping6.py b/src/nepi/resources/ns3/classes/ping6.py index 79865324..c1af6438 100644 --- a/src/nepi/resources/ns3/classes/ping6.py +++ b/src/nepi/resources/ns3/classes/ping6.py @@ -52,7 +52,7 @@ class NS3Ping6(NS3BaseApplication): attr_remoteipv6 = Attribute("RemoteIpv6", "The Ipv6Address of the outbound packets", type = Types.String, - default = "0000:0000:0000:0000:0000:0000:0000:0000", + default = "::", allowed = None, range = None, flags = Flags.Reserved | Flags.Construct) @@ -62,7 +62,7 @@ class NS3Ping6(NS3BaseApplication): attr_localipv6 = Attribute("LocalIpv6", "Local Ipv6Address of the sender", type = Types.String, - default = "0000:0000:0000:0000:0000:0000:0000:0000", + default = "::", allowed = None, range = None, flags = Flags.Reserved | Flags.Construct) diff --git a/src/nepi/resources/ns3/classes/rraa_wifi_manager.py b/src/nepi/resources/ns3/classes/rraa_wifi_manager.py index 1553b8a1..bfae1062 100644 --- a/src/nepi/resources/ns3/classes/rraa_wifi_manager.py +++ b/src/nepi/resources/ns3/classes/rraa_wifi_manager.py @@ -300,7 +300,7 @@ class NS3RraaWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_maxslrc) attr_rtsctsthreshold = Attribute("RtsCtsThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, @@ -310,7 +310,7 @@ class NS3RraaWifiManager(NS3BaseWifiRemoteStationManager): cls._register_attribute(attr_rtsctsthreshold) attr_fragmentationthreshold = Attribute("FragmentationThreshold", - "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2007, Section 9.4. This value will not have any effect on some rate control algorithms.", + "If the size of the data packet + LLC header + MAC header + FCS trailer is biggerthan this value, we fragment it such that the size of the fragments are equal or smaller than this value, as per IEEE Std. 802.11-2012, Section 9.5. This value will not have any effect on some rate control algorithms.", type = Types.Integer, default = "2346", allowed = None, diff --git a/src/nepi/resources/ns3/classes/six_low_pan_net_device.py b/src/nepi/resources/ns3/classes/six_low_pan_net_device.py new file mode 100644 index 00000000..842e20ea --- /dev/null +++ b/src/nepi/resources/ns3/classes/six_low_pan_net_device.py @@ -0,0 +1,123 @@ +# +# 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 . +# + +from nepi.execution.attribute import Attribute, Flags, Types +from nepi.execution.trace import Trace, TraceAttr +from nepi.execution.resource import ResourceManager, clsinit_copy, \ + ResourceState, reschedule_delay +from nepi.resources.ns3.ns3netdevice import NS3BaseNetDevice + +@clsinit_copy +class NS3SixLowPanNetDevice(NS3BaseNetDevice): + _rtype = "ns3::SixLowPanNetDevice" + + @classmethod + def _register_attributes(cls): + + attr_rfc6282 = Attribute("Rfc6282", + "Use RFC6282 (IPHC) if true, RFC4944 (HC1) otherwise.", + type = Types.Bool, + default = "True", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_rfc6282) + + attr_omitudpchecksum = Attribute("OmitUdpChecksum", + "Omit the UDP checksum in IPHC compression.", + type = Types.Bool, + default = "True", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_omitudpchecksum) + + attr_fragmentreassemblylistsize = Attribute("FragmentReassemblyListSize", + "The maximum size of the reassembly buffer (in packets). Zero meaning infinite.", + type = Types.Integer, + default = "0", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_fragmentreassemblylistsize) + + attr_fragmentexpirationtimeout = Attribute("FragmentExpirationTimeout", + "When this timeout expires, the fragments will be cleared from the buffer.", + type = Types.String, + default = "+60000000000.0ns", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_fragmentexpirationtimeout) + + attr_compressionthreshold = Attribute("CompressionThreshold", + "The minimum MAC layer payload size.", + type = Types.Integer, + default = "0", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_compressionthreshold) + + attr_forceethertype = Attribute("ForceEtherType", + "Force a specific EtherType in L2 frames.", + type = Types.Bool, + default = "False", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_forceethertype) + + attr_ethertype = Attribute("EtherType", + "The specific EtherType to be used in L2 frames.", + type = Types.Integer, + default = "65535", + allowed = None, + range = None, + flags = Flags.Reserved | Flags.Construct) + + cls._register_attribute(attr_ethertype) + + + + @classmethod + def _register_traces(cls): + + tx = Trace("Tx", "Send - packet (including 6LoWPAN header), SixLoWPanNetDevice Ptr, interface index.") + + cls._register_trace(tx) + + rx = Trace("Rx", "Receive - packet (including 6LoWPAN header), SixLoWPanNetDevice Ptr, interface index.") + + cls._register_trace(rx) + + drop = Trace("Drop", "Drop - DropReason, packet (including 6LoWPAN header), SixLoWPanNetDevice Ptr, interface index.") + + cls._register_trace(drop) + + + + def __init__(self, ec, guid): + super(NS3SixLowPanNetDevice, self).__init__(ec, guid) + self._home = "ns3-six-low-pan-net-device-%s" % self.guid diff --git a/src/nepi/resources/ns3/classes/udp_trace_client.py b/src/nepi/resources/ns3/classes/udp_trace_client.py index 6263666c..26bc7b53 100644 --- a/src/nepi/resources/ns3/classes/udp_trace_client.py +++ b/src/nepi/resources/ns3/classes/udp_trace_client.py @@ -50,7 +50,7 @@ class NS3UdpTraceClient(NS3BaseApplication): cls._register_attribute(attr_remoteport) attr_maxpacketsize = Attribute("MaxPacketSize", - "The maximum size of a packet.", + "The maximum size of a packet (including the SeqTsHeader, 12 bytes).", type = Types.Integer, default = "1024", allowed = None, diff --git a/src/nepi/resources/ns3/classes/wifi_net_device.py b/src/nepi/resources/ns3/classes/wifi_net_device.py index f4f73454..92dd859b 100644 --- a/src/nepi/resources/ns3/classes/wifi_net_device.py +++ b/src/nepi/resources/ns3/classes/wifi_net_device.py @@ -20,10 +20,10 @@ 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 +from nepi.resources.ns3.ns3wifinetdevice import NS3BaseWifiNetDevice @clsinit_copy -class NS3WifiNetDevice(NS3BaseNetDevice): +class NS3WifiNetDevice(NS3BaseWifiNetDevice): _rtype = "ns3::WifiNetDevice" @classmethod diff --git a/src/nepi/resources/ns3/classes/yans_wifi_channel.py b/src/nepi/resources/ns3/classes/yans_wifi_channel.py index 325c29b9..314d391a 100644 --- a/src/nepi/resources/ns3/classes/yans_wifi_channel.py +++ b/src/nepi/resources/ns3/classes/yans_wifi_channel.py @@ -20,10 +20,10 @@ 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 +from nepi.resources.ns3.ns3wifichannel import NS3BaseWifiChannel @clsinit_copy -class NS3YansWifiChannel(NS3BaseChannel): +class NS3YansWifiChannel(NS3BaseWifiChannel): _rtype = "ns3::YansWifiChannel" @classmethod diff --git a/src/nepi/resources/ns3/ns3base.py b/src/nepi/resources/ns3/ns3base.py index 8a06e4bd..00bdbfba 100644 --- a/src/nepi/resources/ns3/ns3base.py +++ b/src/nepi/resources/ns3/ns3base.py @@ -99,7 +99,7 @@ class NS3Base(ResourceManager): def _wait_rms(self): """ Returns True if dependent RMs are not yer READY, False otherwise""" for rm in self._rms_to_wait: - if rm and rm.state < ResourceState.READY: + if rm.state < ResourceState.READY: return True return False diff --git a/src/nepi/resources/ns3/ns3ccndceapplication.py b/src/nepi/resources/ns3/ns3ccndceapplication.py new file mode 100644 index 00000000..232ac714 --- /dev/null +++ b/src/nepi/resources/ns3/ns3ccndceapplication.py @@ -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 . +# +# Author: Alina Quereilhac + +from nepi.execution.attribute import Attribute, Flags, Types +from nepi.execution.resource import clsinit_copy, ResourceState, reschedule_delay +from nepi.resources.ns3.ns3dceapplication import NS3BaseDceApplication + +import os + +@clsinit_copy +class NS3BaseCCNDceApplication(NS3BaseDceApplication): + _rtype = "abstract::ns3::CCNDceApplication" + + @classmethod + def _register_attributes(cls): + files = Attribute("files", + "Semi-colon separated list of 'key=value' pairs to set as " + "DCE files (AddFile). The key should be a path to a local file " + "and the key is the path to be set in DCE for that file" , + flags = Flags.Design) + + stdinfile = Attribute("stdinFile", + "File to set as StdinFile. The value shoudl be either an empty " + "or a path to a local file ", + flags = Flags.Design) + + cls._register_attribute(files) + cls._register_attribute(stdinfile) + + def _instantiate_object(self): + pass + + def _connect_object(self): + node = self.node + if node.uuid not in self.connected: + self._connected.add(node.uuid) + + # Preventing concurrent access to the DceApplicationHelper + # from different DceApplication RMs + with self.simulation.dce_application_lock: + self.simulation.invoke( + self.simulation.ccn_client_helper_uuid, + "ResetArguments") + + self.simulation.invoke( + self.simulation.ccn_client_helper_uuid, + "ResetEnvironment") + + self.simulation.invoke( + self.simulation.ccn_client_helper_uuid, + "SetBinary", self.get("binary")) + + self.simulation.invoke( + self.simulation.ccn_client_helper_uuid, + "SetStackSize", self.get("stackSize")) + + arguments = self.get("arguments") + if arguments: + for arg in map(str.strip, arguments.split(";")): + self.simulation.invoke( + self.simulation.ccn_client_helper_uuid, + "AddArgument", arg) + + environment = self.get("environment") + if environment: + for env in map(str.strip, environment.split(";")): + key, val = env.split("=") + self.simulation.invoke( + self.simulation.ccn_client_helper_uuid, + "AddEnvironment", key, val) + + if self.has_attribute("files"): + files = self.get("files") + if files: + for files in map(str.strip, files.split(";")): + remotepath, dcepath = files.split("=") + localpath = "${SHARE}/" + os.path.basename(remotepath) + self.simulation.invoke( + self.simulation.ccn_client_helper_uuid, + "AddFile", localpath, dcepath) + + if self.has_attribute("stdinFile"): + stdinfile = self.get("stdinFile") + if stdinfile: + if stdinfile != "": + stdinfile = "${SHARE}/" + os.path.basename(stdinfile) + + self.simulation.invoke( + self.simulation.ccn_client_helper_uuid, + "SetStdinFile", stdinfile) + + apps_uuid = self.simulation.invoke( + self.simulation.ccn_client_helper_uuid, + "InstallInNode", self.node.uuid) + + self._uuid = self.simulation.invoke(apps_uuid, "Get", 0) + + if self.has_changed("StartTime"): + self.simulation.ns3_set(self.uuid, "StartTime", self.get("StartTime")) + + if self.has_changed("StopTime"): + self.simulation.ns3_set(self.uuid, "StopTime", self.get("StopTime")) + + diff --git a/src/nepi/resources/ns3/ns3dceapplication.py b/src/nepi/resources/ns3/ns3dceapplication.py index acaf0e6e..7d26fbda 100644 --- a/src/nepi/resources/ns3/ns3dceapplication.py +++ b/src/nepi/resources/ns3/ns3dceapplication.py @@ -48,10 +48,22 @@ class NS3BaseDceApplication(NS3BaseApplication): "DCE environment variables.", flags = Flags.Design) + starttime = Attribute("StartTime", + "Time at which the application will start", + default = "+0.0ns", + flags = Flags.Reserved | Flags.Construct) + + stoptime = Attribute("StopTime", + "Time at which the application will stop", + default = "+0.0ns", + flags = Flags.Reserved | Flags.Construct) + cls._register_attribute(binary) cls._register_attribute(stack_size) cls._register_attribute(arguments) cls._register_attribute(environment) + cls._register_attribute(stoptime) + cls._register_attribute(starttime) @property def node(self): @@ -95,37 +107,20 @@ class NS3BaseDceApplication(NS3BaseApplication): self.simulation.dce_application_helper_uuid, "SetStackSize", self.get("stackSize")) - arguments = self.get("arguments") or "" - for arg in map(str.strip, arguments.split(";")): - self.simulation.invoke( - self.simulation.dce_application_helper_uuid, - "AddArgument", arg) - - environment = self.get("environment") or "" - for env in map(str.strip, environment.split(";")): - key, val = env.split("=") - self.simulation.invoke( - self.simulation.dce_application_helper_uuid, - "AddEnvironment", key, val) - - if self.has_attribute("files"): - files = self.get("files") or "" - for files in map(str.strip, files.split(";")): - remotepath, dcepath = env.split("=") - localpath = "${SHARE}/" + os.path.basename(remotepath) + arguments = self.get("arguments") + if arguments: + for arg in map(str.strip, arguments.split(";")): self.simulation.invoke( self.simulation.dce_application_helper_uuid, - "AddFile", localpath, dcepath) - - if self.has_attribute("stdinFile"): - stdinfile = self.get("stdinFile") - if stdinfile: - if stdinfile != "": - stdinfile = "${SHARE}/" + os.path.basename(stdinfile) - + "AddArgument", arg) + + environment = self.get("environment") + if environment: + for env in map(str.strip, environment.split(";")): + key, val = env.split("=") self.simulation.invoke( self.simulation.dce_application_helper_uuid, - "SetStdinFile", stdinfile) + "AddEnvironment", key, val) apps_uuid = self.simulation.invoke( self.simulation.dce_application_helper_uuid, diff --git a/src/nepi/resources/ns3/ns3netdevice.py b/src/nepi/resources/ns3/ns3netdevice.py index f136dd89..d401e67d 100644 --- a/src/nepi/resources/ns3/ns3netdevice.py +++ b/src/nepi/resources/ns3/ns3netdevice.py @@ -224,8 +224,7 @@ class NS3BaseNetDevice(NS3Base): self.simulation.invoke(self.uuid, "Attach", channel.uuid) self._connected.add(channel.uuid) - queue = self.queue # Verify that the device has a queue. If no queue is added a segfault # error occurs - if queue and queue.uuid not in self.connected: - self._connected.add(queue.uuid) + queue = self.queue + diff --git a/src/nepi/resources/ns3/ns3queue.py b/src/nepi/resources/ns3/ns3queue.py index d7ec2b7c..735349fa 100644 --- a/src/nepi/resources/ns3/ns3queue.py +++ b/src/nepi/resources/ns3/ns3queue.py @@ -51,4 +51,5 @@ class NS3BaseQueue(NS3Base): if device.uuid not in self.connected: self.simulation.invoke(device.uuid, "SetQueue", self.uuid) self._connected.add(device.uuid) + device._connected.add(self.uuid) diff --git a/src/nepi/resources/ns3/ns3server.py b/src/nepi/resources/ns3/ns3server.py index f761b86e..a9f43538 100644 --- a/src/nepi/resources/ns3/ns3server.py +++ b/src/nepi/resources/ns3/ns3server.py @@ -68,6 +68,8 @@ def handle_message(ns3_wrapper, msg_type, args, kwargs): ns3_wrapper.logger.debug("CREATE %s %s" % (clazzname, str(args))) uuid = ns3_wrapper.create(clazzname, *args) + + #ns3_wrapper.logger.debug("%s = CREATE " % str(uuid)) return uuid if msg_type == NS3WrapperMessage.FACTORY: @@ -76,6 +78,8 @@ def handle_message(ns3_wrapper, msg_type, args, kwargs): ns3_wrapper.logger.debug("FACTORY %s %s" % (type_name, str(kwargs))) uuid = ns3_wrapper.factory(type_name, **kwargs) + + #ns3_wrapper.logger.debug("%s = FACTORY " % str(uuid)) return uuid if msg_type == NS3WrapperMessage.INVOKE: diff --git a/src/nepi/resources/ns3/resource_manager_generator.py b/src/nepi/resources/ns3/resource_manager_generator.py index 5eae3c82..016cfa7f 100644 --- a/src/nepi/resources/ns3/resource_manager_generator.py +++ b/src/nepi/resources/ns3/resource_manager_generator.py @@ -17,6 +17,12 @@ # # Author: Alina Quereilhac +# +# Instructions. Run with: +# +# PYTHONPATH=$PYTHONPATH:~/repos/nepi/src python src/nepi/resources/ns3/resource_manager_generator.py +# + # Force the load of ns3 libraries from nepi.resources.ns3.ns3wrapper import load_ns3_module @@ -24,11 +30,6 @@ import os import re adapted_types = ["ns3::Node", - "ns3::Application", - #"ns3::DceApplication", - "ns3::NetDevice", - "ns3::Channel", - "ns3::Queue", "ns3::Icmpv4L4Protocol", "ns3::ArpL3Protocol", "ns3::Ipv4L3Protocol", @@ -41,7 +42,12 @@ adapted_types = ["ns3::Node", "ns3::WifiPhy", "ns3::WifiMac", "ns3::ErrorModel", - "ns3::ErrorRateModel"] + "ns3::ErrorRateModel", + "ns3::Application", + #"ns3::DceApplication", + "ns3::NetDevice", + "ns3::Channel", + "ns3::Queue"] base_types = ["ns3::IpL4Protocol"] diff --git a/test/resources/linux/ns3/ns3dceapplication.py b/test/resources/linux/ns3/ns3dceapplication.py index a4901aee..e75e8a5f 100644 --- a/test/resources/linux/ns3/ns3dceapplication.py +++ b/test/resources/linux/ns3/ns3dceapplication.py @@ -133,8 +133,8 @@ def add_wifi_channel(ec): class LinuxNS3DceApplicationTest(unittest.TestCase): def setUp(self): - #self.fedora_host = "nepi2.pl.sophia.inria.fr" - self.fedora_host = "planetlabpc1.upf.edu" + self.fedora_host = "nepi2.pl.sophia.inria.fr" + #self.fedora_host = "planetlabpc1.upf.edu" self.fedora_user = "inria_nepi" self.fedora_identity = "%s/.ssh/id_rsa_planetlab" % (os.environ['HOME']) @@ -179,7 +179,7 @@ class LinuxNS3DceApplicationTest(unittest.TestCase): "cd iputils-s20101006/ && " "sed -i 's/CFLAGS=/CFLAGS+=/g' Makefile && " "make CFLAGS=-fPIC LDFLAGS=-pie ping && " - "cp ping ${BIN_DCE} ") + "cp ping ${BIN_DCE} && cd - ") ec.set (ping, "binary", "ping") ec.set (ping, "stackSize", 1<<20) ec.set (ping, "arguments", "-c 10;-s 1000;10.0.0.2") @@ -244,24 +244,23 @@ class LinuxNS3DceApplicationTest(unittest.TestCase): ec.register_connection(chan, p2p2) ### create applications - ccnd1 = ec.register_resource("ns3::LinuxDceApplication") + ccnd1 = ec.register_resource("ns3::LinuxCCNDceApplication") ec.set(ccnd1, "depends", "libpcap0.8-dev openjdk-6-jdk ant1.8 autoconf " "libssl-dev libexpat-dev libpcap-dev libecryptfs0 libxml2-utils auto" "make gawk gcc g++ git-core pkg-config libpcre3-dev openjdk-6-jre-lib") ec.set (ccnd1, "sources", "http://www.ccnx.org/releases/ccnx-0.7.2.tar.gz") - ec.set (ccnd1, "build", "tar xvjf ${SRC}/iputils-s20101006.tar.bz2 && " - "tar zxf ${SRC}/ccnx-0.7.2.tar.gz && " + ec.set (ccnd1, "build", "tar zxf ${SRC}/ccnx-0.7.2.tar.gz && " "cd ccnx-0.7.2 && " - " INSTALL_BASE=${BIN_DCE} ./configure && " + " INSTALL_BASE=${BIN_DCE}/.. ./configure && " " make MORE_LDLIBS=-pie && " - " make install ") + " make install && cd -") ec.set (ccnd1, "binary", "ccndstart") ec.set (ccnd1, "stackSize", 1<<20) ec.set (ccnd1, "StartTime", "1s") ec.set (ccnd1, "StopTime", "20s") ec.register_connection(ccnd1, nsnode1) - ccnkill1 = ec.register_resource("ns3::LinuxDceApplication") + ccnkill1 = ec.register_resource("ns3::LinuxCCNDceApplication") ec.set (ccnkill1, "binary", "ccnsmoketest") ec.set (ccnkill1, "arguments", "kill") ec.set (ccnkill1, "stdinFile", "") @@ -274,7 +273,7 @@ class LinuxNS3DceApplicationTest(unittest.TestCase): os.path.dirname(os.path.realpath(__file__)), "repoFile1") - ccnr = ec.register_resource("ns3::LinuxDceApplication") + ccnr = ec.register_resource("ns3::LinuxCCNDceApplication") ec.set (ccnr, "binary", "ccnr") ec.set (ccnr, "environment", "CCNR_DIRECTORY=/REPO/") ec.set (ccnr, "files", "%s=/REPO/repoFile1" % repofile) @@ -283,7 +282,7 @@ class LinuxNS3DceApplicationTest(unittest.TestCase): ec.set (ccnr, "StopTime", "120s") ec.register_connection(ccnr, nsnode1) - ccndc1 = ec.register_resource("ns3::LinuxDceApplication") + ccndc1 = ec.register_resource("ns3::LinuxCCNDceApplication") ec.set (ccndc1, "binary", "ccndc") ec.set (ccndc1, "arguments", "-v;add;ccnx:/;udp;10.0.0.2") ec.set (ccndc1, "stackSize", 1<<20) @@ -291,14 +290,14 @@ class LinuxNS3DceApplicationTest(unittest.TestCase): ec.set (ccndc1, "StopTime", "120s") ec.register_connection(ccndc1, nsnode1) - ccnd2 = ec.register_resource("ns3::LinuxDceApplication") + ccnd2 = ec.register_resource("ns3::LinuxCCNDceApplication") ec.set (ccnd2, "binary", "ccndstart") ec.set (ccnd2, "stackSize", 1<<20) ec.set (ccnd2, "StartTime", "1s") ec.set (ccnd2, "StopTime", "120s") ec.register_connection(ccnd2, nsnode2) - ccndc2 = ec.register_resource("ns3::LinuxDceApplication") + ccndc2 = ec.register_resource("ns3::LinuxCCNDceApplication") ec.set (ccndc2, "binary", "ccndc") ec.set (ccndc2, "arguments", "-v;add;ccnx:/;udp;10.0.0.1") ec.set (ccndc2, "stackSize", 1<<20) @@ -306,7 +305,7 @@ class LinuxNS3DceApplicationTest(unittest.TestCase): ec.set (ccndc2, "StopTime", "120s") ec.register_connection(ccndc2, nsnode2) - ccnpeek = ec.register_resource("ns3::LinuxDceApplication") + ccnpeek = ec.register_resource("ns3::LinuxCCNDceApplication") ec.set (ccnpeek, "binary", "ccnpeek") ec.set (ccnpeek, "arguments", "ccnx:/test/bunny.ts") ec.set (ccnpeek, "stdinFile", "") @@ -315,7 +314,7 @@ class LinuxNS3DceApplicationTest(unittest.TestCase): ec.set (ccnpeek, "StopTime", "120s") ec.register_connection(ccnpeek, nsnode2) - ccncat = ec.register_resource("ns3::LinuxDceApplication") + ccncat = ec.register_resource("ns3::LinuxCCNDceApplication") ec.set (ccncat, "binary", "ccncat") ec.set (ccncat, "arguments", "ccnx:/test/bunny.ts") ec.set (ccncat, "stdinFile", "") @@ -324,7 +323,7 @@ class LinuxNS3DceApplicationTest(unittest.TestCase): ec.set (ccncat, "StopTime", "120s") ec.register_connection(ccncat, nsnode2) - ccnkill2 = ec.register_resource("ns3::LinuxDceApplication") + ccnkill2 = ec.register_resource("ns3::LinuxCCNDceApplication") ec.set (ccnkill2, "binary", "ccnsmoketest") ec.set (ccnkill2, "arguments", "kill") ec.set (ccnkill2, "stdinFile", "") @@ -335,7 +334,7 @@ class LinuxNS3DceApplicationTest(unittest.TestCase): ec.deploy() - ec.wait_finished([ping]) + ec.wait_finished([ccncat, ccnkill1, ccnkill2]) print ec.trace(ccncat, "cmdline") """ @@ -344,7 +343,7 @@ class LinuxNS3DceApplicationTest(unittest.TestCase): self.assertTrue(cmdline.find(expected) > -1, cmdline) """ - print ec.trace(cccat, "status") + print ec.trace(ccncat, "status") """ expected = "Start Time: NS3 Time: 1s (" status = ec.trace(ping, "status") @@ -364,7 +363,5 @@ class LinuxNS3DceApplicationTest(unittest.TestCase): ec.shutdown() - - if __name__ == '__main__': unittest.main() diff --git a/test/resources/linux/ns3/ns3simulation.py b/test/resources/linux/ns3/ns3simulation.py index 81146856..d46e586c 100644 --- a/test/resources/linux/ns3/ns3simulation.py +++ b/test/resources/linux/ns3/ns3simulation.py @@ -285,6 +285,7 @@ class LinuxNS3SimulationTest(unittest.TestCase): sources = os.path.join(os.path.dirname(os.path.realpath(__file__)), "ns-3.18-user.tar.gz") ec.set(simu, "sources", sources) + ec.set(simu, "pybindgenVersion", "834") ec.register_connection(simu, node) nsnode1 = add_ns3_node(ec, simu)