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

ALOHA MAC Protocol. More...

#include <introspected-doxygen.h>

+ Inheritance diagram for ns3::UanMacAloha:

Public Member Functions

int64_t AssignStreams (int64_t stream)
 
virtual void AttachPhy (Ptr< UanPhy > phy)
 
virtual void Clear (void)
 
virtual bool Enqueue (Ptr< Packet > pkt, const Address &dest, uint16_t protocolNumber)
 
Address GetAddress (void)
 
virtual Address GetBroadcast (void) const
 
virtual void SetAddress (UanAddress addr)
 
virtual void SetForwardUpCb (Callback< void, Ptr< Packet >, const UanAddress & > cb)
 
- Public Member Functions inherited from ns3::Object
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 
AggregateIterator GetAggregateIterator (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 
template<typename T >
Ptr< T > GetObject (void) const
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 
void Initialize (void)
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount (const SimpleRefCount &o)
 
uint32_t GetReferenceCount (void) const
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 
void Ref (void) const
 
void Unref (void) const
 
- Public Member Functions inherited from ns3::ObjectBase
void GetAttribute (std::string name, AttributeValue &value) const
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 

Static Public Member Functions

static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::UanMac
static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 

Protected Member Functions

virtual void DoDispose ()
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void DoInitialize (void)
 
virtual void NotifyNewAggregate (void)
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 

Private Member Functions

void RxPacketError (Ptr< Packet > pkt, double sinr)
 Packet received at lower layer in error. More...
 
void RxPacketGood (Ptr< Packet > pkt, double sinr, UanTxMode txMode)
 Receive packet from lower layer (passed to PHY as callback) More...
 

Private Attributes

UanAddress m_address
 
bool m_cleared
 
Callback< void, Ptr< Packet >
, const UanAddress & > 
m_forUpCb
 
Ptr< UanPhym_phy
 

Detailed Description

ALOHA MAC Protocol.

Doxygen introspection did not find any typical Config paths.
No Attributes are defined for this type.
No TraceSources are defined for this type.

The simplest MAC protocol for wireless networks. Packets enqueued are immediately transmitted. This MAC attaches a UanHeaderCommon to outgoing packets for address information. (The type field is not used)

Definition at line 42 of file uan-mac-aloha.h.

Member Function Documentation

int64_t ns3::UanMacAloha::AssignStreams ( int64_t  stream)
virtual

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.

Parameters
streamfirst stream index to use
Returns
the number of stream indices assigned by this model

Implements ns3::UanMac.

Definition at line 154 of file uan-mac-aloha.cc.

References NS_LOG_FUNCTION.

void ns3::UanMacAloha::AttachPhy ( Ptr< UanPhy phy)
virtual

Attach PHY layer to this MAC. Some MACs may be designed to work with multiple PHY layers. Others may only work with one.

Parameters
phyPhy layer to attach to this MAC

Implements ns3::UanMac.

Definition at line 119 of file uan-mac-aloha.cc.

References ns3::MakeCallback(), RxPacketError(), and RxPacketGood().

void ns3::UanMacAloha::Clear ( void  )
virtual

Clears all pointer references

Implements ns3::UanMac.

Definition at line 48 of file uan-mac-aloha.cc.

Referenced by DoDispose().

void ns3::UanMacAloha::DoDispose ( void  )
protectedvirtual

This method is called by Object::Dispose or by the object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.

It is safe to call GetObject from within this method.

Reimplemented from ns3::Object.

Definition at line 63 of file uan-mac-aloha.cc.

References Clear(), and ns3::Object::DoDispose().

bool ns3::UanMacAloha::Enqueue ( Ptr< Packet pkt,
const Address dest,
uint16_t  protocolNumber 
)
virtual

Enqueue packet to be transmitted

Parameters
pktPacket to be transmitted
destDestination address
protocolNumberProtocol #. Usage varies by MAC

Implements ns3::UanMac.

Definition at line 91 of file uan-mac-aloha.cc.

References ns3::Packet::AddHeader(), ns3::UanAddress::ConvertFrom(), GetAddress(), ns3::Simulator::Now(), NS_LOG_DEBUG, ns3::UanHeaderCommon::SetDest(), ns3::UanHeaderCommon::SetSrc(), and ns3::UanHeaderCommon::SetType().

Address ns3::UanMacAloha::GetAddress ( void  )
virtual
Returns
MAC Address

Implements ns3::UanMac.

Definition at line 80 of file uan-mac-aloha.cc.

Referenced by Enqueue(), RxPacketError(), and RxPacketGood().

Address ns3::UanMacAloha::GetBroadcast ( void  ) const
virtual
Returns
Broadcast address

Implements ns3::UanMac.

Definition at line 147 of file uan-mac-aloha.cc.

void ns3::UanMacAloha::RxPacketError ( Ptr< Packet pkt,
double  sinr 
)
private

Packet received at lower layer in error.

Parameters
pktPacket received in error
sinrSINR of received packet

Definition at line 141 of file uan-mac-aloha.cc.

References ns3::UanAddress::ConvertFrom(), GetAddress(), ns3::Simulator::Now(), and NS_LOG_DEBUG.

Referenced by AttachPhy().

void ns3::UanMacAloha::RxPacketGood ( Ptr< Packet pkt,
double  sinr,
UanTxMode  txMode 
)
private

Receive packet from lower layer (passed to PHY as callback)

Parameters
pktPacket being received
sinrSINR of received packet
txModeMode of received packet

Definition at line 127 of file uan-mac-aloha.cc.

References GetAddress(), ns3::UanAddress::GetBroadcast(), ns3::UanHeaderCommon::GetDest(), ns3::UanHeaderCommon::GetSrc(), NS_LOG_DEBUG, and ns3::Packet::RemoveHeader().

Referenced by AttachPhy().

void ns3::UanMacAloha::SetAddress ( UanAddress  addr)
virtual
Parameters
addrUanAddress for this MAC

Implements ns3::UanMac.

Definition at line 86 of file uan-mac-aloha.cc.

void ns3::UanMacAloha::SetForwardUpCb ( Callback< void, Ptr< Packet >, const UanAddress & >  cb)
virtual
Parameters
cbCallback to be called when a packet is forwarded up to higher layer

Implements ns3::UanMac.

Definition at line 114 of file uan-mac-aloha.cc.


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