A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AodvExample Class Reference

Test script. More...

+ Collaboration diagram for AodvExample:

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 ()
 
void CreateNodes ()
 
void InstallApplications ()
 
void InstallInternetStack ()
 

Private Attributes

parameters
uint32_t size
 Number of nodes. More...
 
double step
 Distance between nodes, meters. More...
 
double totalTime
 Simulation time, seconds. More...
 
bool pcap
 Write per-device PCAP traces if true. More...
 
bool printRoutes
 Print routes if true. More...
 
network
NodeContainer nodes
 
NetDeviceContainer devices
 
Ipv4InterfaceContainer interfaces
 

Detailed Description

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

Definition at line 45 of file aodv.cc.

Constructor & Destructor Documentation

AodvExample::AodvExample ( )

Definition at line 97 of file aodv.cc.

Member Function Documentation

bool AodvExample::Configure ( int  argc,
char **  argv 
)

Configure script parameters,.

Returns
true on successful configuration

Definition at line 107 of file aodv.cc.

References ns3::CommandLine::AddValue(), ns3::CommandLine::Parse(), pcap, printRoutes, size, step, and totalTime.

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AodvExample::CreateDevices ( )
private

Definition at line 172 of file aodv.cc.

References ns3::YansWifiChannelHelper::Create(), devices, ns3::PcapHelperForDevice::EnablePcapAll(), ns3::WifiHelper::Install(), nodes, pcap, ns3::YansWifiPhyHelper::SetChannel(), ns3::WifiHelper::SetRemoteStationManager(), and ns3::NqosWifiMacHelper::SetType().

Referenced by Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AodvExample::CreateNodes ( )
private

Definition at line 147 of file aodv.cc.

References ns3::NodeContainer::Create(), ns3::NodeContainer::Get(), ns3::MobilityHelper::Install(), nodes, ns3::MobilityHelper::SetMobilityModel(), ns3::MobilityHelper::SetPositionAllocator(), size, and step.

Referenced by Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AodvExample::InstallApplications ( )
private

Definition at line 209 of file aodv.cc.

References ns3::NodeContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::Object::GetObject(), interfaces, nodes, ns3::V4PingHelper::SetAttribute(), SetPosition(), size, ns3::ApplicationContainer::Start(), ns3::ApplicationContainer::Stop(), and totalTime.

Referenced by Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AodvExample::InstallInternetStack ( )
private
void AodvExample::Report ( std::ostream &  os)

Report results.

Definition at line 142 of file aodv.cc.

Referenced by main().

+ Here is the caller graph for this function:

void AodvExample::Run ( )

Run simulation.

Definition at line 126 of file aodv.cc.

References CreateDevices(), CreateNodes(), InstallApplications(), InstallInternetStack(), and totalTime.

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

NetDeviceContainer AodvExample::devices
private

Definition at line 74 of file aodv.cc.

Referenced by CreateDevices(), and InstallInternetStack().

Ipv4InterfaceContainer AodvExample::interfaces
private

Definition at line 75 of file aodv.cc.

Referenced by InstallApplications(), and InstallInternetStack().

bool AodvExample::pcap
private

Write per-device PCAP traces if true.

Definition at line 66 of file aodv.cc.

Referenced by Configure(), and CreateDevices().

bool AodvExample::printRoutes
private

Print routes if true.

Definition at line 68 of file aodv.cc.

Referenced by Configure(), and InstallInternetStack().

uint32_t AodvExample::size
private

Number of nodes.

Definition at line 60 of file aodv.cc.

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

double AodvExample::step
private

Distance between nodes, meters.

Definition at line 62 of file aodv.cc.

Referenced by Configure(), and CreateNodes().

double AodvExample::totalTime
private

Simulation time, seconds.

Definition at line 64 of file aodv.cc.

Referenced by Configure(), InstallApplications(), and Run().


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