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 |
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... | |
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.
ns3::WaveHelper::WaveHelper | ( | ) |
Definition at line 276 of file wave-helper.cc.
|
virtual |
Definition at line 280 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 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.
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 303 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 320 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 285 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 404 of file wave-helper.cc.
References ns3::WifiHelper::EnableLogComponents(), ns3::LOG_LEVEL_ALL, and ns3::LogComponentEnable().
|
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 335 of file wave-helper.cc.
References ns3::Node::AddDevice(), ns3::WaveNetDevice::AddMac(), ns3::WaveNetDevice::AddPhy(), ns3::Mac48Address::Allocate(), ns3::NodeContainer::Begin(), ns3::ObjectFactory::Create(), ns3::WifiPhyHelper::Create(), ns3::WifiMacHelper::Create(), first::devices, ns3::OcbWifiMac::EnableForWave(), ns3::NodeContainer::End(), ns3::ChannelManager::GetCch(), two-ray-to-three-gpp-ch-calibration::k, m_channelScheduler, m_macsForChannelNumber, m_physNumber, m_stationManager, NS_ABORT_IF, NS_FATAL_ERROR, ns3::WaveNetDevice::SetAddress(), ns3::WaveNetDevice::SetChannelCoordinator(), ns3::WaveNetDevice::SetChannelManager(), ns3::WaveNetDevice::SetChannelScheduler(), ns3::WaveNetDevice::SetVsaManager(), ns3::WifiMac::SetWifiRemoteStationManager(), ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_STANDARD_80211p.
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 391 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 397 of file wave-helper.cc.
References Install(), third::mac, and third::phy.
void ns3::WaveHelper::SetChannelScheduler | ( | std::string | type, |
Ts &&... | args | ||
) |
Ts | [deduced] Argument types |
type | the type of ns3::ChannelScheduler to create. | |
[in] | args | Name 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().
void ns3::WaveHelper::SetRemoteStationManager | ( | std::string | type, |
Ts &&... | args | ||
) |
Ts | [deduced] Argument types |
type | the type of ns3::WifiRemoteStationManager to create. | |
[in] | args | Name 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().
|
protected |
channel scheduler
Definition at line 213 of file wave-helper.h.
Referenced by Install(), and SetChannelScheduler().
|
protected |
MACs for channel number.
Definition at line 214 of file wave-helper.h.
Referenced by CreateMacForChannel(), and Install().
|
protected |
Phy number.
Definition at line 215 of file wave-helper.h.
Referenced by CreatePhys(), and Install().
|
protected |
station manager
Definition at line 212 of file wave-helper.h.
Referenced by Install(), and SetRemoteStationManager().