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

The VanetRoutingExperiment class implements a wifi app that allows VANET routing experiments to be simulated. More...

+ Inheritance diagram for VanetRoutingExperiment:

Public Member Functions

 VanetRoutingExperiment ()
 Constructor. More...
 
- Public Member Functions inherited from WifiApp
 WifiApp ()
 Constructor. More...
 
virtual ~WifiApp ()
 Destructor. More...
 
void Simulate (int argc, char **argv)
 Enacts simulation of an ns-3 wifi application. More...
 

Protected Member Functions

virtual void ConfigureApplications ()
 Configure applications. More...
 
virtual void ConfigureChannels ()
 Configure channels. More...
 
virtual void ConfigureDevices ()
 Configure devices. More...
 
virtual void ConfigureMobility ()
 Configure mobility. More...
 
virtual void ConfigureNodes ()
 Configure nodes. More...
 
virtual void ConfigureTracing ()
 Configure tracing. More...
 
virtual void ParseCommandLineArguments (int argc, char **argv)
 Process command line arguments. More...
 
virtual void ProcessOutputs ()
 Process outputs. More...
 
virtual void RunSimulation ()
 Run the simulation. More...
 
virtual void SetDefaultAttributeValues ()
 Sets default attribute values. More...
 

Private Member Functions

void CheckThroughput ()
 Checks the throughput and outputs summary to CSV file1. More...
 
void CommandSetup (int argc, char **argv)
 Run the simulation. More...
 
void ConfigureDefaults ()
 Configure default attributes. More...
 
void Run ()
 Run the simulation. More...
 
void SetConfigFromGlobals ()
 Set up configuration parameter from the global variables. More...
 
void SetGlobalsFromConfig ()
 Set up the global variables from the configuration parameters. More...
 
void SetupAdhocDevices ()
 Set up the adhoc devices. More...
 
void SetupAdhocMobilityNodes ()
 Set up the adhoc mobility nodes. More...
 
void SetupLogFile ()
 Set up log file. More...
 
void SetupLogging ()
 Set up logging. More...
 
void SetupRoutingMessages ()
 Set up generation of packets to be routed through the vehicular network. More...
 
void SetupScenario ()
 Set up a prescribed scenario. More...
 
void SetupWaveMessages ()
 Set up generation of IEEE 1609 WAVE messages, as a Basic Safety Message (BSM). More...
 
void WriteCsvHeader ()
 Write the header line to the CSV file1. More...
 

Static Private Member Functions

static void CourseChange (std::ostream *os, std::string context, Ptr< const MobilityModel > mobility)
 Course change function. More...
 

Private Attributes

uint32_t m_80211mode
 80211 mode More...
 
NetDeviceContainer m_adhocTxDevices
 adhoc transmit devices More...
 
Ipv4InterfaceContainer m_adhocTxInterfaces
 adhoc transmit interfaces More...
 
NodeContainer m_adhocTxNodes
 adhoc transmit nodes More...
 
int m_asciiTrace
 ascii trace More...
 
std::string m_CSVfileName
 CSV file name. More...
 
std::string m_CSVfileName2
 CSV file name. More...
 
int m_cumulativeBsmCaptureStart
 capture start More...
 
std::string m_exp
 exp More...
 
uint32_t m_fading
 fading More...
 
double m_gpsAccuracyNs
 GPS accuracy. More...
 
std::string m_loadConfigFilename
 load config file name More...
 
int m_log
 log More...
 
std::string m_logFile
 log file More...
 
uint32_t m_lossModel
 loss model More...
 
std::string m_lossModelName
 loss model name More...
 
uint32_t m_mobility
 mobility More...
 
uint32_t m_nNodes
 number of nodes More...
 
int m_nodePause
 in s More...
 
int m_nodeSpeed
 in m/s More...
 
uint32_t m_nSinks
 number of sinks More...
 
std::ofstream m_os
 output stream More...
 
int m_pcap
 PCAP. More...
 
std::string m_phyMode
 phy mode More...
 
std::string m_phyModeB
 phy mode More...
 
uint32_t m_port
 port More...
 
uint32_t m_protocol
 protocol More...
 
std::string m_protocolName
 protocol name More...
 
std::string m_rate
 rate More...
 
Ptr< RoutingHelperm_routingHelper
 routing helper More...
 
int m_routingTables
 routing tables More...
 
