summaryrefslogtreecommitdiff
path: root/ns3-simulator/modules/modules.hpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerberdes@gmx.com>2019-04-12 14:48:47 +0200
committerLoic Guegan <manzerberdes@gmx.com>2019-04-12 14:48:47 +0200
commitcb10ad2490706fc87f19ef556f36aee679887ad6 (patch)
treea93d1ca9194eea7fb10633a315d177ef6e2d0ba4 /ns3-simulator/modules/modules.hpp
parent927283437161307a23a954b42297412ba03a619c (diff)
Refactoring
Diffstat (limited to 'ns3-simulator/modules/modules.hpp')
-rw-r--r--ns3-simulator/modules/modules.hpp39
1 files changed, 28 insertions, 11 deletions
diff --git a/ns3-simulator/modules/modules.hpp b/ns3-simulator/modules/modules.hpp
index fa6a255..9423866 100644
--- a/ns3-simulator/modules/modules.hpp
+++ b/ns3-simulator/modules/modules.hpp
@@ -26,31 +26,48 @@
#include "ns3/point-to-point-helper.h"
// C++ library
-#include <iostream>
-#include <utility> // To use std::pair
-#include <iomanip>
+#include <iostream> // Why not ?
+#include <utility> // To use std::pair
+#include <iomanip> // To use std::setw
using namespace ns3;
-// Data types
+// ---------- Data types ----------
typedef std::pair<NodeContainer,NodeContainer> CellNodes; // Format (APNode, SensorsNodes)
typedef std::pair<NetDeviceContainer,NetDeviceContainer> CellNetDevices; // Format (APNetDev, SensorsNetDev)
typedef std::pair<CellNodes,CellNetDevices> Cell;
typedef std::pair<Ipv4Address,int> EndPoint; // Format (IP,Port)
typedef std::pair<NodeContainer,EndPoint> CloudInfos; // Format (CloudHops,CloudEndPoint), here data sent to CloudEndPoint
- // via CloudHops.Get(0) will flow throw all hops until the reaching the cloud
+ // via CloudHops.Get(0) will flow throw all hops until the reaching the cloud
-// Platform functions
+// ---------- platform.cc ----------
+/**
+ * Create a WIFI cell paltform composed of nbSensors sensors and ap as an access point
+ */
Cell createCell(uint32_t nbSensors, Ptr<ns3::Node> ap);
-CloudInfos buildEdgeAndCloud(int nbOp);
-void applyScenarios(Cell cell,int sensorsPktSize, int sensorsSendInterval, CloudInfos cloudInfos);
+/**
+ * Build P2P network composed of nbHop hops (to simulate edge->cloud communications)
+ * Note: Cloud Servers are not considered here and completely ignored !
+ */
+CloudInfos createCloud(int nbHop, uint32_t bandwidth, uint32_t latency);
+/**
+ * Setup simulation scenario on the platforms. Sensors in cell will send packets of sensorsPktSize size every
+ * sensorsSensInterval second to the cloud using cloudInfos.
+ */
+void setupScenario(Cell cell, CloudInfos cloudInfos, int sensorsPktSize, int sensorsSendInterval);
-// Energy functions
-void setupEnergy(Cell cell);
+// ---------- energy.cc ----------
+/*
+ * Configure WIFI energy module for cell
+ */
+void setupCellEnergy(Cell cell);
-// Callbacks
+
+// ---------- callbacks.cc ----------
void PktReceived(std::string nodeName,Ptr< const Packet > packet, const Address &address);
void EnergyUpdated(std::string nodeName,double oldValue, double newValue);
+
+
#endif