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

Gateway side of RC-MAC. More...

#include <uan-mac-rc-gw.h>

+ Inheritance diagram for ns3::UanMacRcGw:
+ Collaboration diagram for ns3::UanMacRcGw:

Classes

struct  AckData
 
struct  Request
 

Public Member Functions

 UanMacRcGw ()
 
virtual ~UanMacRcGw ()
 
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
 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)
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 
 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
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 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, INCYCLE, CTSING }
 

Private Member Functions

uint32_t CompExpMinIndex (uint32_t n, uint32_t k)
 
double ComputeAlpha (uint32_t totalFrames, uint32_t totalBytes, uint32_t n, uint32_t a, double deltaK)
 
double ComputeExpBOverA (uint32_t n, uint32_t a, uint32_t ldlh, std::vector< double > deltaK)
 
double ComputeExpS (uint32_t a, uint32_t ld, std::vector< double > exppdk)
 
double ComputeExpS (uint32_t a, uint32_t ld)
 
double ComputePiK (uint32_t a, uint32_t n, uint32_t k)
 
void CycleStarted (void)
 
void EndCycle (void)
 
uint32_t FindOptA (void)
 
std::vector< double > GetExpPdk (void)
 
uint64_t NchooseK (uint32_t n, uint32_t k)
 
void ReceiveError (Ptr< Packet > pkt, double sinr)
 
void ReceivePacket (Ptr< Packet > pkt, double sinr, UanTxMode mode)
 
void SendPacket (Ptr< Packet > pkt, uint32_t rate)
 
void StartCycle (void)
 

Private Attributes

std::map< UanAddress, AckDatam_ackData
 
uint32_t m_ackSize
 
UanAddress m_address
 
bool m_cleared
 
uint32_t m_ctsSizeG
 
uint32_t m_ctsSizeN
 
uint32_t m_currentRateNum
 
uint16_t m_currentRetryRate
 
TracedCallback< Time, Time,
uint32_t, uint32_t, double,
uint32_t, double > 
m_cycleLogger
 
Callback< void, Ptr< Packet >
, const UanAddress & > 
m_forwardUpCb
 
uint32_t m_frameSize
 
Time m_maxDelta
 
uint32_t m_maxRes
 
double m_minRetryRate
 
uint32_t m_numNodes
 
uint32_t m_numRates
 
Ptr< UanPhym_phy
 
std::map< UanAddress, Timem_propDelay
 
uint32_t m_rateStep
 
std::map< UanAddress, Requestm_requests
 
double m_retryStep
 
uint32_t m_rtsSize
 
TracedCallback< Ptr< const
Packet >, UanTxMode
m_rxLogger
 
Time m_sifs
 
std::set< std::pair< Time,
UanAddress > > 
m_sortedRes
 
State m_state
 
uint32_t m_totalRate
 

Detailed Description

Gateway side of RC-MAC.

Config Paths

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

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

Attributes

  • MaxReservations: Maximum number of reservations to accept per cycle
  • NumberOfRates: Number of rates per Phy layer
  • MaxPropDelay: Maximum propagation delay between gateway and non-gateway nodes
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +2000000000.0ns
    • Flags: construct write read
  • SIFS: Spacing between frames to account for timing error and processing delay
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +200000000.0ns
    • Flags: construct write read
  • NumberOfNodes: Number of non-gateway nodes in this gateway's neighborhood
  • 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
  • TotalRate: Total available channel rate in bps (for a single channel, without splitting reservation channel)
  • RateStep: Increments available for rate assignment in bps
  • FrameSize: Size of data frames in bytes

TraceSources

  • RX: A packet was destined for and received at this MAC layer
  • Cycle: Trace cycle statistics

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. UanMacRcGw is the protocol which runs on the gateway nodes.

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 60 of file uan-mac-rc-gw.h.

Member Enumeration Documentation

