Routing experiment class. More...
Public Member Functions | |
RoutingExperiment () | |
void | CommandSetup (int argc, char **argv) |
Handles the command-line parameters. More... | |
void | Run () |
Run the experiment. More... | |
Private Member Functions | |
void | CheckThroughput () |
Compute the throughput. More... | |
void | ReceivePacket (Ptr< Socket > socket) |
Receive a packet. More... | |
Ptr< Socket > | SetupPacketReceive (Ipv4Address addr, Ptr< Node > node) |
Setup the receiving socket in a Sink Node. More... | |
Private Attributes | |
uint32_t | bytesTotal {0} |
Total received bytes. More... | |
std::string | m_CSVfileName {"manet-routing.output.csv"} |
CSV filename. More... | |
bool | m_flowMonitor {false} |
Enable FlowMonitor. More... | |
int | m_nSinks {10} |
Number of sink nodes. More... | |
std::string | m_protocolName {"AODV"} |
Protocol name. More... | |
bool | m_traceMobility {false} |
Enable mobility tracing. More... | |
double | m_txp {7.5} |
Tx power. More... | |
uint32_t | packetsReceived {0} |
Total received packets. More... | |
uint32_t | port {9} |
Receiving port number. More... | |
Routing experiment class.
It handles the creation and run of an experiment.
Definition at line 92 of file manet-routing-compare.cc.
RoutingExperiment::RoutingExperiment | ( | ) |
Definition at line 138 of file manet-routing-compare.cc.
|
private |
Compute the throughput.
Definition at line 175 of file manet-routing-compare.cc.
References openflow-switch::app, ns3::Simulator::Now(), packetsReceived, ns3::Simulator::Schedule(), and ns3::Seconds().
void RoutingExperiment::CommandSetup | ( | int | argc, |
char ** | argv | ||
) |
Handles the command-line parameters.
argc | The argument count. |
argv | The argument vector. |
Definition at line 203 of file manet-routing-compare.cc.
References second::cmd, and NS_FATAL_ERROR.
Receive a packet.
socket | The receiving socket. |
Definition at line 162 of file manet-routing-compare.cc.
References ns3::Packet::GetSize(), NS_LOG_UNCOND, packetsReceived, PrintReceivedPacket(), and ns3::Socket::RecvFrom().
Referenced by SetupPacketReceive().
void RoutingExperiment::Run | ( | ) |
Run the experiment.
Definition at line 232 of file manet-routing-compare.cc.
References ns3::YansWifiChannelHelper::AddPropagationLoss(), ns3::Ipv4AddressHelper::Assign(), ns3::MobilityHelper::AssignStreams(), ns3::ObjectFactory::Create(), ns3::YansWifiChannelHelper::Create(), ns3::NodeContainer::Create(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::Simulator::Destroy(), ns3::MobilityHelper::EnableAsciiAll(), ns3::Packet::EnablePrinting(), ns3::NodeContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::Object::GetObject(), ns3::UniformRandomVariable::GetValue(), ns3::DsrMainHelper::Install(), ns3::OnOffHelper::Install(), ns3::MobilityHelper::Install(), ns3::FlowMonitorHelper::InstallAll(), nsclick-simple-lan::internet, list, nodes, NS_FATAL_ERROR, NS_LOG_INFO, port, nsclick-simple-lan::remoteAddress, ns3::Simulator::Run(), ns3::Seconds(), ns3::ObjectFactory::Set(), ns3::WifiPhyHelper::Set(), ns3::OnOffHelper::SetAttribute(), ns3::Ipv4AddressHelper::SetBase(), ns3::YansWifiPhyHelper::SetChannel(), ns3::Config::SetDefault(), ns3::MobilityHelper::SetMobilityModel(), ns3::MobilityHelper::SetPositionAllocator(), ns3::YansWifiChannelHelper::SetPropagationDelay(), ns3::WifiMacHelper::SetType(), ns3::ObjectFactory::SetTypeId(), SetupPacketReceive(), sink, ns3::ApplicationContainer::Start(), ns3::Simulator::Stop(), ns3::ApplicationContainer::Stop(), third::wifi, and ns3::WIFI_STANDARD_80211b.
|
private |
Setup the receiving socket in a Sink Node.
addr | The address of the node. |
node | The node pointer. |
Definition at line 191 of file manet-routing-compare.cc.
References ns3::Socket::CreateSocket(), ns3::TypeId::LookupByName(), ns3::MakeCallback(), port, ReceivePacket(), and sink.
|
private |
Total received bytes.
Definition at line 127 of file manet-routing-compare.cc.
|
private |
CSV filename.
Definition at line 130 of file manet-routing-compare.cc.
|
private |
Enable FlowMonitor.
Definition at line 135 of file manet-routing-compare.cc.
|
private |
Number of sink nodes.
Definition at line 131 of file manet-routing-compare.cc.
|
private |
Protocol name.
Definition at line 132 of file manet-routing-compare.cc.
|
private |
Enable mobility tracing.
Definition at line 134 of file manet-routing-compare.cc.
|
private |
Tx power.
Definition at line 133 of file manet-routing-compare.cc.
|
private |
Total received packets.
Definition at line 128 of file manet-routing-compare.cc.
|
private |
Receiving port number.
Definition at line 126 of file manet-routing-compare.cc.