A Discrete-Event Network Simulator
API
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AodvExample Class Reference

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...
 

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 47 of file aodv.cc.

Constructor & Destructor Documentation

◆ AodvExample()

AodvExample::AodvExample ( )

Definition at line 111 of file aodv.cc.

Member Function Documentation

◆ Configure()

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

Configure script parameters.

Parameters
argcis the command line argument count
argvis the command line arguments
Returns
true on successful configuration

Definition at line 121 of file aodv.cc.

References second::cmd, pcap, printRoutes, size, step, and totalTime.

◆ CreateDevices()

void AodvExample::CreateDevices ( )
private

◆ CreateNodes()

void AodvExample::CreateNodes ( )
private

Create the nodes.

Definition at line 161 of file aodv.cc.

References ns3::NodeContainer::Create(), ns3::NodeContainer::Get(), third::mobility, nodes, size, and step.

Referenced by Run().

◆ InstallApplications()

void AodvExample::InstallApplications ( )
private

◆ InstallInternetStack()

void AodvExample::InstallInternetStack ( )
private

Create the network.

Definition at line 204 of file aodv.cc.

References first::address, devices, interfaces, nodes, printRoutes, ns3::Ipv4RoutingHelper::PrintRoutingTableAllAt(), ns3::Seconds(), and first::stack.

Referenced by Run().

◆ Report()

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

Report results.

Parameters
osthe output stream

Definition at line 156 of file aodv.cc.

◆ Run()

void AodvExample::Run ( )

Run simulation.

Definition at line 140 of file aodv.cc.

References CreateDevices(), CreateNodes(), InstallApplications(), InstallInternetStack(), ns3::Seconds(), and totalTime.

Member Data Documentation

◆ devices

NetDeviceContainer AodvExample::devices
private

devices used in the example

Definition at line 84 of file aodv.cc.

Referenced by CreateDevices(), and InstallInternetStack().

◆ interfaces

Ipv4InterfaceContainer AodvExample::interfaces
private

interfaces used in the example

Definition at line 86 of file aodv.cc.

Referenced by InstallApplications(), and InstallInternetStack().

◆ nodes

NodeContainer AodvExample::nodes
private

nodes used in the example

Definition at line 82 of file aodv.cc.

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

◆ pcap

bool AodvExample::pcap
private

Write per-device PCAP traces if true.

Definition at line 76 of file aodv.cc.

Referenced by Configure(), and CreateDevices().

◆ printRoutes

bool AodvExample::printRoutes
private

Print routes if true.

Definition at line 78 of file aodv.cc.

Referenced by Configure(), and InstallInternetStack().

◆ size

uint32_t AodvExample::size
private

Number of nodes.

Definition at line 70 of file aodv.cc.

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

◆ step

double AodvExample::step
private

Distance between nodes, meters.

Definition at line 72 of file aodv.cc.

Referenced by Configure(), and CreateNodes().

◆ totalTime

double AodvExample::totalTime
private

Simulation time, seconds.

Definition at line 74 of file aodv.cc.

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


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