std::string m_saveConfigFilename
 save configi file name More...
 
uint32_t m_scenario
 scenario More...
 
int64_t m_streamIndex
 used to get consistent random numbers across scenarios More...
 
double m_TotalSimTime
 total sim time More...
 
std::string m_traceFile
 trace file More...
 
bool m_traceMobility
 trace mobility More...
 
std::string m_trName
 trace file name More...
 
double m_txMaxDelayMs
 transmit maximum delay More...
 
double m_txp
 distance More...
 
double m_txSafetyRange1
 range 1 More...
 
double m_txSafetyRange10
 range 10 More...
 
double m_txSafetyRange2
 range 2 More...
 
double m_txSafetyRange3
 range 3 More...
 
double m_txSafetyRange4
 range 4 More...
 
double m_txSafetyRange5
 range 5 More...
 
double m_txSafetyRange6
 range 6 More...
 
double m_txSafetyRange7
 range 7 More...
 
double m_txSafetyRange8
 range 8 More...
 
double m_txSafetyRange9
 range 9 More...
 
std::vector< double > m_txSafetyRanges
 list of ranges More...
 
int m_verbose
 verbose More...
 
WaveBsmHelper m_waveBsmHelper
 helper More...
 
double m_waveInterval
 seconds More...
 
uint32_t m_wavePacketSize
 bytes More...
 
Ptr< WifiPhyStatsm_wifiPhyStats
 wifi phy statistics More...
 

Detailed Description

The VanetRoutingExperiment class implements a wifi app that allows VANET routing experiments to be simulated.

Definition at line 1079 of file vanet-routing-compare.cc.

Constructor & Destructor Documentation

◆ VanetRoutingExperiment()

VanetRoutingExperiment::VanetRoutingExperiment ( )

Constructor.

Returns
none

Definition at line 1315 of file vanet-routing-compare.cc.

References m_log, m_routingHelper, and m_wifiPhyStats.

Member Function Documentation

◆ CheckThroughput()

void VanetRoutingExperiment::CheckThroughput ( )
private

◆ CommandSetup()

void VanetRoutingExperiment::CommandSetup ( int  argc,
char **  argv 
)
private

◆ ConfigureApplications()

void VanetRoutingExperiment::ConfigureApplications ( )
protectedvirtual

Configure applications.

Returns
none

Reimplemented from WifiApp.

Definition at line 1625 of file vanet-routing-compare.cc.

References ns3::Config::Connect(), m_routingHelper, ns3::MakeCallback(), RoutingHelper::OnOffTrace(), SetupRoutingMessages(), and SetupWaveMessages().

◆ ConfigureChannels()

void VanetRoutingExperiment::ConfigureChannels ( )
protectedvirtual

Configure channels.

Returns
none

Reimplemented from WifiApp.

Definition at line 1596 of file vanet-routing-compare.cc.

References SetupAdhocDevices().

◆ ConfigureDefaults()

void VanetRoutingExperiment::ConfigureDefaults ( void  )
private

Configure default attributes.

Returns
none

Definition at line 2116 of file vanet-routing-compare.cc.

References m_80211mode, m_phyMode, m_phyModeB, m_rate, and ns3::Config::SetDefault().

Referenced by ParseCommandLineArguments().

◆ ConfigureDevices()

void VanetRoutingExperiment::ConfigureDevices ( )
protectedvirtual

◆ ConfigureMobility()

void VanetRoutingExperiment::ConfigureMobility ( )
protectedvirtual

Configure mobility.

Returns
none

Reimplemented from WifiApp.

Definition at line 1619 of file vanet-routing-compare.cc.

References SetupAdhocMobilityNodes().

◆ ConfigureNodes()

void VanetRoutingExperiment::ConfigureNodes ( )
protectedvirtual

Configure nodes.

Returns
none

Reimplemented from WifiApp.

Definition at line 1590 of file vanet-routing-compare.cc.

References ns3::NodeContainer::Create(), m_adhocTxNodes, and m_nNodes.

◆ ConfigureTracing()

void VanetRoutingExperiment::ConfigureTracing ( )
protectedvirtual

Configure tracing.

Returns
none

Reimplemented from WifiApp.

Definition at line 1643 of file vanet-routing-compare.cc.

References ns3::AsciiTraceHelper::CreateFileStream(), m_trName, SetupLogFile(), SetupLogging(), and WriteCsvHeader().

