A Discrete-Event Network Simulator
API
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. 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< SocketSetupPacketReceive (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...
 

Detailed Description

Routing experiment class.

It handles the creation and run of an experiment.

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

Constructor & Destructor Documentation

◆ RoutingExperiment()

RoutingExperiment::RoutingExperiment ( )

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

Member Function Documentation

◆ CheckThroughput()

void RoutingExperiment::CheckThroughput ( )
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().

+ Here is the call 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 203 of file manet-routing-compare.cc.

References second::cmd, and NS_FATAL_ERROR.

◆ ReceivePacket()

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

Receive a packet.

Parameters
socketThe 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().

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

◆ Run()

◆ 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 191 of file manet-routing-compare.cc.

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

+ Here is the call graph for this function:

Member Data Documentation

◆ bytesTotal

uint32_t RoutingExperiment::bytesTotal {0}
private

Total received bytes.

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

◆ m_CSVfileName

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

CSV filename.

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

◆ m_flowMonitor

bool RoutingExperiment::m_flowMonitor {false}
private

Enable FlowMonitor.

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

◆ m_nSinks

int RoutingExperiment::m_nSinks {10}
private

Number of sink nodes.

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

◆ m_protocolName

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

Protocol name.

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

◆ m_traceMobility

bool RoutingExperiment::m_traceMobility {false}
private

Enable mobility tracing.

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

◆ m_txp

double RoutingExperiment::m_txp {7.5}
private

Tx power.

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

◆ packetsReceived

uint32_t RoutingExperiment::packetsReceived {0}
private

Total received packets.

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

◆ port

uint32_t RoutingExperiment::port {9}
private

Receiving port number.

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


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