Gateway side of RC-MAC. More...
#include <uan-mac-rc-gw.h>
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) |
![]() | |
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 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, AckData > | m_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< UanPhy > | m_phy |
std::map< UanAddress, Time > | m_propDelay |
uint32_t | m_rateStep |
std::map< UanAddress, Request > | m_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 |
Gateway side of RC-MAC.
ns3::UanMacRcGw is accessible through the following paths with Config::Set and Config::Connect:
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 (This work is, as of yet, unpublished) acy@ u.was hing ton.e du
Definition at line 60 of file uan-mac-rc-gw.h.
|
private |
Enumerator | |
---|---|
IDLE | |
INCYCLE | |
CTSING |
Definition at line 88 of file uan-mac-rc-gw.h.
ns3::UanMacRcGw::UanMacRcGw | ( | ) |
Definition at line 55 of file uan-mac-rc-gw.cc.
References ns3::UanHeaderCommon::GetSerializedSize(), ns3::UanHeaderRcRts::GetSerializedSize(), ns3::UanHeaderRcCtsGlobal::GetSerializedSize(), ns3::UanHeaderRcCts::GetSerializedSize(), ns3::UanHeaderRcAck::GetSerializedSize(), m_ackSize, m_ctsSizeG, m_ctsSizeN, m_rtsSize, and NS_LOG_DEBUG.
|
virtual |
Definition at line 75 of file uan-mac-rc-gw.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 729 of file uan-mac-rc-gw.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 203 of file uan-mac-rc-gw.cc.
References m_phy, ns3::MakeCallback(), ReceiveError(), and ReceivePacket().
|
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().
|
private |
Definition at line 643 of file uan-mac-rc-gw.cc.
References NchooseK().
Referenced by GetExpPdk().
|
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().
|
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().
|
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().
|
private |
Definition at line 637 of file uan-mac-rc-gw.cc.
References ComputeExpS(), and GetExpPdk().
|
private |
Definition at line 656 of file uan-mac-rc-gw.cc.
References NchooseK().
Referenced by ComputeExpBOverA(), and ComputeExpS().
|
private |
Definition at line 466 of file uan-mac-rc-gw.cc.
References INCYCLE, and m_state.
Referenced by StartCycle().
|
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().
|
private |
Definition at line 471 of file uan-mac-rc-gw.cc.
References ns3::Packet::AddHeader(), ns3::UanHeaderRcAck::AddNackedFrame(), data, ns3::UanMacRcGw::AckData::expFrames, ns3::UanMacRcGw::AckData::frameNo, m_ackData, m_ackSize, m_address, m_currentRateNum, m_phy, m_sifs, ns3::Simulator::Now(), NS_LOG_DEBUG, ns3::UanMacRcGw::AckData::rxFrames, ns3::Simulator::Schedule(), SendPacket(), ns3::UanHeaderCommon::SetDest(), ns3::UanHeaderRcAck::SetFrameNo(), ns3::UanHeaderCommon::SetSrc(), ns3::UanHeaderCommon::SetType(), StartCycle(), and ns3::UanMacRc::TYPE_ACK.
Referenced by StartCycle().
|
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 190 of file uan-mac-rc-gw.cc.
References NS_LOG_WARN.
|
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().
|
virtual |
Implements ns3::UanMac.
Definition at line 178 of file uan-mac-rc-gw.cc.
References m_address.
|
virtual |
Implements ns3::UanMac.
Definition at line 216 of file uan-mac-rc-gw.cc.
References ns3::UanAddress::GetBroadcast().
|
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().
|
static |
Definition at line 110 of file uan-mac-rc-gw.cc.
References m_cycleLogger, m_frameSize, m_maxDelta, m_maxRes, m_minRetryRate, m_numNodes, m_numRates, m_rateStep, m_retryStep, m_rxLogger, m_sifs, m_totalRate, ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
|
private |
Definition at line 682 of file uan-mac-rc-gw.cc.
Referenced by CompExpMinIndex(), and ComputePiK().
Definition at line 211 of file uan-mac-rc-gw.cc.
Referenced by AttachPhy().
Definition at line 222 of file uan-mac-rc-gw.cc.
References CTSING, ns3::UanMacRcGw::Request::frameNo, ns3::UanAddress::GetBroadcast(), ns3::UanHeaderCommon::GetDest(), ns3::UanHeaderRcData::GetFrameNo(), ns3::UanHeaderRcRts::GetFrameNo(), ns3::UanHeaderRcRts::GetLength(), ns3::UanHeaderRcRts::GetNoFrames(), ns3::UanHeaderRcData::GetPropDelay(), ns3::UanHeaderRcRts::GetRetryNo(), ns3::Packet::GetSize(), ns3::UanHeaderCommon::GetSrc(), ns3::UanHeaderCommon::GetType(), IDLE, ns3::UanMacRcGw::Request::length, m_ackData, m_address, m_forwardUpCb, m_maxDelta, m_propDelay, m_requests, m_rxLogger, m_sortedRes, m_state, ns3::Simulator::Now(), NS_FATAL_ERROR, NS_LOG_DEBUG, ns3::UanMacRcGw::Request::numFrames, ns3::Packet::PeekHeader(), ns3::Packet::RemoveHeader(), ns3::UanMacRcGw::Request::retryNo, ns3::UanMacRcGw::Request::rxTime, StartCycle(), ns3::UanMacRc::TYPE_ACK, ns3::UanMacRc::TYPE_CTS, ns3::UanMacRc::TYPE_DATA, ns3::UanMacRc::TYPE_GWPING, and ns3::UanMacRc::TYPE_RTS.
Referenced by AttachPhy().
Definition at line 517 of file uan-mac-rc-gw.cc.
References ns3::UanHeaderCommon::GetDest(), ns3::Packet::GetSize(), ns3::UanHeaderCommon::GetType(), m_phy, ns3::Simulator::Now(), NS_LOG_DEBUG, ns3::Packet::PeekHeader(), ns3::UanMacRc::TYPE_ACK, ns3::UanMacRc::TYPE_CTS, ns3::UanMacRc::TYPE_DATA, ns3::UanMacRc::TYPE_GWPING, and ns3::UanMacRc::TYPE_RTS.
Referenced by EndCycle(), and StartCycle().
|
virtual |
addr | UanAddress for this MAC |
Implements ns3::UanMac.
Definition at line 184 of file uan-mac-rc-gw.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 197 of file uan-mac-rc-gw.cc.
References m_forwardUpCb.
|
private |
Definition at line 306 of file uan-mac-rc-gw.cc.
References ns3::Packet::AddHeader(), ComputeAlpha(), CTSING, CycleStarted(), EndCycle(), ns3::UanMacRcGw::AckData::expFrames, FindOptA(), ns3::UanMacRcGw::Request::frameNo, ns3::UanMacRcGw::AckData::frameNo, ns3::UanAddress::GetBroadcast(), ns3::Time::GetSeconds(), INCYCLE, ns3::UanMacRcGw::Request::length, m_ackData, m_ackSize, m_address, m_ctsSizeG, m_ctsSizeN, m_currentRateNum, m_currentRetryRate, m_cycleLogger, m_maxDelta, m_maxRes, m_minRetryRate, m_numNodes, m_numRates, m_phy, m_rateStep, m_requests, m_retryStep, m_rtsSize, m_sifs, m_sortedRes, m_state, m_totalRate, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_WARN, ns3::UanMacRcGw::Request::numFrames, ns3::UanMacRcGw::Request::retryNo, ns3::UanMacRcGw::Request::rxTime, ns3::Simulator::Schedule(), SendPacket(), ns3::UanHeaderRcCts::SetAddress(), ns3::UanHeaderCommon::SetDest(), ns3::UanHeaderRcCtsGlobal::SetRateNum(), ns3::UanHeaderRcCtsGlobal::SetRetryRate(), ns3::UanHeaderCommon::SetSrc(), ns3::UanHeaderRcCtsGlobal::SetTxTimeStamp(), ns3::UanHeaderCommon::SetType(), ns3::UanHeaderRcCtsGlobal::SetWindowTime(), and ns3::UanMacRc::TYPE_CTS.
Referenced by EndCycle(), and ReceivePacket().
|
private |
Definition at line 131 of file uan-mac-rc-gw.h.
Referenced by Clear(), EndCycle(), ReceivePacket(), and StartCycle().
|
private |
Definition at line 118 of file uan-mac-rc-gw.h.
Referenced by ComputeExpBOverA(), EndCycle(), StartCycle(), and UanMacRcGw().
|
private |
Definition at line 110 of file uan-mac-rc-gw.h.
Referenced by EndCycle(), GetAddress(), ReceivePacket(), SetAddress(), and StartCycle().
|
private |
Definition at line 137 of file uan-mac-rc-gw.h.
Referenced by Clear().
|
private |
Definition at line 117 of file uan-mac-rc-gw.h.
Referenced by ComputeAlpha(), ComputeExpBOverA(), ComputeExpS(), StartCycle(), and UanMacRcGw().
|
private |
Definition at line 116 of file uan-mac-rc-gw.h.
Referenced by ComputeExpBOverA(), StartCycle(), and UanMacRcGw().
|
private |
Definition at line 120 of file uan-mac-rc-gw.h.
Referenced by EndCycle(), and StartCycle().
|
private |
Definition at line 119 of file uan-mac-rc-gw.h.
Referenced by StartCycle().
|
private |
Definition at line 142 of file uan-mac-rc-gw.h.
Referenced by GetTypeId(), and StartCycle().
|
private |
Definition at line 108 of file uan-mac-rc-gw.h.
Referenced by ReceivePacket(), and SetForwardUpCb().
|
private |
Definition at line 124 of file uan-mac-rc-gw.h.
Referenced by FindOptA(), and GetTypeId().
|
private |
Definition at line 111 of file uan-mac-rc-gw.h.
Referenced by ComputeAlpha(), ComputeExpS(), GetExpPdk(), GetTypeId(), ReceivePacket(), and StartCycle().
|
private |
Definition at line 113 of file uan-mac-rc-gw.h.
Referenced by GetTypeId(), and StartCycle().
|
private |
Definition at line 126 of file uan-mac-rc-gw.h.
Referenced by GetTypeId(), and StartCycle().
|
private |
Definition at line 121 of file uan-mac-rc-gw.h.
Referenced by ComputeExpS(), GetExpPdk(), GetTypeId(), and StartCycle().
|
private |
Definition at line 114 of file uan-mac-rc-gw.h.
Referenced by GetTypeId(), and StartCycle().
Definition at line 109 of file uan-mac-rc-gw.h.
Referenced by AttachPhy(), Clear(), EndCycle(), SendPacket(), and StartCycle().
|
private |
Definition at line 129 of file uan-mac-rc-gw.h.
Referenced by Clear(), GetExpPdk(), and ReceivePacket().
|
private |
Definition at line 123 of file uan-mac-rc-gw.h.
Referenced by GetTypeId(), and StartCycle().
|
private |
Definition at line 134 of file uan-mac-rc-gw.h.
Referenced by Clear(), ReceivePacket(), and StartCycle().
|
private |
Definition at line 127 of file uan-mac-rc-gw.h.
Referenced by GetTypeId(), and StartCycle().
|
private |
Definition at line 115 of file uan-mac-rc-gw.h.
Referenced by ComputeAlpha(), ComputeExpS(), StartCycle(), and UanMacRcGw().
|
private |
Definition at line 139 of file uan-mac-rc-gw.h.
Referenced by GetTypeId(), and ReceivePacket().
|
private |
Definition at line 112 of file uan-mac-rc-gw.h.
Referenced by ComputeAlpha(), ComputeExpS(), EndCycle(), GetTypeId(), and StartCycle().
|
private |
Definition at line 135 of file uan-mac-rc-gw.h.
Referenced by Clear(), ReceivePacket(), and StartCycle().
|
private |
Definition at line 91 of file uan-mac-rc-gw.h.
Referenced by CycleStarted(), ReceivePacket(), and StartCycle().
|
private |
Definition at line 122 of file uan-mac-rc-gw.h.
Referenced by ComputeAlpha(), ComputeExpBOverA(), ComputeExpS(), GetTypeId(), and StartCycle().