◆ CourseChange()

void VanetRoutingExperiment::CourseChange ( std::ostream *  os,
std::string  context,
Ptr< const MobilityModel mobility 
)
staticprivate

Course change function.

Parameters
osthe output stream
contexttrace source context (unused)
mobilitythe mobility model

Definition at line 1733 of file vanet-routing-compare.cc.

References third::mobility, and ns3::Now().

Referenced by SetupAdhocMobilityNodes().

◆ ParseCommandLineArguments()

void VanetRoutingExperiment::ParseCommandLineArguments ( int  argc,
char **  argv 
)
protectedvirtual

◆ ProcessOutputs()

void VanetRoutingExperiment::ProcessOutputs ( )
protectedvirtual

◆ Run()

void VanetRoutingExperiment::Run ( void  )
private

Run the simulation.

Returns
none

Definition at line 1719 of file vanet-routing-compare.cc.

References CheckThroughput(), m_TotalSimTime, NS_LOG_INFO, and ns3::Seconds().

Referenced by RunSimulation().

◆ RunSimulation()

void VanetRoutingExperiment::RunSimulation ( )
protectedvirtual

Run the simulation.

Returns
none

Reimplemented from WifiApp.

Definition at line 1654 of file vanet-routing-compare.cc.

References Run().

◆ SetConfigFromGlobals()

void VanetRoutingExperiment::SetConfigFromGlobals ( )
private

◆ SetDefaultAttributeValues()

void VanetRoutingExperiment::SetDefaultAttributeValues ( )
protectedvirtual

Sets default attribute values.

Returns
none

Reimplemented from WifiApp.

Definition at line 1379 of file vanet-routing-compare.cc.

◆ SetGlobalsFromConfig()

void VanetRoutingExperiment::SetGlobalsFromConfig ( )
private

◆ SetupAdhocDevices()

void VanetRoutingExperiment::SetupAdhocDevices ( )
private

◆ SetupAdhocMobilityNodes()

void VanetRoutingExperiment::SetupAdhocMobilityNodes ( )
private

◆ SetupLogFile()

void VanetRoutingExperiment::SetupLogFile ( )
private

Set up log file.

Returns
none

Definition at line 2100 of file vanet-routing-compare.cc.

References m_logFile, and m_os.

Referenced by ConfigureTracing().

◆ SetupLogging()

void VanetRoutingExperiment::SetupLogging ( )
private

Set up logging.

Returns
none

Definition at line 2106 of file vanet-routing-compare.cc.

References ns3::LOG_LEVEL_DEBUG, and ns3::LogComponentEnable().

Referenced by ConfigureTracing().

◆ SetupRoutingMessages()

void VanetRoutingExperiment::SetupRoutingMessages ( )
private

Set up generation of packets to be routed through the vehicular network.

Returns
none

Definition at line 2348 of file vanet-routing-compare.cc.

References RoutingHelper::Install(), m_adhocTxDevices, m_adhocTxInterfaces, m_adhocTxNodes, m_nSinks, m_protocol, m_routingHelper, m_routingTables, and m_TotalSimTime.

Referenced by ConfigureApplications().

◆ SetupScenario()

void VanetRoutingExperiment::SetupScenario ( )
private

Set up a prescribed scenario.

Returns
none

Definition at line 2360 of file vanet-routing-compare.cc.

References m_CSVfileName, m_logFile, m_mobility, m_nNodes, m_nodePause, m_nodeSpeed, m_scenario, m_TotalSimTime, and m_traceFile.

Referenced by ParseCommandLineArguments().

◆ SetupWaveMessages()

void VanetRoutingExperiment::SetupWaveMessages ( )
private

Set up generation of IEEE 1609 WAVE messages, as a Basic Safety Message (BSM).

The BSM is typically a ~200-byte packets broadcast by all vehicles at a nominal rate of 10 Hz

Returns
none

Definition at line 2322 of file vanet-routing-compare.cc.

References ns3::WaveBsmHelper::AssignStreams(), ns3::WaveBsmHelper::Install(), m_80211mode, m_adhocTxInterfaces, m_adhocTxNodes, m_gpsAccuracyNs, m_streamIndex, m_TotalSimTime, m_txMaxDelayMs, m_txSafetyRanges, m_waveBsmHelper, m_waveInterval, m_wavePacketSize, ns3::MilliSeconds(), and ns3::Seconds().

