A Discrete-Event Network Simulator
API
RoutingExperiment Class Reference

Routing experiment class. More...

+ Collaboration diagram for RoutingExperiment:

Public Member Functions

 RoutingExperiment ()
 
std::string CommandSetup (int argc, char **argv)
 Handles the command-line parmeters. More...
 
void Run (int nSinks, double txp, std::string CSVfileName)
 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
 Total received bytes. More...
 
std::string m_CSVfileName
 CSV filename. More...
 
int m_nSinks
 Number of sink nodes. More...
 
uint32_t m_protocol
 Protocol type. More...
 
std::string m_protocolName
 Protocol name. More...
 
bool m_traceMobility
 Enavle mobility tracing. More...
 
double m_txp
 Tx power. More...
 
uint32_t packetsReceived
 Total received packets. More...
 
uint32_t port
 Receiving port number. More...
 

Detailed Description

Routing experiment class.

It handles the creation and run of an experiment.

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

Constructor & Destructor Documentation

◆ RoutingExperiment()

RoutingExperiment::RoutingExperiment ( )

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

Member Function Documentation

◆ CheckThroughput()

void RoutingExperiment::CheckThroughput ( )
private

Compute the throughput.

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

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

std::string RoutingExperiment::CommandSetup ( int  argc,
char **  argv 
)

Handles the command-line parmeters.

Parameters
argcThe argument count.
argvThe argument vector.
Returns
the CSV filename.

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

References second::cmd, m_CSVfileName, m_protocol, and m_traceMobility.

◆ ReceivePacket()

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

Receive a packet.

Parameters
socketThe receiving socket.

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

References bytesTotal, 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()

void RoutingExperiment::Run ( int  nSinks,
double  txp,
std::string  CSVfileName 
)

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

References 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
private

Total received bytes.

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

Referenced by CheckThroughput(), and ReceivePacket().

◆ m_CSVfileName

std::string RoutingExperiment::m_CSVfileName
private

CSV filename.

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

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

◆ m_nSinks

int RoutingExperiment::m_nSinks
private

Number of sink nodes.

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

Referenced by CheckThroughput(), and Run().

◆ m_protocol

uint32_t RoutingExperiment::m_protocol
private

Protocol type.

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

Referenced by CommandSetup(), and Run().

◆ m_protocolName

std::string RoutingExperiment::m_protocolName
private

Protocol name.

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

Referenced by CheckThroughput(), and Run().

◆ m_traceMobility

bool RoutingExperiment::m_traceMobility
private

Enavle mobility tracing.

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

Referenced by CommandSetup().

◆ m_txp

double RoutingExperiment::m_txp
private

Tx power.

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

Referenced by CheckThroughput(), and Run().

◆ packetsReceived

uint32_t RoutingExperiment::packetsReceived
private

Total received packets.

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

Referenced by CheckThroughput(), and ReceivePacket().

◆ port

uint32_t RoutingExperiment::port
private

Receiving port number.

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

Referenced by Run(), and SetupPacketReceive().


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