A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
Experiment Class Reference

WiFi adhoc experiment class. More...

#include "uan-cw-example.h"

+ Collaboration diagram for Experiment:

Public Member Functions

 Experiment ()
 
 Experiment ()
 
 Experiment ()
 
 Experiment ()
 
 Experiment ()
 Default constructor.
 
 Experiment ()
 Default constructor.
 
 Experiment ()
 
 Experiment (std::string name)
 Constructor.
 
 Experiment (std::string name)
 Constructor.
 
 Experiment (std::string name)
 Construct a new Experiment object.
 
bool CommandSetup (int argc, char **argv)
 Setup the experiment from the command line arguments.
 
void CreateDualModes (uint32_t fc)
 Create m_numRates matching control and data modes.
 
UanTxMode CreateMode (uint32_t kass, uint32_t fc, bool upperblock, std::string name) const
 Create a UanTxMode.
 
std::string GetOutputFileName () const
 Get the Output File Name.
 
std::string GetRateManager () const
 Get the Rate Manager.
 
std::string GetRtsThreshold () const
 Get the RTS Threshold.
 
uint32_t GetScenario () const
 Get the Scenario number.
 
void IncrementCw (uint32_t cw)
 Compute average throughput for a set of runs, then increment CW.
 
bool IsMobility () const
 Check if mobility is enabled.
 
bool IsRouting () const
 Check if routing is enabled.
 
void ReceivePacket (Ptr< Socket > socket)
 Receive all available packets from a socket.
 
void ReceivePacket (Ptr< Socket > socket)
 Callback to receive a packet.
 
void ResetData ()
 Save the throughput from a single run.
 
Gnuplot2dDataset Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel)
 Run an experiment.
 
uint32_t Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel)
 Run an experiment.
 
Gnuplot2dDataset Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel, const MobilityHelper &mobility)
 Run an experiment.
 
int Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel, uint32_t trialNumber, uint32_t networkSize, Time duration, bool pcap, bool infra, uint16_t guardIntervalNs, double distanceM, double apTxPowerDbm, double staTxPowerDbm, Time pktInterval)
 Configure and run the experiment.
 
double Run (Parameters params)
 Run an experiment with the given parameters.
 
Gnuplot2dDataset Run (UanHelper &uan)
 Run an experiment across a range of congestion window values.
 
uint32_t Run (uint32_t param)
 Run a parametrized experiment.
 
void UpdatePositions (NodeContainer &nodes) const
 Assign new random positions to a set of nodes.
 

Public Attributes

std::string m_asciitracefile
 Name for ascii trace file, default uan-cw-example.asc.
 
uint32_t m_avgs
 Number of topologies to test for each cw point.
 
std::string m_bhCfgFile
 (Unused)
 
double m_boundary
 Size of boundary in meters.
 
UanModesList m_controlModes
 List of UanTxModes used for control channels.
 
uint32_t m_cwMax
 Max CW to simulate.
 
uint32_t m_cwMin
 Min CW to simulate.
 
uint32_t m_cwStep
 CW step size, default 10.
 
Gnuplot2dDataset m_data
 Container for the simulation data.
 
UanModesList m_dataModes
 List of UanTxModes used for data channels.
 
uint32_t m_dataRate
 DataRate in bps.
 
double m_depth
 Depth of transmitting and sink nodes.
 
bool m_doNode
 1 for do max nodes simulation (invalidates AMin and AMax values).
 
std::string m_gnudatfile
 Name for GNU Plot output, default uan-cw-example.gpl.
 
std::string m_gnuplotfile
 Filename for GnuPlot.
 
uint32_t m_maxRange
 Maximum range between gateway and acoustic node.
 
uint32_t m_numNodes
 Number of transmitting nodes.
 
uint32_t m_numRates
 Number of divided rates ( (NumberRates+1)TotalRate should be 0).
 
uint32_t m_pktSize
 Packet size in bytes.
 
Time m_sifs
 SIFS time duration.
 
uint32_t m_simMax
 Maximum parameter to test.
 
uint32_t m_simMin
 Minimum parameter to test.
 
uint32_t m_simStep
 Amount to increment param per trial.
 
Time m_simTime
 Simulation run time, default 1000 s.
 
Time m_slotTime
 Slot time duration.
 
std::vector< doublem_throughputs
 Throughput for each run.
 
uint32_t m_totalRate
 Total channel capacity.
 

Private Member Functions

void AdvancePosition (Ptr< Node > node)
 Move a node by 1m on the x axis, stops at 210m.
 
void ApplicationSetup (Ptr< Node > client, Ptr< Node > server, double start, double stop)
 Setup the application in the nodes.
 
