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-rc-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_RC_EXAMPLE_H
21
#define UAN_RC_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
*
32
* Container for the parameters describing a single experiment.
33
*
34
* An experiment samples a range of parameter values. The parameter
35
* controls the number of nodes (if m_doNode is true), or the
36
* UanMacRcGw MaxReservations attribute.
37
*
38
* \see uan-rc-example.cc
39
*
40
*/
41
class
Experiment
42
{
43
public
:
44
uint32_t
m_simMin
;
//!< Minimum parameter to test.
45
uint32_t
m_simMax
;
//!< Maximum parameter to test.
46
uint32_t
m_simStep
;
//!< Amount to increment param per trial
47
uint32_t
m_numRates
;
//!< Number of divided rates ( (NumberRates+1)%TotalRate should be 0).
48
uint32_t
m_totalRate
;
//!< Total channel capacity.
49
uint32_t
m_maxRange
;
//!< Maximum range between gateway and acoustic node.
50
uint32_t
m_numNodes
;
//!< Number of nodes (invalid for m_doNode true).
51
uint32_t
m_pktSize
;
//!< Packet size in bytes.
52
bool
m_doNode
;
//!< 1 for do max nodes simulation (invalidates AMin and AMax values).
53
Time
m_sifs
;
//!< SIFS time duration.
54
Time
m_simTime
;
//!< Simulation time per trial
55
56
std::string
m_gnuplotfile
;
//!< Filename for GnuPlot.
57
58
uint32_t
m_bytesTotal
;
//!< Total number of bytes received in a simulation run.
59
60
UanModesList
m_dataModes
;
//!< List of UanTxModes used for data channels.
61
UanModesList
m_controlModes
;
//!< List of UanTxModes used for control channels.
62
63
/**
64
* Callback to receive a packet.
65
*
66
* \param socket The socket receiving packets.
67
*/
68
void
ReceivePacket
(
Ptr<Socket>
socket);
69
/**
70
* Create a UanTxMode.
71
*
72
* The mode physical rate is set equal to m_totalRate.
73
* The data rate and bandwidth are set to
74
*
75
* \f[{\rm{rate, bandwidth}} = {\rm{kass}}\frac{{{\rm{m\_totalRate}}}}{{{\rm{m\_numRates}} +
76
* 1}}\f]
77
*
78
* The center frequency is set to
79
*
80
* \f[{f_{center}} = {\rm{fc}} + \frac{{ \pm {\rm{m\_totalRate}} \mp {\rm{rate}}}}{2}\f]
81
*
82
* where the upper sign is taken if upperblock is true.
83
*
84
* \param kass Fraction of total bandwidth assigned to mode.
85
* \param fc Mode center frequency offset.
86
* \param upperblock Sign choice in setting the center frequency.
87
* \param name Mode name.
88
* \return The new mode.
89
*/
90
UanTxMode
CreateMode
(
uint32_t
kass,
uint32_t
fc,
bool
upperblock, std::string name)
const
;
91
/**
92
* Create m_numRates matching control and data modes.
93
*
94
* \param fc Mode center frequency offset.
95
*/
96
void
CreateDualModes
(
uint32_t
fc);
97
/**
98
* Run a parametrized experiment.
99
*
100
* The parameter sets either the number of nodes (if m_doNode is true)
101
* or the \"a\" parameter, which controls the UanMacRcGw MaxReservations
102
* attribute.
103
*
104
* \param param The parameter value.
105
* \return The total number of bytes delivered.
106
*/
107
uint32_t
Run
(
uint32_t
param);
108
109
/** Default constructor. */
110
Experiment
();
111
};
112
113
#endif
/* UAN_RC_EXAMPLE_H */
Experiment
WiFi adhoc experiment class.
Definition:
wifi-adhoc.cc:45
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_simMin
uint32_t m_simMin
Minimum parameter to test.
Definition:
uan-rc-example.h:44
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_simStep
uint32_t m_simStep
Amount to increment param per trial.
Definition:
uan-rc-example.h:46
Experiment::m_dataModes
UanModesList m_dataModes
List of UanTxModes used for data channels.
Definition:
uan-rc-example.h:60
Experiment::m_sifs
Time m_sifs
SIFS time duration.
Definition:
uan-rc-example.h:53
Experiment::m_totalRate
uint32_t m_totalRate
Total channel capacity.
Definition:
uan-rc-example.h:48
Experiment::CreateMode
UanTxMode CreateMode(uint32_t kass, uint32_t fc, bool upperblock, std::string name) const
Create a UanTxMode.
Definition:
uan-rc-example.cc:99
Experiment::ReceivePacket
void ReceivePacket(Ptr< Socket > socket)
Callback to receive a packet.
Experiment::m_doNode
bool m_doNode
1 for do max nodes simulation (invalidates AMin and AMax values).
Definition:
uan-rc-example.h:52
Experiment::m_simMax
uint32_t m_simMax
Maximum parameter to test.
Definition:
uan-rc-example.h:45
Experiment::CreateDualModes
void CreateDualModes(uint32_t fc)
Create m_numRates matching control and data modes.
Definition:
uan-rc-example.cc:126
Experiment::m_controlModes
UanModesList m_controlModes
List of UanTxModes used for control channels.
Definition:
uan-rc-example.h:61
Experiment::m_numRates
uint32_t m_numRates
Number of divided rates ( (NumberRates+1)TotalRate should be 0).
Definition:
uan-rc-example.h:47
Experiment::m_numNodes
uint32_t m_numNodes
Number of transmitting nodes.
Definition:
uan-cw-example.h:69
Experiment::m_maxRange
uint32_t m_maxRange
Maximum range between gateway and acoustic node.
Definition:
uan-rc-example.h:49
Experiment::m_pktSize
uint32_t m_pktSize
Packet size in bytes.
Definition:
uan-rc-example.h:51
Experiment::m_gnuplotfile
std::string m_gnuplotfile
Filename for GnuPlot.
Definition:
uan-rc-example.h:56
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::UanModesList
Container for UanTxModes.
Definition:
uan-tx-mode.h:259
ns3::UanTxMode
Abstraction of packet modulation information.
Definition:
uan-tx-mode.h:43
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
uan
examples
uan-rc-example.h
Generated on Tue May 28 2024 23:39:51 for ns-3 by
1.9.6