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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Leonard Tracy <lentracy@gmail.com>
7 */
8
9#ifndef UAN_RC_EXAMPLE_H
10#define UAN_RC_EXAMPLE_H
11
12#include "ns3/network-module.h"
13#include "ns3/stats-module.h"
14#include "ns3/uan-module.h"
15
16using namespace ns3;
17
18/**
19 * @ingroup uan
20 *
21 * Container for the parameters describing a single experiment.
22 *
23 * An experiment samples a range of parameter values. The parameter
24 * controls the number of nodes (if m_doNode is true), or the
25 * UanMacRcGw MaxReservations attribute.
26 *
27 * @see uan-rc-example.cc
28 *
29 */
30class Experiment
31{
32 public:
33 uint32_t m_simMin; //!< Minimum parameter to test.
34 uint32_t m_simMax; //!< Maximum parameter to test.
35 uint32_t m_simStep; //!< Amount to increment param per trial
36 uint32_t m_numRates; //!< Number of divided rates ( (NumberRates+1)%TotalRate should be 0).
37 uint32_t m_totalRate; //!< Total channel capacity.
38 uint32_t m_maxRange; //!< Maximum range between gateway and acoustic node.
39 uint32_t m_numNodes; //!< Number of nodes (invalid for m_doNode true).
40 uint32_t m_pktSize; //!< Packet size in bytes.
41 bool m_doNode; //!< 1 for do max nodes simulation (invalidates AMin and AMax values).
42 Time m_sifs; //!< SIFS time duration.
43 Time m_simTime; //!< Simulation time per trial
44
45 std::string m_gnuplotfile; //!< Filename for GnuPlot.
46
47 uint32_t m_bytesTotal; //!< Total number of bytes received in a simulation run.
48
49 UanModesList m_dataModes; //!< List of UanTxModes used for data channels.
50 UanModesList m_controlModes; //!< List of UanTxModes used for control channels.
51
52 /**
53 * Callback to receive a packet.
54 *
55 * @param socket The socket receiving packets.
56 */
58 /**
59 * Create a UanTxMode.
60 *
61 * The mode physical rate is set equal to m_totalRate.
62 * The data rate and bandwidth are set to
63 *
64 * \f[{\rm{rate, bandwidth}} = {\rm{kass}}\frac{{{\rm{m\_totalRate}}}}{{{\rm{m\_numRates}} +
65 * 1}}\f]
66 *
67 * The center frequency is set to
68 *
69 * \f[{f_{center}} = {\rm{fc}} + \frac{{ \pm {\rm{m\_totalRate}} \mp {\rm{rate}}}}{2}\f]
70 *
71 * where the upper sign is taken if upperblock is true.
72 *
73 * @param kass Fraction of total bandwidth assigned to mode.
74 * @param fc Mode center frequency offset.
75 * @param upperblock Sign choice in setting the center frequency.
76 * @param name Mode name.
77 * @return The new mode.
78 */
79 UanTxMode CreateMode(uint32_t kass, uint32_t fc, bool upperblock, std::string name) const;
80 /**
81 * Create m_numRates matching control and data modes.
82 *
83 * @param fc Mode center frequency offset.
84 */
86 /**
87 * Run a parametrized experiment.
88 *
89 * The parameter sets either the number of nodes (if m_doNode is true)
90 * or the \"a\" parameter, which controls the UanMacRcGw MaxReservations
91 * attribute.
92 *
93 * @param param The parameter value.
94 * @return The total number of bytes delivered.
95 */
96 uint32_t Run(uint32_t param);
97
98 /** Default constructor. */
100};
101
102#endif /* UAN_RC_EXAMPLE_H */
WiFi adhoc experiment class.
Definition wifi-adhoc.cc:34
Gnuplot2dDataset Run(const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel)
Run an experiment.
uint32_t m_simMin
Minimum parameter to test.
uint32_t m_bytesTotal
The number of received bytes.
Definition wifi-adhoc.cc:86
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.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Container for UanTxModes.
Abstraction of packet modulation information.
Definition uan-tx-mode.h:32
Every class exported by the ns3 library is enclosed in the ns3 namespace.