A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Experiment Class Reference

Helper class for UAN CW MAC example. More...

#include <uan-cw-example.h>

+ Collaboration diagram for Experiment:

Public Member Functions

 Experiment ()
 Experiment (std::string name)
 Experiment ()
 Experiment (std::string name)
 Experiment ()
 Experiment ()
 Experiment ()
 Experiment (std::string name)
bool CommandSetup (int argc, char **argv)
void CreateDualModes (uint32_t fc)
UanTxMode CreateMode (uint32_t kass, uint32_t fc, bool upperblock, std::string name)
std::string GetOutputFileName ()
std::string GetRateManager ()
std::string GetRtsThreshold ()
uint32_t GetScenario ()
void IncrementCw (uint32_t cw)
bool IsMobility ()
bool IsRouting ()
void ReceivePacket (Ptr< Socket > socket)
void ReceivePacket (Ptr< Socket > socket)
void ResetData ()
Gnuplot2dDataset Run (UanHelper &uan)
Gnuplot2dDataset Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel)
uint32_t Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel)
uint32_t Run (uint32_t param)
Gnuplot2dDataset Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel, const MobilityHelper &mobility)
void UpdatePositions (NodeContainer &nodes)

Public Attributes

std::string m_asciitracefile
uint32_t m_avgs
std::string m_bhCfgFile
double m_boundary
UanModesList m_controlModes
uint32_t m_cwMax
uint32_t m_cwMin
uint32_t m_cwStep
Gnuplot2dDataset m_data
UanModesList m_dataModes
uint32_t m_dataRate
double m_depth
bool m_doNode
std::string m_gnudatfile
std::string m_gnuplotfile
uint32_t m_maxRange
uint32_t m_numNodes
uint32_t m_numRates
uint32_t m_packetSize
uint32_t m_pktSize
Time m_sifs
uint32_t m_simMax
uint32_t m_simMin
uint32_t m_simStep
Time m_simTime
Time m_slotTime
std::vector< double > m_throughputs
uint32_t m_totalRate

Private Member Functions

void AdvancePosition (Ptr< Node > node)
void ApplicationSetup (Ptr< Node > client, Ptr< Node > server, double start, double stop)
void AssignNeighbors (NodeContainer c)
void CheckThroughput ()
NodeContainer GenerateNeighbors (NodeContainer c, uint32_t senderId)
void GenerateTraffic (Ptr< Socket > socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval)
Vector GetPosition (Ptr< Node > node)
Vector GetPosition (Ptr< Node > node)
void ReceivePacket (Ptr< Socket > socket)
void ReceivePacket (Ptr< Socket > socket)
void ReceivePacket (Ptr< Socket > socket)
void SelectSrcDest (NodeContainer c)
void SendMultiDestinations (Ptr< Node > sender, NodeContainer c)
void SetPosition (Ptr< Node > node, Vector position)
void SetPosition (Ptr< Node > node, Vector position)
Ptr< SocketSetupPacketReceive (Ptr< Node > node)
Ptr< SocketSetupPacketReceive (Ptr< Node > node)
Ptr< SocketSetupPacketReceive (Ptr< Node > node)

Private Attributes

uint32_t bytesTotal
NodeContainer containerA
NodeContainer containerB
NodeContainer containerC
NodeContainer containerD
bool enableFlowMon
bool enableMobility
bool enablePcap
bool enableRouting
bool enableTracing
double expMean
uint32_t gridSize
uint32_t m_bytesTotal
Gnuplot2dDataset m_output
uint32_t m_pktsTotal
uint32_t nodeDistance
std::string outputFileName
uint32_t packetSize
uint32_t port
std::string rateManager
std::string rtsThreshold
double samplingPeriod
uint32_t scenario
double totalTime

Detailed Description

Helper class for UAN CW MAC example.

Definition at line 71 of file multirate.cc.

Constructor & Destructor Documentation

Experiment::Experiment ( )

Definition at line 125 of file multirate.cc.

Experiment::Experiment ( std::string  name)

Definition at line 129 of file multirate.cc.

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

+ Here is the call graph for this function:

Experiment::Experiment ( )
Experiment::Experiment ( std::string  name)
Experiment::Experiment ( )
Experiment::Experiment ( std::string  name)
Experiment::Experiment ( )
Experiment::Experiment ( )

Member Function Documentation

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

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

References ns3::Gnuplot2dDataset::Add(), GetPosition(), m_bytesTotal, m_output, SetPosition(), and ns3::Vector3D::x.

Referenced by Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Experiment::ApplicationSetup ( Ptr< Node client,
Ptr< Node server,
double  start,
double  stop 
)
private
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

