Helper class for UAN CW MAC example. More...
Public Member Functions | |
| Experiment () | |
| Default constructor. | |
| void | IncrementCw (uint32_t cw) |
| Compute average throughput for a set of runs, then increment CW. | |
| void | ReceivePacket (Ptr< Socket > socket) |
| Receive all available packets from a socket. | |
| void | ResetData () |
| Save the throughput from a single run. | |
| Gnuplot2dDataset | Run (UanHelper &uan) |
| Run an experiment across a range of congestion window values. | |
| 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. | |
| uint32_t | m_bytesTotal |
| Total bytes received. | |
| 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. | |
| uint32_t | m_dataRate |
| DataRate in bps. | |
| double | m_depth |
| Depth of transmitting and sink nodes. | |
| std::string | m_gnudatfile |
| Name for GNU Plot output, default uan-cw-example.gpl. | |
| uint32_t | m_numNodes |
| Number of transmitting nodes. | |
| uint32_t | m_packetSize |
| Generated packet size in bytes. | |
| Time | m_simTime |
| Simulation run time, default 1000 s. | |
| Time | m_slotTime |
| Slot time duration. | |
| std::vector< double > | m_throughputs |
| Throughput for each run. | |
Helper class for UAN CW MAC example.
An experiment measures the average throughput for a series of CW values.
Definition at line 57 of file uan-cw-example.cc.
| anonymous_namespace{uan-cw-example.cc}::Experiment::Experiment | ( | ) |
Default constructor.
Definition at line 114 of file uan-cw-example.cc.
References m_asciitracefile, m_avgs, m_bhCfgFile, m_boundary, m_bytesTotal, m_cwMax, m_cwMin, m_cwStep, m_dataRate, m_depth, m_gnudatfile, m_numNodes, m_packetSize, m_simTime, m_slotTime, and ns3::Seconds().
| void anonymous_namespace{uan-cw-example.cc}::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 142 of file uan-cw-example.cc.
References 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().
Receive all available packets from a socket.
| socket | The receive socket. |
Definition at line 176 of file uan-cw-example.cc.
References m_bytesTotal.
Referenced by Run().
| void anonymous_namespace{uan-cw-example.cc}::Experiment::ResetData | ( | ) |
Save the throughput from a single run.
Definition at line 134 of file uan-cw-example.cc.
References m_bytesTotal, m_simTime, m_throughputs, ns3::Now(), NS_LOG_DEBUG, and ns3::Time::S.
Referenced by Run().
| Gnuplot2dDataset anonymous_namespace{uan-cw-example.cc}::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 188 of file uan-cw-example.cc.
References ns3::NodeContainer::Create(), ns3::CreateObject(), ns3::CreateObjectWithAttributes(), ns3::Socket::CreateSocket(), ns3::Simulator::Destroy(), ns3::UanHelper::EnableAsciiAll(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::NetDeviceContainer::GetN(), ns3::NodeContainer::GetN(), ns3::MobilityModel::GetPosition(), IncrementCw(), ns3::PacketSocketHelper::Install(), ns3::UanHelper::Install(), ns3::TypeId::LookupByName(), 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(), NS_FATAL_ERROR, NS_LOG_DEBUG, ReceivePacket(), ResetData(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::UanHelper::SetMac(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::PacketSocketAddress::SetSingleDevice(), sink, ns3::ApplicationContainer::Start(), ns3::ApplicationContainer::Stop(), UpdatePositions(), and x.
| void anonymous_namespace{uan-cw-example.cc}::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 163 of file uan-cw-example.cc.
References ns3::CreateObject(), m_boundary, nodes, ns3::Now(), NS_LOG_DEBUG, and ns3::Time::S.
Referenced by Run().
| std::string anonymous_namespace{uan-cw-example.cc}::Experiment::m_asciitracefile |
Name for ascii trace file, default uan-cw-example.asc.
Definition at line 104 of file uan-cw-example.cc.
Referenced by Experiment(), and Run().
| uint32_t anonymous_namespace{uan-cw-example.cc}::Experiment::m_avgs |
Number of topologies to test for each cw point.
Definition at line 98 of file uan-cw-example.cc.
Referenced by Experiment(), IncrementCw(), and Run().
| std::string anonymous_namespace{uan-cw-example.cc}::Experiment::m_bhCfgFile |
| double anonymous_namespace{uan-cw-example.cc}::Experiment::m_boundary |
Size of boundary in meters.
Definition at line 92 of file uan-cw-example.cc.
Referenced by Experiment(), Run(), and UpdatePositions().
| uint32_t anonymous_namespace{uan-cw-example.cc}::Experiment::m_bytesTotal |
Total bytes received.
Definition at line 94 of file uan-cw-example.cc.
Referenced by Experiment(), ReceivePacket(), ResetData(), and Run().
| uint32_t anonymous_namespace{uan-cw-example.cc}::Experiment::m_cwMax |
Max CW to simulate.
Definition at line 96 of file uan-cw-example.cc.
Referenced by Experiment(), and Run().
| uint32_t anonymous_namespace{uan-cw-example.cc}::Experiment::m_cwMin |
Min CW to simulate.
Definition at line 95 of file uan-cw-example.cc.
Referenced by Experiment(), and Run().
| uint32_t anonymous_namespace{uan-cw-example.cc}::Experiment::m_cwStep |
CW step size, default 10.
Definition at line 97 of file uan-cw-example.cc.
Referenced by Experiment(), IncrementCw(), and Run().
| Gnuplot2dDataset anonymous_namespace{uan-cw-example.cc}::Experiment::m_data |
Container for the simulation data.
Definition at line 107 of file uan-cw-example.cc.
Referenced by IncrementCw(), and Run().
| uint32_t anonymous_namespace{uan-cw-example.cc}::Experiment::m_dataRate |
DataRate in bps.
Definition at line 90 of file uan-cw-example.cc.
Referenced by Experiment(), and Run().
| double anonymous_namespace{uan-cw-example.cc}::Experiment::m_depth |
Depth of transmitting and sink nodes.
Definition at line 91 of file uan-cw-example.cc.
Referenced by Experiment(), and Run().
| std::string anonymous_namespace{uan-cw-example.cc}::Experiment::m_gnudatfile |
Name for GNU Plot output, default uan-cw-example.gpl.
Definition at line 103 of file uan-cw-example.cc.
Referenced by Experiment().
| uint32_t anonymous_namespace{uan-cw-example.cc}::Experiment::m_numNodes |
Number of transmitting nodes.
Definition at line 89 of file uan-cw-example.cc.
Referenced by Experiment(), and Run().
| uint32_t anonymous_namespace{uan-cw-example.cc}::Experiment::m_packetSize |
Generated packet size in bytes.
Definition at line 93 of file uan-cw-example.cc.
Referenced by Experiment(), and Run().
| Time anonymous_namespace{uan-cw-example.cc}::Experiment::m_simTime |
Simulation run time, default 1000 s.
Definition at line 101 of file uan-cw-example.cc.
Referenced by Experiment(), ResetData(), and Run().
| Time anonymous_namespace{uan-cw-example.cc}::Experiment::m_slotTime |
Slot time duration.
Definition at line 100 of file uan-cw-example.cc.
Referenced by Experiment(), and Run().
| std::vector<double> anonymous_namespace{uan-cw-example.cc}::Experiment::m_throughputs |
Throughput for each run.
Definition at line 108 of file uan-cw-example.cc.
Referenced by IncrementCw(), and ResetData().