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

helps to create WaveNetDevice objects More...

#include "wave-helper.h"

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

Constructor & Destructor Documentation

◆ WaveHelper()

ns3::WaveHelper::WaveHelper ( )

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

◆ ~WaveHelper()

ns3::WaveHelper::~WaveHelper ( )
virtual

Definition at line 264 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 443 of file wave-helper.cc.

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

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

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

Referenced by Default().

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

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

Referenced by Default().

◆ Default()

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

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

Referenced by WaveNetDeviceExample::CreateWaveNodes().

◆ EnableLogComponents()

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

Helper to enable all WaveNetDevice log components with one statement.

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

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

Referenced by VanetRoutingExperiment::SetupAdhocDevices().

◆ Install() [1/3]

NetDeviceContainer ns3::WaveHelper::Install ( const WifiPhyHelper phy,
const WifiMacHelper mac,
NodeContainer  c 
) const
virtual

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

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

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

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

◆ SetChannelScheduler()

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

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

Referenced by Default().

◆ SetRemoteStationManager()

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

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

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

Member Data Documentation

◆ m_channelScheduler

ObjectFactory ns3::WaveHelper::m_channelScheduler
protected

channel scheduler

Definition at line 248 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 249 of file wave-helper.h.

Referenced by CreateMacForChannel(), and Install().

◆ m_physNumber

uint32_t ns3::WaveHelper::m_physNumber
protected

Phy number.

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

Referenced by CreatePhys(), and Install().

◆ m_stationManager

ObjectFactory ns3::WaveHelper::m_stationManager
protected

station manager

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

Referenced by Install(), and SetRemoteStationManager().


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