A Discrete-Event Network Simulator
API
DsdvManetExample Class Reference

DSDV Manet example. More...

+ Collaboration diagram for DsdvManetExample:

Public Member Functions

 DsdvManetExample ()
 
void CaseRun (uint32_t nWifis, uint32_t nSinks, double totalTime, std::string rate, std::string phyMode, uint32_t nodeSpeed, uint32_t periodicUpdateInterval, uint32_t settlingTime, double dataStart, bool printRoutes, std::string CSVfileName)
 Run function. More...
 

Private Member Functions

void CheckThroughput ()
 Check network throughput. More...
 
void CreateDevices (std::string tr_name)
 Create and initialize all devices. More...
 
void CreateNodes ()
 Create and initialize all nodes. More...
 
void InstallApplications ()
 Create data sinks and sources. More...
 
void InstallInternetStack (std::string tr_name)
 Create network. More...
 
void ReceivePacket (Ptr< Socket > socket)
 Packet receive function. More...
 
void SetupMobility ()
 Setup mobility model. More...
 
Ptr< SocketSetupPacketReceive (Ipv4Address addr, Ptr< Node > node)
 Setup packet receivers. More...
 

Private Attributes

uint32_t bytesTotal
 total bytes received by all nodes More...
 
NetDeviceContainer devices
 the collection of devices More...
 
Ipv4InterfaceContainer interfaces
 the collection of interfaces More...
 
std::string m_CSVfileName
 CSV file name. More...
 
double m_dataStart
 time to start data transmissions (seconds) More...
 
uint32_t m_nodeSpeed
 mobility speed More...
 
uint32_t m_nSinks
 number of receiver nodes More...
 
uint32_t m_nWifis
 total number of nodes More...
 
uint32_t m_periodicUpdateInterval
 routing update interval More...
 
std::string m_phyMode
 remote station manager data mode More...
 
bool m_printRoutes
 print routing table More...
 
std::string m_rate
 network bandwidth More...
 
uint32_t m_settlingTime
 routing setting time More...
 
double m_totalTime
 total simulation time (in seconds) More...
 
NodeContainer nodes
 the collection of nodes More...
 
uint32_t packetsReceived
 total packets received by all nodes More...
 

Detailed Description

DSDV Manet example.

Definition at line 56 of file dsdv-manet.cc.

Constructor & Destructor Documentation

DsdvManetExample::DsdvManetExample ( )

Definition at line 191 of file dsdv-manet.cc.

Member Function Documentation

void DsdvManetExample::CaseRun ( uint32_t  nWifis,
uint32_t  nSinks,
double  totalTime,
std::string  rate,
std::string  phyMode,
uint32_t  nodeSpeed,
uint32_t  periodicUpdateInterval,
uint32_t  settlingTime,
double  dataStart,
bool  printRoutes,
std::string  CSVfileName 
)

Run function.

Parameters
nWifisThe total number of nodes
nSinksThe total number of receivers
totalTimeThe total simulation time
rateThe network speed
phyModeThe physical mode
nodeSpeedThe node speed
periodicUpdateIntervalThe routing update interval
settlingTimeThe routing update settling time
dataStartThe data transmission start time
printRoutesprint the routes if true
CSVfileNameThe CSV file name

Definition at line 238 of file dsdv-manet.cc.

References CheckThroughput(), CreateDevices(), CreateNodes(), InstallApplications(), InstallInternetStack(), m_CSVfileName, m_dataStart, m_nodeSpeed, m_nSinks, m_nWifis, m_periodicUpdateInterval, m_phyMode, m_printRoutes, m_rate, m_settlingTime, m_totalTime, ns3::Seconds(), and SetupMobility().

+ Here is the call graph for this function:

void DsdvManetExample::CheckThroughput ( )
private

Check network throughput.

Definition at line 210 of file dsdv-manet.cc.

References bytesTotal, m_CSVfileName, m_nSinks, ns3::Now(), packetsReceived, and ns3::Seconds().

Referenced by CaseRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DsdvManetExample::CreateNodes ( )
private

Create and initialize all nodes.

Definition at line 281 of file dsdv-manet.cc.

References ns3::NodeContainer::Create(), m_nSinks, m_nWifis, nodes, and NS_ASSERT_MSG().

Referenced by CaseRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DsdvManetExample::InstallApplications ( )
private
void DsdvManetExample::InstallInternetStack ( std::string  tr_name)
private
void DsdvManetExample::ReceivePacket ( Ptr< Socket socket)
private

