DSDV Manet example. More...
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< Socket > | SetupPacketReceive (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 | |
DSDV Manet example.
Definition at line 48 of file dsdv-manet.cc.
DsdvManetExample::DsdvManetExample | ( | ) |
Definition at line 201 of file dsdv-manet.cc.
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.
nWifis | The total number of nodes |
nSinks | The total number of receivers |
totalTime | The total simulation time |
rate | The network speed |
phyMode | The physical mode |
nodeSpeed | The node speed |
periodicUpdateInterval | The routing update interval |
settlingTime | The routing update settling time |
dataStart | The data transmission start time |
printRoutes | print the routes if true |
CSVfileName | The CSV file name |
Definition at line 248 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().
|
private |
Check network throughput.
Definition at line 220 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().
|
private |
Create and initialize all devices.
tr_name | The trace file name |
Definition at line 333 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().
|
private |
Create and initialize all nodes.
Definition at line 299 of file dsdv-manet.cc.
References ns3::NodeContainer::Create(), m_nSinks, m_nWifis, nodes, and NS_ASSERT_MSG.
Referenced by CaseRun().
|
private |
Create data sinks and sources.
Definition at line 377 of file dsdv-manet.cc.
References ns3::CreateObject(), 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().
|
private |
Create network.
tr_name | The trace file name |
Definition at line 357 of file dsdv-manet.cc.
References ns3::Create(), devices, interfaces, m_periodicUpdateInterval, m_printRoutes, m_settlingTime, nodes, ns3::Ipv4RoutingHelper::PrintRoutingTableAllAt(), ns3::Seconds(), and ns3::DsdvHelper::Set().
Referenced by CaseRun().
Packet receive function.
socket | The communication socket |
Definition at line 208 of file dsdv-manet.cc.
References bytesTotal, ns3::Simulator::Now(), NS_LOG_UNCOND, packetsReceived, and ns3::Time::S.
Referenced by SetupPacketReceive().
|
private |
Setup mobility model.
Definition at line 308 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().
|
private |
Setup packet receivers.
addr | the receiving IPv4 address |
node | the receiving node |
Definition at line 236 of file dsdv-manet.cc.
References ns3::Socket::CreateSocket(), ns3::TypeId::LookupByName(), ns3::MakeCallback(), port, ReceivePacket(), and sink.
Referenced by InstallApplications().
|
private |
total bytes received by all nodes
Definition at line 88 of file dsdv-manet.cc.
Referenced by CheckThroughput(), and ReceivePacket().
|
private |
the collection of devices
Definition at line 94 of file dsdv-manet.cc.
Referenced by CreateDevices(), and InstallInternetStack().
|
private |
the collection of interfaces
Definition at line 95 of file dsdv-manet.cc.
Referenced by InstallApplications(), and InstallInternetStack().
|
private |
CSV file name.
Definition at line 91 of file dsdv-manet.cc.
Referenced by CaseRun(), and CheckThroughput().
|
private |
time to start data transmissions (seconds)
Definition at line 87 of file dsdv-manet.cc.
Referenced by CaseRun(), and InstallApplications().
|
private |
mobility speed
Definition at line 84 of file dsdv-manet.cc.
Referenced by CaseRun(), and SetupMobility().
|
private |
number of receiver nodes
Definition at line 80 of file dsdv-manet.cc.
Referenced by CaseRun(), CheckThroughput(), CreateNodes(), and InstallApplications().
|
private |
total number of nodes
Definition at line 79 of file dsdv-manet.cc.
Referenced by CaseRun(), CreateNodes(), and InstallApplications().
|
private |
routing update interval
Definition at line 85 of file dsdv-manet.cc.
Referenced by CaseRun(), and InstallInternetStack().
|
private |
remote station manager data mode
Definition at line 83 of file dsdv-manet.cc.
Referenced by CaseRun(), and CreateDevices().
|
private |
print routing table
Definition at line 90 of file dsdv-manet.cc.
Referenced by CaseRun(), and InstallInternetStack().
|
private |
|
private |
routing setting time
Definition at line 86 of file dsdv-manet.cc.
Referenced by CaseRun(), and InstallInternetStack().
|
private |
total simulation time (in seconds)
Definition at line 81 of file dsdv-manet.cc.
Referenced by CaseRun(), and InstallApplications().
|
private |
the collection of nodes
Definition at line 93 of file dsdv-manet.cc.
Referenced by CreateDevices(), CreateNodes(), InstallApplications(), InstallInternetStack(), and SetupMobility().
|
private |
total packets received by all nodes
Definition at line 89 of file dsdv-manet.cc.
Referenced by CheckThroughput(), and ReceivePacket().