void AssignNeighbors (NodeContainer c)
 Take the grid map, divide it into 4 quadrants Assign all nodes from each quadrant to a specific container.
 
void CheckThroughput ()
 Calculate the throughput.
 
NodeContainer GenerateNeighbors (NodeContainer c, uint32_t senderId)
 Generate 1-hop and 2-hop neighbors of a node in grid topology.
 
void GenerateTraffic (Ptr< Socket > socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval)
 Generate the traffic.
 
Vector GetPosition (Ptr< Node > node)
 Get the position of a node.
 
Vector GetPosition (Ptr< Node > node)
 Get the position of a node.
 
void ReceivePacket (Ptr< Socket > socket)
 Receive a packet.
 
void ReceivePacket (Ptr< Socket > socket)
 Receive a packet.
 
void ReceivePacket (Ptr< Socket > socket)
 Receive a packet.
 
void SelectSrcDest (NodeContainer c)
 Sources and destinations are randomly selected such that a node may be the source for multiple destinations and a node maybe a destination for multiple sources.
 
void SendMultiDestinations (Ptr< Node > sender, NodeContainer c)
 A sender node will set up a flow to each of the its neighbors in its quadrant randomly.
 
void SetPosition (Ptr< Node > node, Vector position)
 Set the position of a node.
 
void SetPosition (Ptr< Node > node, Vector position)
 Set the position of a node.
 
Ptr< SocketSetupPacketReceive (Ptr< Node > node)
 Setup the receiving socket.
 
Ptr< SocketSetupPacketReceive (Ptr< Node > node)
 Setup the receiving socket.
 
Ptr< SocketSetupPacketReceive (Ptr< Node > node)
 Setup the receiving socket.
 

Private Attributes

uint32_t m_bytesTotal
 The number of received bytes.
 
bool m_enableFlowMon
 True if FlowMon is enabled.
 
bool m_enableMobility
 True if mobility is enabled.
 
bool m_enablePcap
 True if PCAP output is enabled.
 
bool m_enableRouting
 True if routing is enabled.
 
bool m_enableTracing
 True if tracing output is enabled.
 
double m_expMean
 Exponential parameter for sending packets.
 
uint32_t m_gridSize
 Grid size.
 
uint32_t m_nodeDistance
 Node distance.
 
Gnuplot2dDataset m_output
 The output dataset.
 
std::string m_outputFileName
 Output file name.
 
uint32_t m_packetSize
 Packet size.
 
uint32_t m_pktsTotal
 Total number of received packets.
 
uint32_t m_port
 Listening port.
 
std::string m_rateManager
 Rate manager.
 
std::string m_rtsThreshold
 Rts threshold.
 
double m_samplingPeriod
 Sampling period.
 
uint32_t m_scenario
 Scenario number.
 
double m_totalTime
 Total experiment time.
 
NodeContainer m_containerA
 Node containers for each quadrant.
 
NodeContainer m_containerB
 Node containers for each quadrant.
 
NodeContainer m_containerC
 Node containers for each quadrant.
 
NodeContainer m_containerD
 Node containers for each quadrant.
 

Detailed Description

WiFi adhoc experiment class.

Class to configure and run an experiment.

Container for the parameters describing a single experiment.

Helper class for UAN CW MAC example.

WiFi multirate experiment class.

WiFi clear channel cmu experiment class.

It handles the creation and run of an experiment.

It handles the creation and run of an experiment.

Scenarios: 100 nodes, multiple simultaneous flows, multi-hop ad hoc, routing, and mobility

QUICK INSTRUCTIONS:

To optimize build: ./ns3 configure -d optimized ./ns3

To compile: ./ns3 run wifi-multirate

To compile with command line(useful for varying parameters): ./ns3 run "wifi-multirate --totalTime=0.3s --rateManager=ns3::MinstrelWifiManager"

To turn on NS_LOG: export NS_LOG=multirate=level_all (can only view log if built with ./ns3 configure -d debug)

To debug: ./ns3 shell gdb ./build/debug/examples/wireless/wifi-multirate

To view pcap files: tcpdump -nn -tt -r filename.pcap

To monitor the files: tail -f filename.pcap

An experiment measures the average throughput for a series of CW values.

See also
uan-cw-example.cc

An experiment samples a range of parameter values. The parameter controls the number of nodes (if m_doNode is true), or the UanMacRcGw MaxReservations attribute.

See also
uan-rc-example.cc

Definition at line 44 of file wifi-adhoc.cc.

Constructor & Destructor Documentation

◆ Experiment() [1/10]

Experiment::Experiment ( )

Definition at line 101 of file wifi-adhoc.cc.

◆ Experiment() [2/10]

Experiment::Experiment ( std::string  name)

Constructor.

Parameters
nameThe name of the experiment.

