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

CW-MAC A MAC protocol similar in idea to the 802.11 DCF with constant backoff window. More...

#include <introspected-doxygen.h>

+ Inheritance diagram for ns3::UanMacCw:

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
 
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 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< UanPhym_phy
 
Ptr< Packetm_pktTx
 
uint16_t m_pktTxProt
 
Ptr< UniformRandomVariablem_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
 

Detailed Description

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.

Attributes

  • CW: The MAC parameter CW
  • SlotTime: Time slot duration for MAC backoff
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +20000000.0ns
    • Flags: construct write read

TraceSources

  • Enqueue: A packet arrived at the MAC for transmission
  • Dequeue: A was passed down to the PHY from the MAC
  • RX: A packet was destined for this MAC and was received

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.

Member Function Documentation

int64_t ns3::UanMacCw::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 290 of file uan-mac-cw.cc.

References m_rv, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().

void ns3::UanMacCw::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 193 of file uan-mac-cw.cc.

References ns3::MakeCallback().

void ns3::UanMacCw::Clear ( void  )
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().

void ns3::UanMacCw::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 70 of file uan-mac-cw.cc.

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

bool ns3::UanMacCw::Enqueue ( Ptr< Packet pkt,
const Address dest,
uint16_t  protocolNumber 
)
virtual
Address ns3::UanMacCw::GetAddress ( )
virtual
Returns
MAC Address

Implements ns3::UanMac.

Definition at line 107 of file uan-mac-cw.cc.

Referenced by Enqueue(), NotifyCcaEnd(), NotifyCcaStart(), NotifyRxEndError(), NotifyRxEndOk(), and NotifyRxStart().

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

Implements ns3::UanMac.

Definition at line 202 of file uan-mac-cw.cc.

References ns3::UanAddress::GetBroadcast().

uint32_t ns3::UanMacCw::GetCw ( void  )
virtual
Returns
Contention window size

Definition at line 330 of file uan-mac-cw.cc.

Time ns3::UanMacCw::GetSlotTime ( void  )
virtual
Returns
slot time duration

Definition at line 335 of file uan-mac-cw.cc.

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

Implements ns3::UanMac.

Definition at line 113 of file uan-mac-cw.cc.

void ns3::UanMacCw::SetCw ( uint32_t  cw)
virtual
Parameters
cwContention window size

Definition at line 320 of file uan-mac-cw.cc.

void ns3::UanMacCw::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 187 of file uan-mac-cw.cc.

void ns3::UanMacCw::SetSlotTime ( Time  duration)
virtual
Parameters
durationSlot time duration

Definition at line 325 of file uan-mac-cw.cc.


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