Non-gateway node MAC for reservation channel MAC protocol. More...
#include <uan-mac-rc.h>
Public Types | |
enum | { TYPE_DATA, TYPE_GWPING, TYPE_RTS, TYPE_CTS, TYPE_ACK } |
Public Member Functions | |
UanMacRc () | |
virtual | ~UanMacRc () |
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 | |
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 { 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< ExponentialRandomVariable > | m_ev |
Provides exponential random variables. More... | |
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 |
Ptr< UanPhy > | m_phy |
std::list< std::pair< Ptr < Packet >, UanAddress > > | m_pktQueue |
uint32_t | m_queueLimit |
std::list< Reservation > | m_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 |
Non-gateway node MAC for reservation channel MAC protocol.
ns3::UanMacRc 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. 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 137 of file uan-mac-rc.h.
anonymous enum |
Enumerator | |
---|---|
TYPE_DATA | |
TYPE_GWPING | |
TYPE_RTS | |
TYPE_CTS | |
TYPE_ACK |
Definition at line 140 of file uan-mac-rc.h.
|
private |
Enumerator | |
---|---|
UNASSOCIATED | |
GWPSENT | |
IDLE | |
RTSSENT | |
DATATX |
Definition at line 168 of file uan-mac-rc.h.
ns3::UanMacRc::UanMacRc | ( | ) |
Definition at line 153 of file uan-mac-rc.cc.
References ns3::UanHeaderRcCtsGlobal::GetSerializedSize(), ns3::UanHeaderRcCts::GetSerializedSize(), m_ctsSizeG, m_ctsSizeN, and m_ev.
|
virtual |
Definition at line 171 of file uan-mac-rc.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 266 of file uan-mac-rc.cc.
References m_ev, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
|
private |
Definition at line 618 of file uan-mac-rc.cc.
References ns3::Packet::AddHeader(), ns3::Reservation::AddTimestamp(), AssociateTimeout(), CreateRtsHeader(), ns3::UanAddress::GetBroadcast(), ns3::ExponentialRandomVariable::GetValue(), GWPSENT, IsPhy1Ok(), ns3::EventId::IsRunning(), m_address, m_cntrlSends, m_currentRate, m_ev, m_frameNo, m_maxFrames, m_numRates, m_phy, m_pktQueue, m_resList, m_retryRate, m_rtsBlocked, m_rtsEvent, m_state, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, ns3::Simulator::Schedule(), SendPacket(), ns3::ObjectBase::SetAttribute(), timeout, and TYPE_GWPING.
Referenced by Enqueue().
|
private |
Definition at line 644 of file uan-mac-rc.cc.
References ns3::Packet::AddHeader(), CreateRtsHeader(), ns3::UanAddress::GetBroadcast(), ns3::ExponentialRandomVariable::GetValue(), GWPSENT, IsPhy1Ok(), ns3::EventId::IsRunning(), m_address, m_cntrlSends, m_currentRate, m_ev, m_numRates, m_phy, m_resList, m_retryRate, m_rtsBlocked, m_rtsEvent, m_state, ns3::Simulator::Now(), NS_ASSERT, ns3::Simulator::Schedule(), SendPacket(), ns3::ObjectBase::SetAttribute(), timeout, and TYPE_GWPING.
Referenced by Associate().
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 328 of file uan-mac-rc.cc.
References m_phy, ns3::MakeCallback(), and ReceiveOkFromPhy().
|
private |
Definition at line 771 of file uan-mac-rc.cc.
References m_rtsBlocked.
Referenced by ReceiveOkFromPhy().
|
virtual |
Clears all pointer references
Implements ns3::UanMac.
Definition at line 176 of file uan-mac-rc.cc.
References ns3::EventId::Cancel(), m_cleared, m_phy, m_pktQueue, m_resList, m_rtsEvent, and m_startAgain.
Referenced by DoDispose().
|
private |
Definition at line 605 of file uan-mac-rc.cc.
References ns3::Reservation::GetFrameNo(), ns3::Reservation::GetLength(), ns3::Reservation::GetNoFrames(), ns3::Reservation::GetRetryNo(), ns3::Reservation::GetTimestamp(), ns3::UanHeaderRcRts::SetFrameNo(), ns3::UanHeaderRcRts::SetLength(), ns3::UanHeaderRcRts::SetNoFrames(), ns3::UanHeaderRcRts::SetRetryNo(), and ns3::UanHeaderRcRts::SetTimeStamp().
Referenced by Associate(), AssociateTimeout(), RtsTimeout(), and SendRts().
|
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().
|
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 286 of file uan-mac-rc.cc.
References Associate(), ns3::UanAddress::ConvertFrom(), DATATX, GWPSENT, IDLE, ns3::EventId::IsRunning(), m_pktQueue, m_queueLimit, m_rtsEvent, m_state, NS_LOG_WARN, RTSSENT, SendRts(), and UNASSOCIATED.
|
virtual |
Implements ns3::UanMac.
Definition at line 274 of file uan-mac-rc.cc.
References m_address.
Referenced by ReceiveOkFromPhy().
|
virtual |
Implements ns3::UanMac.
Definition at line 335 of file uan-mac-rc.cc.
References ns3::UanAddress::GetBroadcast().
|
static |
Definition at line 207 of file uan-mac-rc.cc.
References m_dequeueLogger, m_enqueueLogger, m_learnedProp, m_maxFrames, m_minRetryRate, m_numRates, m_queueLimit, m_retryRate, m_retryStep, m_rxLogger, m_sifs, ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
|
private |
Definition at line 709 of file uan-mac-rc.cc.
References ns3::UanHeaderCommon::GetDest(), ns3::UanHeaderCommon::GetType(), m_address, m_phy, ns3::Packet::PeekHeader(), TYPE_ACK, and TYPE_CTS.
Referenced by Associate(), AssociateTimeout(), RtsTimeout(), and SendRts().
Definition at line 553 of file uan-mac-rc.cc.
References ns3::UanHeaderRcAck::GetFrameNo(), ns3::UanHeaderRcAck::GetNackedFrames(), ns3::UanHeaderRcAck::GetNoNacks(), m_address, m_pktQueue, m_resList, ns3::Simulator::Now(), NS_LOG_DEBUG, and ns3::Packet::RemoveHeader().
Referenced by ReceiveOkFromPhy().
Definition at line 341 of file uan-mac-rc.cc.
References BlockRtsing(), GetAddress(), ns3::UanHeaderRcCts::GetAddress(), ns3::UanAddress::GetBroadcast(), ns3::UanHeaderCommon::GetDest(), ns3::UanHeaderRcCtsGlobal::GetRateNum(), ns3::UanHeaderRcCtsGlobal::GetRetryRate(), ns3::Time::GetSeconds(), ns3::UanHeaderCommon::GetSerializedSize(), ns3::Packet::GetSize(), ns3::UanHeaderCommon::GetSrc(), ns3::UanHeaderCommon::GetType(), ns3::UanHeaderRcCtsGlobal::GetWindowTime(), GWPSENT, m_address, m_assocAddr, m_currentRate, m_forwardUpCb, m_minRetryRate, m_retryRate, m_retryStep, m_rtsBlocked, m_rxLogger, m_state, ns3::Simulator::Now(), NS_FATAL_ERROR, NS_LOG_DEBUG, ProcessAck(), ns3::Packet::RemoveHeader(), RTSSENT, ns3::Simulator::Schedule(), ScheduleData(), ns3::UanHeaderRcCts::SetAddress(), TYPE_ACK, TYPE_CTS, TYPE_DATA, TYPE_GWPING, and TYPE_RTS.
Referenced by AttachPhy().
|
private |
Definition at line 732 of file uan-mac-rc.cc.
References ns3::Packet::AddHeader(), CreateRtsHeader(), ns3::UanAddress::GetBroadcast(), ns3::ExponentialRandomVariable::GetValue(), IsPhy1Ok(), ns3::EventId::IsRunning(), m_address, m_cntrlSends, m_currentRate, m_ev, m_numRates, m_phy, m_resList, m_retryRate, m_rtsBlocked, m_rtsEvent, m_state, ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, RTSSENT, ns3::Simulator::Schedule(), SendPacket(), ns3::ObjectBase::SetAttribute(), timeout, and TYPE_RTS.
Referenced by SendRts().
|
private |
Definition at line 432 of file uan-mac-rc.cc.
References ns3::Packet::AddHeader(), ns3::EventId::Cancel(), ns3::Packet::Copy(), ns3::UanHeaderRcCts::GetDelayToTx(), ns3::UanHeaderRcCts::GetFrameNo(), ns3::Time::GetSeconds(), ns3::Packet::GetSize(), ns3::UanHeaderRcCtsGlobal::GetTxTimeStamp(), ns3::ExponentialRandomVariable::GetValue(), GWPSENT, IDLE, ns3::EventId::IsRunning(), m_address, m_assocAddr, m_currentRate, m_ev, m_learnedProp, m_phy, m_pktQueue, m_resList, m_retryRate, m_rtsEvent, m_sifs, m_state, ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, RTSSENT, ns3::Simulator::Schedule(), SendPacket(), SendRts(), ns3::ObjectBase::SetAttribute(), ns3::UanHeaderCommon::SetDest(), ns3::UanHeaderRcData::SetFrameNo(), ns3::UanHeaderRcData::SetPropDelay(), ns3::UanHeaderCommon::SetSrc(), ns3::UanHeaderCommon::SetType(), timeout, and TYPE_DATA.
Referenced by ReceiveOkFromPhy().
Definition at line 521 of file uan-mac-rc.cc.
References ns3::UanHeaderCommon::GetDest(), ns3::Packet::GetSize(), ns3::UanHeaderCommon::GetType(), m_address, m_dequeueLogger, m_phy, ns3::Simulator::Now(), NS_LOG_DEBUG, ns3::Packet::PeekHeader(), TYPE_ACK, TYPE_CTS, TYPE_DATA, TYPE_GWPING, and TYPE_RTS.
Referenced by Associate(), AssociateTimeout(), RtsTimeout(), ScheduleData(), and SendRts().
|
private |
Definition at line 676 of file uan-mac-rc.cc.
References ns3::Packet::AddHeader(), CreateRtsHeader(), ns3::UanAddress::GetBroadcast(), ns3::ExponentialRandomVariable::GetValue(), IsPhy1Ok(), ns3::EventId::IsRunning(), m_address, m_cntrlSends, m_currentRate, m_ev, m_frameNo, m_maxFrames, m_numRates, m_phy, m_pktQueue, m_resList, m_retryRate, m_rtsBlocked, m_rtsEvent, m_state, ns3::Simulator::Now(), NS_ASSERT, RTSSENT, RtsTimeout(), ns3::Simulator::Schedule(), SendPacket(), ns3::ObjectBase::SetAttribute(), timeout, and TYPE_RTS.
Referenced by Enqueue(), and ScheduleData().
|
virtual |
addr | UanAddress for this MAC |
Implements ns3::UanMac.
Definition at line 280 of file uan-mac-rc.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 322 of file uan-mac-rc.cc.
References m_forwardUpCb.
|
private |
Definition at line 176 of file uan-mac-rc.h.
Referenced by Associate(), AssociateTimeout(), GetAddress(), IsPhy1Ok(), ProcessAck(), ReceiveOkFromPhy(), RtsTimeout(), ScheduleData(), SendPacket(), SendRts(), and SetAddress().
|
private |
Definition at line 178 of file uan-mac-rc.h.
Referenced by ReceiveOkFromPhy(), and ScheduleData().
|
private |
Definition at line 194 of file uan-mac-rc.h.
Referenced by Clear().
|
staticprivate |
Definition at line 219 of file uan-mac-rc.h.
Referenced by Associate(), AssociateTimeout(), RtsTimeout(), and SendRts().
|
private |
Definition at line 192 of file uan-mac-rc.h.
Referenced by UanMacRc().
|
private |
Definition at line 191 of file uan-mac-rc.h.
Referenced by UanMacRc().
|
private |
Definition at line 181 of file uan-mac-rc.h.
Referenced by Associate(), AssociateTimeout(), ReceiveOkFromPhy(), RtsTimeout(), ScheduleData(), and SendRts().
|
private |
Definition at line 203 of file uan-mac-rc.h.
Referenced by GetTypeId(), and SendPacket().
|
private |
Definition at line 202 of file uan-mac-rc.h.
Referenced by GetTypeId().
|
private |
Provides exponential random variables.
Definition at line 222 of file uan-mac-rc.h.
Referenced by AssignStreams(), Associate(), AssociateTimeout(), RtsTimeout(), ScheduleData(), SendRts(), and UanMacRc().
|
private |
Definition at line 199 of file uan-mac-rc.h.
Referenced by ReceiveOkFromPhy(), and SetForwardUpCb().
|
private |
Definition at line 184 of file uan-mac-rc.h.
Referenced by Associate(), and SendRts().
|
private |
Definition at line 186 of file uan-mac-rc.h.
Referenced by GetTypeId(), and ScheduleData().
|
private |
Definition at line 182 of file uan-mac-rc.h.
Referenced by Associate(), GetTypeId(), and SendRts().
|
private |
Definition at line 188 of file uan-mac-rc.h.
Referenced by GetTypeId(), and ReceiveOkFromPhy().
|
private |
Definition at line 180 of file uan-mac-rc.h.
Referenced by Associate(), AssociateTimeout(), GetTypeId(), RtsTimeout(), and SendRts().
Definition at line 179 of file uan-mac-rc.h.
Referenced by Associate(), AssociateTimeout(), AttachPhy(), Clear(), IsPhy1Ok(), RtsTimeout(), ScheduleData(), SendPacket(), and SendRts().
|
private |
Definition at line 196 of file uan-mac-rc.h.
Referenced by Associate(), Clear(), Enqueue(), ProcessAck(), ScheduleData(), and SendRts().
|
private |
Definition at line 183 of file uan-mac-rc.h.
Referenced by Enqueue(), and GetTypeId().
|
private |
Definition at line 197 of file uan-mac-rc.h.
Referenced by Associate(), AssociateTimeout(), Clear(), ProcessAck(), RtsTimeout(), ScheduleData(), and SendRts().
|
private |
Definition at line 177 of file uan-mac-rc.h.
Referenced by Associate(), AssociateTimeout(), GetTypeId(), ReceiveOkFromPhy(), RtsTimeout(), ScheduleData(), and SendRts().
|
private |
Definition at line 189 of file uan-mac-rc.h.
Referenced by GetTypeId(), and ReceiveOkFromPhy().
|
private |
Definition at line 173 of file uan-mac-rc.h.
Referenced by Associate(), AssociateTimeout(), BlockRtsing(), ReceiveOkFromPhy(), RtsTimeout(), and SendRts().
|
private |
Definition at line 205 of file uan-mac-rc.h.
Referenced by Associate(), AssociateTimeout(), Clear(), Enqueue(), RtsTimeout(), ScheduleData(), and SendRts().
|
private |
Definition at line 201 of file uan-mac-rc.h.
Referenced by GetTypeId(), and ReceiveOkFromPhy().
|
private |
Definition at line 185 of file uan-mac-rc.h.
Referenced by GetTypeId(), and ScheduleData().
|
private |
Definition at line 175 of file uan-mac-rc.h.
Referenced by Clear().
|
private |
Definition at line 172 of file uan-mac-rc.h.
Referenced by Associate(), AssociateTimeout(), Enqueue(), ReceiveOkFromPhy(), RtsTimeout(), ScheduleData(), and SendRts().