Definition at line 105 of file wifi-adhoc.cc.

References ns3::Gnuplot2dDataset::LINES, m_output, and ns3::Gnuplot2dDataset::SetStyle().

+ Here is the call graph for this function:

◆ Experiment() [3/10]

Experiment::Experiment ( )

◆ Experiment() [4/10]

Experiment::Experiment ( std::string  name)

Constructor.

Parameters
nameThe name of the experiment.

◆ Experiment() [5/10]

Experiment::Experiment ( )

◆ Experiment() [6/10]

Experiment::Experiment ( )

◆ Experiment() [7/10]

Experiment::Experiment ( std::string  name)

Construct a new Experiment object.

Parameters
nameThe name of the experiment.

◆ Experiment() [8/10]

Experiment::Experiment ( )

Default constructor.

◆ Experiment() [9/10]

Experiment::Experiment ( )

Default constructor.

◆ Experiment() [10/10]

Experiment::Experiment ( )

Member Function Documentation

◆ AdvancePosition()

void Experiment::AdvancePosition ( Ptr< Node node)
private

Move a node by 1m on the x axis, stops at 210m.

Parameters
nodeThe node.

Definition at line 126 of file wifi-adhoc.cc.

References ns3::Gnuplot2dDataset::Add(), AdvancePosition(), GetPosition(), m_bytesTotal, m_output, ns3::Simulator::Schedule(), ns3::Seconds(), and SetPosition().

Referenced by AdvancePosition(), and Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ApplicationSetup()

void Experiment::ApplicationSetup ( Ptr< Node client,
Ptr< Node server,
double  start,
double  stop 
)
private

Setup the application in the nodes.

Parameters
clientClient node.
serverServer node.
startStart time.
stopStop time.

Definition at line 471 of file wifi-multirate.cc.

References m_packetSize, m_port, NS_LOG_DEBUG, PrintPosition(), ns3::Seconds(), SetupPacketReceive(), sink, ns3::ApplicationContainer::Start(), and ns3::ApplicationContainer::Stop().

Referenced by Run(), SelectSrcDest(), and SendMultiDestinations().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AssignNeighbors()

void Experiment::AssignNeighbors ( NodeContainer  c)
private

Take the grid map, divide it into 4 quadrants Assign all nodes from each quadrant to a specific container.

Parameters
cThe node container.

Definition at line 328 of file wifi-multirate.cc.

References ns3::NodeContainer::Add(), ns3::NodeContainer::Get(), ns3::NodeContainer::GetN(), m_containerA, m_containerB, m_containerC, m_containerD, and m_gridSize.

Referenced by Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckThroughput()

void Experiment::CheckThroughput ( )
private

Calculate the throughput.

Definition at line 317 of file wifi-multirate.cc.

References ns3::Gnuplot2dDataset::Add(), CheckThroughput(), m_bytesTotal, m_output, m_samplingPeriod, ns3::Simulator::Now(), ns3::Simulator::Schedule(), and ns3::Seconds().

Referenced by CheckThroughput(), and Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CommandSetup()

bool Experiment::CommandSetup ( int  argc,
char **  argv 
)

Setup the experiment from the command line arguments.

Parameters
argcThe argument count.
argvThe argument vector.
Returns
true

Definition at line 666 of file wifi-multirate.cc.

References m_enableMobility, m_enableRouting, m_outputFileName, m_packetSize, m_rateManager, m_rtsThreshold, m_samplingPeriod, m_scenario, and m_totalTime.

◆ CreateDualModes()

void Experiment::CreateDualModes ( uint32_t  fc)

Create m_numRates matching control and data modes.

Parameters
fcMode center frequency offset.

Definition at line 126 of file uan-rc-example.cc.

References ns3::UanModesList::AppendMode(), CreateMode(), m_controlModes, m_dataModes, and m_numRates.

+ Here is the call graph for this function:

◆ CreateMode()

UanTxMode Experiment::CreateMode ( uint32_t  kass,
uint32_t  fc,
bool  upperblock,
std::string  name 
) const

Create a UanTxMode.

The mode physical rate is set equal to m_totalRate. The data rate and bandwidth are set to

\[{\rm{rate, bandwidth}} = {\rm{kass}}\frac{{{\rm{m\_totalRate}}}}{{{\rm{m\_numRates}} +
1}}\]

The center frequency is set to

\[{f_{center}} = {\rm{fc}} + \frac{{ \pm {\rm{m\_totalRate}} \mp {\rm{rate}}}}{2}\]

where the upper sign is taken if upperblock is true.

Parameters
kassFraction of total bandwidth assigned to mode.
fcMode center frequency offset.
upperblockSign choice in setting the center frequency.
nameMode name.
Returns
The new mode.

