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... | |
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.
ns3::WaveHelper::WaveHelper | ( | ) |
Definition at line 260 of file wave-helper.cc.
|
virtual |
Definition at line 264 of file wave-helper.cc.
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.
c | NetDeviceContainer of the set of net devices for which the WaveNetDevice should be modified to use fixed streams |
stream | first stream index to use |
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().
void ns3::WaveHelper::CreateMacForChannel | ( | std::vector< uint32_t > | channelNumbers | ) |
channelNumbers | the 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().
void ns3::WaveHelper::CreatePhys | ( | uint32_t | phys | ) |
phys | the 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().
|
static |
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().
|
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().
|
virtual |
phy | the PHY helper to create PHY objects |
mac | the MAC helper to create MAC objects |
c | the set of nodes on which a wifi device must be created |
Definition at line 361 of file wave-helper.cc.
References ns3::Node::AddDevice(), ns3::WaveNetDevice::AddMac(), ns3::WaveNetDevice::AddPhy(), ns3::Mac48Address::Allocate(), ns3::NodeContainer::Begin(), ns3::WifiMac::ConfigureStandard(), ns3::WifiPhyHelper::Create(), ns3::ObjectFactory::Create(), ns3::WifiMacHelper::Create(), first::devices, ns3::OcbWifiMac::EnableForWave(), ns3::NodeContainer::End(), ns3::ChannelManager::GetCch(), m_channelScheduler, m_macsForChannelNumber, m_physNumber, m_stationManager, NS_FATAL_ERROR, NS_UNUSED, third::phy, ns3::WaveNetDevice::SetAddress(), ns3::WaveNetDevice::SetChannelCoordinator(), ns3::WaveNetDevice::SetChannelManager(), ns3::WaveNetDevice::SetChannelScheduler(), ns3::WaveNetDevice::SetVsaManager(), ns3::RegularWifiMac::SetWifiRemoteStationManager(), and ns3::WIFI_PHY_STANDARD_80211_10MHZ.
Referenced by WaveNetDeviceExample::CreateWaveNodes(), TestCaseHelper::CreatWaveDevice(), Install(), and VanetRoutingExperiment::SetupAdhocDevices().
|
virtual |
phy | the PHY helper to create PHY objects |
mac | the MAC helper to create MAC objects |
node | the node on which a wifi device must be created |
Definition at line 413 of file wave-helper.cc.
References Install(), third::mac, and third::phy.
|
virtual |
phy | the PHY helper to create PHY objects |
mac | the MAC helper to create MAC objects |
nodeName | the name of node on which a wifi device must be created |
Definition at line 419 of file wave-helper.cc.
References Install(), third::mac, and third::phy.
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 () |
||
) |
type | the type of ns3::ChannelScheduler to create. |
n0 | the name of the attribute to set |
v0 | the value of the attribute to set |
n1 | the name of the attribute to set |
v1 | the value of the attribute to set |
n2 | the name of the attribute to set |
v2 | the value of the attribute to set |
n3 | the name of the attribute to set |
v3 | the value of the attribute to set |
n4 | the name of the attribute to set |
v4 | the value of the attribute to set |
n5 | the name of the attribute to set |
v5 | the value of the attribute to set |
n6 | the name of the attribute to set |
v6 | the value of the attribute to set |
n7 | the name of the attribute to set |
v7 | the 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().
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 () |
||
) |
type | the type of ns3::WifiRemoteStationManager to create. |
n0 | the name of the attribute to set |
v0 | the value of the attribute to set |
n1 | the name of the attribute to set |
v1 | the value of the attribute to set |
n2 | the name of the attribute to set |
v2 | the value of the attribute to set |
n3 | the name of the attribute to set |
v3 | the value of the attribute to set |
n4 | the name of the attribute to set |
v4 | the value of the attribute to set |
n5 | the name of the attribute to set |
v5 | the value of the attribute to set |
n6 | the name of the attribute to set |
v6 | the value of the attribute to set |
n7 | the name of the attribute to set |
v7 | the 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().
|
protected |
channel scheduler
Definition at line 248 of file wave-helper.h.
Referenced by Install(), and SetChannelScheduler().
|
protected |
MACs for channel number.
Definition at line 249 of file wave-helper.h.
Referenced by CreateMacForChannel(), and Install().
|
protected |
Phy number.
Definition at line 250 of file wave-helper.h.
Referenced by CreatePhys(), and Install().
|
protected |
station manager
Definition at line 247 of file wave-helper.h.
Referenced by Install(), and SetRemoteStationManager().