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
* 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
16
using 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
*/
30
class
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
*/
57
void
ReceivePacket
(
Ptr<Socket>
socket);
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
*/
85
void
CreateDualModes
(
uint32_t
fc);
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. */
99
Experiment
();
100
};
101
102
#endif
/* UAN_RC_EXAMPLE_H */
Experiment
WiFi adhoc experiment class.
Definition
wifi-adhoc.cc:34
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_simMin
uint32_t m_simMin
Minimum parameter to test.
Definition
uan-rc-example.h:33
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_simStep
uint32_t m_simStep
Amount to increment param per trial.
Definition
uan-rc-example.h:35
Experiment::m_dataModes
UanModesList m_dataModes
List of UanTxModes used for data channels.
Definition
uan-rc-example.h:49
Experiment::m_sifs
Time m_sifs
SIFS time duration.
Definition
uan-rc-example.h:42
Experiment::m_totalRate
uint32_t m_totalRate
Total channel capacity.
Definition
uan-rc-example.h:37
Experiment::CreateMode
UanTxMode CreateMode(uint32_t kass, uint32_t fc, bool upperblock, std::string name) const
Create a UanTxMode.
Definition
uan-rc-example.cc:88
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:41
Experiment::m_simMax
uint32_t m_simMax
Maximum parameter to test.
Definition
uan-rc-example.h:34
Experiment::CreateDualModes
void CreateDualModes(uint32_t fc)
Create m_numRates matching control and data modes.
Definition
uan-rc-example.cc:115
Experiment::m_controlModes
UanModesList m_controlModes
List of UanTxModes used for control channels.
Definition
uan-rc-example.h:50
Experiment::m_numRates
uint32_t m_numRates
Number of divided rates ( (NumberRates+1)TotalRate should be 0).
Definition
uan-rc-example.h:36
Experiment::m_numNodes
uint32_t m_numNodes
Number of transmitting nodes.
Definition
uan-cw-example.h:58
Experiment::m_maxRange
uint32_t m_maxRange
Maximum range between gateway and acoustic node.
Definition
uan-rc-example.h:38
Experiment::m_pktSize
uint32_t m_pktSize
Packet size in bytes.
Definition
uan-rc-example.h:40
Experiment::m_gnuplotfile
std::string m_gnuplotfile
Filename for GnuPlot.
Definition
uan-rc-example.h:45
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::UanModesList
Container for UanTxModes.
Definition
uan-tx-mode.h:248
ns3::UanTxMode
Abstraction of packet modulation information.
Definition
uan-tx-mode.h:32
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 Fri Dec 13 2024 18:20:49 for ns-3 by
1.11.0