A Discrete-Event Network Simulator
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
27using 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 */
41class 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 */
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 */
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. */
111};
112
113#endif /* UAN_RC_EXAMPLE_H */
WiFi adhoc experiment class.
Definition: wifi-adhoc.cc:45
Gnuplot2dDataset Run(const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel)
Run an experiment.
Definition: wifi-adhoc.cc:162
uint32_t m_simMin
Minimum parameter to test.
uint32_t m_bytesTotal
The number of received bytes.
Definition: wifi-adhoc.cc:97
Experiment()
Default constructor.
Time m_simTime
Simulation run time, default 1000 s.
uint32_t m_simStep
Amount to increment param per trial.
UanModesList m_dataModes
List of UanTxModes used for data channels.
Time m_sifs
SIFS time duration.
uint32_t m_totalRate
Total channel capacity.
UanTxMode CreateMode(uint32_t kass, uint32_t fc, bool upperblock, std::string name) const
Create a UanTxMode.
void ReceivePacket(Ptr< Socket > socket)
Callback to receive a packet.
bool m_doNode
1 for do max nodes simulation (invalidates AMin and AMax values).
uint32_t m_simMax
Maximum parameter to test.
void CreateDualModes(uint32_t fc)
Create m_numRates matching control and data modes.
UanModesList m_controlModes
List of UanTxModes used for control channels.
uint32_t m_numRates
Number of divided rates ( (NumberRates+1)TotalRate should be 0).
uint32_t m_numNodes
Number of transmitting nodes.
uint32_t m_maxRange
Maximum range between gateway and acoustic node.
uint32_t m_pktSize
Packet size in bytes.
std::string m_gnuplotfile
Filename for GnuPlot.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Container for UanTxModes.
Definition: uan-tx-mode.h:259
Abstraction of packet modulation information.
Definition: uan-tx-mode.h:43
Every class exported by the ns3 library is enclosed in the ns3 namespace.