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

Non-gateway node MAC for reservation channel MAC protocol. More...

#include <introspected-doxygen.h>

+ Inheritance diagram for ns3::UanMacRc:

Public Types

enum  {
  TYPE_DATA, TYPE_GWPING, TYPE_RTS, TYPE_CTS,
  TYPE_ACK
}
 

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 (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

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 {
  UNASSOCIATED, GWPSENT, IDLE, RTSSENT,
  DATATX
}
 

Private Member Functions

void Associate (void)
 
void AssociateTimeout (void)
 
void BlockRtsing (void)
 
UanHeaderRcRts CreateRtsHeader (const Reservation &res)
 
bool IsPhy1Ok (void)
 
void ProcessAck (Ptr< Packet > ack)
 
void ReceiveOkFromPhy (Ptr< Packet >, double sinr, UanTxMode mode)
 
void RtsTimeout (void)
 
void ScheduleData (const UanHeaderRcCts &ctsh, const UanHeaderRcCtsGlobal &ctsg, uint32_t ctsBytes)
 
void SendPacket (Ptr< Packet > pkt, uint32_t rate)
 
void SendRts (void)
 

Private Attributes

UanAddress m_address
 
UanAddress m_assocAddr
 
bool m_cleared
 
uint32_t m_ctsSizeG
 
uint32_t m_ctsSizeN
 
uint32_t m_currentRate
 
TracedCallback< Ptr< const
Packet >, uint16_t > 
m_dequeueLogger
 
TracedCallback< Ptr< const
Packet >, uint16_t > 
m_enqueueLogger
 
Ptr< ExponentialRandomVariablem_ev
 Provides exponential random variables.
 
Callback< void, Ptr< Packet >
, const UanAddress & > 
m_forwardUpCb
 
uint8_t m_frameNo
 
Time m_learnedProp
 
uint32_t m_maxFrames
 
double m_minRetryRate
 
uint32_t m_numRates
 
uint16_t m_numRetryRates
 
Ptr< UanPhym_phy
 
std::list< std::pair< Ptr
< Packet >, UanAddress > > 
m_pktQueue
 
uint32_t m_queueLimit
 
std::list< Reservationm_resList
 
double m_retryRate
 
double m_retryStep
 
bool m_rtsBlocked
 
EventId m_rtsEvent
 
TracedCallback< Ptr< const
Packet >, UanTxMode
m_rxLogger
 
Time m_sifs
 
EventId m_startAgain
 
State m_state
 

Static Private Attributes

static uint32_t m_cntrlSends = 0
 

Detailed Description

Non-gateway node MAC for reservation channel MAC protocol.

Config Paths

ns3::UanMacRc is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Mac/$ns3::UanMacRc

Attributes

  • RetryRate: Number of retry attempts per second (of RTS/GWPING)
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0.2
    • Flags: construct write read
  • MaxFrames: Maximum number of frames to include in a single RTS
  • QueueLimit: Maximum packets to queue at MAC
  • SIFS: Spacing to give between frames (this should match gateway)
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +200000000.0ns
    • Flags: construct write read
  • NumberOfRates: Number of rate divisions supported by each PHY
  • MinRetryRate: Smallest allowed RTS retry rate
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0.01
    • Flags: construct write read
  • RetryStep: Retry rate increment
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0.01
    • Flags: construct write read
  • NumberOfRetryRates: Number of retry rates
  • MaxPropDelay: Maximum possible propagation delay to gateway
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +2000000000.0ns
    • Flags: construct write read

TraceSources

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

This MAC protocol assumes a network topology where all traffic is destined for a set of GW nodes which are connected via some out of band (RF?) means. This particular implementation assumes that there is only a single gateway.

For more information on class operation email lentr.nosp@m.acy@.nosp@m.u.was.nosp@m.hing.nosp@m.ton.e.nosp@m.du (This work is, as of yet, unpublished)

Definition at line 137 of file uan-mac-rc.h.

Member Function Documentation

int64_t ns3::UanMacRc::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 271 of file uan-mac-rc.cc.

References m_ev, and NS_LOG_FUNCTION.

void ns3::UanMacRc::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 333 of file uan-mac-rc.cc.

References ns3::MakeCallback().

void ns3::UanMacRc::Clear ( void  )
virtual

Clears all pointer references

Implements ns3::UanMac.

Definition at line 176 of file uan-mac-rc.cc.

References ns3::EventId::Cancel().

Referenced by DoDispose().

void ns3::UanMacRc::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 200 of file uan-mac-rc.cc.

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

bool ns3::UanMacRc::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 291 of file uan-mac-rc.cc.

References ns3::UanAddress::ConvertFrom(), ns3::EventId::IsRunning(), and NS_LOG_WARN.

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

Implements ns3::UanMac.

Definition at line 279 of file uan-mac-rc.cc.

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

Implements ns3::UanMac.

Definition at line 340 of file uan-mac-rc.cc.

References ns3::UanAddress::GetBroadcast().

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

Implements ns3::UanMac.

Definition at line 285 of file uan-mac-rc.cc.

void ns3::UanMacRc::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 327 of file uan-mac-rc.cc.


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