A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
TracerouteExample Class Reference

Test script. More...

+ Collaboration diagram for TracerouteExample:

Public Member Functions

 TracerouteExample ()
 
bool Configure (int argc, char **argv)
 Configure script parameters.
 
void Report (std::ostream &os)
 Report results.
 
void Run ()
 Run simulation.
 

Private Member Functions

void CreateDevices ()
 Create the devices.
 
void CreateNodes ()
 Create the nodes.
 
void InstallApplications ()
 Create the simulation applications.
 
void InstallInternetStack ()
 Create the network.
 

Private Attributes

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

Detailed Description

Test script.

This script creates 1-dimensional grid topology and Traceroute the 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]

The results should be all the intermediate hops all the way to 10.0.0.10

Usage:

traceroute 10.0.0.10

Definition at line 41 of file traceroute-example.cc.

Constructor & Destructor Documentation

◆ TracerouteExample()

TracerouteExample::TracerouteExample ( )

Definition at line 106 of file traceroute-example.cc.

Member Function Documentation

◆ Configure()

bool TracerouteExample::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 116 of file traceroute-example.cc.

References pcap, printRoutes, ns3::RngSeedManager::SetSeed(), size, step, and totalTime.

+ Here is the call graph for this function:

◆ CreateDevices()

void TracerouteExample::CreateDevices ( )
private

Create the devices.

Definition at line 189 of file traceroute-example.cc.

References ns3::YansWifiChannelHelper::Create(), ns3::YansWifiChannelHelper::Default(), devices, ns3::PcapHelperForDevice::EnablePcapAll(), nodes, pcap, ns3::YansWifiPhyHelper::SetChannel(), and ns3::WifiMacHelper::SetType().

Referenced by Run().

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

◆ CreateNodes()

void TracerouteExample::CreateNodes ( )
private

Create the nodes.

Definition at line 158 of file traceroute-example.cc.

References ns3::Names::Add(), ns3::NodeContainer::Create(), ns3::NodeContainer::Get(), nodes, size, and step.

Referenced by Run().

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

◆ InstallApplications()

void TracerouteExample::InstallApplications ( )
private

Create the simulation applications.

Definition at line 231 of file traceroute-example.cc.

References ns3::NodeContainer::Get(), ns3::ApplicationHelper::Install(), nodes, ns3::Seconds(), ns3::ApplicationHelper::SetAttribute(), 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:

◆ InstallInternetStack()

void TracerouteExample::InstallInternetStack ( )
private

Create the network.

Definition at line 211 of file traceroute-example.cc.

References ns3::Create(), devices, interfaces, nodes, printRoutes, ns3::Ipv4RoutingHelper::PrintRoutingTableAllAt(), and ns3::Seconds().

Referenced by Run().

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

◆ Report()

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

Report results.

Parameters
osthe output stream

Definition at line 153 of file traceroute-example.cc.

◆ Run()

void TracerouteExample::Run ( )

Run simulation.

Definition at line 135 of file traceroute-example.cc.

References CreateDevices(), CreateNodes(), ns3::Simulator::Destroy(), InstallApplications(), InstallInternetStack(), ns3::Simulator::Run(), ns3::Seconds(), ns3::Simulator::Stop(), and totalTime.

+ Here is the call graph for this function:

Member Data Documentation

◆ devices

NetDeviceContainer TracerouteExample::devices
private

devices used in the example

Definition at line 75 of file traceroute-example.cc.

Referenced by CreateDevices(), and InstallInternetStack().

◆ interfaces

Ipv4InterfaceContainer TracerouteExample::interfaces
private

interfaces used in the example

Definition at line 77 of file traceroute-example.cc.

Referenced by InstallInternetStack().

◆ nodes

NodeContainer TracerouteExample::nodes
private

nodes used in the example

Definition at line 73 of file traceroute-example.cc.

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

◆ pcap

bool TracerouteExample::pcap
private

Write per-device PCAP traces if true.

Definition at line 69 of file traceroute-example.cc.

Referenced by Configure(), and CreateDevices().

◆ printRoutes

bool TracerouteExample::printRoutes
private

Print aodv routes if true.

Definition at line 71 of file traceroute-example.cc.

Referenced by Configure(), and InstallInternetStack().

◆ size

uint32_t TracerouteExample::size
private

Number of nodes.

Definition at line 63 of file traceroute-example.cc.

Referenced by Configure(), and CreateNodes().

◆ step

double TracerouteExample::step
private

Distance between nodes, meters.

Definition at line 65 of file traceroute-example.cc.

Referenced by Configure(), and CreateNodes().

◆ totalTime

double TracerouteExample::totalTime
private

Simulation time, seconds.

Definition at line 67 of file traceroute-example.cc.

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


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