Test script. More...
Public Member Functions | |
AodvExample () | |
bool | Configure (int argc, char **argv) |
Configure script parameters. More... | |
void | Report (std::ostream &os) |
Report results. More... | |
void | Run () |
Run simulation. More... | |
Private Member Functions | |
void | CreateDevices () |
Create the devices. More... | |
void | CreateNodes () |
Create the nodes. More... | |
void | InstallApplications () |
Create the simulation applications. More... | |
void | InstallInternetStack () |
Create the network. More... | |
Private Attributes | |
NetDeviceContainer | devices |
devices used in the example More... | |
Ipv4InterfaceContainer | interfaces |
interfaces used in the example More... | |
NodeContainer | nodes |
nodes used in the example More... | |
bool | pcap |
Write per-device PCAP traces if true. More... | |
bool | printRoutes |
Print routes if true. More... | |
uint32_t | size |
Number of nodes. More... | |
double | step |
Distance between nodes, meters. More... | |
double | totalTime |
Simulation time, seconds. More... | |
Test script.
This script creates 1-dimensional grid topology and then ping last node from the first one:
[10.0.0.1] <– step --> [10.0.0.2] <– step --> [10.0.0.3] <– step --> [10.0.0.4]
ping 10.0.0.4
When 1/3 of simulation time has elapsed, one of the nodes is moved out of range, thereby breaking the topology. By default, this will result in only 34 of 100 pings being received. If the step size is reduced to cover the gap, then all pings can be received.
bool AodvExample::Configure | ( | int | argc, |
char ** | argv | ||
) |
Configure script parameters.
argc | is the command line argument count |
argv | is the command line arguments |
Definition at line 126 of file aodv.cc.
References second::cmd, pcap, printRoutes, size, step, and totalTime.
|
private |
Create the devices.
Definition at line 191 of file aodv.cc.
References ns3::YansWifiChannelHelper::Create(), devices, ns3::PcapHelperForDevice::EnablePcapAll(), nodes, pcap, ns3::YansWifiPhyHelper::SetChannel(), ns3::WifiMacHelper::SetType(), and third::wifi.
Referenced by Run().
|
private |
Create the nodes.
Definition at line 166 of file aodv.cc.
References ns3::NodeContainer::Create(), ns3::NodeContainer::Get(), third::mobility, nodes, size, and step.
Referenced by Run().
|
private |
Create the simulation applications.
Definition at line 228 of file aodv.cc.
References ns3::NodeContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::Object::GetObject(), ns3::V4PingHelper::Install(), interfaces, nodes, ns3::Seconds(), ns3::V4PingHelper::SetAttribute(), SetPosition(), size, ns3::ApplicationContainer::Start(), ns3::ApplicationContainer::Stop(), and totalTime.
Referenced by Run().
|
private |
Create the network.
Definition at line 209 of file aodv.cc.
References first::address, devices, interfaces, nodes, printRoutes, ns3::Ipv4RoutingHelper::PrintRoutingTableAllAt(), ns3::Seconds(), and first::stack.
Referenced by Run().
void AodvExample::Report | ( | std::ostream & | os | ) |
void AodvExample::Run | ( | ) |
Run simulation.
Definition at line 145 of file aodv.cc.
References CreateDevices(), CreateNodes(), InstallApplications(), InstallInternetStack(), ns3::Seconds(), and totalTime.
|
private |
devices used in the example
Definition at line 89 of file aodv.cc.
Referenced by CreateDevices(), and InstallInternetStack().
|
private |
interfaces used in the example
Definition at line 91 of file aodv.cc.
Referenced by InstallApplications(), and InstallInternetStack().
|
private |
nodes used in the example
Definition at line 87 of file aodv.cc.
Referenced by CreateDevices(), CreateNodes(), InstallApplications(), and InstallInternetStack().
|
private |
Write per-device PCAP traces if true.
Definition at line 81 of file aodv.cc.
Referenced by Configure(), and CreateDevices().
|
private |
Print routes if true.
Definition at line 83 of file aodv.cc.
Referenced by Configure(), and InstallInternetStack().
|
private |
Number of nodes.
Definition at line 75 of file aodv.cc.
Referenced by Configure(), CreateNodes(), and InstallApplications().
|
private |
Distance between nodes, meters.
Definition at line 77 of file aodv.cc.
Referenced by Configure(), and CreateNodes().
|
private |
Simulation time, seconds.
Definition at line 79 of file aodv.cc.
Referenced by Configure(), InstallApplications(), and Run().