enum ns3::UanMacRcGw::State
private
Enumerator
IDLE 
INCYCLE 
CTSING 

Definition at line 88 of file uan-mac-rc-gw.h.

Constructor & Destructor Documentation

ns3::UanMacRcGw::~UanMacRcGw ( )
virtual

Definition at line 75 of file uan-mac-rc-gw.cc.

Member Function Documentation

int64_t ns3::UanMacRcGw::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 729 of file uan-mac-rc-gw.cc.

References NS_LOG_FUNCTION.

void ns3::UanMacRcGw::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 203 of file uan-mac-rc-gw.cc.

References m_phy, ns3::MakeCallback(), ReceiveError(), and ReceivePacket().

+ Here is the call graph for this function:

void ns3::UanMacRcGw::Clear ( void  )
virtual

Clears all pointer references

Implements ns3::UanMac.

Definition at line 80 of file uan-mac-rc-gw.cc.

References m_ackData, m_cleared, m_phy, m_propDelay, m_requests, and m_sortedRes.

Referenced by DoDispose().

+ Here is the caller graph for this function:

uint32_t ns3::UanMacRcGw::CompExpMinIndex ( uint32_t  n,
uint32_t  k 
)
private

Definition at line 643 of file uan-mac-rc-gw.cc.

References NchooseK().

Referenced by GetExpPdk().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double ns3::UanMacRcGw::ComputeAlpha ( uint32_t  totalFrames,
uint32_t  totalBytes,
uint32_t  n,
uint32_t  a,
double  deltaK 
)
private

Definition at line 549 of file uan-mac-rc-gw.cc.

References ns3::Time::GetSeconds(), m_ctsSizeG, m_maxDelta, m_rtsSize, m_sifs, m_totalRate, NS_ASSERT_MSG, and visualizer.higcontainer::w.

Referenced by ComputeExpBOverA(), ComputeExpS(), and StartCycle().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double ns3::UanMacRcGw::ComputeExpBOverA ( uint32_t  n,
uint32_t  a,
uint32_t  ldlh,
std::vector< double >  deltaK 
)
private

Definition at line 663 of file uan-mac-rc-gw.cc.

References ComputeAlpha(), ComputePiK(), m_ackSize, m_ctsSizeG, m_ctsSizeN, and m_totalRate.

Referenced by ComputeExpS().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double ns3::UanMacRcGw::ComputeExpS ( uint32_t  a,
uint32_t  ld,
std::vector< double >  exppdk 
)
private

Definition at line 608 of file uan-mac-rc-gw.cc.

References ComputeAlpha(), ComputeExpBOverA(), ComputePiK(), ns3::Time::GetSeconds(), ns3::UanHeaderCommon::GetSerializedSize(), m_ctsSizeG, m_maxDelta, m_numNodes, m_rtsSize, m_sifs, m_totalRate, NS_LOG_DEBUG, and s.

Referenced by ComputeExpS(), and FindOptA().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double ns3::UanMacRcGw::ComputeExpS ( uint32_t  a,
uint32_t  ld 
)
private

Definition at line 637 of file uan-mac-rc-gw.cc.

References ComputeExpS(), and GetExpPdk().

+ Here is the call graph for this function:

double ns3::UanMacRcGw::ComputePiK ( uint32_t  a,
uint32_t  n,
uint32_t  k 
)
private

Definition at line 656 of file uan-mac-rc-gw.cc.

References NchooseK().

Referenced by ComputeExpBOverA(), and ComputeExpS().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::UanMacRcGw::CycleStarted ( void  )
private

Definition at line 466 of file uan-mac-rc-gw.cc.

References INCYCLE, and m_state.

Referenced by StartCycle().

+ Here is the caller graph for this function:

void ns3::UanMacRcGw::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 104 of file uan-mac-rc-gw.cc.

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

+ Here is the call graph for this function:

bool ns3::UanMacRcGw::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 190 of file uan-mac-rc-gw.cc.

