A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
uan-cw-example.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 University of Washington
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Leonard Tracy <lentracy@gmail.com>
18
*/
19
20
#ifndef UAN_CW_EXAMPLE_H
21
#define UAN_CW_EXAMPLE_H
22
23
#include "ns3/network-module.h"
24
#include "ns3/stats-module.h"
25
#include "ns3/uan-module.h"
26
27
using namespace
ns3
;
28
29
/**
30
* \ingroup uan
31
* \brief Helper class for UAN CW MAC example.
32
*
33
* An experiment measures the average throughput for a series of CW values.
34
*
35
* \see uan-cw-example.cc
36
*/
37
class
Experiment
38
{
39
public
:
40
/**
41
* Run an experiment across a range of congestion window values.
42
*
43
* \param uan The Uan stack helper to configure nodes in the model.
44
* \return The data set of CW values and measured throughput
45
*/
46
Gnuplot2dDataset
Run
(
UanHelper
& uan);
47
/**
48
* Receive all available packets from a socket.
49
*
50
* \param socket The receive socket.
51
*/
52
void
ReceivePacket
(
Ptr<Socket>
socket);
53
/**
54
* Assign new random positions to a set of nodes. New positions
55
* are randomly assigned within the bounding box.
56
*
57
* \param nodes The nodes to reposition.
58
*/
59
void
UpdatePositions
(
NodeContainer
&
nodes
)
const
;
60
/** Save the throughput from a single run. */
61
void
ResetData
();
62
/**
63
* Compute average throughput for a set of runs, then increment CW.
64
*
65
* \param cw CW value for completed runs.
66
*/
67
void
IncrementCw
(
uint32_t
cw);
68
69
uint32_t
m_numNodes
;
//!< Number of transmitting nodes.
70
uint32_t
m_dataRate
;
//!< DataRate in bps.
71
double
m_depth
;
//!< Depth of transmitting and sink nodes.
72
double
m_boundary
;
//!< Size of boundary in meters.
73
uint32_t
m_packetSize
;
//!< Generated packet size in bytes.
74
uint32_t
m_bytesTotal
;
//!< Total bytes received.
75
uint32_t
m_cwMin
;
//!< Min CW to simulate.
76
uint32_t
m_cwMax
;
//!< Max CW to simulate.
77
uint32_t
m_cwStep
;
//!< CW step size, default 10.
78
uint32_t
m_avgs
;
//!< Number of topologies to test for each cw point.
79
80
Time
m_slotTime
;
//!< Slot time duration.
81
Time
m_simTime
;
//!< Simulation run time, default 1000 s.
82
83
std::string
m_gnudatfile
;
//!< Name for GNU Plot output, default uan-cw-example.gpl.
84
std::string
m_asciitracefile
;
//!< Name for ascii trace file, default uan-cw-example.asc.
85
std::string
m_bhCfgFile
;
//!< (Unused)
86
87
Gnuplot2dDataset
m_data
;
//!< Container for the simulation data.
88
std::vector<double>
m_throughputs
;
//!< Throughput for each run.
89
90
/** Default constructor. */
91
Experiment
();
92
};
93
94
#endif
/* UAN_CW_EXAMPLE_H */
Experiment
WiFi adhoc experiment class.
Definition:
wifi-adhoc.cc:45
Experiment::m_packetSize
uint32_t m_packetSize
Packet size.
Definition:
wifi-multirate.cc:238
Experiment::m_depth
double m_depth
Depth of transmitting and sink nodes.
Definition:
uan-cw-example.h:71
Experiment::Run
Gnuplot2dDataset Run(const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel)
Run an experiment.
Definition:
wifi-adhoc.cc:162
Experiment::m_asciitracefile
std::string m_asciitracefile
Name for ascii trace file, default uan-cw-example.asc.
Definition:
uan-cw-example.h:84
Experiment::m_cwMin
uint32_t m_cwMin
Min CW to simulate.
Definition:
uan-cw-example.h:75
Experiment::m_bytesTotal
uint32_t m_bytesTotal
The number of received bytes.
Definition:
wifi-adhoc.cc:97
Experiment::Experiment
Experiment()
Default constructor.
Experiment::m_simTime
Time m_simTime
Simulation run time, default 1000 s.
Definition:
uan-cw-example.h:81
Experiment::m_cwMax
uint32_t m_cwMax
Max CW to simulate.
Definition:
uan-cw-example.h:76
Experiment::m_avgs
uint32_t m_avgs
Number of topologies to test for each cw point.
Definition:
uan-cw-example.h:78
Experiment::ResetData
void ResetData()
Save the throughput from a single run.
Definition:
uan-cw-example.cc:77
Experiment::m_dataRate
uint32_t m_dataRate
DataRate in bps.
Definition:
uan-cw-example.h:70
Experiment::m_data
Gnuplot2dDataset m_data
Container for the simulation data.
Definition:
uan-cw-example.h:87
Experiment::ReceivePacket
void ReceivePacket(Ptr< Socket > socket)
Receive all available packets from a socket.
Experiment::m_slotTime
Time m_slotTime
Slot time duration.
Definition:
uan-cw-example.h:80
Experiment::m_bhCfgFile
std::string m_bhCfgFile
(Unused)
Definition:
uan-cw-example.h:85
Experiment::m_gnudatfile
std::string m_gnudatfile
Name for GNU Plot output, default uan-cw-example.gpl.
Definition:
uan-cw-example.h:83
Experiment::m_throughputs
std::vector< double > m_throughputs
Throughput for each run.
Definition:
uan-cw-example.h:88
Experiment::IncrementCw
void IncrementCw(uint32_t cw)
Compute average throughput for a set of runs, then increment CW.
Definition:
uan-cw-example.cc:85
Experiment::m_numNodes
uint32_t m_numNodes
Number of transmitting nodes.
Definition:
uan-cw-example.h:69
Experiment::m_boundary
double m_boundary
Size of boundary in meters.
Definition:
uan-cw-example.h:72
Experiment::UpdatePositions
void UpdatePositions(NodeContainer &nodes) const
Assign new random positions to a set of nodes.
Definition:
uan-cw-example.cc:106
Experiment::m_cwStep
uint32_t m_cwStep
CW step size, default 10.
Definition:
uan-cw-example.h:77
ns3::Gnuplot2dDataset
Class to represent a 2D points plot.
Definition:
gnuplot.h:116
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:40
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
ns3::UanHelper
UAN configuration helper.
Definition:
uan-helper.h:42
uint32_t
nodes
NodeContainer nodes
Definition:
lr-wpan-bootstrap.cc:54
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
uan
examples
uan-cw-example.h
Generated on Tue May 28 2024 23:39:50 for ns-3 by
1.9.6