The class that constructs the WSN, setup applications on nodes and starts the simulation. More...
#include "wsnconstructor.h"
Inheritance diagram for WsnConstructor:
Collaboration diagram for WsnConstructor:Public Member Functions | |
| WsnConstructor () | |
| Default constructor. More... | |
| void | Configure () |
| Generate a description of attributes given from the config file and from CLI set the simulation seed and verbosity. More... | |
| void | Run () |
| Construct the WSN, install applications on nodes and start the simulation. More... | |
Static Public Member Functions | |
| static TypeId | GetTypeId (void) |
| Register this type. More... | |
Private Member Functions | |
| void | AODVrouting () |
| Install AODV routing. More... | |
| void | BuildDiscTopology () |
| Deploy nodes at random positions on a disc shaped plane. More... | |
| void | BuildGridTopology () |
| Sensor nodes are deployed according to a grid structure; each sensor node is equidistant from the closest sensor nodes in cardinal directions. More... | |
| void | CaptureStatistics () |
| Instantiate objects for collecting data with the statistical framework. More... | |
| void | CreateDevices () |
| Create Network devices and setup the wireless communication based on the IEEE 802.11n Allow to select from 2.4GHz to 5GHz and setup different MCS using the attribute system. More... | |
| void | CreateNodes () |
| Create node objects. More... | |
| void | DSDVrouting () |
| Install DSDV routing. More... | |
| void | DSRrouting () |
| Install DSR routing. More... | |
| void | InstallApplications () |
| Install applications on nodes and setup starting time of the handshake and the onion start time. More... | |
| void | InstallInternetStack () |
| Installing the internet stack on nodes and setting up IP-addresses. More... | |
| void | OLSRrouting () |
| Install OLSR routing. More... | |
| void | ProcessPathString () |
Split the string m_pathsLengths by the delimiter (,) and save each value into m_onionPathsLengths and the number of values into m_numOnionPaths. More... | |
Private Attributes | |
| DataCollector | data |
| Collect data with the stats framework. More... | |
| uint16_t | m_cellSide |
| Parameter for the setup of the grid topology. More... | |
| enum IEEE_80211n | m_mac |
| Carrier frequency of the IEEE 802.11n. More... | |
| uint16_t | m_mss |
| maximum segment size More... | |
| uint16_t | m_numNodes |
| number of sensor nodes in the WSN More... | |
| uint16_t | m_numOnionPaths = 0 |
| Number of different onion paths. More... | |
| uint16_t * | m_onionPathsLengths |
| Array containing one onion path length in each cell. More... | |
| uint16_t | m_onionRepeate |
| Number of times to generate the onion for each value of path length. More... | |
| Ptr< OnionValidator > | m_onionValidator |
| Checks if the onion messagess transiting in the network are valid. More... | |
| Ptr< OutputManager > | m_outputManager |
| Manages the output of the simulation. More... | |
| std::string | m_pathsLengths |
| String of values delimited by the symbol "," each value representing the number of hops the onion will travel to return back to the sink node issuer of the onion. More... | |
| uint16_t | m_radius |
| Parameter for the setup of the random disc topology. More... | |
| enum Routing | m_routing |
| routing algorithm for wireless multihop networks More... | |
| std::string | m_simulationDescription |
| String holding a description of parameters used in the simulation. More... | |
| std::string | m_simulationName |
| name of the simulation More... | |
| uint32_t | m_simulationSeed |
| seed to use for the random generation of numbers during the simulation More... | |
| NodeContainer | m_sink |
| Container of the sink node. More... | |
| enum CommunicationStatistics | m_stats |
| setting of recording communication statistics More... | |
| enum Topology | m_topology |
| network topology More... | |
| enum Verbosity | m_verbosity |
| verbosity of the simulation More... | |
| MobilityHelper | mobility |
| Topology helper. More... | |
| ApplicationContainer | sensornodeApps |
| Container of sensor node applications. More... | |
| NodeContainer | sensornodes |
| Container of sensor nodes. More... | |
| ApplicationContainer | sinkApps |
| Container of sink node applications. More... | |
| NetDeviceContainer | wifiDevices |
| Container of wireless devices. More... | |
| Ipv4InterfaceContainer | wifiInterfaces |
| Container of netork interfaces. More... | |
| NodeContainer | wifiNodes |
| Container of wireless nodes. More... | |
The class that constructs the WSN, setup applications on nodes and starts the simulation.
Definition at line 69 of file wsnconstructor.h.
| WsnConstructor::WsnConstructor | ( | ) |
Default constructor.
Definition at line 112 of file wsnconstructor.cc.
|
private |
Install AODV routing.
Definition at line 551 of file wsnconstructor.cc.
References m_simulationDescription, and wifiNodes.
Referenced by InstallInternetStack().
Here is the caller graph for this function:
|
private |
Deploy nodes at random positions on a disc shaped plane.
The radius of the disc is selected based on r_disc2 * π = A. A being the sum of circular areas covered by m_numNodes at radius m_radius Therefore the average sensor node density is maintained fixed if the parameter m_numNodes changes. The sink node is deployed in the center of the disc.
Definition at line 414 of file wsnconstructor.cc.
References m_numNodes, m_radius, m_simulationDescription, m_sink, mobility, and sensornodes.
Referenced by Run().
Here is the caller graph for this function:
|
private |
Sensor nodes are deployed according to a grid structure; each sensor node is equidistant from the closest sensor nodes in cardinal directions.
The distance between sensor nodes is defined by the parameter m_cellSide The sink node is deployed in the center of the grid repleacing a sensor node.
Definition at line 459 of file wsnconstructor.cc.
References m_cellSide, m_numNodes, m_simulationDescription, m_sink, mobility, and sensornodes.
Referenced by Run().
Here is the caller graph for this function:
|
private |
Instantiate objects for collecting data with the statistical framework.
data sent and received at MAC layer, and data received at Application layer
Definition at line 286 of file wsnconstructor.cc.
References data, and m_simulationDescription.
Referenced by Run().
Here is the caller graph for this function:| void WsnConstructor::Configure | ( | ) |
Generate a description of attributes given from the config file and from CLI set the simulation seed and verbosity.
Definition at line 117 of file wsnconstructor.cc.
References ns3::AODV, ns3::Both, ns3::ConsoleLog, ns3::DISC, ns3::DSDV, ns3::DSR, ns3::GRID, m_mss, m_numNodes, m_onionValidator, m_outputManager, m_routing, m_simulationDescription, m_simulationName, m_simulationSeed, m_topology, m_verbosity, ns3::OLSR, and ns3::PrintDescription.
|
private |
Create Network devices and setup the wireless communication based on the IEEE 802.11n Allow to select from 2.4GHz to 5GHz and setup different MCS using the attribute system.
Set up the network: configure the physical mode, the wi-fi parameters (seting an adhoc wifi), etc.
Definition at line 336 of file wsnconstructor.cc.
References ns3::F_24GHz, ns3::F_5GHz, m_mac, m_mss, m_simulationDescription, wifiDevices, and wifiNodes.
Referenced by Run().
Here is the caller graph for this function:
|
private |
Create node objects.
Create nodes and split them between node containers, to split nodes by functionality in the application.
Definition at line 317 of file wsnconstructor.cc.
References m_numNodes, m_simulationDescription, m_sink, sensornodes, and wifiNodes.
Referenced by Run().
Here is the caller graph for this function:
|
private |
Install DSDV routing.
Definition at line 589 of file wsnconstructor.cc.
References m_simulationDescription, and wifiNodes.
Referenced by InstallInternetStack().
Here is the caller graph for this function:
|
private |
Install DSR routing.
Definition at line 537 of file wsnconstructor.cc.
References m_simulationDescription, and wifiNodes.
Referenced by InstallInternetStack().
Here is the caller graph for this function:
|
static |
Register this type.
Definition at line 39 of file wsnconstructor.cc.
References ns3::AODV, ns3::Both, ns3::ConsoleLog, ns3::DISC, ns3::DSDV, ns3::DSR, ns3::F_24GHz, ns3::F_5GHz, ns3::GRID, m_cellSide, m_mac, m_mss, m_numNodes, m_onionRepeate, m_pathsLengths, m_radius, m_routing, m_simulationName, m_simulationSeed, m_stats, m_topology, m_verbosity, ns3::N, ns3::NO, ns3::OLSR, ns3::PrintDescription, and ns3::Y.
|
private |
Install applications on nodes and setup starting time of the handshake and the onion start time.
Install an aplication on network.
Definition at line 611 of file wsnconstructor.cc.
References ns3::DSDV, ns3::SensorNodeHelper::Install(), ns3::SinkHelper::Install(), m_numNodes, m_numOnionPaths, m_onionPathsLengths, m_onionRepeate, m_onionValidator, m_outputManager, m_routing, m_simulationDescription, m_sink, ns3::OLSR, sensornodeApps, sensornodes, sinkApps, and wifiInterfaces.
Referenced by Run().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Installing the internet stack on nodes and setting up IP-addresses.
Set internet stack (ipv4) and its addresses.
Definition at line 504 of file wsnconstructor.cc.
References ns3::AODV, AODVrouting(), ns3::DSDV, DSDVrouting(), ns3::DSR, DSRrouting(), m_outputManager, m_routing, ns3::OLSR, OLSRrouting(), wifiDevices, and wifiInterfaces.
Referenced by Run().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Install OLSR routing.
Definition at line 570 of file wsnconstructor.cc.
References m_simulationDescription, and wifiNodes.
Referenced by InstallInternetStack().
Here is the caller graph for this function:
|
private |
Split the string m_pathsLengths by the delimiter (,) and save each value into m_onionPathsLengths and the number of values into m_numOnionPaths.
Convert the string given as parameter containing path lenghts in the array m_onionPathsLenghts containing a path length in each cell.
Definition at line 256 of file wsnconstructor.cc.
References m_numOnionPaths, m_onionPathsLengths, and m_pathsLengths.
Referenced by Run().
Here is the caller graph for this function:| void WsnConstructor::Run | ( | ) |
Construct the WSN, install applications on nodes and start the simulation.
Run the simulation, showing the progress of it.
Definition at line 191 of file wsnconstructor.cc.
References BuildDiscTopology(), BuildGridTopology(), CaptureStatistics(), CreateDevices(), CreateNodes(), data, ns3::DISC, ns3::GRID, InstallApplications(), InstallInternetStack(), m_outputManager, m_simulationDescription, m_simulationName, m_stats, m_topology, ProcessPathString(), and ns3::Y.
Here is the call graph for this function:
|
private |
Collect data with the stats framework.
Definition at line 130 of file wsnconstructor.h.
Referenced by CaptureStatistics(), and Run().
|
private |
Parameter for the setup of the grid topology.
Definition at line 113 of file wsnconstructor.h.
Referenced by BuildGridTopology(), and GetTypeId().
|
private |
Carrier frequency of the IEEE 802.11n.
Definition at line 108 of file wsnconstructor.h.
Referenced by CreateDevices(), and GetTypeId().
|
private |
maximum segment size
Definition at line 111 of file wsnconstructor.h.
Referenced by Configure(), CreateDevices(), and GetTypeId().
|
private |
number of sensor nodes in the WSN
Definition at line 105 of file wsnconstructor.h.
Referenced by BuildDiscTopology(), BuildGridTopology(), Configure(), CreateNodes(), GetTypeId(), and InstallApplications().
|
private |
Number of different onion paths.
Definition at line 124 of file wsnconstructor.h.
Referenced by InstallApplications(), and ProcessPathString().
|
private |
Array containing one onion path length in each cell.
Definition at line 125 of file wsnconstructor.h.
Referenced by InstallApplications(), and ProcessPathString().
|
private |
Number of times to generate the onion for each value of path length.
Definition at line 126 of file wsnconstructor.h.
Referenced by GetTypeId(), and InstallApplications().
|
private |
Checks if the onion messagess transiting in the network are valid.
Definition at line 118 of file wsnconstructor.h.
Referenced by Configure(), and InstallApplications().
|
private |
Manages the output of the simulation.
Definition at line 116 of file wsnconstructor.h.
Referenced by Configure(), InstallApplications(), InstallInternetStack(), and Run().
|
private |
String of values delimited by the symbol "," each value representing the number of hops the onion will travel to return back to the sink node issuer of the onion.
Definition at line 128 of file wsnconstructor.h.
Referenced by GetTypeId(), and ProcessPathString().
|
private |
Parameter for the setup of the random disc topology.
Definition at line 112 of file wsnconstructor.h.
Referenced by BuildDiscTopology(), and GetTypeId().
|
private |
routing algorithm for wireless multihop networks
Definition at line 106 of file wsnconstructor.h.
Referenced by Configure(), GetTypeId(), InstallApplications(), and InstallInternetStack().
|
private |
String holding a description of parameters used in the simulation.
Definition at line 120 of file wsnconstructor.h.
Referenced by AODVrouting(), BuildDiscTopology(), BuildGridTopology(), CaptureStatistics(), Configure(), CreateDevices(), CreateNodes(), DSDVrouting(), DSRrouting(), InstallApplications(), OLSRrouting(), and Run().
|
private |
name of the simulation
Definition at line 121 of file wsnconstructor.h.
Referenced by Configure(), GetTypeId(), and Run().
|
private |
seed to use for the random generation of numbers during the simulation
Definition at line 104 of file wsnconstructor.h.
Referenced by Configure(), and GetTypeId().
|
private |
Container of the sink node.
Definition at line 224 of file wsnconstructor.h.
Referenced by BuildDiscTopology(), BuildGridTopology(), CreateNodes(), and InstallApplications().
|
private |
setting of recording communication statistics
Definition at line 110 of file wsnconstructor.h.
Referenced by GetTypeId(), and Run().
|
private |
network topology
Definition at line 107 of file wsnconstructor.h.
Referenced by Configure(), GetTypeId(), and Run().
|
private |
verbosity of the simulation
Definition at line 109 of file wsnconstructor.h.
Referenced by Configure(), and GetTypeId().
|
private |
Topology helper.
Definition at line 222 of file wsnconstructor.h.
Referenced by BuildDiscTopology(), and BuildGridTopology().
|
private |
Container of sensor node applications.
Definition at line 229 of file wsnconstructor.h.
Referenced by InstallApplications().
|
private |
Container of sensor nodes.
Definition at line 225 of file wsnconstructor.h.
Referenced by BuildDiscTopology(), BuildGridTopology(), CreateNodes(), and InstallApplications().
|
private |
Container of sink node applications.
Definition at line 228 of file wsnconstructor.h.
Referenced by InstallApplications().
|
private |
Container of wireless devices.
Definition at line 226 of file wsnconstructor.h.
Referenced by CreateDevices(), and InstallInternetStack().
|
private |
Container of netork interfaces.
Definition at line 227 of file wsnconstructor.h.
Referenced by InstallApplications(), and InstallInternetStack().
|
private |
Container of wireless nodes.
Definition at line 223 of file wsnconstructor.h.
Referenced by AODVrouting(), CreateDevices(), CreateNodes(), DSDVrouting(), DSRrouting(), and OLSRrouting().