References NS_LOG_WARN.

uint32_t ns3::UanMacRcGw::FindOptA ( void  )
private

Definition at line 705 of file uan-mac-rc-gw.cc.

References ComputeExpS(), m_frameSize, ns3::Simulator::Now(), and NS_LOG_DEBUG.

Referenced by StartCycle().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Implements ns3::UanMac.

Definition at line 178 of file uan-mac-rc-gw.cc.

References m_address.

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

Implements ns3::UanMac.

Definition at line 216 of file uan-mac-rc-gw.cc.

References ns3::UanAddress::GetBroadcast().

+ Here is the call graph for this function:

std::vector< double > ns3::UanMacRcGw::GetExpPdk ( void  )
private

Definition at line 580 of file uan-mac-rc-gw.cc.

References CompExpMinIndex(), ns3::Time::GetSeconds(), m_maxDelta, m_numNodes, and m_propDelay.

Referenced by ComputeExpS().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TypeId ns3::UanMacRcGw::GetTypeId ( void  )
static
uint64_t ns3::UanMacRcGw::NchooseK ( uint32_t  n,
uint32_t  k 
)
private

Definition at line 682 of file uan-mac-rc-gw.cc.

Referenced by CompExpMinIndex(), and ComputePiK().

+ Here is the caller graph for this function:

void ns3::UanMacRcGw::ReceiveError ( Ptr< Packet pkt,
double  sinr 
)
private

Definition at line 211 of file uan-mac-rc-gw.cc.

Referenced by AttachPhy().

+ Here is the caller graph for this function:

void ns3::UanMacRcGw::SendPacket ( Ptr< Packet pkt,
uint32_t  rate 
)
private
void ns3::UanMacRcGw::SetAddress ( UanAddress  addr)
virtual
Parameters
addrUanAddress for this MAC

Implements ns3::UanMac.

Definition at line 184 of file uan-mac-rc-gw.cc.

References m_address.

void ns3::UanMacRcGw::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 197 of file uan-mac-rc-gw.cc.

References m_forwardUpCb.

Member Data Documentation

std::map<UanAddress, AckData> ns3::UanMacRcGw::m_ackData
private

Definition at line 131 of file uan-mac-rc-gw.h.

Referenced by Clear(), EndCycle(), ReceivePacket(), and StartCycle().

uint32_t ns3::UanMacRcGw::m_ackSize
private

Definition at line 118 of file uan-mac-rc-gw.h.

Referenced by ComputeExpBOverA(), EndCycle(), StartCycle(), and UanMacRcGw().

UanAddress ns3::UanMacRcGw::m_address
private

Definition at line 110 of file uan-mac-rc-gw.h.

Referenced by EndCycle(), GetAddress(), ReceivePacket(), SetAddress(), and StartCycle().

bool ns3::UanMacRcGw::m_cleared
private

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

Referenced by Clear().

uint32_t ns3::UanMacRcGw::m_ctsSizeG
private

Definition at line 117 of file uan-mac-rc-gw.h.

Referenced by ComputeAlpha(), ComputeExpBOverA(), ComputeExpS(), StartCycle(), and UanMacRcGw().

uint32_t ns3::UanMacRcGw::m_ctsSizeN
private

Definition at line 116 of file uan-mac-rc-gw.h.

Referenced by ComputeExpBOverA(), StartCycle(), and UanMacRcGw().

uint32_t ns3::UanMacRcGw::m_currentRateNum
private

Definition at line 120 of file uan-mac-rc-gw.h.

Referenced by EndCycle(), and StartCycle().

uint16_t ns3::UanMacRcGw::m_currentRetryRate
private

Definition at line 119 of file uan-mac-rc-gw.h.

Referenced by StartCycle().

TracedCallback<Time, Time, uint32_t, uint32_t, double, uint32_t, double> ns3::UanMacRcGw::m_cycleLogger
private

