WiFi adhoc experiment class. More...
#include "uan-cw-example.h"
Public Member Functions | |
Experiment () | |
Experiment () | |
Experiment () | |
Experiment () | |
Experiment () | |
Default constructor. More... | |
Experiment () | |
Default constructor. More... | |
Experiment () | |
Experiment (std::string name) | |
Constructor. More... | |
Experiment (std::string name) | |
Constructor. More... | |
Experiment (std::string name) | |
Construct a new Experiment object. More... | |
bool | CommandSetup (int argc, char **argv) |
Setup the experiment from the command line arguments. More... | |
void | CreateDualModes (uint32_t fc) |
Create m_numRates matching control and data modes. More... | |
UanTxMode | CreateMode (uint32_t kass, uint32_t fc, bool upperblock, std::string name) const |
Create a UanTxMode. More... | |
std::string | GetOutputFileName () const |
Get the Output File Name. More... | |
std::string | GetRateManager () const |
Get the Rate Manager. More... | |
std::string | GetRtsThreshold () const |
Get the RTS Threshold. More... | |
uint32_t | GetScenario () const |
Get the Scenario number. More... | |
void | IncrementCw (uint32_t cw) |
Compute average throughput for a set of runs, then increment CW. More... | |
bool | IsMobility () const |
Check if mobility is enabled. More... | |
bool | IsRouting () const |
Check if routing is enabled. More... | |
void | ReceivePacket (Ptr< Socket > socket) |
Receive all available packets from a socket. More... | |
void | ReceivePacket (Ptr< Socket > socket) |
Callback to receive a packet. More... | |
void | ResetData () |
Save the throughput from a single run. More... | |
Gnuplot2dDataset | Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel) |
Run an experiment. More... | |
uint32_t | Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel) |
Run an experiment. More... | |
Gnuplot2dDataset | Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel, const MobilityHelper &mobility) |
Run an experiment. More... | |
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. More... | |
double | Run (Parameters params) |
Run an experiment with the given parameters. More... | |
Gnuplot2dDataset | Run (UanHelper &uan) |
Run an experiment across a range of congestion window values. More... | |
uint32_t | Run (uint32_t param) |
Run a parametrized experiment. More... | |
void | UpdatePositions (NodeContainer &nodes) const |
Assign new random positions to a set of nodes. More... | |
Public Attributes | |
std::string | m_asciitracefile |
Name for ascii trace file, default uan-cw-example.asc. More... | |
uint32_t | m_avgs |
Number of topologies to test for each cw point. More... | |
std::string | m_bhCfgFile |
(Unused) More... | |
double | m_boundary |
Size of boundary in meters. More... | |
UanModesList | m_controlModes |
List of UanTxModes used for control channels. More... | |
uint32_t | m_cwMax |
Max CW to simulate. More... | |
uint32_t | m_cwMin |
Min CW to simulate. More... | |
uint32_t | m_cwStep |
CW step size, default 10. More... | |
Gnuplot2dDataset | m_data |
Container for the simulation data. More... | |
UanModesList | m_dataModes |
List of UanTxModes used for data channels. More... | |
uint32_t | m_dataRate |
DataRate in bps. More... | |
double | m_depth |
Depth of transmitting and sink nodes. More... | |
bool | m_doNode |
1 for do max nodes simulation (invalidates AMin and AMax values). More... | |
std::string | m_gnudatfile |
Name for GNU Plot output, default uan-cw-example.gpl. More... | |
std::string | m_gnuplotfile |
Filename for GnuPlot. More... | |
uint32_t | m_maxRange |
Maximum range between gateway and acoustic node. More... | |
uint32_t | m_numNodes |
Number of transmitting nodes. More... | |
uint32_t | m_numRates |
Number of divided rates ( (NumberRates+1)TotalRate should be 0). More... | |
uint32_t | m_pktSize |
Packet size in bytes. More... | |
Time | m_sifs |
SIFS time duration. More... | |
uint32_t | m_simMax |
Maximum parameter to test. More... | |
uint32_t | m_simMin |
Minimum parameter to test. More... | |
uint32_t | m_simStep |
Amount to increment param per trial. More... | |
Time | m_simTime |
Simulation run time, default 1000 s. More... | |
Time | m_slotTime |
Slot time duration. More... | |
std::vector< double > | m_throughputs |
Throughput for each run. More... | |
uint32_t | m_totalRate |
Total channel capacity. More... | |
Private Member Functions | |
void | AdvancePosition (Ptr< Node > node) |
Move a node by 1m on the x axis, stops at 210m. More... | |
void | ApplicationSetup (Ptr< Node > client, Ptr< Node > server, double start, double stop) |
Setup the application in the nodes. More... | |
void | AssignNeighbors (NodeContainer c) |
Take the grid map, divide it into 4 quadrants Assign all nodes from each quadrant to a specific container. More... | |
void | CheckThroughput () |
Calculate the throughput. More... | |
NodeContainer | GenerateNeighbors (NodeContainer c, uint32_t senderId) |
Generate 1-hop and 2-hop neighbors of a node in grid topology. More... | |
void | GenerateTraffic (Ptr< Socket > socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval) |
Generate the traffic. More... | |
Vector | GetPosition (Ptr< Node > node) |
Get the position of a node. More... | |
Vector | GetPosition (Ptr< Node > node) |
Get the position of a node. More... | |
void | ReceivePacket (Ptr< Socket > socket) |
Receive a packet. More... | |
void | ReceivePacket (Ptr< Socket > socket) |
Receive a packet. More... | |
void | ReceivePacket (Ptr< Socket > socket) |
Receive a packet. More... | |
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. More... | |
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. More... | |
void | SetPosition (Ptr< Node > node, Vector position) |
Set the position of a node. More... | |
void | SetPosition (Ptr< Node > node, Vector position) |
Set the position of a node. More... | |
Ptr< Socket > | SetupPacketReceive (Ptr< Node > node) |
Setup the receiving socket. More... | |
Ptr< Socket > | SetupPacketReceive (Ptr< Node > node) |
Setup the receiving socket. More... | |
Ptr< Socket > | SetupPacketReceive (Ptr< Node > node) |
Setup the receiving socket. More... | |
Private Attributes | |
uint32_t | m_bytesTotal |
The number of received bytes. More... | |
bool | m_enableFlowMon |
True if FlowMon is enabled. More... | |
bool | m_enableMobility |
True if mobility is enabled. More... | |
bool | m_enablePcap |
True if PCAP output is enabled. More... | |
bool | m_enableRouting |
True if routing is enabled. More... | |
bool | m_enableTracing |
True if tracing output is enabled. More... | |
double | m_expMean |
Exponential parameter for sending packets. More... | |
uint32_t | m_gridSize |
Grid size. More... | |
uint32_t | m_nodeDistance |
Node distance. More... | |
Gnuplot2dDataset | m_output |
The output dataset. More... | |
std::string | m_outputFileName |
Output file name. More... | |
uint32_t | m_packetSize |
Packet size. More... | |
uint32_t | m_pktsTotal |
Total number of received packets. More... | |
uint32_t | m_port |
Listening port. More... | |
std::string | m_rateManager |
Rate manager. More... | |
std::string | m_rtsThreshold |
Rts threshold. More... | |
double | m_samplingPeriod |
Sampling period. More... | |
uint32_t | m_scenario |
Scenario number. More... | |
double | m_totalTime |
Total experiment time. More... | |
NodeContainer | m_containerA |
Node containers for each quadrant. More... | |
NodeContainer | m_containerB |
Node containers for each quadrant. More... | |
NodeContainer | m_containerC |
Node containers for each quadrant. More... | |
NodeContainer | m_containerD |
Node containers for each quadrant. More... | |
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.
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.
Definition at line 44 of file wifi-adhoc.cc.
Experiment::Experiment | ( | ) |
Definition at line 101 of file wifi-adhoc.cc.
Experiment::Experiment | ( | std::string | name | ) |
Constructor.
name | The name of the experiment. |
Definition at line 105 of file wifi-adhoc.cc.
References m_output, and ns3::Gnuplot2dDataset::SetStyle().
Experiment::Experiment | ( | ) |
Experiment::Experiment | ( | std::string | name | ) |
Constructor.
name | The name of the experiment. |
Experiment::Experiment | ( | ) |
Experiment::Experiment | ( | ) |
Experiment::Experiment | ( | std::string | name | ) |
Construct a new Experiment object.
name | The name of the experiment. |
Experiment::Experiment | ( | ) |
Default constructor.
Experiment::Experiment | ( | ) |
Default constructor.
Experiment::Experiment | ( | ) |
Move a node by 1m on the x axis, stops at 210m.
node | The node. |
Definition at line 126 of file wifi-adhoc.cc.
References ns3::Gnuplot2dDataset::Add(), GetPosition(), m_bytesTotal, m_output, ns3::Seconds(), and SetPosition().
Referenced by Run().
|
private |
Setup the application in the nodes.
client | Client node. |
server | Server node. |
start | Start time. |
stop | Stop time. |
Definition at line 471 of file wifi-multirate.cc.
References brite-generic-example::client, m_packetSize, m_port, NS_LOG_DEBUG, openflow-switch::onoff, PrintPosition(), ns3::Seconds(), brite-generic-example::server, SetupPacketReceive(), sink, ns3::ApplicationContainer::Start(), two-ray-to-three-gpp-ch-calibration::start, ns3::ApplicationContainer::Stop(), and two-ray-to-three-gpp-ch-calibration::stop.
Referenced by Run(), SelectSrcDest(), and SendMultiDestinations().
|
private |
Take the grid map, divide it into 4 quadrants Assign all nodes from each quadrant to a specific container.
c | The 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().
|
private |
Calculate the throughput.
Definition at line 317 of file wifi-multirate.cc.
References ns3::Gnuplot2dDataset::Add(), m_bytesTotal, m_output, m_samplingPeriod, ns3::Now(), and ns3::Seconds().
Referenced by Run().
bool Experiment::CommandSetup | ( | int | argc, |
char ** | argv | ||
) |
Setup the experiment from the command line arguments.
argc | The argument count. |
argv | The argument vector. |
Definition at line 666 of file wifi-multirate.cc.
References second::cmd, m_enableMobility, m_enableRouting, m_outputFileName, m_packetSize, m_rateManager, m_rtsThreshold, m_samplingPeriod, m_scenario, and m_totalTime.
void Experiment::CreateDualModes | ( | uint32_t | fc | ) |
Create m_numRates matching control and data modes.
fc | Mode center frequency offset. |
Definition at line 125 of file uan-rc-example.cc.
References ns3::UanModesList::AppendMode(), CreateMode(), m_controlModes, m_dataModes, and m_numRates.
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
The center frequency is set to
where the upper sign is taken if upperblock is true.
kass | Fraction of total bandwidth assigned to mode. |
fc | Mode center frequency offset. |
upperblock | Sign choice in setting the center frequency. |
name | Mode name. |
Definition at line 98 of file uan-rc-example.cc.
References m_numRates, and m_totalRate.
Referenced by CreateDualModes().
|
private |
Generate 1-hop and 2-hop neighbors of a node in grid topology.
c | The node container. |
senderId | The sender ID. |
Definition at line 365 of file wifi-multirate.cc.
References ns3::NodeContainer::Add(), and ns3::NodeContainer::Get().
Referenced by Run().
|
private |
Generate the traffic.
socket | The sending socket. |
pktSize | The packet size. |
pktCount | The number of packets to send. |
pktInterval | The time between packets. |
Definition at line 147 of file wifi-clear-channel-cmu.cc.
References ns3::Socket::Close(), pktSize, and ns3::Socket::Send().
|
inline |
Get the Output File Name.
Definition at line 157 of file wifi-multirate.cc.
Referenced by Run().
Get the position of a node.
node | The node. |
Definition at line 119 of file wifi-adhoc.cc.
References ns3::Object::GetObject(), and third::mobility.
Referenced by AdvancePosition().
Get the position of a node.
node | The node. |
|
inline |
|
inline |
|
inline |
Get the Scenario number.
Definition at line 137 of file wifi-multirate.cc.
void Experiment::IncrementCw | ( | uint32_t | cw | ) |
Compute average throughput for a set of runs, then increment CW.
cw | CW value for completed runs. |
Definition at line 85 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().
|
inline |
Check if mobility is enabled.
Definition at line 127 of file wifi-multirate.cc.
|
inline |
Check if routing is enabled.
Definition at line 117 of file wifi-multirate.cc.
Receive a packet.
socket | The receiving socket. |
Definition at line 142 of file wifi-adhoc.cc.
References ns3::Packet::GetSize(), m_bytesTotal, and ns3::Socket::Recv().
Referenced by Run(), and SetupPacketReceive().
Receive a packet.
socket | The receiving socket. |
Receive a packet.
socket | The receiving socket. |
Receive all available packets from a socket.
socket | The receive socket. |
Callback to receive a packet.
socket | The socket receiving packets. |
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(), and NS_LOG_DEBUG.
Referenced by Run().
uint32_t Experiment::Run | ( | const WifiHelper & | wifi, |
const YansWifiPhyHelper & | wifiPhy, | ||
const WifiMacHelper & | wifiMac, | ||
const YansWifiChannelHelper & | wifiChannel | ||
) |
Run an experiment.
wifi | //!< The WifiHelper class. |
wifiPhy | //!< The YansWifiPhyHelper class. |
wifiMac | //!< The WifiMacHelper class. |
wifiChannel | //!< The YansWifiChannelHelper class. |
Definition at line 162 of file wifi-adhoc.cc.
References AdvancePosition(), ns3::YansWifiChannelHelper::Create(), ns3::NodeContainer::Create(), first::devices, ns3::NodeContainer::Get(), ns3::PacketSocketHelper::Install(), m_bytesTotal, m_output, third::mobility, openflow-switch::onoff, third::phy, ns3::Seconds(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::PacketSocketAddress::SetSingleDevice(), SetupPacketReceive(), ns3::ApplicationContainer::Start(), ns3::ApplicationContainer::Stop(), and third::wifi.
uint32_t Experiment::Run | ( | const WifiHelper & | wifi, |
const YansWifiPhyHelper & | wifiPhy, | ||
const WifiMacHelper & | wifiMac, | ||
const YansWifiChannelHelper & | wifiChannel | ||
) |
Run an experiment.
wifi | //!< The WifiHelper class. |
wifiPhy | //!< The YansWifiPhyHelper class. |
wifiMac | //!< The WifiMacHelper class. |
wifiChannel | //!< The YansWifiChannelHelper class. |
Gnuplot2dDataset Experiment::Run | ( | const WifiHelper & | wifi, |
const YansWifiPhyHelper & | wifiPhy, | ||
const WifiMacHelper & | wifiMac, | ||
const YansWifiChannelHelper & | wifiChannel, | ||
const MobilityHelper & | mobility | ||
) |
Run an experiment.
wifi | The WifiHelper class. |
wifiPhy | The YansWifiPhyHelper class. |
wifiMac | The WifiMacHelper class. |
wifiChannel | The YansWifiChannelHelper class. |
mobility | The MobilityHelper class. |
Definition at line 495 of file wifi-multirate.cc.
References first::address, ApplicationSetup(), AssignNeighbors(), CheckThroughput(), ns3::YansWifiChannelHelper::Create(), ns3::NodeContainer::Create(), ns3::AsciiTraceHelper::CreateFileStream(), first::devices, GenerateNeighbors(), ns3::NodeContainer::Get(), GetOutputFileName(), ns3::MobilityHelper::Install(), ns3::FlowMonitorHelper::InstallAll(), nsclick-simple-lan::internet, list, m_containerA, m_containerB, m_containerC, m_containerD, m_enableFlowMon, m_enableMobility, m_enablePcap, m_enableRouting, m_enableTracing, m_gridSize, m_nodeDistance, m_output, m_scenario, m_totalTime, third::mobility, NS_LOG_DEBUG, third::phy, ns3::Seconds(), SelectSrcDest(), SendMultiDestinations(), ns3::FlowMonitorHelper::SerializeToXmlFile(), ns3::MobilityHelper::SetMobilityModel(), ns3::MobilityHelper::SetPositionAllocator(), and third::wifi.
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.
wifi | the pre-configured WifiHelper |
wifiPhy | the pre-configured YansWifiPhyHelper |
wifiMac | the pre-configured WifiMacHelper |
wifiChannel | the pre-configured YansWifiChannelHelper |
trialNumber | the trial index |
networkSize | the number of stations |
duration | the duration of each simulation run |
pcap | flag to enable/disable PCAP files generation |
infra | flag to enable infrastructure model, ring adhoc network if not set |
guardIntervalNs | the guard interval in ns |
distanceM | the distance in meters |
apTxPowerDbm | the AP transmit power in dBm |
staTxPowerDbm | the STA transmit power in dBm |
pktInterval | the packet interval |
Definition at line 2437 of file wifi-bianchi.cc.
References ns3::Node::AddApplication(), AssociationLog(), BackoffTrace(), backoffTraceFile, brite-generic-example::client, ns3::Config::Connect(), ns3::YansWifiChannelHelper::Create(), ns3::NodeContainer::Create(), CwTrace(), cwTraceFile, ns3::Simulator::Destroy(), first::devices, DisassociationLog(), ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::NodeContainer::Get(), ns3::Node::GetDevice(), ns3::WifiNetDevice::GetMac(), ns3::NodeContainer::GetN(), ns3::Time::GetSeconds(), ns3::UniformRandomVariable::GetValue(), ns3::PacketSocketHelper::Install(), third::mac, MacRxTrace(), macRxTraceFile, MacTxTrace(), macTxTraceFile, ns3::MakeCallback(), max, maxMpdus, ns3::MicroSeconds(), third::mobility, ns3::NanoSeconds(), NS_LOG_DEBUG, third::phy, PhyRxDoneTrace(), PhyRxDropTrace(), PhyRxErrorTrace(), PhyRxOkTrace(), PhyRxPayloadTrace(), PhyRxTrace(), PhyTxDoneTrace(), PhyTxTrace(), phyTxTraceFile, PI, pktSize, RestartCalc(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), brite-generic-example::server, ns3::Config::Set(), ns3::ObjectBase::SetAttribute(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::PacketSocketAddress::SetSingleDevice(), SocketSendTrace(), socketSendTraceFile, third::ssid, two-ray-to-three-gpp-ch-calibration::start, ns3::Simulator::Stop(), TracePacketReception(), tracing, and third::wifi.
double Experiment::Run | ( | Parameters | params | ) |
Run an experiment with the given parameters.
params | the given parameters |
Definition at line 104 of file wifi-mixed-network.cc.
References first::address, third::channel, brite-generic-example::client, first::clientApps, ns3::NodeContainer::Create(), ns3::YansWifiChannelHelper::Default(), ns3::Simulator::Destroy(), ns3::PointerValue::Get(), ns3::ApplicationContainer::Get(), ns3::NodeContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::Ipv4Address::GetAny(), ns3::ObjectBase::GetAttribute(), ns3::Node::GetDevice(), ns3::WifiNetDevice::GetMac(), third::mac, ns3::MicroSeconds(), third::mobility, openflow-switch::onoff, nsclick-simple-lan::packetSinkHelper, two-ray-to-three-gpp-ch-calibration::params, third::phy, port, nsclick-simple-lan::remoteAddress, ns3::Simulator::Run(), ns3::Seconds(), brite-generic-example::server, ns3::Config::Set(), ns3::Config::SetDefault(), ns3::Txop::SetTxopLimit(), third::ssid, first::stack, ns3::ApplicationContainer::Start(), ns3::Simulator::Stop(), ns3::ApplicationContainer::Stop(), throughput, third::wifi, ns3::WIFI_STANDARD_80211b, ns3::WIFI_STANDARD_80211g, ns3::WIFI_STANDARD_80211n, and third::wifiApNode.
Gnuplot2dDataset Experiment::Run | ( | UanHelper & | uan | ) |
Run an experiment across a range of congestion window values.
uan | The Uan stack helper to configure nodes in the model. |
Definition at line 131 of file uan-cw-example.cc.
References ns3::Object::AggregateObject(), openflow-switch::app, ns3::Socket::Bind(), third::channel, ns3::NodeContainer::Create(), first::devices, ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::NetDeviceContainer::GetN(), ns3::NodeContainer::GetN(), ns3::Object::GetObject(), ns3::MobilityModel::GetPosition(), ns3::UniformRandomVariable::GetValue(), IncrementCw(), ns3::UanHelper::Install(), ns3::PacketSocketHelper::Install(), m_asciitracefile, m_avgs, m_boundary, m_bytesTotal, m_cwMax, m_cwMin, m_cwStep, m_data, m_dataRate, m_depth, m_numNodes, m_packetSize, m_simTime, m_slotTime, ns3::MakeCallback(), min, third::mobility, NS_FATAL_ERROR, NS_LOG_DEBUG, ReceivePacket(), ResetData(), ns3::Seconds(), ns3::UanHelper::SetMac(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::Socket::SetRecvCallback(), ns3::PacketSocketAddress::SetSingleDevice(), sink, ns3::ApplicationContainer::Start(), ns3::ApplicationContainer::Stop(), UpdatePositions(), and two-ray-to-three-gpp-ch-calibration::x.
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.
param | The parameter value. |
Definition at line 138 of file uan-rc-example.cc.
References openflow-switch::app, ns3::Socket::Bind(), ns3::NodeContainer::Create(), first::devices, ns3::NetDeviceContainer::Get(), ns3::UniformRandomVariable::GetValue(), ns3::UanHelper::Install(), ns3::PacketSocketHelper::Install(), m_bytesTotal, m_controlModes, m_dataModes, m_doNode, m_maxRange, m_numNodes, m_numRates, m_pktSize, m_sifs, m_simTime, m_totalRate, ns3::MakeCallback(), third::mobility, nodes, ReceivePacket(), ns3::Seconds(), ns3::UanHelper::SetMac(), ns3::UanHelper::SetPhy(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::Socket::SetRecvCallback(), ns3::PacketSocketAddress::SetSingleDevice(), sink, ns3::ApplicationContainer::Start(), ns3::ApplicationContainer::Stop(), and two-ray-to-three-gpp-ch-calibration::x.
|
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.
c | The node container. |
Definition at line 382 of file wifi-multirate.cc.
References ApplicationSetup(), ns3::NodeContainer::Get(), ns3::UniformRandomVariable::GetInteger(), ns3::NodeContainer::GetN(), m_totalTime, and ns3::ObjectBase::SetAttribute().
Referenced by Run().
|
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.
sender | The sender node. |
c | The node neighbors. |
Definition at line 399 of file wifi-multirate.cc.
References ApplicationSetup(), ns3::NodeContainer::Get(), ns3::Node::GetId(), ns3::NodeContainer::GetN(), ns3::ExponentialRandomVariable::GetValue(), ns3::UniformRandomVariable::GetValue(), m_expMean, m_totalTime, NS_LOG_DEBUG, ns3::ObjectBase::SetAttribute(), two-ray-to-three-gpp-ch-calibration::start, and two-ray-to-three-gpp-ch-calibration::stop.
Referenced by Run().
Set the position of a node.
node | The node. |
position | The position of the node. |
Definition at line 112 of file wifi-adhoc.cc.
References ns3::Object::GetObject(), and third::mobility.
Referenced by AdvancePosition().
Set the position of a node.
node | The node. |
position | The position of the node. |
Setup the receiving socket.
node | The receiving node. |
Definition at line 152 of file wifi-adhoc.cc.
References ns3::MakeCallback(), ReceivePacket(), and sink.
Referenced by ApplicationSetup(), and Run().
Setup the receiving socket.
node | The receiving node. |
Setup the receiving socket.
node | The receiving node. |
void Experiment::UpdatePositions | ( | NodeContainer & | nodes | ) | const |
Assign new random positions to a set of nodes.
New positions are randomly assigned within the bounding box.
nodes | The nodes to reposition. |
Definition at line 106 of file uan-cw-example.cc.
References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), ns3::Object::GetObject(), ns3::UniformRandomVariable::GetValue(), m_boundary, nodes, ns3::Now(), NS_LOG_DEBUG, and ns3::MobilityModel::SetPosition().
Referenced by Run().
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().
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().
std::string Experiment::m_bhCfgFile |
(Unused)
Definition at line 85 of file uan-cw-example.h.
double Experiment::m_boundary |
Size of boundary in meters.
Definition at line 72 of file uan-cw-example.h.
Referenced by Run(), and UpdatePositions().
|
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().
|
private |
Node containers for each quadrant.
Definition at line 254 of file wifi-multirate.cc.
Referenced by AssignNeighbors(), and Run().
|
private |
Node containers for each quadrant.
Definition at line 255 of file wifi-multirate.cc.
Referenced by AssignNeighbors(), and Run().
|
private |
Node containers for each quadrant.
Definition at line 256 of file wifi-multirate.cc.
Referenced by AssignNeighbors(), and Run().
|
private |
Node containers for each quadrant.
Definition at line 257 of file wifi-multirate.cc.
Referenced by AssignNeighbors(), and Run().
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().
uint32_t Experiment::m_cwMax |
uint32_t Experiment::m_cwMin |
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().
Gnuplot2dDataset Experiment::m_data |
Container for the simulation data.
Definition at line 87 of file uan-cw-example.h.
Referenced by IncrementCw(), and Run().
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().
uint32_t Experiment::m_dataRate |
double Experiment::m_depth |
Depth of transmitting and sink nodes.
Definition at line 71 of file uan-cw-example.h.
Referenced by Run().
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().
|
private |
|
private |
True if mobility is enabled.
Definition at line 248 of file wifi-multirate.cc.
Referenced by CommandSetup(), and Run().
|
private |
True if PCAP output is enabled.
Definition at line 244 of file wifi-multirate.cc.
Referenced by Run().
|
private |
True if routing is enabled.
Definition at line 247 of file wifi-multirate.cc.
Referenced by CommandSetup(), and Run().
|
private |
True if tracing output is enabled.
Definition at line 245 of file wifi-multirate.cc.
Referenced by Run().
|
private |
Exponential parameter for sending packets.
Definition at line 234 of file wifi-multirate.cc.
Referenced by SendMultiDestinations().
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.
std::string Experiment::m_gnuplotfile |
Filename for GnuPlot.
Definition at line 56 of file uan-rc-example.h.
|
private |
Grid size.
Definition at line 239 of file wifi-multirate.cc.
Referenced by AssignNeighbors(), and Run().
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().
|
private |
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().
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().
|
private |
The output dataset.
Output dataset.
Definition at line 98 of file wifi-adhoc.cc.
Referenced by Experiment(), AdvancePosition(), CheckThroughput(), and Run().
|
private |
|
private |
Packet size.
Generated packet size in bytes.
Definition at line 238 of file wifi-multirate.cc.
Referenced by ApplicationSetup(), CommandSetup(), and Run().
uint32_t Experiment::m_pktSize |
|
private |
Total number of received packets.
Definition at line 97 of file wifi-clear-channel-cmu.cc.
|
private |
|
private |
|
private |
|
private |
Sampling period.
Definition at line 235 of file wifi-multirate.cc.
Referenced by CheckThroughput(), and CommandSetup().
|
private |
Scenario number.
Definition at line 242 of file wifi-multirate.cc.
Referenced by CommandSetup(), and Run().
Time Experiment::m_sifs |
uint32_t Experiment::m_simMax |
Maximum parameter to test.
Definition at line 45 of file uan-rc-example.h.
uint32_t Experiment::m_simMin |
Minimum parameter to test.
Definition at line 44 of file uan-rc-example.h.
uint32_t Experiment::m_simStep |
Amount to increment param per trial.
Definition at line 46 of file uan-rc-example.h.
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().
Time Experiment::m_slotTime |
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().
uint32_t Experiment::m_totalRate |
Total channel capacity.
Definition at line 48 of file uan-rc-example.h.
Referenced by CreateMode(), and Run().
|
private |
Total experiment time.
Definition at line 233 of file wifi-multirate.cc.
Referenced by CommandSetup(), Run(), SelectSrcDest(), and SendMultiDestinations().