Packet receive function.

Parameters
socketThe communication socket

Definition at line 198 of file dsdv-manet.cc.

References bytesTotal, ns3::Packet::GetSize(), ns3::Now(), NS_LOG_UNCOND, packetsReceived, and ns3::Socket::Recv().

Referenced by SetupPacketReceive().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DsdvManetExample::SetupMobility ( )
private

Setup mobility model.

Definition at line 289 of file dsdv-manet.cc.

References ns3::ObjectFactory::Create(), ns3::Object::GetObject(), ns3::MobilityHelper::Install(), m_nodeSpeed, third::mobility, nodes, ns3::ObjectFactory::Set(), ns3::MobilityHelper::SetMobilityModel(), ns3::MobilityHelper::SetPositionAllocator(), and ns3::ObjectFactory::SetTypeId().

Referenced by CaseRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Setup packet receivers.

Parameters
addrthe receiving IPv4 address
nodethe receiving node
Returns
the communication socket

Definition at line 225 of file dsdv-manet.cc.

References ns3::Socket::Bind(), ns3::MakeCallback(), port, ReceivePacket(), ns3::Socket::SetRecvCallback(), and sink.

Referenced by InstallApplications().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

uint32_t DsdvManetExample::bytesTotal
private

total bytes received by all nodes

Definition at line 96 of file dsdv-manet.cc.

Referenced by CheckThroughput(), and ReceivePacket().

NetDeviceContainer DsdvManetExample::devices
private

the collection of devices

Definition at line 102 of file dsdv-manet.cc.

Referenced by CreateDevices(), and InstallInternetStack().

Ipv4InterfaceContainer DsdvManetExample::interfaces
private

the collection of interfaces

Definition at line 103 of file dsdv-manet.cc.

Referenced by InstallApplications(), and InstallInternetStack().

std::string DsdvManetExample::m_CSVfileName
private

CSV file name.

Definition at line 99 of file dsdv-manet.cc.

Referenced by CaseRun(), and CheckThroughput().

double DsdvManetExample::m_dataStart
private

time to start data transmissions (seconds)

Definition at line 95 of file dsdv-manet.cc.

Referenced by CaseRun(), and InstallApplications().

uint32_t DsdvManetExample::m_nodeSpeed
private

mobility speed

Definition at line 92 of file dsdv-manet.cc.

Referenced by CaseRun(), and SetupMobility().

uint32_t DsdvManetExample::m_nSinks
private

number of receiver nodes

Definition at line 88 of file dsdv-manet.cc.

Referenced by CaseRun(), CheckThroughput(), CreateNodes(), and InstallApplications().

uint32_t DsdvManetExample::m_nWifis
private

total number of nodes

Definition at line 87 of file dsdv-manet.cc.

Referenced by CaseRun(), CreateNodes(), and InstallApplications().

uint32_t DsdvManetExample::m_periodicUpdateInterval
private

routing update interval

Definition at line 93 of file dsdv-manet.cc.

Referenced by CaseRun(), and InstallInternetStack().

std::string DsdvManetExample::m_phyMode
private

remote station manager data mode

Definition at line 91 of file dsdv-manet.cc.

Referenced by CaseRun(), and CreateDevices().

bool DsdvManetExample::m_printRoutes
private

print routing table

Definition at line 98 of file dsdv-manet.cc.

Referenced by CaseRun(), and InstallInternetStack().

std::string DsdvManetExample::m_rate
private

network bandwidth

Definition at line 90 of file dsdv-manet.cc.

Referenced by CaseRun().

uint32_t DsdvManetExample::m_settlingTime
private

routing setting time

Definition at line 94 of file dsdv-manet.cc.

Referenced by CaseRun(), and InstallInternetStack().

double DsdvManetExample::m_totalTime
private

total simulation time (in seconds)

Definition at line 89 of file dsdv-manet.cc.

Referenced by CaseRun(), and InstallApplications().

NodeContainer DsdvManetExample::nodes
private

the collection of nodes

Definition at line 101 of file dsdv-manet.cc.

Referenced by CreateDevices(), CreateNodes(), InstallApplications(), InstallInternetStack(), and SetupMobility().

uint32_t DsdvManetExample::packetsReceived
private

total packets received by all nodes

Definition at line 97 of file dsdv-manet.cc.

Referenced by CheckThroughput(), and ReceivePacket().


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