CW-MAC A MAC protocol similar in idea to the 802.11 DCF with constant backoff window. More...
#include <introspected-doxygen.h>
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) |
virtual Address | GetAddress () |
virtual Address | GetBroadcast (void) const |
virtual uint32_t | GetCw (void) |
virtual Time | GetSlotTime (void) |
virtual void | NotifyCcaEnd (void) |
Function called by UanPhy object to notify of channel no longer sensed busy. | |
virtual void | NotifyCcaStart (void) |
Function called by UanPhy object to notify of channel sensed busy. | |
virtual void | NotifyRxEndError (void) |
Function called by UanPhy object to notify of packet received in error. | |
virtual void | NotifyRxEndOk (void) |
Function called by UanPhy object to notify of packet received successfully. | |
virtual void | NotifyRxStart (void) |
Function called by UanPhy object to notify of packet reception. | |
virtual void | NotifyTxStart (Time duration) |
Function called by UanPhy object to notify of outgoing transmission start. | |
virtual void | SetAddress (UanAddress addr) |
virtual void | SetCw (uint32_t cw) |
virtual void | SetForwardUpCb (Callback< void, Ptr< Packet >, const UanAddress & > cb) |
virtual void | SetSlotTime (Time duration) |
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 |
SimpleRefCount & | operator= (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 Types | |
enum | State { IDLE, CCABUSY, RUNNING, TX } |
Private Member Functions | |
void | EndTx (void) |
void | PhyRxPacketError (Ptr< Packet > packet, double sinr) |
void | PhyRxPacketGood (Ptr< Packet > packet, double sinr, UanTxMode mode) |
void | SaveTimer (void) |
void | SendPacket (void) |
void | StartTimer (void) |
Private Attributes | |
UanAddress | m_address |
bool | m_cleared |
uint32_t | m_cw |
TracedCallback< Ptr< const Packet >, uint16_t > | m_dequeueLogger |
TracedCallback< Ptr< const Packet >, uint16_t > | m_enqueueLogger |
Callback< void, Ptr< Packet > , const UanAddress & > | m_forwardUpCb |
Ptr< UanPhy > | m_phy |
Ptr< Packet > | m_pktTx |
uint16_t | m_pktTxProt |
Ptr< UniformRandomVariable > | m_rv |
Provides uniform random variables. | |
TracedCallback< Ptr< const Packet >, UanTxMode > | m_rxLogger |
Time | m_savedDelayS |
EventId | m_sendEvent |
Time | m_sendTime |
Time | m_slotTime |
State | m_state |
EventId | m_txEndEvent |
CW-MAC A MAC protocol similar in idea to the 802.11 DCF with constant backoff window.
Doxygen introspection did not find any typical Config paths.
For more information on this MAC protocol, see: Parrish, N.; Tracy, L.; Roy, S.; Arabshahi, P.; Fox, W., "System Design Considerations for Undersea Networks: Link and Multiple Access Protocols," Selected Areas in Communications, IEEE Journal on , vol.26, no.9, pp.1720-1730, December 2008
Definition at line 43 of file uan-mac-cw.h.
|
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 290 of file uan-mac-cw.cc.
References m_rv, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
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 193 of file uan-mac-cw.cc.
References ns3::MakeCallback().
|
virtual |
Clears all pointer references
Implements ns3::UanMac.
Definition at line 52 of file uan-mac-cw.cc.
References ns3::EventId::Cancel().
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 70 of file uan-mac-cw.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 119 of file uan-mac-cw.cc.
References ns3::Packet::AddHeader(), ns3::UanAddress::ConvertFrom(), GetAddress(), ns3::Time::GetSeconds(), ns3::Packet::GetSize(), ns3::UniformRandomVariable::GetValue(), ns3::EventId::IsRunning(), m_rv, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, ns3::Seconds(), ns3::UanHeaderCommon::SetDest(), ns3::UanHeaderCommon::SetSrc(), and ns3::UanHeaderCommon::SetType().
|
virtual |
Implements ns3::UanMac.
Definition at line 107 of file uan-mac-cw.cc.
Referenced by Enqueue(), NotifyCcaEnd(), NotifyCcaStart(), NotifyRxEndError(), NotifyRxEndOk(), and NotifyRxStart().
|
virtual |
Implements ns3::UanMac.
Definition at line 202 of file uan-mac-cw.cc.
References ns3::UanAddress::GetBroadcast().
|
virtual |
Definition at line 330 of file uan-mac-cw.cc.
|
virtual |
Definition at line 335 of file uan-mac-cw.cc.
|
virtual |
addr | UanAddress for this MAC |
Implements ns3::UanMac.
Definition at line 113 of file uan-mac-cw.cc.
|
virtual |
cw | Contention window size |
Definition at line 320 of file uan-mac-cw.cc.
|
virtual |
cb | Callback to be called when a packet is forwarded up to higher layer |
Implements ns3::UanMac.
Definition at line 187 of file uan-mac-cw.cc.
|
virtual |
duration | Slot time duration |
Definition at line 325 of file uan-mac-cw.cc.