Referenced by ConfigureApplications().

◆ WriteCsvHeader()

void VanetRoutingExperiment::WriteCsvHeader ( )
private

Write the header line to the CSV file1.

Returns
none

Definition at line 2404 of file vanet-routing-compare.cc.

References m_CSVfileName, and m_CSVfileName2.

Referenced by ConfigureTracing().

Member Data Documentation

◆ m_80211mode

uint32_t VanetRoutingExperiment::m_80211mode
private

◆ m_adhocTxDevices

NetDeviceContainer VanetRoutingExperiment::m_adhocTxDevices
private

adhoc transmit devices

Definition at line 1282 of file vanet-routing-compare.cc.

Referenced by SetupAdhocDevices(), and SetupRoutingMessages().

◆ m_adhocTxInterfaces

Ipv4InterfaceContainer VanetRoutingExperiment::m_adhocTxInterfaces
private

adhoc transmit interfaces

Definition at line 1283 of file vanet-routing-compare.cc.

Referenced by SetupRoutingMessages(), and SetupWaveMessages().

◆ m_adhocTxNodes

NodeContainer VanetRoutingExperiment::m_adhocTxNodes
private

◆ m_asciiTrace

int VanetRoutingExperiment::m_asciiTrace
private

◆ m_CSVfileName

std::string VanetRoutingExperiment::m_CSVfileName
private

◆ m_CSVfileName2

std::string VanetRoutingExperiment::m_CSVfileName2
private

◆ m_cumulativeBsmCaptureStart

int VanetRoutingExperiment::m_cumulativeBsmCaptureStart
private

capture start

Definition at line 1312 of file vanet-routing-compare.cc.

Referenced by CheckThroughput(), CommandSetup(), SetConfigFromGlobals(), and SetGlobalsFromConfig().

◆ m_exp

std::string VanetRoutingExperiment::m_exp
private

exp

Definition at line 1311 of file vanet-routing-compare.cc.

Referenced by CommandSetup().

◆ m_fading

uint32_t VanetRoutingExperiment::m_fading
private

◆ m_gpsAccuracyNs

double VanetRoutingExperiment::m_gpsAccuracyNs
private

GPS accuracy.

Definition at line 1285 of file vanet-routing-compare.cc.

Referenced by CommandSetup(), SetConfigFromGlobals(), SetGlobalsFromConfig(), and SetupWaveMessages().

◆ m_loadConfigFilename

std::string VanetRoutingExperiment::m_loadConfigFilename
private

load config file name

Definition at line 1290 of file vanet-routing-compare.cc.

Referenced by CommandSetup().

◆ m_log

int VanetRoutingExperiment::m_log
private

◆ m_logFile

std::string VanetRoutingExperiment::m_logFile
private

◆ m_lossModel

uint32_t VanetRoutingExperiment::m_lossModel
private

◆ m_lossModelName

std::string VanetRoutingExperiment::m_lossModelName
private

loss model name

Definition at line 1263 of file vanet-routing-compare.cc.

Referenced by SetupAdhocDevices().

◆ m_mobility

uint32_t VanetRoutingExperiment::m_mobility
private

◆ m_nNodes

uint32_t VanetRoutingExperiment::m_nNodes
private

◆ m_nodePause

int VanetRoutingExperiment::m_nodePause
private

◆ m_nodeSpeed

int VanetRoutingExperiment::m_nodeSpeed
private

◆ m_nSinks

uint32_t VanetRoutingExperiment::m_nSinks
private

◆ m_os

std::ofstream VanetRoutingExperiment::m_os
private

output stream

Definition at line 1281 of file vanet-routing-compare.cc.

Referenced by ProcessOutputs(), SetupAdhocMobilityNodes(), and SetupLogFile().

◆ m_pcap

int VanetRoutingExperiment::m_pcap
private

◆ m_phyMode

std::string VanetRoutingExperiment::m_phyMode
private

◆ m_phyModeB

std::string VanetRoutingExperiment::m_phyModeB
private

◆ m_port

uint32_t VanetRoutingExperiment::m_port
private

port

Definition at line 1252 of file vanet-routing-compare.cc.

Referenced by SetConfigFromGlobals(), and SetGlobalsFromConfig().

◆ m_protocol

uint32_t VanetRoutingExperiment::m_protocol
private

◆ m_protocolName

std::string VanetRoutingExperiment::m_protocolName
private