Definition at line 99 of file uan-rc-example.cc.

References ns3::UanTxModeFactory::CreateMode(), m_numRates, m_totalRate, and ns3::UanTxMode::OTHER.

Referenced by CreateDualModes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateNeighbors()

NodeContainer Experiment::GenerateNeighbors ( NodeContainer  c,
uint32_t  senderId 
)
private

Generate 1-hop and 2-hop neighbors of a node in grid topology.

Parameters
cThe node container.
senderIdThe sender ID.
Returns
the neighbor nodes.

Definition at line 365 of file wifi-multirate.cc.

References ns3::NodeContainer::Add(), and ns3::NodeContainer::Get().

Referenced by Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateTraffic()

void Experiment::GenerateTraffic ( Ptr< Socket socket,
uint32_t  pktSize,
uint32_t  pktCount,
Time  pktInterval 
)
private

Generate the traffic.

Parameters
socketThe sending socket.
pktSizeThe packet size.
pktCountThe number of packets to send.
pktIntervalThe time between packets.

Definition at line 147 of file wifi-clear-channel-cmu.cc.

References GenerateTraffic(), pktSize, and ns3::Simulator::Schedule().

Referenced by GenerateTraffic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetOutputFileName()

std::string Experiment::GetOutputFileName ( ) const
inline

Get the Output File Name.

Returns
the Output File Name.

Definition at line 157 of file wifi-multirate.cc.

References m_outputFileName.

Referenced by Run().

+ Here is the caller graph for this function:

◆ GetPosition() [1/2]

Vector Experiment::GetPosition ( Ptr< Node node)
private

Get the position of a node.

Parameters
nodeThe node.
Returns
the position of the node.

Definition at line 119 of file wifi-adhoc.cc.

Referenced by AdvancePosition().

+ Here is the caller graph for this function:

◆ GetPosition() [2/2]

Vector Experiment::GetPosition ( Ptr< Node node)
private

Get the position of a node.

Parameters
nodeThe node.
Returns
the position of the node.

◆ GetRateManager()

std::string Experiment::GetRateManager ( ) const
inline

Get the Rate Manager.

Returns
the Rate Manager.

Definition at line 167 of file wifi-multirate.cc.

References m_rateManager.

◆ GetRtsThreshold()

std::string Experiment::GetRtsThreshold ( ) const
inline

Get the RTS Threshold.

Returns
the RTS Threshold.

Definition at line 147 of file wifi-multirate.cc.

References m_rtsThreshold.

◆ GetScenario()

uint32_t Experiment::GetScenario ( ) const
inline

Get the Scenario number.

Returns
the scenario number.

Definition at line 137 of file wifi-multirate.cc.

References m_scenario.

◆ IncrementCw()

void Experiment::IncrementCw ( uint32_t  cw)

Compute average throughput for a set of runs, then increment CW.

Parameters
cwCW value for completed runs.

Definition at line 85 of file uan-cw-example.cc.

References ns3::Gnuplot2dDataset::Add(), ns3::RngSeedManager::GetRun(), m_avgs, m_cwStep, m_data, m_throughputs, NS_ASSERT, NS_LOG_DEBUG, ns3::Config::Set(), and ns3::RngSeedManager::SetRun().

Referenced by Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsMobility()

bool Experiment::IsMobility ( ) const
inline

Check if mobility is enabled.

Returns
true if mobility is enabled.

Definition at line 127 of file wifi-multirate.cc.

References m_enableMobility.

◆ IsRouting()

bool Experiment::IsRouting ( ) const
inline

Check if routing is enabled.

Returns
true if routing is enabled.

Definition at line 117 of file wifi-multirate.cc.

References m_enableRouting.

◆ ReceivePacket() [1/5]

void Experiment::ReceivePacket ( Ptr< Socket socket)
private

Receive a packet.

Parameters
socketThe receiving socket.

Definition at line 142 of file wifi-adhoc.cc.

References m_bytesTotal.

Referenced by Run(), and SetupPacketReceive().

+ Here is the caller graph for this function:

◆ ReceivePacket() [2/5]

void Experiment::ReceivePacket ( Ptr< Socket socket)
private

Receive a packet.

Parameters
socketThe receiving socket.

◆ ReceivePacket() [3/5]

void Experiment::ReceivePacket ( Ptr< Socket socket)
private

Receive a packet.

Parameters
socketThe receiving socket.

◆ ReceivePacket() [4/5]

void Experiment::ReceivePacket ( Ptr< Socket socket)

Receive all available packets from a socket.

Parameters
socketThe receive socket.

◆ ReceivePacket() [5/5]

void Experiment::ReceivePacket ( Ptr< Socket socket)