Definition at line 192 of file multirate.cc.

References ns3::NodeContainer::Add(), containerA, containerB, containerC, containerD, ns3::NodeContainer::Get(), ns3::NodeContainer::GetN(), and gridSize.

Referenced by Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Experiment::CheckThroughput ( )
private

Definition at line 175 of file multirate.cc.

References ns3::Gnuplot2dDataset::Add(), bytesTotal, m_output, ns3::Now(), and samplingPeriod.

Referenced by Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 533 of file multirate.cc.

References ns3::CommandLine::AddValue(), enableMobility, enableRouting, outputFileName, packetSize, ns3::CommandLine::Parse(), rateManager, rtsThreshold, samplingPeriod, scenario, and totalTime.

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Experiment::CreateDualModes ( uint32_t  fc)

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

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

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References m_numRates, and m_totalRate.

Referenced by CreateDualModes().

+ Here is the caller graph for this function:

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

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

Definition at line 233 of file 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:

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

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

References ns3::Socket::Close(), and ns3::Socket::Send().

+ Here is the call graph for this function:

std::string Experiment::GetOutputFileName ( )
inline

Definition at line 87 of file multirate.cc.

Referenced by main(), and Run().

+ Here is the caller graph for this function:

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

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

References ns3::Object::GetObject(), and ns3::MobilityModel::GetPosition().

Referenced by AdvancePosition(), and Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Vector Experiment::GetPosition ( Ptr< Node node)
private
std::string Experiment::GetRateManager ( )
inline

Definition at line 88 of file multirate.cc.

Referenced by main().

+ Here is the caller graph for this function:

std::string Experiment::GetRtsThreshold ( )
inline

Definition at line 86 of file multirate.cc.

Referenced by main().

+ Here is the caller graph for this function:

uint32_t Experiment::GetScenario ( )
inline

Definition at line 84 of file multirate.cc.

Referenced by main().

+ Here is the caller graph for this function:

void Experiment::IncrementCw ( uint32_t  cw)

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

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

Referenced by Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Experiment::IsMobility ( )
inline

Definition at line 82 of file multirate.cc.

Referenced by main().

+ Here is the caller graph for this function:

bool Experiment::IsRouting ( )
inline

Definition at line 81 of file multirate.cc.

Referenced by main().

+ Here is the caller graph for this function:

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

Definition at line 165 of file multirate.cc.

References bytesTotal, ns3::Packet::GetSize(), and ns3::Socket::Recv().

Referenced by Run(), and SetupPacketReceive().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Experiment::ResetData ( )

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

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

Referenced by Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t Experiment::Run ( const WifiHelper wifi,
const YansWifiPhyHelper wifiPhy,
const NqosWifiMacHelper wifiMac,
const YansWifiChannelHelper wifiChannel 
)
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.

Definition at line 255 of file multirate.cc.

References ApplicationSetup(), ns3::NodeContainer::Get(), ns3::UniformRandomVariable::GetInteger(), ns3::NodeContainer::GetN(), ns3::ObjectBase::SetAttribute(), and totalTime.

Referenced by Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 278 of file multirate.cc.

References ApplicationSetup(), expMean, ns3::NodeContainer::Get(), ns3::Node::GetId(), ns3::NodeContainer::GetN(), ns3::UniformRandomVariable::GetValue(), ns3::ExponentialRandomVariable::GetValue(), NS_LOG_DEBUG, ns3::ObjectBase::SetAttribute(), visualizer.core::start(), and totalTime.

Referenced by Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References ns3::Object::GetObject(), and ns3::MobilityModel::SetPosition().

Referenced by AdvancePosition().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 153 of file multirate.cc.

References ns3::Socket::Bind(), ns3::MakeCallback(), port, ReceivePacket(), and ns3::Socket::SetRecvCallback().

Referenced by ApplicationSetup(), and Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Experiment::UpdatePositions ( NodeContainer nodes)

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

References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), ns3::Object::GetObject(), ns3::UniformRandomVariable::GetValue(), m_boundary, ns3::Now(), NS_LOG_DEBUG, and ns3::MobilityModel::SetPosition().

Referenced by Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

uint32_t Experiment::bytesTotal
private

Definition at line 108 of file multirate.cc.

Referenced by CheckThroughput(), and ReceivePacket().

NodeContainer Experiment::containerA
private

Definition at line 121 of file multirate.cc.

Referenced by AssignNeighbors(), and Run().

NodeContainer Experiment::containerB
private

Definition at line 121 of file multirate.cc.

Referenced by AssignNeighbors(), and Run().

NodeContainer Experiment::containerC
private