protocol name

Definition at line 1256 of file vanet-routing-compare.cc.

Referenced by CheckThroughput().

◆ m_rate

std::string VanetRoutingExperiment::m_rate
private

◆ m_routingHelper

Ptr<RoutingHelper> VanetRoutingExperiment::m_routingHelper
private

◆ m_routingTables

int VanetRoutingExperiment::m_routingTables
private

routing tables

Definition at line 1287 of file vanet-routing-compare.cc.

Referenced by CommandSetup(), SetConfigFromGlobals(), SetGlobalsFromConfig(), and SetupRoutingMessages().

◆ m_saveConfigFilename

std::string VanetRoutingExperiment::m_saveConfigFilename
private

save configi file name

Definition at line 1291 of file vanet-routing-compare.cc.

Referenced by CommandSetup(), and ParseCommandLineArguments().

◆ m_scenario

uint32_t VanetRoutingExperiment::m_scenario
private

◆ m_streamIndex

int64_t VanetRoutingExperiment::m_streamIndex
private

used to get consistent random numbers across scenarios

Definition at line 1298 of file vanet-routing-compare.cc.

Referenced by SetupAdhocMobilityNodes(), and SetupWaveMessages().

◆ m_TotalSimTime

double VanetRoutingExperiment::m_TotalSimTime
private

◆ m_traceFile

std::string VanetRoutingExperiment::m_traceFile
private

◆ m_traceMobility

bool VanetRoutingExperiment::m_traceMobility
private

trace mobility

Definition at line 1258 of file vanet-routing-compare.cc.

Referenced by CommandSetup(), SetConfigFromGlobals(), and SetGlobalsFromConfig().

◆ m_trName

std::string VanetRoutingExperiment::m_trName
private

trace file name

Definition at line 1275 of file vanet-routing-compare.cc.

Referenced by ConfigureTracing(), SetConfigFromGlobals(), SetGlobalsFromConfig(), and SetupAdhocDevices().

◆ m_txMaxDelayMs

double VanetRoutingExperiment::m_txMaxDelayMs
private

transmit maximum delay

Definition at line 1286 of file vanet-routing-compare.cc.

Referenced by CommandSetup(), SetConfigFromGlobals(), SetGlobalsFromConfig(), and SetupWaveMessages().

◆ m_txp

double VanetRoutingExperiment::m_txp
private

◆ m_txSafetyRange1

double VanetRoutingExperiment::m_txSafetyRange1
private

◆ m_txSafetyRange10

double VanetRoutingExperiment::m_txSafetyRange10
private

◆ m_txSafetyRange2

double VanetRoutingExperiment::m_txSafetyRange2
private

◆ m_txSafetyRange3

double VanetRoutingExperiment::m_txSafetyRange3
private

◆ m_txSafetyRange4

double VanetRoutingExperiment::m_txSafetyRange4
private

◆ m_txSafetyRange5

double VanetRoutingExperiment::m_txSafetyRange5
private

◆ m_txSafetyRange6

double VanetRoutingExperiment::m_txSafetyRange6
private

◆ m_txSafetyRange7

double VanetRoutingExperiment::m_txSafetyRange7
private

◆ m_txSafetyRange8

double VanetRoutingExperiment::m_txSafetyRange8
private

◆ m_txSafetyRange9

double VanetRoutingExperiment::m_txSafetyRange9
private

◆ m_txSafetyRanges

std::vector<double> VanetRoutingExperiment::m_txSafetyRanges
private

list of ranges

Definition at line 1310 of file vanet-routing-compare.cc.

Referenced by ParseCommandLineArguments(), and SetupWaveMessages().

◆ m_verbose

int VanetRoutingExperiment::m_verbose
private

◆ m_waveBsmHelper

WaveBsmHelper VanetRoutingExperiment::m_waveBsmHelper
private

◆ m_waveInterval

double VanetRoutingExperiment::m_waveInterval
private

◆ m_wavePacketSize

uint32_t VanetRoutingExperiment::m_wavePacketSize
private

◆ m_wifiPhyStats

Ptr<WifiPhyStats> VanetRoutingExperiment::m_wifiPhyStats
private

wifi phy statistics

Definition at line 1295 of file vanet-routing-compare.cc.

Referenced by CheckThroughput(), ConfigureDevices(), ProcessOutputs(), and VanetRoutingExperiment().


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