A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::MeshHelper Class Reference

Helper to create IEEE 802.11s mesh networks. More...

#include <mesh-helper.h>

Public Types

enum  ChannelPolicy { SPREAD_CHANNELS, ZERO_CHANNEL }
 Spread/not spread frequency channels of MP interfaces. More...
 

Public Member Functions

 MeshHelper ()
 
 ~MeshHelper ()
 
int64_t AssignStreams (NetDeviceContainer c, int64_t stream)
 
NetDeviceContainer Install (const WifiPhyHelper &phyHelper, NodeContainer c) const
 Install 802.11s mesh device & protocols on given node list. More...
 
void Report (const ns3::Ptr< ns3::NetDevice > &, std::ostream &)
 Print statistics.
 
void ResetStats (const ns3::Ptr< ns3::NetDevice > &)
 Reset statistics.
 
void SetMacType (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 SetNumberOfInterfaces (uint32_t nInterfaces)
 Set a number of interfaces in a mesh network. More...
 
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())
 
void SetSpreadInterfaceChannels (ChannelPolicy)
 set the channel policy
 
void SetStackInstaller (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 SetStandard (enum WifiPhyStandard standard)
 

Static Public Member Functions

static MeshHelper Default ()
 Set the helper to the default values for the MAC type, remote station manager and channel policy.
 

Private Member Functions

Ptr< WifiNetDeviceCreateInterface (const WifiPhyHelper &phyHelper, Ptr< Node > node, uint16_t channelId) const
 

Private Attributes

uint32_t m_nInterfaces
 
ChannelPolicy m_spreadChannelPolicy
 
Ptr< MeshStackm_stack
 
ObjectFactory m_stackFactory
 
Interface factory
ObjectFactory m_mac
 
ObjectFactory m_stationManager
 
enum WifiPhyStandard m_standard
 

Detailed Description

Helper to create IEEE 802.11s mesh networks.

Definition at line 38 of file mesh-helper.h.

Member Enumeration Documentation

Spread/not spread frequency channels of MP interfaces.

If set to true different non-overlapping 20MHz frequency channels will be assigned to different mesh point interfaces.

Definition at line 129 of file mesh-helper.h.

Constructor & Destructor Documentation

ns3::MeshHelper::MeshHelper ( )

Construct a MeshHelper used to make life easier when creating 802.11s networks.

Definition at line 29 of file mesh-helper.cc.

ns3::MeshHelper::~MeshHelper ( )

Destroy a MeshHelper.

Definition at line 36 of file mesh-helper.cc.

Member Function Documentation

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

Assign a fixed random variable stream number to the random variables used by this model. Return the number of streams (possibly zero) that have been assigned. The Install() method of this helper should have previously been called by the user.

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

Definition at line 212 of file mesh-helper.cc.

References ns3::NetDeviceContainer::Begin(), and ns3::NetDeviceContainer::End().

Ptr< WifiNetDevice > ns3::MeshHelper::CreateInterface ( const WifiPhyHelper phyHelper,
Ptr< Node node,
uint16_t  channelId 
) const
private
Returns
a WifiNetDevice with ready-to-use interface

Definition at line 171 of file mesh-helper.cc.

References ns3::Node::AddDevice(), ns3::Mac48Address::Allocate(), ns3::WifiPhyHelper::Create(), ns3::ObjectFactory::Create(), and NS_ASSERT.

Referenced by Install().

NetDeviceContainer ns3::MeshHelper::Install ( const WifiPhyHelper phyHelper,
NodeContainer  c 
) const

Install 802.11s mesh device & protocols on given node list.

Parameters
phyHelperWifi PHY helper
cList of nodes to install
Returns
list of created mesh point devices, see MeshPointDevice

Definition at line 79 of file mesh-helper.cc.

References ns3::NetDeviceContainer::Add(), ns3::Node::AddDevice(), ns3::NodeContainer::Begin(), CreateInterface(), ns3::NodeContainer::End(), NS_ASSERT, and NS_FATAL_ERROR.

Referenced by MeshTest::CreateNodes().

void ns3::MeshHelper::SetMacType ( 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
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 mac.

Definition at line 123 of file mesh-helper.cc.

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

Referenced by MeshTest::CreateNodes(), and Default().

void ns3::MeshHelper::SetNumberOfInterfaces ( uint32_t  nInterfaces)

Set a number of interfaces in a mesh network.

Parameters
nInterfacesis the number of interfaces

Definition at line 74 of file mesh-helper.cc.

Referenced by MeshTest::CreateNodes().

void ns3::MeshHelper::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 143 of file mesh-helper.cc.

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

Referenced by Default().

void ns3::MeshHelper::SetStackInstaller ( 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::MeshStack.
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

Definition at line 46 of file mesh-helper.cc.

References ns3::ObjectFactory::Create(), NS_FATAL_ERROR, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().

Referenced by MeshTest::CreateNodes().

void ns3::MeshHelper::SetStandard ( enum WifiPhyStandard  standard)

Set PHY standard

Definition at line 165 of file mesh-helper.cc.


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