27 #include "ns3/uan-net-device.h"
28 #include "ns3/uan-mac.h"
29 #include "ns3/uan-phy.h"
30 #include "ns3/uan-channel.h"
31 #include "ns3/uan-prop-model.h"
32 #include "ns3/uan-prop-model-ideal.h"
33 #include "ns3/uan-transducer.h"
34 #include "ns3/mobility-model.h"
36 #include "ns3/uan-tx-mode.h"
37 #include "ns3/config.h"
38 #include "ns3/simulator.h"
39 #include "ns3/uan-noise-model-default.h"
59 [[maybe_unused]]
double txPowerDb,
UanTxMode mode)
75 [[maybe_unused]]
double snr,
UanTxMode mode)
169 std::ostringstream oss;
171 oss <<
"/NodeList/" << nodeid <<
"/DeviceList/" << deviceid <<
"/$ns3::UanNetDevice/Phy/RxOk";
176 oss <<
"/NodeList/" << nodeid <<
"/DeviceList/" << deviceid <<
"/$ns3::UanNetDevice/Phy/Tx";
197 for (uint32_t j = 0; j < node->
GetNDevices (); ++j)
216 channel->SetPropagationModel (CreateObject<UanPropModelIdeal> ());
217 channel->SetNoiseModel (noise);
248 device->SetMac (
mac);
249 device->SetPhy (
phy);
250 device->SetTransducer (trans);
261 int64_t currentStream = stream;
269 currentStream += uan->GetPhy ()->AssignStreams (currentStream);
270 currentStream += uan->GetMac ()->AssignStreams (currentStream);
273 return (currentStream - stream);
Hold a value for an Attribute.
static Mac8Address Allocate()
Allocates Mac8Address from 0-254.
Keep track of the current position and velocity of an object.
holds a vector of ns3::NetDevice pointers
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
virtual Ptr< Node > GetNode(void) const =0
virtual uint32_t GetIfIndex(void) const =0
keep track of a set of node pointers.
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
static NodeContainer GetGlobal(void)
Create a NodeContainer that contains a list of all nodes created through NodeContainer::Create() and ...
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
uint32_t GetId(void) const
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
uint32_t GetNDevices(void) const
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
Instantiate subclasses of ns3::Object.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
static void EnablePrinting(void)
Enable printing packets metadata.
static Time Now(void)
Return the current simulation virtual time.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
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.
ObjectFactory m_phy
The PHY layer.
ObjectFactory m_transducer
The transducer.
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.
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::UanNe...
ObjectFactory m_mac
The MAC layer.
NetDeviceContainer Install(NodeContainer c) const
This method creates a simple ns3::UanChannel (with a default ns3::UanNoiseModelDefault and ns3::UanPr...
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
static void EnableAsciiAll(std::ostream &os)
Enable ascii output on each device which is of the ns3::UanNetDevice type and dump that to the specif...
UanHelper()
Default constructor.
virtual ~UanHelper()
Destructor.
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.
Virtual base class for all UAN MAC protocols.
Base class for UAN Phy models.
Virtual base for Transducer objects.
Abstraction of packet modulation information.
void Connect(std::string path, const CallbackBase &cb)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static void AsciiPhyRxOkEvent(std::ostream *os, std::string context, Ptr< const Packet > packet, [[maybe_unused]] double snr, UanTxMode mode)
Ascii trace callback on successful packet reception.
static void AsciiPhyTxEvent(std::ostream *os, std::string context, Ptr< const Packet > packet, [[maybe_unused]] double txPowerDb, UanTxMode mode)
Ascii trace callback on Phy transmit events.