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
 
template<typename... Ts>
void SetChannelScheduler (std::string type, Ts &&... args)
 
template<typename... Ts>
void SetRemoteStationManager (std::string type, Ts &&... args)
 

Static Public Member Functions

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

Protected Attributes

ObjectFactory m_channelScheduler
 channel scheduler More...
 
std::vector< uint32_t > m_macsForChannelNumber
 MACs for channel number. More...
 
uint32_t m_physNumber
 Phy number. More...
 
ObjectFactory m_stationManager
 station manager More...
 

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 115 of file wave-helper.h.

Constructor & Destructor Documentation

◆ WaveHelper()

ns3::WaveHelper::WaveHelper ( )

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

◆ ~WaveHelper()

ns3::WaveHelper::~WaveHelper ( )
virtual

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

Member Function Documentation

◆ AssignStreams()

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 421 of file wave-helper.cc.

References ns3::Txop::AssignStreams(), ns3::NetDeviceContainer::Begin(), ns3::NetDeviceContainer::End(), ns3::PointerValue::Get(), ns3::WaveNetDevice::GetMacs(), ns3::WaveNetDevice::GetPhys(), and two-ray-to-three-gpp-ch-calibration::k.

+ Here is the call graph for this function:

◆ CreateMacForChannel()

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 303 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:

◆ CreatePhys()

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

Definition at line 320 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:

◆ Default()

WaveHelper ns3::WaveHelper::Default ( )
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 285 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:

◆ EnableLogComponents()

void ns3::WaveHelper::EnableLogComponents ( )
static

Helper to enable all WaveNetDevice log components with one statement.

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

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

+ Here is the call graph for this function:

◆ Install() [1/3]

◆ Install() [2/3]

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 391 of file wave-helper.cc.

References Install(), third::mac, and third::phy.

+ Here is the call graph for this function:

◆ Install() [3/3]

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 397 of file wave-helper.cc.

References Install(), third::mac, and third::phy.

+ Here is the call graph for this function:

◆ SetChannelScheduler()

template<typename... Ts>
void ns3::WaveHelper::SetChannelScheduler ( std::string  type,
Ts &&...  args 
)
Template Parameters
Ts[deduced] Argument types
Parameters
typethe type of ns3::ChannelScheduler to create.
[in]argsName and AttributeValue pairs to set.

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

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

References check-style-clang-format::args, m_channelScheduler, and check-style-clang-format::type.

Referenced by Default().

+ Here is the caller graph for this function:

◆ SetRemoteStationManager()

template<typename... Ts>
void ns3::WaveHelper::SetRemoteStationManager ( std::string  type,
Ts &&...  args 
)
Template Parameters
Ts[deduced] Argument types
Parameters
typethe type of ns3::WifiRemoteStationManager to create.
[in]argsName and AttributeValue pairs to set.

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

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

References check-style-clang-format::args, m_stationManager, and check-style-clang-format::type.

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

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channelScheduler

ObjectFactory ns3::WaveHelper::m_channelScheduler
protected

channel scheduler

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

Referenced by Install(), and SetChannelScheduler().

◆ m_macsForChannelNumber

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

MACs for channel number.

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

Referenced by CreateMacForChannel(), and Install().

◆ m_physNumber

uint32_t ns3::WaveHelper::m_physNumber
protected

Phy number.

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

Referenced by CreatePhys(), and Install().

◆ m_stationManager

ObjectFactory ns3::WaveHelper::m_stationManager
protected

station manager

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

Referenced by Install(), and SetRemoteStationManager().


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