The WaveBsmHelper class manages IEEE 1609 WAVE (Wireless Access in Vehicular Environments) Basic Safety Messages (BSMs) and uses the WaveBsmStats class to manage statistics about BSMs transmitted and received The BSM is a ~200-byte packet that is generally broadcast from every vehicle at a nominal rate of 10 Hz. More...
#include "wave-bsm-helper.h"
Public Member Functions | |
WaveBsmHelper () | |
Constructor. More... | |
int64_t | AssignStreams (NodeContainer c, int64_t stream) |
Assign a fixed random variable stream number to the random variables used by this model. More... | |
Ptr< WaveBsmStats > | GetWaveBsmStats () |
Returns the WaveBsmStats instance. More... | |
ApplicationContainer | Install (Ipv4InterfaceContainer i) const |
Install an ns3::BsmApplication on each node of the input container configured with all the attributes set with SetAttribute. More... | |
ApplicationContainer | Install (Ptr< Node > node) const |
Install an ns3::BsmApplication on the node configured with all the attributes set with SetAttribute. More... | |
void | Install (Ipv4InterfaceContainer &i, Time totalTime, uint32_t wavePacketSize, Time waveInterval, double gpsAccuracyNs, std::vector< double > ranges, int chAccessMode, Time txMaxDelay) |
Installs BSM generation on devices for nodes and their interfaces. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Helper function used to set the underlying application attributes. More... | |
Static Public Member Functions | |
static std::vector< int > & | GetNodesMoving () |
Returns the list of moving nove indicators. More... | |
Private Member Functions | |
Ptr< Application > | InstallPriv (Ptr< Node > node) const |
Install an ns3::BsmApplication on the node. More... | |
Private Attributes | |
ObjectFactory | m_factory |
Object factory. More... | |
std::vector< double > | m_txSafetyRangesSq |
tx safety range squared, for optimization More... | |
WaveBsmStats | m_waveBsmStats |
wave BSM stats More... | |
Static Private Attributes | |
static std::vector< int > | nodesMoving |
nodes moving More... | |
The WaveBsmHelper class manages IEEE 1609 WAVE (Wireless Access in Vehicular Environments) Basic Safety Messages (BSMs) and uses the WaveBsmStats class to manage statistics about BSMs transmitted and received The BSM is a ~200-byte packet that is generally broadcast from every vehicle at a nominal rate of 10 Hz.
Definition at line 44 of file wave-bsm-helper.h.
ns3::WaveBsmHelper::WaveBsmHelper | ( | ) |
Constructor.
Definition at line 31 of file wave-bsm-helper.cc.
References m_factory, m_txSafetyRangesSq, and ns3::ObjectFactory::SetTypeId().
int64_t ns3::WaveBsmHelper::AssignStreams | ( | NodeContainer | c, |
int64_t | stream | ||
) |
Assign a fixed random variable stream number to the random variables used by this model.
Return the number of streams (possibly zero) that have been assigned. The Install() method should have previously been called by the user.
stream | first stream index to use |
c | NodeContainer of the set of nodes for which the BsmApplication should be modified to use a fixed stream |
Definition at line 139 of file wave-bsm-helper.cc.
References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), ns3::Node::GetApplication(), and ns3::Node::GetNApplications().
Referenced by VanetRoutingExperiment::SetupWaveMessages().
|
static |
Returns the list of moving nove indicators.
Definition at line 159 of file wave-bsm-helper.cc.
References nodesMoving.
Ptr< WaveBsmStats > ns3::WaveBsmHelper::GetWaveBsmStats | ( | ) |
Returns the WaveBsmStats instance.
Definition at line 133 of file wave-bsm-helper.cc.
References m_waveBsmStats.
Referenced by VanetRoutingExperiment::CheckThroughput(), Install(), VanetRoutingExperiment::ParseCommandLineArguments(), and VanetRoutingExperiment::ProcessOutputs().
ApplicationContainer ns3::WaveBsmHelper::Install | ( | Ipv4InterfaceContainer | i | ) | const |
Install an ns3::BsmApplication on each node of the input container configured with all the attributes set with SetAttribute.
i | Ipv4InterfaceContainer of the set of interfaces on which an BsmApplication will be installed on the nodes. |
Definition at line 62 of file wave-bsm-helper.cc.
References ns3::ApplicationContainer::Add(), ns3::Ipv4InterfaceContainer::Begin(), ns3::Ipv4InterfaceContainer::End(), ns3::Object::GetObject(), and InstallPriv().
Referenced by Install(), and VanetRoutingExperiment::SetupWaveMessages().
ApplicationContainer ns3::WaveBsmHelper::Install | ( | Ptr< Node > | node | ) | const |
Install an ns3::BsmApplication on the node configured with all the attributes set with SetAttribute.
node | The node on which an BsmApplication will be installed. |
Definition at line 56 of file wave-bsm-helper.cc.
References InstallPriv().
void ns3::WaveBsmHelper::Install | ( | Ipv4InterfaceContainer & | i, |
Time | totalTime, | ||
uint32_t | wavePacketSize, | ||
Time | waveInterval, | ||
double | gpsAccuracyNs, | ||
std::vector< double > | ranges, | ||
int | chAccessMode, | ||
Time | txMaxDelay | ||
) |
Installs BSM generation on devices for nodes and their interfaces.
i | IPv4 interface container |
totalTime | total amount of time that BSM packets should be transmitted |
wavePacketSize | the size, in bytes, of a WAVE BSM |
waveInterval | the time, in seconds, between each WAVE BSM transmission, typically 10 Hz (0.1 second) |
gpsAccuracyNs | the timing synchronization accuracy of GPS time, in nanoseconds. GPS time-sync is ~40-100 ns. Universally synchronized time among all vehicles will result in all vehicles transmitting safety messages simultaneously, leading to excessive wireless collisions. |
ranges | the expected transmission range, in m. |
chAccessMode | channel access mode (0=continuous; 1=switching) |
txMaxDelay | max delay prior to transmit |
Definition at line 86 of file wave-bsm-helper.cc.
References ns3::ApplicationContainer::Begin(), ns3::ApplicationContainer::End(), GetWaveBsmStats(), Install(), m_txSafetyRangesSq, nodesMoving, ns3::Seconds(), ns3::ApplicationContainer::Start(), and ns3::ApplicationContainer::Stop().
|
private |
Install an ns3::BsmApplication on the node.
node | The node on which an BsmApplication will be installed. |
Definition at line 77 of file wave-bsm-helper.cc.
References ns3::Node::AddApplication(), ns3::ObjectFactory::Create(), and m_factory.
Referenced by Install().
void ns3::WaveBsmHelper::SetAttribute | ( | std::string | name, |
const AttributeValue & | value | ||
) |
Helper function used to set the underlying application attributes.
name | the name of the application attribute to set |
value | the value of the application attribute to set |
Definition at line 50 of file wave-bsm-helper.cc.
References m_factory, and ns3::ObjectFactory::Set().
|
private |
Object factory.
Definition at line 140 of file wave-bsm-helper.h.
Referenced by InstallPriv(), SetAttribute(), and WaveBsmHelper().
|
private |
tx safety range squared, for optimization
Definition at line 143 of file wave-bsm-helper.h.
Referenced by Install(), and WaveBsmHelper().
|
private |
|
staticprivate |
nodes moving
Definition at line 144 of file wave-bsm-helper.h.
Referenced by GetNodesMoving(), and Install().