ALOHA MAC Protocol. More...
#include <uan-mac-aloha.h>
Public Member Functions | |
UanMacAloha () | |
virtual | ~UanMacAloha () |
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) |
![]() | |
Object () | |
virtual | ~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) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~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 TypeId | GetTypeId (void) |
![]() | |
static TypeId | GetTypeId (void) |
![]() | |
static void | Cleanup (void) |
![]() | |
static TypeId | GetTypeId (void) |
Protected Member Functions | |
virtual void | DoDispose () |
![]() | |
Object (const Object &o) | |
virtual void | DoInitialize (void) |
virtual void | NotifyNewAggregate (void) |
![]() | |
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< UanPhy > | m_phy |
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.
ns3::UanMacAloha::UanMacAloha | ( | ) |
Definition at line 37 of file uan-mac-aloha.cc.
|
virtual |
Definition at line 43 of file uan-mac-aloha.cc.
|
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.
stream | first stream index to use |
Implements ns3::UanMac.
Definition at line 154 of file uan-mac-aloha.cc.
References NS_LOG_FUNCTION.
Attach PHY layer to this MAC. Some MACs may be designed to work with multiple PHY layers. Others may only work with one.
phy | Phy layer to attach to this MAC |
Implements ns3::UanMac.
Definition at line 119 of file uan-mac-aloha.cc.
References m_phy, ns3::MakeCallback(), RxPacketError(), and RxPacketGood().
|
virtual |
Clears all pointer references
Implements ns3::UanMac.
Definition at line 48 of file uan-mac-aloha.cc.
References m_cleared, and m_phy.
Referenced by DoDispose().
|
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().
|
virtual |
Enqueue packet to be transmitted
pkt | Packet to be transmitted |
dest | Destination address |
protocolNumber | Protocol #. 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(), m_phy, ns3::Simulator::Now(), NS_LOG_DEBUG, ns3::UanHeaderCommon::SetDest(), ns3::UanHeaderCommon::SetSrc(), and ns3::UanHeaderCommon::SetType().
|
virtual |
Implements ns3::UanMac.
Definition at line 80 of file uan-mac-aloha.cc.
References m_address.
Referenced by Enqueue(), RxPacketError(), and RxPacketGood().
|
virtual |
|
static |
Definition at line 70 of file uan-mac-aloha.cc.
References ns3::TypeId::SetParent().
Packet received at lower layer in error.
pkt | Packet received in error |
sinr | SINR 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().
Receive packet from lower layer (passed to PHY as callback)
pkt | Packet being received |
sinr | SINR of received packet |
txMode | Mode of received packet |
Definition at line 127 of file uan-mac-aloha.cc.
References GetAddress(), ns3::UanAddress::GetBroadcast(), ns3::UanHeaderCommon::GetDest(), ns3::UanHeaderCommon::GetSrc(), m_forUpCb, NS_LOG_DEBUG, and ns3::Packet::RemoveHeader().
Referenced by AttachPhy().
|
virtual |
addr | UanAddress for this MAC |
Implements ns3::UanMac.
Definition at line 86 of file uan-mac-aloha.cc.
References m_address.
|
virtual |
cb | Callback 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.
References m_forUpCb.
|
private |
Definition at line 70 of file uan-mac-aloha.h.
Referenced by GetAddress(), and SetAddress().
|
private |
Definition at line 73 of file uan-mac-aloha.h.
Referenced by Clear().
|
private |
Definition at line 72 of file uan-mac-aloha.h.
Referenced by RxPacketGood(), and SetForwardUpCb().
Definition at line 71 of file uan-mac-aloha.h.
Referenced by AttachPhy(), Clear(), and Enqueue().