Callback to receive a packet.

Parameters
socketThe socket receiving packets.

◆ ResetData()

void Experiment::ResetData ( )

Save the throughput from a single run.

Definition at line 77 of file uan-cw-example.cc.

References ns3::Time::GetSeconds(), m_bytesTotal, m_simTime, m_throughputs, ns3::Now(), NS_LOG_DEBUG, and ns3::Time::S.

Referenced by Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Run() [1/7]

uint32_t Experiment::Run ( const WifiHelper wifi,
const YansWifiPhyHelper wifiPhy,
const WifiMacHelper wifiMac,
const YansWifiChannelHelper wifiChannel 
)

Run an experiment.

Parameters
wifi//!< The WifiHelper class.
wifiPhy//!< The YansWifiPhyHelper class.
wifiMac//!< The WifiMacHelper class.
wifiChannel//!< The YansWifiChannelHelper class.
Returns
a 2D dataset of the experiment data.

Definition at line 162 of file wifi-adhoc.cc.

References AdvancePosition(), ns3::YansWifiChannelHelper::Create(), ns3::NodeContainer::Create(), ns3::Simulator::Destroy(), ns3::NodeContainer::Get(), ns3::PacketSocketHelper::Install(), m_bytesTotal, m_output, ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::PacketSocketAddress::SetSingleDevice(), SetupPacketReceive(), ns3::ApplicationContainer::Start(), and ns3::ApplicationContainer::Stop().

+ Here is the call graph for this function:

◆ Run() [2/7]

uint32_t Experiment::Run ( const WifiHelper wifi,
const YansWifiPhyHelper wifiPhy,
const WifiMacHelper wifiMac,
const YansWifiChannelHelper wifiChannel 
)

Run an experiment.

Parameters
wifi//!< The WifiHelper class.
wifiPhy//!< The YansWifiPhyHelper class.
wifiMac//!< The WifiMacHelper class.
wifiChannel//!< The YansWifiChannelHelper class.
Returns
the number of received packets.

◆ Run() [3/7]

Gnuplot2dDataset Experiment::Run ( const WifiHelper wifi,
const YansWifiPhyHelper wifiPhy,
const WifiMacHelper wifiMac,
const YansWifiChannelHelper wifiChannel,
const MobilityHelper mobility 
)

◆ Run() [4/7]

int Experiment::Run ( const WifiHelper wifi,
const YansWifiPhyHelper wifiPhy,
const WifiMacHelper wifiMac,
const YansWifiChannelHelper wifiChannel,
uint32_t  trialNumber,
uint32_t  networkSize,
Time  duration,
bool  pcap,
bool  infra,
uint16_t  guardIntervalNs,
double  distanceM,
double  apTxPowerDbm,
double  staTxPowerDbm,
Time  pktInterval 
)

Configure and run the experiment.

Parameters
wifithe pre-configured WifiHelper
wifiPhythe pre-configured YansWifiPhyHelper
wifiMacthe pre-configured WifiMacHelper
wifiChannelthe pre-configured YansWifiChannelHelper
trialNumberthe trial index
networkSizethe number of stations
durationthe duration of each simulation run
pcapflag to enable/disable PCAP files generation
infraflag to enable infrastructure model, ring adhoc network if not set
guardIntervalNsthe guard interval in ns
distanceMthe distance in meters
apTxPowerDbmthe AP transmit power in dBm
staTxPowerDbmthe STA transmit power in dBm
pktIntervalthe packet interval
Returns
0 if all went well

Definition at line 2438 of file wifi-bianchi.cc.