Definition at line 121 of file multirate.cc.

Referenced by AssignNeighbors(), and Run().

NodeContainer Experiment::containerD
private

Definition at line 121 of file multirate.cc.

Referenced by AssignNeighbors(), and Run().

bool Experiment::enableFlowMon
private

Definition at line 117 of file multirate.cc.

Referenced by Run().

bool Experiment::enableMobility
private

Definition at line 119 of file multirate.cc.

Referenced by CommandSetup(), and Run().

bool Experiment::enablePcap
private

Definition at line 115 of file multirate.cc.

Referenced by Run().

bool Experiment::enableRouting
private

Definition at line 118 of file multirate.cc.

Referenced by CommandSetup(), and Run().

bool Experiment::enableTracing
private

Definition at line 116 of file multirate.cc.

Referenced by Run().

double Experiment::expMean
private

Definition at line 105 of file multirate.cc.

Referenced by SendMultiDestinations().

uint32_t Experiment::gridSize
private

Definition at line 110 of file multirate.cc.

Referenced by AssignNeighbors(), and Run().

std::string Experiment::m_asciitracefile

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

Referenced by Run().

uint32_t Experiment::m_avgs

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

Referenced by IncrementCw(), main(), and Run().

std::string Experiment::m_bhCfgFile

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

double Experiment::m_boundary

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

Referenced by main(), Run(), and UpdatePositions().

uint32_t Experiment::m_bytesTotal
private

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

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

UanModesList Experiment::m_controlModes

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

Referenced by CreateDualModes(), and Run().

uint32_t Experiment::m_cwMax

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

Referenced by main(), and Run().

uint32_t Experiment::m_cwMin

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

Referenced by main(), and Run().

uint32_t Experiment::m_cwStep

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

Referenced by IncrementCw(), and Run().

Gnuplot2dDataset Experiment::m_data

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

Referenced by IncrementCw(), and Run().

UanModesList Experiment::m_dataModes

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

Referenced by CreateDualModes(), and Run().

uint32_t Experiment::m_dataRate

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

Referenced by main(), and Run().

double Experiment::m_depth

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

Referenced by main(), and Run().

bool Experiment::m_doNode

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

Referenced by main(), and Run().

std::string Experiment::m_gnudatfile

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

Referenced by main().

std::string Experiment::m_gnuplotfile

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

Referenced by main().

uint32_t Experiment::m_maxRange

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

Referenced by main(), and Run().

uint32_t Experiment::m_numNodes

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

Referenced by main(), and Run().

uint32_t Experiment::m_numRates

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

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

Gnuplot2dDataset Experiment::m_output
private

Definition at line 102 of file multirate.cc.

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

uint32_t Experiment::m_packetSize

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

Referenced by main(), and Run().

uint32_t Experiment::m_pktSize

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

Referenced by main(), and Run().

uint32_t Experiment::m_pktsTotal
private

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

Time Experiment::m_sifs

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

Referenced by main(), and Run().

uint32_t Experiment::m_simMax

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

Referenced by main().

uint32_t Experiment::m_simMin

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

Referenced by main().

uint32_t Experiment::m_simStep

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

Referenced by main().

Time Experiment::m_simTime

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

Referenced by main(), ResetData(), and Run().

Time Experiment::m_slotTime

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

Referenced by main(), and Run().

std::vector<double> Experiment::m_throughputs

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

Referenced by IncrementCw(), and ResetData().

uint32_t Experiment::m_totalRate

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

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

uint32_t Experiment::nodeDistance
private

Definition at line 111 of file multirate.cc.

Referenced by Run().

std::string Experiment::outputFileName
private

Definition at line 122 of file multirate.cc.

Referenced by CommandSetup().

uint32_t Experiment::packetSize
private

Definition at line 109 of file multirate.cc.

Referenced by ApplicationSetup(), and CommandSetup().

uint32_t Experiment::port
private

Definition at line 112 of file multirate.cc.

Referenced by ApplicationSetup(), and SetupPacketReceive().

std::string Experiment::rateManager
private

Definition at line 122 of file multirate.cc.

Referenced by CommandSetup().

std::string Experiment::rtsThreshold
private

Definition at line 122 of file multirate.cc.

Referenced by CommandSetup().

double Experiment::samplingPeriod
private

Definition at line 106 of file multirate.cc.

Referenced by CheckThroughput(), and CommandSetup().

uint32_t Experiment::scenario
private

Definition at line 113 of file multirate.cc.

Referenced by CommandSetup(), and Run().

double Experiment::totalTime
private

Definition at line 104 of file multirate.cc.

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


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