Definition at line 142 of file uan-mac-rc-gw.h.

Referenced by GetTypeId(), and StartCycle().

Callback<void, Ptr<Packet>, const UanAddress& > ns3::UanMacRcGw::m_forwardUpCb
private

Definition at line 108 of file uan-mac-rc-gw.h.

Referenced by ReceivePacket(), and SetForwardUpCb().

uint32_t ns3::UanMacRcGw::m_frameSize
private

Definition at line 124 of file uan-mac-rc-gw.h.

Referenced by FindOptA(), and GetTypeId().

Time ns3::UanMacRcGw::m_maxDelta
private
uint32_t ns3::UanMacRcGw::m_maxRes
private

Definition at line 113 of file uan-mac-rc-gw.h.

Referenced by GetTypeId(), and StartCycle().

double ns3::UanMacRcGw::m_minRetryRate
private

Definition at line 126 of file uan-mac-rc-gw.h.

Referenced by GetTypeId(), and StartCycle().

uint32_t ns3::UanMacRcGw::m_numNodes
private

Definition at line 121 of file uan-mac-rc-gw.h.

Referenced by ComputeExpS(), GetExpPdk(), GetTypeId(), and StartCycle().

uint32_t ns3::UanMacRcGw::m_numRates
private

Definition at line 114 of file uan-mac-rc-gw.h.

Referenced by GetTypeId(), and StartCycle().

Ptr<UanPhy> ns3::UanMacRcGw::m_phy
private

Definition at line 109 of file uan-mac-rc-gw.h.

Referenced by AttachPhy(), Clear(), EndCycle(), SendPacket(), and StartCycle().

std::map<UanAddress, Time> ns3::UanMacRcGw::m_propDelay
private

Definition at line 129 of file uan-mac-rc-gw.h.

Referenced by Clear(), GetExpPdk(), and ReceivePacket().

uint32_t ns3::UanMacRcGw::m_rateStep
private

Definition at line 123 of file uan-mac-rc-gw.h.

Referenced by GetTypeId(), and StartCycle().

std::map<UanAddress, Request> ns3::UanMacRcGw::m_requests
private

Definition at line 134 of file uan-mac-rc-gw.h.

Referenced by Clear(), ReceivePacket(), and StartCycle().

double ns3::UanMacRcGw::m_retryStep
private

Definition at line 127 of file uan-mac-rc-gw.h.

Referenced by GetTypeId(), and StartCycle().

uint32_t ns3::UanMacRcGw::m_rtsSize
private

Definition at line 115 of file uan-mac-rc-gw.h.

Referenced by ComputeAlpha(), ComputeExpS(), StartCycle(), and UanMacRcGw().

TracedCallback<Ptr<const Packet>, UanTxMode > ns3::UanMacRcGw::m_rxLogger
private

Definition at line 139 of file uan-mac-rc-gw.h.

Referenced by GetTypeId(), and ReceivePacket().

Time ns3::UanMacRcGw::m_sifs
private

Definition at line 112 of file uan-mac-rc-gw.h.

Referenced by ComputeAlpha(), ComputeExpS(), EndCycle(), GetTypeId(), and StartCycle().

std::set<std::pair<Time, UanAddress> > ns3::UanMacRcGw::m_sortedRes
private

Definition at line 135 of file uan-mac-rc-gw.h.

Referenced by Clear(), ReceivePacket(), and StartCycle().

State ns3::UanMacRcGw::m_state
private

Definition at line 91 of file uan-mac-rc-gw.h.

Referenced by CycleStarted(), ReceivePacket(), and StartCycle().

uint32_t ns3::UanMacRcGw::m_totalRate
private

Definition at line 122 of file uan-mac-rc-gw.h.

Referenced by ComputeAlpha(), ComputeExpBOverA(), ComputeExpS(), GetTypeId(), and StartCycle().


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