References ns3::Node::AddApplication(), AssociationLog(), BackoffTrace(), backoffTraceFile, ns3::Config::Connect(), ns3::YansWifiChannelHelper::Create(), ns3::NodeContainer::Create(), CwTrace(), cwTraceFile, ns3::Simulator::Destroy(), DisassociationLog(), ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::NodeContainer::Get(), ns3::Node::GetDevice(), ns3::NodeContainer::GetN(), ns3::Time::GetSeconds(), ns3::PacketSocketHelper::Install(), MacRxTrace(), macRxTraceFile, MacTxTrace(), macTxTraceFile, ns3::MakeCallback(), maxMpdus, ns3::MicroSeconds(), ns3::NanoSeconds(), NS_LOG_DEBUG, PhyRxDoneTrace(), PhyRxDropTrace(), PhyRxErrorTrace(), PhyRxOkTrace(), PhyRxPayloadTrace(), PhyRxTrace(), PhyTxDoneTrace(), PhyTxTrace(), phyTxTraceFile, PI, pktSize, RestartCalc(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::Config::Set(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::PacketSocketAddress::SetSingleDevice(), SocketSendTrace(), socketSendTraceFile, ns3::Simulator::Stop(), TracePacketReception(), and tracing.

+ Here is the call graph for this function:

◆ Run() [5/7]

◆ Run() [6/7]

◆ Run() [7/7]

uint32_t Experiment::Run ( uint32_t  param)

Run a parametrized experiment.

The parameter sets either the number of nodes (if m_doNode is true) or the "a" parameter, which controls the UanMacRcGw MaxReservations attribute.

Parameters
paramThe parameter value.
Returns
The total number of bytes delivered.

Definition at line 139 of file uan-rc-example.cc.

References ns3::NodeContainer::Create(), ns3::Socket::CreateSocket(), ns3::Simulator::Destroy(), ns3::NetDeviceContainer::Get(), ns3::UanHelper::Install(), ns3::PacketSocketHelper::Install(), ns3::TypeId::LookupByName(), m_bytesTotal, m_controlModes, m_dataModes, m_doNode, m_maxRange, m_numNodes, m_numRates, m_pktSize, m_sifs, m_simTime, m_totalRate, ns3::MakeCallback(), nodes, ReceivePacket(), ns3::Simulator::Run(), ns3::Seconds(), ns3::UanHelper::SetMac(), ns3::UanHelper::SetPhy(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::PacketSocketAddress::SetSingleDevice(), sink, ns3::ApplicationContainer::Start(), ns3::Simulator::Stop(), and ns3::ApplicationContainer::Stop().

+ Here is the call graph for this function:

◆ SelectSrcDest()

void Experiment::SelectSrcDest ( NodeContainer  c)
private

Sources and destinations are randomly selected such that a node may be the source for multiple destinations and a node maybe a destination for multiple sources.

Parameters
cThe node container.

Definition at line 382 of file wifi-multirate.cc.

References ApplicationSetup(), ns3::NodeContainer::Get(), ns3::NodeContainer::GetN(), and m_totalTime.

Referenced by Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendMultiDestinations()

void Experiment::SendMultiDestinations ( Ptr< Node sender,
NodeContainer  c 
)
private

A sender node will set up a flow to each of the its neighbors in its quadrant randomly.

All the flows are exponentially distributed.

Parameters
senderThe sender node.
cThe node neighbors.

Definition at line 399 of file wifi-multirate.cc.

References ApplicationSetup(), ns3::NodeContainer::Get(), ns3::NodeContainer::GetN(), m_expMean, m_totalTime, and NS_LOG_DEBUG.

Referenced by Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetPosition() [1/2]

void Experiment::SetPosition ( Ptr< Node node,
Vector  position 
)
private

Set the position of a node.

Parameters
nodeThe node.
positionThe position of the node.

Definition at line 112 of file wifi-adhoc.cc.

Referenced by AdvancePosition().

+ Here is the caller graph for this function:

◆ SetPosition() [2/2]

void Experiment::SetPosition ( Ptr< Node node,
Vector  position 
)
private

Set the position of a node.

Parameters
nodeThe node.
positionThe position of the node.

◆ SetupPacketReceive() [1/3]

Ptr< Socket > Experiment::SetupPacketReceive ( Ptr< Node node)
private

Setup the receiving socket.

Parameters
nodeThe receiving node.
Returns
the socket.

Definition at line 152 of file wifi-adhoc.cc.

References ns3::Socket::CreateSocket(), ns3::TypeId::LookupByName(), ns3::MakeCallback(), ReceivePacket(), and sink.

Referenced by ApplicationSetup(), and Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetupPacketReceive() [2/3]

Ptr< Socket > Experiment::SetupPacketReceive ( Ptr< Node node)
private

Setup the receiving socket.

Parameters
nodeThe receiving node.
Returns
the socket.

◆ SetupPacketReceive() [3/3]

Ptr< Socket > Experiment::SetupPacketReceive ( Ptr< Node node)
private

Setup the receiving socket.

Parameters
nodeThe receiving node.
Returns
the Rx socket.

◆ UpdatePositions()

void Experiment::UpdatePositions ( NodeContainer nodes) const

Assign new random positions to a set of nodes.

New positions are randomly assigned within the bounding box.

Parameters
nodesThe nodes to reposition.

Definition at line 106 of file uan-cw-example.cc.

References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), m_boundary, nodes, ns3::Now(), NS_LOG_DEBUG, and ns3::Time::S.

Referenced by Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_asciitracefile

std::string Experiment::m_asciitracefile

Name for ascii trace file, default uan-cw-example.asc.

Definition at line 84 of file uan-cw-example.h.

Referenced by Run().

◆ m_avgs

uint32_t Experiment::m_avgs

Number of topologies to test for each cw point.

Definition at line 78 of file uan-cw-example.h.

Referenced by IncrementCw(), and Run().

◆ m_bhCfgFile

std::string Experiment::m_bhCfgFile

(Unused)

Definition at line 85 of file uan-cw-example.h.

◆ m_boundary

double Experiment::m_boundary

Size of boundary in meters.

Definition at line 72 of file uan-cw-example.h.

Referenced by Run(), and UpdatePositions().

◆ m_bytesTotal

uint32_t Experiment::m_bytesTotal
private

The number of received bytes.

Total number of bytes received in a simulation run.

Total bytes received.

Total number of received bytes.

Definition at line 97 of file wifi-adhoc.cc.

Referenced by AdvancePosition(), CheckThroughput(), ReceivePacket(), ResetData(), and Run().

◆ m_containerA

NodeContainer Experiment::m_containerA
private

Node containers for each quadrant.

Definition at line 254 of file wifi-multirate.cc.

Referenced by AssignNeighbors(), and Run().

◆ m_containerB

NodeContainer Experiment::m_containerB
private

Node containers for each quadrant.

Definition at line 255 of file wifi-multirate.cc.

Referenced by AssignNeighbors(), and Run().

◆ m_containerC

NodeContainer Experiment::m_containerC
private

Node containers for each quadrant.

Definition at line 256 of file wifi-multirate.cc.

Referenced by AssignNeighbors(), and Run().

◆ m_containerD

NodeContainer Experiment::m_containerD
private

Node containers for each quadrant.

Definition at line 257 of file wifi-multirate.cc.

Referenced by AssignNeighbors(), and Run().

◆ m_controlModes

UanModesList Experiment::m_controlModes

List of UanTxModes used for control channels.

Definition at line 61 of file uan-rc-example.h.

Referenced by CreateDualModes(), and Run().

◆ m_cwMax

uint32_t Experiment::m_cwMax

Max CW to simulate.

Definition at line 76 of file uan-cw-example.h.

Referenced by Run().

◆ m_cwMin

uint32_t Experiment::m_cwMin

Min CW to simulate.

Definition at line 75 of file uan-cw-example.h.

Referenced by Run().

◆ m_cwStep

uint32_t Experiment::m_cwStep

CW step size, default 10.

Definition at line 77 of file uan-cw-example.h.

Referenced by IncrementCw(), and Run().

◆ m_data

Gnuplot2dDataset Experiment::m_data

Container for the simulation data.

Definition at line 87 of file uan-cw-example.h.

Referenced by IncrementCw(), and Run().

◆ m_dataModes

UanModesList Experiment::m_dataModes

List of UanTxModes used for data channels.

Definition at line 60 of file uan-rc-example.h.

Referenced by CreateDualModes(), and Run().

◆ m_dataRate

uint32_t Experiment::m_dataRate

DataRate in bps.

Definition at line 70 of file uan-cw-example.h.

Referenced by Run().

◆ m_depth

double Experiment::m_depth

Depth of transmitting and sink nodes.

Definition at line 71 of file uan-cw-example.h.

Referenced by Run().

◆ m_doNode

bool Experiment::m_doNode

1 for do max nodes simulation (invalidates AMin and AMax values).

Definition at line 52 of file uan-rc-example.h.

Referenced by Run().

◆ m_enableFlowMon

bool Experiment::m_enableFlowMon
private

True if FlowMon is enabled.

Definition at line 246 of file wifi-multirate.cc.

Referenced by Run().

◆ m_enableMobility

bool Experiment::m_enableMobility
private

True if mobility is enabled.

Definition at line 248 of file wifi-multirate.cc.

Referenced by CommandSetup(), IsMobility(), and Run().

◆ m_enablePcap

bool Experiment::m_enablePcap
private

True if PCAP output is enabled.

Definition at line 244 of file wifi-multirate.cc.

Referenced by Run().

◆ m_enableRouting

bool Experiment::m_enableRouting
private

True if routing is enabled.

Definition at line 247 of file wifi-multirate.cc.

Referenced by CommandSetup(), IsRouting(), and Run().

◆ m_enableTracing

bool Experiment::m_enableTracing
private

True if tracing output is enabled.

Definition at line 245 of file wifi-multirate.cc.

Referenced by Run().

◆ m_expMean

double Experiment::m_expMean
private

Exponential parameter for sending packets.

Definition at line 234 of file wifi-multirate.cc.

Referenced by SendMultiDestinations().

◆ m_gnudatfile

std::string Experiment::m_gnudatfile

Name for GNU Plot output, default uan-cw-example.gpl.

Definition at line 83 of file uan-cw-example.h.

◆ m_gnuplotfile

std::string Experiment::m_gnuplotfile

Filename for GnuPlot.

Definition at line 56 of file uan-rc-example.h.

◆ m_gridSize

uint32_t Experiment::m_gridSize
private

Grid size.

Definition at line 239 of file wifi-multirate.cc.

Referenced by AssignNeighbors(), and Run().

◆ m_maxRange

uint32_t Experiment::m_maxRange

Maximum range between gateway and acoustic node.

Definition at line 49 of file uan-rc-example.h.

Referenced by Run().

◆ m_nodeDistance

uint32_t Experiment::m_nodeDistance
private

Node distance.

Definition at line 240 of file wifi-multirate.cc.

Referenced by Run().

◆ m_numNodes

uint32_t Experiment::m_numNodes

Number of transmitting nodes.

Number of nodes (invalid for m_doNode true).

Definition at line 69 of file uan-cw-example.h.

Referenced by Run().

◆ m_numRates

uint32_t Experiment::m_numRates

Number of divided rates ( (NumberRates+1)TotalRate should be 0).

Definition at line 47 of file uan-rc-example.h.

Referenced by CreateDualModes(), CreateMode(), and Run().

◆ m_output

Gnuplot2dDataset Experiment::m_output
private

The output dataset.

Output dataset.

Definition at line 98 of file wifi-adhoc.cc.

Referenced by Experiment(), AdvancePosition(), CheckThroughput(), and Run().

◆ m_outputFileName

std::string Experiment::m_outputFileName
private

Output file name.

Definition at line 261 of file wifi-multirate.cc.

Referenced by CommandSetup(), and GetOutputFileName().

◆ m_packetSize

uint32_t Experiment::m_packetSize
private

Packet size.

Generated packet size in bytes.

Definition at line 238 of file wifi-multirate.cc.

Referenced by ApplicationSetup(), CommandSetup(), and Run().

◆ m_pktSize

uint32_t Experiment::m_pktSize

Packet size in bytes.

Definition at line 51 of file uan-rc-example.h.

Referenced by Run().

◆ m_pktsTotal

uint32_t Experiment::m_pktsTotal
private

Total number of received packets.

Definition at line 97 of file wifi-clear-channel-cmu.cc.

◆ m_port

uint32_t Experiment::m_port
private

Listening port.

Definition at line 241 of file wifi-multirate.cc.

Referenced by ApplicationSetup().

◆ m_rateManager

std::string Experiment::m_rateManager
private

Rate manager.

Definition at line 260 of file wifi-multirate.cc.

Referenced by CommandSetup(), and GetRateManager().

◆ m_rtsThreshold

std::string Experiment::m_rtsThreshold
private

Rts threshold.

Definition at line 259 of file wifi-multirate.cc.

Referenced by CommandSetup(), and GetRtsThreshold().

◆ m_samplingPeriod

double Experiment::m_samplingPeriod
private

Sampling period.

Definition at line 235 of file wifi-multirate.cc.

Referenced by CheckThroughput(), and CommandSetup().

◆ m_scenario

uint32_t Experiment::m_scenario
private

Scenario number.

Definition at line 242 of file wifi-multirate.cc.

Referenced by CommandSetup(), GetScenario(), and Run().

◆ m_sifs

Time Experiment::m_sifs

SIFS time duration.

Definition at line 53 of file uan-rc-example.h.

Referenced by Run().

◆ m_simMax

uint32_t Experiment::m_simMax

Maximum parameter to test.

Definition at line 45 of file uan-rc-example.h.

◆ m_simMin

uint32_t Experiment::m_simMin

Minimum parameter to test.

Definition at line 44 of file uan-rc-example.h.

◆ m_simStep

uint32_t Experiment::m_simStep

Amount to increment param per trial.

Definition at line 46 of file uan-rc-example.h.

◆ m_simTime

Time Experiment::m_simTime

Simulation run time, default 1000 s.

Simulation time per trial.

Definition at line 81 of file uan-cw-example.h.

Referenced by ResetData(), and Run().

◆ m_slotTime

Time Experiment::m_slotTime

Slot time duration.

Definition at line 80 of file uan-cw-example.h.

Referenced by Run().

◆ m_throughputs

std::vector<double> Experiment::m_throughputs

Throughput for each run.

Definition at line 88 of file uan-cw-example.h.

Referenced by IncrementCw(), and ResetData().

◆ m_totalRate

uint32_t Experiment::m_totalRate

Total channel capacity.

Definition at line 48 of file uan-rc-example.h.

Referenced by CreateMode(), and Run().

◆ m_totalTime

double Experiment::m_totalTime
private

Total experiment time.

Definition at line 233 of file wifi-multirate.cc.

Referenced by CommandSetup(), Run(), SelectSrcDest(), and SendMultiDestinations().


The documentation for this class was generated from the following files: