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

Routing experiment class. More...

+ Collaboration diagram for RoutingExperiment:

Public Member Functions

 RoutingExperiment ()
 
void CommandSetup (int argc, char **argv)
 Handles the command-line parameters.
 
void Run ()
 Run the experiment.
 

Private Member Functions

void CheckThroughput ()
 Compute the throughput.
 
void ReceivePacket (Ptr< Socket > socket)
 Receive a packet.
 
Ptr< SocketSetupPacketReceive (Ipv4Address addr, Ptr< Node > node)
 Setup the receiving socket in a Sink Node.
 

Private Attributes

uint32_t bytesTotal {0}
 Total received bytes.
 
std::string m_CSVfileName {"manet-routing.output.csv"}
 CSV filename.
 
bool m_flowMonitor {false}
 Enable FlowMonitor.
 
int m_nSinks {10}
 Number of sink nodes.
 
std::string m_protocolName {"AODV"}
 Protocol name.
 
bool m_traceMobility {false}
 Enable mobility tracing.
 
double m_txp {7.5}
 Tx power.
 
uint32_t packetsReceived {0}
 Total received packets.
 
uint32_t port {9}
 Receiving port number.
 

Detailed Description

Routing experiment class.

It handles the creation and run of an experiment.

Definition at line 81 of file manet-routing-compare.cc.

Constructor & Destructor Documentation

◆ RoutingExperiment()

RoutingExperiment::RoutingExperiment ( )

Definition at line 127 of file manet-routing-compare.cc.

Member Function Documentation

◆ CheckThroughput()

void RoutingExperiment::CheckThroughput ( )
private

Compute the throughput.

Definition at line 164 of file manet-routing-compare.cc.

References bytesTotal, CheckThroughput(), m_CSVfileName, m_nSinks, m_protocolName, m_txp, ns3::Simulator::Now(), packetsReceived, 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()

void RoutingExperiment::CommandSetup ( int argc,
char ** argv )

Handles the command-line parameters.

Parameters
argcThe argument count.
argvThe argument vector.

Definition at line 192 of file manet-routing-compare.cc.

References m_CSVfileName, m_flowMonitor, m_protocolName, m_traceMobility, and NS_FATAL_ERROR.

◆ ReceivePacket()

void RoutingExperiment::ReceivePacket ( Ptr< Socket > socket)
private

Receive a packet.

Parameters
socketThe receiving socket.

Definition at line 151 of file manet-routing-compare.cc.

References bytesTotal, NS_LOG_UNCOND, packetsReceived, and PrintReceivedPacket().

Referenced by SetupPacketReceive().

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

◆ Run()

void RoutingExperiment::Run ( )

Run the experiment.

Definition at line 221 of file manet-routing-compare.cc.

References ns3::YansWifiChannelHelper::AddPropagationLoss(), ns3::Ipv4AddressHelper::Assign(), ns3::MobilityHelper::AssignStreams(), CheckThroughput(), ns3::NodeContainer::Create(), ns3::ObjectFactory::Create(), ns3::YansWifiChannelHelper::Create(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::CreateObject(), ns3::Simulator::Destroy(), ns3::MobilityHelper::EnableAsciiAll(), ns3::Packet::EnablePrinting(), ns3::NodeContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::Object::GetObject(), ns3::ApplicationHelper::Install(), ns3::DsrMainHelper::Install(), ns3::MobilityHelper::Install(), ns3::FlowMonitorHelper::InstallAll(), list, m_CSVfileName, m_flowMonitor, m_nSinks, m_protocolName, m_txp, nodes, NS_FATAL_ERROR, NS_LOG_INFO, port, ns3::Simulator::Run(), ns3::Seconds(), ns3::ObjectFactory::Set(), ns3::WifiPhyHelper::Set(), ns3::ApplicationHelper::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::ApplicationContainer::Stop(), ns3::Simulator::Stop(), and ns3::WIFI_STANDARD_80211b.

+ Here is the call graph for this function:

◆ SetupPacketReceive()

Ptr< Socket > RoutingExperiment::SetupPacketReceive ( Ipv4Address addr,
Ptr< Node > node )
private

Setup the receiving socket in a Sink Node.

Parameters
addrThe address of the node.
nodeThe node pointer.
Returns
the socket.

Definition at line 180 of file manet-routing-compare.cc.

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

Referenced by Run().

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

Member Data Documentation

◆ bytesTotal

uint32_t RoutingExperiment::bytesTotal {0}
private

Total received bytes.

Definition at line 116 of file manet-routing-compare.cc.

Referenced by CheckThroughput(), and ReceivePacket().

◆ m_CSVfileName

std::string RoutingExperiment::m_CSVfileName {"manet-routing.output.csv"}
private

CSV filename.

Definition at line 119 of file manet-routing-compare.cc.

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

◆ m_flowMonitor

bool RoutingExperiment::m_flowMonitor {false}
private

Enable FlowMonitor.

Definition at line 124 of file manet-routing-compare.cc.

Referenced by CommandSetup(), and Run().

◆ m_nSinks

int RoutingExperiment::m_nSinks {10}
private

Number of sink nodes.

Definition at line 120 of file manet-routing-compare.cc.

Referenced by CheckThroughput(), and Run().

◆ m_protocolName

std::string RoutingExperiment::m_protocolName {"AODV"}
private

Protocol name.

Definition at line 121 of file manet-routing-compare.cc.

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

◆ m_traceMobility

bool RoutingExperiment::m_traceMobility {false}
private

Enable mobility tracing.

Definition at line 123 of file manet-routing-compare.cc.

Referenced by CommandSetup().

◆ m_txp

double RoutingExperiment::m_txp {7.5}
private

Tx power.

Definition at line 122 of file manet-routing-compare.cc.

Referenced by CheckThroughput(), and Run().

◆ packetsReceived

uint32_t RoutingExperiment::packetsReceived {0}
private

Total received packets.

Definition at line 117 of file manet-routing-compare.cc.

Referenced by CheckThroughput(), and ReceivePacket().

◆ port

uint32_t RoutingExperiment::port {9}
private

Receiving port number.

Definition at line 115 of file manet-routing-compare.cc.

Referenced by Run(), and SetupPacketReceive().


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