A Discrete-Event Network Simulator
API
ns3::WaveHelper Class Reference

helps to create WaveNetDevice objects More...

#include "wave-helper.h"

+ Collaboration diagram for ns3::WaveHelper:

Public Member Functions

 WaveHelper ()
 
virtual ~WaveHelper ()
 
int64_t AssignStreams (NetDeviceContainer c, int64_t stream)
 Assign a fixed random variable stream number to the random variables used by the Phy and Mac aspects of the WAVE models. More...
 
void CreateMacForChannel (std::vector< uint32_t > channelNumbers)
 
void CreatePhys (uint32_t phys)
 
virtual NetDeviceContainer Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
 
virtual NetDeviceContainer Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, Ptr< Node > node) const
 
virtual NetDeviceContainer Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, std::string nodeName) const
 
void SetChannelScheduler (std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
 
void SetRemoteStationManager (std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
 

Static Public Member Functions

static WaveHelper Default (void)
 
static void EnableLogComponents (void)
 Helper to enable all WaveNetDevice log components with one statement. More...
 

Protected Attributes

ObjectFactory m_channelScheduler
 
std::vector< uint32_t > m_macsForChannelNumber
 
uint32_t m_physNumber
 
ObjectFactory m_stationManager
 

Detailed Description

helps to create WaveNetDevice objects

This class can help to create a large set of similar WaveNetDevice objects and to configure a large set of their attributes during creation.

Generally WaveHelper with default configuration will create devices with 7 MAC entities,1 PHY entity and a multiple-channel scheduler for to deal with these entities.

If users can make sure on which channel this WAVE device will work, they can set specific channel numbers to save resources of unused channels as below: WaveHelper helper = WaveHelper::Default (); uint32_t channels[] = {CCH, SCH1}; std::vector<uint32_t> channelsVector (channels, channels + 2); helper.helper.CreateMacForChannel (channelsVector);

If users can create other channel scheduler such as "AnotherScheduler" which can assign channel access in the context of more PHY entities, they can use this helper to create WAVE devices as below: WaveHelper helper = WaveHelper::Default (); helper.helper.CreateMacForChannel (ChannelManager::GetWaveChannels ()); helper.CreatePhys (2); // or other number which should be less than 7 helper.SetChannelScheduler ("ns3::AnotherScheduler"); helper.SetRemoteStationManager ("ns3::ConstantRateWifiManager"); // or other rate control algorithms

Definition at line 110 of file wave-helper.h.

Constructor & Destructor Documentation

ns3::WaveHelper::WaveHelper ( )

Definition at line 229 of file wave-helper.cc.

ns3::WaveHelper::~WaveHelper ( )
virtual

Definition at line 233 of file wave-helper.cc.

Member Function Documentation

int64_t ns3::WaveHelper::AssignStreams ( NetDeviceContainer  c,
int64_t  stream 
)

Assign a fixed random variable stream number to the random variables used by the Phy and Mac aspects of the WAVE models.

Each device in container c has fixed stream numbers assigned to its random variables. The Wifi channel (e.g. propagation loss model) is excluded. Return the number of streams (possibly zero) that have been assigned. The Install() method should have previously been called by the user.

Parameters
cNetDeviceContainer of the set of net devices for which the WaveNetDevice should be modified to use fixed streams
streamfirst stream index to use
Returns
the number of stream indices assigned by this helper

Definition at line 412 of file wave-helper.cc.

References ns3::EdcaTxopN::AssignStreams(), ns3::NetDeviceContainer::Begin(), ns3::NetDeviceContainer::End(), ns3::PointerValue::Get(), ns3::WaveNetDevice::GetMacs(), and ns3::WaveNetDevice::GetPhys().

+ Here is the call graph for this function:

void ns3::WaveHelper::CreateMacForChannel ( std::vector< uint32_t >  channelNumbers)
Parameters
channelNumbersthe MAC entities will be created to support these channels for multiple channel operation.

Definition at line 253 of file wave-helper.cc.

References ns3::ChannelManager::IsWaveChannel(), m_macsForChannelNumber, and NS_FATAL_ERROR.

Referenced by Default().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::WaveHelper::CreatePhys ( uint32_t  phys)
Parameters
physthe number of PHY entity which will be created for multiple channel operation.

Definition at line 270 of file wave-helper.cc.

References ns3::ChannelManager::GetNumberOfWaveChannels(), m_physNumber, and NS_FATAL_ERROR.

Referenced by Default().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

WaveHelper ns3::WaveHelper::Default ( void  )
static
Returns
a new WaveHelper in a default state

The default state is defined as being seven OcbWifiMac MAC entities with an ConstantRate rate control algorithm, one WifiPhy entity and a default multiple-channel scheduler DefaultChannelScheduler for assigning channel access with these created entities.

Definition at line 238 of file wave-helper.cc.

References CreateMacForChannel(), CreatePhys(), ns3::ChannelManager::GetWaveChannels(), SetChannelScheduler(), and SetRemoteStationManager().

Referenced by WaveNetDeviceExample::CreateWaveNodes().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::WaveHelper::EnableLogComponents ( void  )
static

Helper to enable all WaveNetDevice log components with one statement.

Definition at line 395 of file wave-helper.cc.

References ns3::WifiHelper::EnableLogComponents(), ns3::LOG_LEVEL_ALL, and ns3::LogComponentEnable().

Referenced by VanetRoutingExperiment::SetupAdhocDevices().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

NetDeviceContainer ns3::WaveHelper::Install ( const WifiPhyHelper phy,
const WifiMacHelper mac,
NodeContainer  c 
) const
virtual
NetDeviceContainer ns3::WaveHelper::Install ( const WifiPhyHelper phy,
const WifiMacHelper mac,
Ptr< Node node 
) const
virtual
Parameters
phythe PHY helper to create PHY objects
macthe MAC helper to create MAC objects
nodethe node on which a wifi device must be created
Returns
a device container which contains all the devices created by this method.

Definition at line 382 of file wave-helper.cc.

References Install().

+ Here is the call graph for this function:

NetDeviceContainer ns3::WaveHelper::Install ( const WifiPhyHelper phy,
const WifiMacHelper mac,
std::string  nodeName 
) const
virtual
Parameters
phythe PHY helper to create PHY objects
macthe MAC helper to create MAC objects
nodeNamethe name of node on which a wifi device must be created
Returns
a device container which contains all the devices created by this method.

Definition at line 388 of file wave-helper.cc.

References Install().

+ Here is the call graph for this function:

void ns3::WaveHelper::SetChannelScheduler ( std::string  type,
std::string  n0 = "",
const AttributeValue v0 = EmptyAttributeValue (),
std::string  n1 = "",
const AttributeValue v1 = EmptyAttributeValue (),
std::string  n2 = "",
const AttributeValue v2 = EmptyAttributeValue (),
std::string  n3 = "",
const AttributeValue v3 = EmptyAttributeValue (),
std::string  n4 = "",
const AttributeValue v4 = EmptyAttributeValue (),
std::string  n5 = "",
const AttributeValue v5 = EmptyAttributeValue (),
std::string  n6 = "",
const AttributeValue v6 = EmptyAttributeValue (),
std::string  n7 = "",
const AttributeValue v7 = EmptyAttributeValue () 
)
Parameters
typethe type of ns3::ChannelScheduler to create.
n0the name of the attribute to set
v0the value of the attribute to set
n1the name of the attribute to set
v1the value of the attribute to set
n2the name of the attribute to set
v2the value of the attribute to set
n3the name of the attribute to set
v3the value of the attribute to set
n4the name of the attribute to set
v4the value of the attribute to set
n5the name of the attribute to set
v5the value of the attribute to set
n6the name of the attribute to set
v6the value of the attribute to set
n7the name of the attribute to set
v7the value of the attribute to set

All the attributes specified in this method should exist in the requested channel scheduler.

Definition at line 307 of file wave-helper.cc.

References m_channelScheduler, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().

Referenced by Default().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::WaveHelper::SetRemoteStationManager ( std::string  type,
std::string  n0 = "",
const AttributeValue v0 = EmptyAttributeValue (),
std::string  n1 = "",
const AttributeValue v1 = EmptyAttributeValue (),
std::string  n2 = "",
const AttributeValue v2 = EmptyAttributeValue (),
std::string  n3 = "",
const AttributeValue v3 = EmptyAttributeValue (),
std::string  n4 = "",
const AttributeValue v4 = EmptyAttributeValue (),
std::string  n5 = "",
const AttributeValue v5 = EmptyAttributeValue (),
std::string  n6 = "",
const AttributeValue v6 = EmptyAttributeValue (),
std::string  n7 = "",
const AttributeValue v7 = EmptyAttributeValue () 
)
Parameters
typethe type of ns3::WifiRemoteStationManager to create.
n0the name of the attribute to set
v0the value of the attribute to set
n1the name of the attribute to set
v1the value of the attribute to set
n2the name of the attribute to set
v2the value of the attribute to set
n3the name of the attribute to set
v3the value of the attribute to set
n4the name of the attribute to set
v4the value of the attribute to set
n5the name of the attribute to set
v5the value of the attribute to set
n6the name of the attribute to set
v6the value of the attribute to set
n7the name of the attribute to set
v7the value of the attribute to set

All the attributes specified in this method should exist in the requested station manager.

Definition at line 284 of file wave-helper.cc.

References m_stationManager, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().

Referenced by Default(), and VanetRoutingExperiment::SetupAdhocDevices().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

ObjectFactory ns3::WaveHelper::m_channelScheduler
protected

Definition at line 246 of file wave-helper.h.

Referenced by Install(), and SetChannelScheduler().

std::vector<uint32_t> ns3::WaveHelper::m_macsForChannelNumber
protected

Definition at line 247 of file wave-helper.h.

Referenced by CreateMacForChannel(), and Install().

uint32_t ns3::WaveHelper::m_physNumber
protected

Definition at line 248 of file wave-helper.h.

Referenced by CreatePhys(), and Install().

ObjectFactory ns3::WaveHelper::m_stationManager
protected

Definition at line 245 of file wave-helper.h.

Referenced by Install(), and SetRemoteStationManager().


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