A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 

Private Member Functions

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

Private Attributes

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

Detailed Description

DSDV Manet example.

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

Constructor & Destructor Documentation

◆ DsdvManetExample()

DsdvManetExample::DsdvManetExample ( )

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

Member Function Documentation

◆ CaseRun()

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 259 of file dsdv-manet.cc.

References CheckThroughput(), CreateDevices(), CreateNodes(), ns3::Simulator::Destroy(), 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::Simulator::Run(), ns3::Seconds(), SetupMobility(), and ns3::Simulator::Stop().

+ Here is the call graph for this function:

◆ CheckThroughput()

void DsdvManetExample::CheckThroughput ( )
private

Check network throughput.

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

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

Referenced by CaseRun(), and CheckThroughput().

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

◆ CreateDevices()

void DsdvManetExample::CreateDevices ( std::string  tr_name)
private

Create and initialize all devices.

Parameters
tr_nameThe trace file name

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

References ns3::YansWifiChannelHelper::AddPropagationLoss(), ns3::YansWifiChannelHelper::Create(), ns3::AsciiTraceHelper::CreateFileStream(), devices, ns3::AsciiTraceHelperForDevice::EnableAsciiAll(), ns3::PcapHelperForDevice::EnablePcapAll(), m_phyMode, nodes, ns3::YansWifiPhyHelper::SetChannel(), ns3::YansWifiChannelHelper::SetPropagationDelay(), ns3::WifiMacHelper::SetType(), and ns3::WIFI_STANDARD_80211b.

Referenced by CaseRun().

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

◆ CreateNodes()

void DsdvManetExample::CreateNodes ( )
private

Create and initialize all nodes.

Definition at line 310 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:

◆ InstallApplications()

void DsdvManetExample::InstallApplications ( )
private

Create data sinks and sources.

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

References ns3::NodeContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::NodeList::GetNode(), ns3::ApplicationHelper::Install(), interfaces, m_dataStart, m_nSinks, m_nWifis, m_totalTime, nodes, port, ns3::Seconds(), ns3::ApplicationHelper::SetAttribute(), SetupPacketReceive(), sink, ns3::ApplicationContainer::Start(), and ns3::ApplicationContainer::Stop().

Referenced by CaseRun().

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

◆ InstallInternetStack()

void DsdvManetExample::InstallInternetStack ( std::string  tr_name)
private

Create network.

Parameters
tr_nameThe trace file name

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

References devices, interfaces, m_periodicUpdateInterval, m_printRoutes, m_settlingTime, nodes, ns3::Ipv4RoutingHelper::PrintRoutingTableAllAt(), ns3::Seconds(), and ns3::DsdvHelper::Set().

Referenced by CaseRun().

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

◆ ReceivePacket()

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

Packet receive function.

Parameters
socketThe communication socket

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

References bytesTotal, ns3::Simulator::Now(), NS_LOG_UNCOND, packetsReceived, and ns3::Time::S.

Referenced by SetupPacketReceive().

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

◆ SetupMobility()

void DsdvManetExample::SetupMobility ( )
private

Setup mobility model.

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

References ns3::ObjectFactory::Create(), ns3::Object::GetObject(), m_nodeSpeed, nodes, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().

Referenced by CaseRun().

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

◆ SetupPacketReceive()

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 247 of file dsdv-manet.cc.

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

Referenced by InstallApplications().

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

Member Data Documentation

◆ bytesTotal

uint32_t DsdvManetExample::bytesTotal
private

total bytes received by all nodes

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

Referenced by CheckThroughput(), and ReceivePacket().

◆ devices

NetDeviceContainer DsdvManetExample::devices
private

the collection of devices

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

Referenced by CreateDevices(), and InstallInternetStack().

◆ interfaces

Ipv4InterfaceContainer DsdvManetExample::interfaces
private

the collection of interfaces

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

Referenced by InstallApplications(), and InstallInternetStack().

◆ m_CSVfileName

std::string DsdvManetExample::m_CSVfileName
private

CSV file name.

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

Referenced by CaseRun(), and CheckThroughput().

◆ m_dataStart

double DsdvManetExample::m_dataStart
private

time to start data transmissions (seconds)

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

Referenced by CaseRun(), and InstallApplications().

◆ m_nodeSpeed

uint32_t DsdvManetExample::m_nodeSpeed
private

mobility speed

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

Referenced by CaseRun(), and SetupMobility().

◆ m_nSinks

uint32_t DsdvManetExample::m_nSinks
private

number of receiver nodes

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

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

◆ m_nWifis

uint32_t DsdvManetExample::m_nWifis
private

total number of nodes

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

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

◆ m_periodicUpdateInterval

uint32_t DsdvManetExample::m_periodicUpdateInterval
private

routing update interval

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

Referenced by CaseRun(), and InstallInternetStack().

◆ m_phyMode

std::string DsdvManetExample::m_phyMode
private

remote station manager data mode

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

Referenced by CaseRun(), and CreateDevices().

◆ m_printRoutes

bool DsdvManetExample::m_printRoutes
private

print routing table

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

Referenced by CaseRun(), and InstallInternetStack().

◆ m_rate

std::string DsdvManetExample::m_rate
private

network bandwidth

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

Referenced by CaseRun().

◆ m_settlingTime

uint32_t DsdvManetExample::m_settlingTime
private

routing setting time

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

Referenced by CaseRun(), and InstallInternetStack().

◆ m_totalTime

double DsdvManetExample::m_totalTime
private

total simulation time (in seconds)

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

Referenced by CaseRun(), and InstallApplications().

◆ nodes

NodeContainer DsdvManetExample::nodes
private

the collection of nodes

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

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

◆ packetsReceived

uint32_t DsdvManetExample::packetsReceived
private

total packets received by all nodes

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

Referenced by CheckThroughput(), and ReceivePacket().


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