A Discrete-Event Network Simulator
API
ns3::UanHelper Class Reference

UAN configuration helper. More...

#include "uan-helper.h"

+ Collaboration diagram for ns3::UanHelper:

Public Member Functions

 UanHelper ()
 Defalt constructor. More...
 
virtual ~UanHelper ()
 Destructor. More...
 
int64_t AssignStreams (NetDeviceContainer c, int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
NetDeviceContainer Install (NodeContainer c) const
 This method creates a simple ns3::UanChannel (with a default ns3::UanNoiseModelDefault and ns3::UanPropModelIdeal) and creates, for each of the input nodes, a new ns3::UanNetDevice attached to this shared channel. More...
 
NetDeviceContainer Install (NodeContainer c, Ptr< UanChannel > channel) const
 For each of the input nodes, a new ns3::UanNetDevice is attached to the shared input channel. More...
 
Ptr< UanNetDeviceInstall (Ptr< Node > node, Ptr< UanChannel > channel) const
 Create a default an stack. More...
 
void SetMac (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())
 Set MAC attributes. More...
 
void SetPhy (std::string phyType, 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())
 Set PHY attributes. More...
 
void SetTransducer (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())
 Set the transducer attributes. More...
 

Static Public Member Functions

static void EnableAscii (std::ostream &os, uint32_t nodeid, uint32_t deviceid)
 Enable ascii output on the specified deviceid within the specified nodeid if it is of type ns3::UanNetDevice and dump that to the specified stdc++ output stream. More...
 
static void EnableAscii (std::ostream &os, NetDeviceContainer d)
 Enable ascii output on each device which is of the ns3::UanNetDevice type and which is located in the input device container and dump that to the specified stdc++ output stream. More...
 
static void EnableAscii (std::ostream &os, NodeContainer n)
 Enable ascii output on each device which is of the ns3::UanNetDevice type and which is located in one of the input node and dump that to the specified stdc++ output stream. More...
 
static void EnableAsciiAll (std::ostream &os)
 Enable ascii output on each device which is of the ns3::UanNetDevice type and dump that to the specified stdc++ output stream. More...
 

Private Attributes

ObjectFactory m_device
 The device. More...
 
ObjectFactory m_mac
 The MAC layer. More...
 
ObjectFactory m_phy
 The PHY layer. More...
 
ObjectFactory m_transducer
 The transducer. More...
 

Detailed Description

UAN configuration helper.

Definition at line 40 of file uan-helper.h.

Constructor & Destructor Documentation

ns3::UanHelper::UanHelper ( )

Defalt constructor.

Definition at line 78 of file uan-helper.cc.

References m_mac, m_phy, m_transducer, and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

ns3::UanHelper::~UanHelper ( )
virtual

Destructor.

Definition at line 86 of file uan-helper.cc.

Member Function Documentation

int64_t ns3::UanHelper::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 should have previously been called by the user.

Parameters
cNetDeviceContainer of the set of net devices for which the UanNetDevice should be modified to use a fixed stream.
streamFirst stream index to use.
Returns
The number of stream indices assigned by this helper.

Definition at line 257 of file uan-helper.cc.

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

+ Here is the call graph for this function:

void ns3::UanHelper::EnableAscii ( std::ostream &  os,
uint32_t  nodeid,
uint32_t  deviceid 
)
static

Enable ascii output on the specified deviceid within the specified nodeid if it is of type ns3::UanNetDevice and dump that to the specified stdc++ output stream.

Parameters
osOutput stream.
nodeidThe id of the node to generate ascii output for.
deviceidThe id of the device to generate ascii output for.

Definition at line 164 of file uan-helper.cc.

References ns3::AsciiPhyRxOkEvent(), ns3::AsciiPhyTxEvent(), ns3::Config::Connect(), ns3::Packet::EnablePrinting(), and ns3::MakeBoundCallback().

Referenced by EnableAscii(), and EnableAsciiAll().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::UanHelper::EnableAscii ( std::ostream &  os,
NetDeviceContainer  d 
)
static

Enable ascii output on each device which is of the ns3::UanNetDevice type and which is located in the input device container and dump that to the specified stdc++ output stream.

Parameters
osOutput stream.
dDevice container.

Definition at line 179 of file uan-helper.cc.

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

+ Here is the call graph for this function:

void ns3::UanHelper::EnableAscii ( std::ostream &  os,
NodeContainer  n 
)
static

Enable ascii output on each device which is of the ns3::UanNetDevice type and which is located in one of the input node and dump that to the specified stdc++ output stream.

Parameters
osOutput stream.
nNode container.

Definition at line 189 of file uan-helper.cc.

References ns3::NetDeviceContainer::Add(), ns3::NodeContainer::Begin(), EnableAscii(), ns3::NodeContainer::End(), ns3::Node::GetDevice(), and ns3::Node::GetNDevices().

+ Here is the call graph for this function:

void ns3::UanHelper::EnableAsciiAll ( std::ostream &  os)
static

Enable ascii output on each device which is of the ns3::UanNetDevice type and dump that to the specified stdc++ output stream.

Parameters
osOutput stream.

Definition at line 204 of file uan-helper.cc.

References EnableAscii(), and ns3::NodeContainer::GetGlobal().

Referenced by Experiment::Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

NetDeviceContainer ns3::UanHelper::Install ( NodeContainer  c) const

This method creates a simple ns3::UanChannel (with a default ns3::UanNoiseModelDefault and ns3::UanPropModelIdeal) and creates, for each of the input nodes, a new ns3::UanNetDevice attached to this shared channel.

Each ns3::UanNetDevice is also configured with an ns3::UanTransducerHd, ns3::UanMac, and, ns3::UanPhy, all of which are created based on the user-specified attributes specified in UanHelper::SetTransducer, UanHelper::SetMac, and, UanHelper::SetPhy.

Parameters
cA set of nodes.
Returns
The installed netdevices.

Definition at line 210 of file uan-helper.cc.

References third::channel.

Referenced by AcousticModemEnergyTestCase::DoRun(), AcousticModemEnergyDepletionTestCase::DoRun(), Install(), NetAnimExperiment::Run(), and Experiment::Run().

+ Here is the caller graph for this function:

NetDeviceContainer ns3::UanHelper::Install ( NodeContainer  c,
Ptr< UanChannel channel 
) const

For each of the input nodes, a new ns3::UanNetDevice is attached to the shared input channel.

Each ns3::UanNetDevice is also configured with an ns3::UanTransducerHd, a ns3::UanMac, and ns3::UanPhy, all of which are created based on the user-specified attributes specified in UanHelper::SetTransducer, UanHelper::SetMac, and UanHelper::SetPhy.

Parameters
cA set of nodes.
channelA channel to use.
Returns
The installed netdevices.

Definition at line 221 of file uan-helper.cc.

References ns3::NetDeviceContainer::Add(), ns3::NodeContainer::Begin(), first::devices, ns3::NodeContainer::End(), ns3::Object::GetObject(), Install(), and NS_LOG_DEBUG.

+ Here is the call graph for this function:

Ptr< UanNetDevice > ns3::UanHelper::Install ( Ptr< Node node,
Ptr< UanChannel channel 
) const

Create a default an stack.

The stack includes:

  • default channel, ideal propagation and default noise model.
  • default physical layer, with UanPhyGen.
  • default transducer, half duplex acoustic modem with UanTransducerHd.
  • default MAC layer, with UanMacAloha.

Channel, physical layer, transducer and mac layer are added to the UanNetDevice and then added to the node.

Parameters
nodeA node where to install the uan components.
channelA channel to use.
Returns
The installed UanNetDevice.

Definition at line 237 of file uan-helper.cc.

References ns3::Node::AddDevice(), ns3::UanAddress::Allocate(), ns3::ObjectFactory::Create(), m_mac, m_phy, m_transducer, third::mac, and third::phy.

+ Here is the call graph for this function:

void ns3::UanHelper::SetMac ( 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 () 
)

Set MAC attributes.

Parameters
typeThe type of ns3::UanMac 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 mac.

Definition at line 93 of file uan-helper.cc.

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

Referenced by NetAnimExperiment::Run(), and Experiment::Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::UanHelper::SetPhy ( std::string  phyType,
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 () 
)

Set PHY attributes.

Parameters
phyTypeThe type of ns3::UanPhy 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 Phy.

Definition at line 116 of file uan-helper.cc.

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

Referenced by Experiment::Run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::UanHelper::SetTransducer ( 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 () 
)

Set the transducer attributes.

Parameters
typeThe type of ns3::Transducer 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 transducer.

Definition at line 140 of file uan-helper.cc.

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

+ Here is the call graph for this function:

Member Data Documentation

ObjectFactory ns3::UanHelper::m_device
private

The device.

Definition at line 249 of file uan-helper.h.

ObjectFactory ns3::UanHelper::m_mac
private

The MAC layer.

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

Referenced by Install(), SetMac(), and UanHelper().

ObjectFactory ns3::UanHelper::m_phy
private

The PHY layer.

Definition at line 251 of file uan-helper.h.

Referenced by Install(), SetPhy(), and UanHelper().

ObjectFactory ns3::UanHelper::m_transducer
private

The transducer.

Definition at line 252 of file uan-helper.h.

Referenced by Install(), SetTransducer(), and UanHelper().


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