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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Leonard Tracy <lentracy@gmail.com>
7
*/
8
9
#ifndef UAN_CW_EXAMPLE_H
10
#define UAN_CW_EXAMPLE_H
11
12
#include "ns3/network-module.h"
13
#include "ns3/stats-module.h"
14
#include "ns3/uan-module.h"
15
16
using namespace
ns3
;
17
18
/**
19
* @ingroup uan
20
* @brief Helper class for UAN CW MAC example.
21
*
22
* An experiment measures the average throughput for a series of CW values.
23
*
24
* @see uan-cw-example.cc
25
*/
26
class
Experiment
27
{
28
public
:
29
/**
30
* Run an experiment across a range of congestion window values.
31
*
32
* @param uan The Uan stack helper to configure nodes in the model.
33
* @return The data set of CW values and measured throughput
34
*/
35
Gnuplot2dDataset
Run
(
UanHelper
& uan);
36
/**
37
* Receive all available packets from a socket.
38
*
39
* @param socket The receive socket.
40
*/
41
void
ReceivePacket
(
Ptr<Socket>
socket);
42
/**
43
* Assign new random positions to a set of nodes. New positions
44
* are randomly assigned within the bounding box.
45
*
46
* @param nodes The nodes to reposition.
47
*/
48
void
UpdatePositions
(
NodeContainer
&
nodes
)
const
;
49
/** Save the throughput from a single run. */
50
void
ResetData
();
51
/**
52
* Compute average throughput for a set of runs, then increment CW.
53
*
54
* @param cw CW value for completed runs.
55
*/
56
void
IncrementCw
(
uint32_t
cw);
57
58
uint32_t
m_numNodes
;
//!< Number of transmitting nodes.
59
uint32_t
m_dataRate
;
//!< DataRate in bps.
60
double
m_depth
;
//!< Depth of transmitting and sink nodes.
61
double
m_boundary
;
//!< Size of boundary in meters.
62
uint32_t
m_packetSize
;
//!< Generated packet size in bytes.
63
uint32_t
m_bytesTotal
;
//!< Total bytes received.
64
uint32_t
m_cwMin
;
//!< Min CW to simulate.
65
uint32_t
m_cwMax
;
//!< Max CW to simulate.
66
uint32_t
m_cwStep
;
//!< CW step size, default 10.
67
uint32_t
m_avgs
;
//!< Number of topologies to test for each cw point.
68
69
Time
m_slotTime
;
//!< Slot time duration.
70
Time
m_simTime
;
//!< Simulation run time, default 1000 s.
71
72
std::string
m_gnudatfile
;
//!< Name for GNU Plot output, default uan-cw-example.gpl.
73
std::string
m_asciitracefile
;
//!< Name for ascii trace file, default uan-cw-example.asc.
74
std::string
m_bhCfgFile
;
//!< (Unused)
75
76
Gnuplot2dDataset
m_data
;
//!< Container for the simulation data.
77
std::vector<double>
m_throughputs
;
//!< Throughput for each run.
78
79
/** Default constructor. */
80
Experiment
();
81
};
82
83
#endif
/* UAN_CW_EXAMPLE_H */
Experiment
WiFi adhoc experiment class.
Definition
wifi-adhoc.cc:34
Experiment::m_packetSize
uint32_t m_packetSize
Packet size.
Definition
wifi-multirate.cc:227
Experiment::m_depth
double m_depth
Depth of transmitting and sink nodes.
Definition
uan-cw-example.h:60
Experiment::Run
Gnuplot2dDataset Run(const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel)
Run an experiment.
Definition
wifi-adhoc.cc:151
Experiment::m_asciitracefile
std::string m_asciitracefile
Name for ascii trace file, default uan-cw-example.asc.
Definition
uan-cw-example.h:73
Experiment::m_cwMin
uint32_t m_cwMin
Min CW to simulate.
Definition
uan-cw-example.h:64
Experiment::m_bytesTotal
uint32_t m_bytesTotal
The number of received bytes.
Definition
wifi-adhoc.cc:86
Experiment::Experiment
Experiment()
Default constructor.
Experiment::m_simTime
Time m_simTime
Simulation run time, default 1000 s.
Definition
uan-cw-example.h:70
Experiment::m_cwMax
uint32_t m_cwMax
Max CW to simulate.
Definition
uan-cw-example.h:65
Experiment::m_avgs
uint32_t m_avgs
Number of topologies to test for each cw point.
Definition
uan-cw-example.h:67
Experiment::ResetData
void ResetData()
Save the throughput from a single run.
Definition
uan-cw-example.cc:66
Experiment::m_dataRate
uint32_t m_dataRate
DataRate in bps.
Definition
uan-cw-example.h:59
Experiment::m_data
Gnuplot2dDataset m_data
Container for the simulation data.
Definition
uan-cw-example.h:76
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:69
Experiment::m_bhCfgFile
std::string m_bhCfgFile
(Unused)
Definition
uan-cw-example.h:74
Experiment::m_gnudatfile
std::string m_gnudatfile
Name for GNU Plot output, default uan-cw-example.gpl.
Definition
uan-cw-example.h:72
Experiment::m_throughputs
std::vector< double > m_throughputs
Throughput for each run.
Definition
uan-cw-example.h:77
Experiment::IncrementCw
void IncrementCw(uint32_t cw)
Compute average throughput for a set of runs, then increment CW.
Definition
uan-cw-example.cc:74
Experiment::m_numNodes
uint32_t m_numNodes
Number of transmitting nodes.
Definition
uan-cw-example.h:58
Experiment::m_boundary
double m_boundary
Size of boundary in meters.
Definition
uan-cw-example.h:61
Experiment::UpdatePositions
void UpdatePositions(NodeContainer &nodes) const
Assign new random positions to a set of nodes.
Definition
uan-cw-example.cc:95
Experiment::m_cwStep
uint32_t m_cwStep
CW step size, default 10.
Definition
uan-cw-example.h:66
ns3::Gnuplot2dDataset
Class to represent a 2D points plot.
Definition
gnuplot.h:105
ns3::NodeContainer
keep track of a set of node pointers.
Definition
node-container.h:29
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::UanHelper
UAN configuration helper.
Definition
uan-helper.h:31
uint32_t
nodes
NodeContainer nodes
Definition
lr-wpan-bootstrap.cc:43
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
uan
examples
uan-cw-example.h
Generated on Wed Dec 11 2024 09:20:57 for ns-3 by
1.11.0