A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::UanMacRc Class Reference

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

#include "uan-mac-rc.h"

+ Inheritance diagram for ns3::UanMacRc:
+ Collaboration diagram for ns3::UanMacRc:

Public Types

enum  {
  TYPE_DATA , TYPE_GWPING , TYPE_RTS , TYPE_CTS ,
  TYPE_ACK
}
 Packet types. More...
 
typedef void(* QueueTracedCallback) (Ptr< const Packet > packet, uint32_t proto)
 TracedCallback signature for dequeue of a packet.
 
- Public Types inherited from ns3::UanMac
typedef void(* PacketModeTracedCallback) (Ptr< const Packet > packet, UanTxMode mode)
 TracedCallback signature for packet reception/enqueue/dequeue events.
 

Public Member Functions

 UanMacRc ()
 Default constructor.
 
 ~UanMacRc () override
 Dummy destructor, DoDispose.
 
int64_t AssignStreams (int64_t stream) override
 Assign a fixed random variable stream number to the random variables used by this model.
 
void AttachPhy (Ptr< UanPhy > phy) override
 Attach PHY layer to this MAC.
 
void Clear () override
 Clears all pointer references.
 
bool Enqueue (Ptr< Packet > pkt, uint16_t protocolNumber, const Address &dest) override
 Enqueue packet to be transmitted.
 
void SetForwardUpCb (Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > cb) override
 Set the callback to forward packets up to higher layers.
 
- Public Member Functions inherited from ns3::UanMac
 UanMac ()
 Default constructor.
 
virtual Address GetAddress ()
 Get the MAC Address.
 
virtual Address GetBroadcast () const
 Get the broadcast address.
 
uint32_t GetTxModeIndex () const
 Get the Tx mode index (Modulation type).
 
virtual void SetAddress (Mac8Address addr)
 Set the address.
 
void SetTxModeIndex (uint32_t txModeIndex)
 Set the Tx mode index (Modulation type).
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::UanMac
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Protected Member Functions

void DoDispose () override
 Destructor implementation.
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Private Types

enum  State {
  UNASSOCIATED , GWPSENT , IDLE , RTSSENT ,
  DATATX
}
 MAC state. More...
 

Private Member Functions

void Associate ()
 Associate with a gateway by sending the first GWPING.
 
void AssociateTimeout ()
 Periodically retry association.
 
void BlockRtsing ()
 Callback to block RST.
 
UanHeaderRcRts CreateRtsHeader (const Reservation &res)
 Create the RTS header from a Reservation.
 
bool IsPhy1Ok ()
 Check that PHY is ok: not CTS or ACK not to my address.
 
void ProcessAck (Ptr< Packet > ack)
 Process a received ACK.
 
void ReceiveOkFromPhy (Ptr< Packet > pkt, double sinr, UanTxMode mode)
 PHY receive ok Callback.
 
void RtsTimeout ()
 Retry RTS.
 
void ScheduleData (const UanHeaderRcCts &ctsh, const UanHeaderRcCtsGlobal &ctsg, uint32_t ctsBytes)
 Schedule Packet sends.
 
void SendPacket (Ptr< Packet > pkt, uint32_t rate)
 Send on packet on the PHY.
 
void SendRts ()
 Send RTS packet.
 

Private Attributes

Mac8Address m_assocAddr
 Next hop address.
 
bool m_cleared
 Flag when we've been cleared.
 
uint32_t m_ctsSizeG
 Size of UanHeaderCommon and UanHeaderRcCtsGlobal.
 
uint32_t m_ctsSizeN
 Size of UanHeaderRcCts.
 
uint32_t m_currentRate
 Rate number corresponding to data rate of current cycle.
 
TracedCallback< Ptr< const Packet >, uint32_tm_dequeueLogger
 A was passed down to the PHY from the MAC.
 
TracedCallback< Ptr< const Packet >, uint32_tm_enqueueLogger
 A packet arrived at the MAC for transmission.
 
Ptr< ExponentialRandomVariablem_ev
 Provides exponential random variables.
 
Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > m_forwardUpCb
 The callback to forward a packet up to higher layer.
 
uint8_t m_frameNo
 Current frame number.
 
Time m_learnedProp
 Propagation delay to gateway.
 
uint32_t m_maxFrames
 Maximum number of frames to include in a single RTS.
 
double m_minRetryRate
 Smallest allowed RTS retry rate.
 
uint32_t m_numRates
 Number of rates per Phy layer.
 
Ptr< UanPhym_phy
 PHY layer attached to this MAC.
 
std::list< std::pair< Ptr< Packet >, Mac8Address > > m_pktQueue
 Pending packets.
 
uint32_t m_queueLimit
 Maximum packets to queue at MAC.
 
std::list< Reservationm_resList
 List of scheduled reservations.
 
double m_retryRate
 Number of retry attempts per second (of RTS/GWPING.
 
double m_retryStep
 Retry rate increment.
 
bool m_rtsBlocked
 RTS blocked while processing ACK.
 
EventId m_rtsEvent
 The RTS event.
 
TracedCallback< Ptr< const Packet >, UanTxModem_rxLogger
 A packet was destined for and received at this MAC layer.
 
Time m_sifs
 Spacing between frames to account for timing error and processing delay.
 
EventId m_startAgain
 (Unused).
 
State m_state
 MAC state.
 

Static Private Attributes

static uint32_t m_cntrlSends = 0
 Global count of calls to Associate, AssociateTimeout, SendRts, and RtsTimeout.
 

Additional Inherited Members

Detailed Description

Non-gateway node MAC for reservation channel MAC protocol.

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

Member Typedef Documentation

◆ QueueTracedCallback

typedef void(* ns3::UanMacRc::QueueTracedCallback) (Ptr< const Packet > packet, uint32_t proto)

TracedCallback signature for dequeue of a packet.

Parameters
[in]packetThe Packet being received.
[in]protoThe protocol number.

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

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Packet types.

Enumerator
TYPE_DATA 

Data.

TYPE_GWPING 

Gateway ping.

TYPE_RTS 

RTS.

TYPE_CTS 

CTS.

TYPE_ACK 

ACK.

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

◆ State

enum ns3::UanMacRc::State
private

MAC state.

Enumerator
UNASSOCIATED 

Initial state.

GWPSENT 

Associated with gateway.

IDLE 

Finished scheduling packet sends.

RTSSENT 

RTS just sent.

DATATX 

(Unused).

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

Constructor & Destructor Documentation

◆ UanMacRc()

ns3::UanMacRc::UanMacRc ( )

Default constructor.

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

References ns3::CreateObject(), ns3::UanHeaderCommon::GetSerializedSize(), ns3::UanHeaderRcCts::GetSerializedSize(), ns3::UanHeaderRcCtsGlobal::GetSerializedSize(), m_ctsSizeG, m_ctsSizeN, and m_ev.

+ Here is the call graph for this function:

◆ ~UanMacRc()

ns3::UanMacRc::~UanMacRc ( )
override

Dummy destructor, DoDispose.

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

Member Function Documentation

◆ AssignStreams()

int64_t ns3::UanMacRc::AssignStreams ( int64_t stream)
overridevirtual

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 257 of file uan-mac-rc.cc.

References m_ev, and NS_LOG_FUNCTION.

◆ Associate()

void ns3::UanMacRc::Associate ( )
private

Associate with a gateway by sending the first GWPING.

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

References AssociateTimeout(), ns3::Mac8Address::ConvertFrom(), ns3::Create(), CreateRtsHeader(), ns3::UanMac::GetAddress(), ns3::Mac8Address::GetBroadcast(), GWPSENT, ns3::EventId::IsPending(), IsPhy1Ok(), 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::Now(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, ns3::Time::S, ns3::Simulator::Schedule(), ns3::Seconds(), SendPacket(), timeout, and TYPE_GWPING.

Referenced by Enqueue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AssociateTimeout()

void ns3::UanMacRc::AssociateTimeout ( )
private

Periodically retry association.

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

References AssociateTimeout(), ns3::Mac8Address::ConvertFrom(), ns3::Create(), CreateRtsHeader(), ns3::UanMac::GetAddress(), ns3::Mac8Address::GetBroadcast(), GWPSENT, ns3::EventId::IsPending(), IsPhy1Ok(), 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(), ns3::Seconds(), SendPacket(), timeout, and TYPE_GWPING.

Referenced by Associate(), and AssociateTimeout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AttachPhy()

void ns3::UanMacRc::AttachPhy ( Ptr< UanPhy > phy)
overridevirtual

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 307 of file uan-mac-rc.cc.

References m_phy, ns3::MakeCallback(), and ReceiveOkFromPhy().

+ Here is the call graph for this function:

◆ BlockRtsing()

void ns3::UanMacRc::BlockRtsing ( )
private

Callback to block RST.

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

References m_rtsBlocked.

Referenced by ReceiveOkFromPhy().

+ Here is the caller graph for this function:

◆ Clear()

void ns3::UanMacRc::Clear ( )
overridevirtual

Clears all pointer references.

Implements ns3::UanMac.

Definition at line 164 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateRtsHeader()

UanHeaderRcRts ns3::UanMacRc::CreateRtsHeader ( const Reservation & res)
private

Create the RTS header from a Reservation.

Parameters
resThe Reservation.
Returns
A RTS header.

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

References ns3::UanHeaderRcRts::SetFrameNo(), ns3::UanHeaderRcRts::SetLength(), ns3::UanHeaderRcRts::SetNoFrames(), ns3::UanHeaderRcRts::SetRetryNo(), and ns3::UanHeaderRcRts::SetTimeStamp().

Referenced by Associate(), AssociateTimeout(), RtsTimeout(), and SendRts().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::UanMacRc::DoDispose ( )
overrideprotectedvirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden 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 187 of file uan-mac-rc.cc.

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

+ Here is the call graph for this function:

◆ Enqueue()

bool ns3::UanMacRc::Enqueue ( Ptr< Packet > pkt,
uint16_t protocolNumber,
const Address & dest )
overridevirtual

Enqueue packet to be transmitted.

Parameters
pktPacket to be transmitted.
destDestination address.
protocolNumberThe type of the packet.
Returns
True if packet was successfully enqueued.

Implements ns3::UanMac.

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

References Associate(), ns3::Mac8Address::ConvertFrom(), DATATX, GWPSENT, IDLE, ns3::EventId::IsPending(), m_pktQueue, m_queueLimit, m_rtsEvent, m_state, NS_LOG_WARN, RTSSENT, SendRts(), and UNASSOCIATED.

+ Here is the call graph for this function:

◆ GetTypeId()

TypeId ns3::UanMacRc::GetTypeId ( )
static

Register this type.

Returns
The TypeId.

Definition at line 194 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::MakeDoubleAccessor(), ns3::MakeDoubleChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), ns3::MakeUintegerChecker(), ns3::Seconds(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ IsPhy1Ok()

bool ns3::UanMacRc::IsPhy1Ok ( )
private

Check that PHY is ok: not CTS or ACK not to my address.

Returns
True if PHY is ok.

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

References ns3::Mac8Address::ConvertFrom(), ns3::UanMac::GetAddress(), ns3::UanHeaderCommon::GetDest(), ns3::UanHeaderCommon::GetType(), m_phy, TYPE_ACK, and TYPE_CTS.

Referenced by Associate(), AssociateTimeout(), RtsTimeout(), and SendRts().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessAck()

void ns3::UanMacRc::ProcessAck ( Ptr< Packet > ack)
private

Process a received ACK.

Parameters
ackThe ACK packet.

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

References ns3::Mac8Address::ConvertFrom(), ns3::UanMac::GetAddress(), ns3::UanHeaderRcAck::GetFrameNo(), ns3::UanHeaderRcAck::GetNackedFrames(), ns3::UanHeaderRcAck::GetNoNacks(), m_pktQueue, m_resList, ns3::Now(), NS_LOG_DEBUG, and ns3::Time::S.

Referenced by ReceiveOkFromPhy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReceiveOkFromPhy()

void ns3::UanMacRc::ReceiveOkFromPhy ( Ptr< Packet > pkt,
double sinr,
UanTxMode mode )
private

PHY receive ok Callback.

Parameters
pktThe received packet.
sinr(Unused).
modeModulation mode.

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

References BlockRtsing(), ns3::Mac8Address::ConvertFrom(), ns3::UanHeaderRcCts::GetAddress(), ns3::UanMac::GetAddress(), ns3::Mac8Address::GetBroadcast(), ns3::UanHeaderCommon::GetDest(), ns3::UanHeaderCommon::GetProtocolNumber(), ns3::UanHeaderRcCtsGlobal::GetRateNum(), ns3::UanHeaderRcCtsGlobal::GetRetryRate(), ns3::UanHeaderCommon::GetSerializedSize(), ns3::UanHeaderCommon::GetSrc(), ns3::UanHeaderCommon::GetType(), ns3::UanHeaderRcCtsGlobal::GetWindowTime(), GWPSENT, m_assocAddr, m_currentRate, m_forwardUpCb, m_minRetryRate, m_retryRate, m_retryStep, m_rtsBlocked, m_rxLogger, m_state, ns3::Now(), NS_FATAL_ERROR, NS_LOG_DEBUG, ProcessAck(), RTSSENT, ns3::Time::S, ns3::Simulator::Schedule(), ScheduleData(), ns3::UanHeaderRcCts::SetAddress(), TYPE_ACK, TYPE_CTS, TYPE_DATA, TYPE_GWPING, and TYPE_RTS.

Referenced by AttachPhy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RtsTimeout()

void ns3::UanMacRc::RtsTimeout ( )
private

Retry RTS.

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

References ns3::Mac8Address::ConvertFrom(), ns3::Create(), CreateRtsHeader(), ns3::UanMac::GetAddress(), ns3::Mac8Address::GetBroadcast(), ns3::EventId::IsPending(), IsPhy1Ok(), m_cntrlSends, m_currentRate, m_ev, m_numRates, m_phy, m_resList, m_retryRate, m_rtsBlocked, m_rtsEvent, m_state, ns3::Now(), ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, RTSSENT, RtsTimeout(), ns3::Time::S, ns3::Simulator::Schedule(), ns3::Seconds(), SendPacket(), timeout, and TYPE_RTS.

Referenced by RtsTimeout(), and SendRts().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ScheduleData()

void ns3::UanMacRc::ScheduleData ( const UanHeaderRcCts & ctsh,
const UanHeaderRcCtsGlobal & ctsg,
uint32_t ctsBytes )
private

Schedule Packet sends.

Parameters
ctshThe CTS header identifying the frame number and delay.
ctsgThe CTS global header giving the transmit time stamp base.
ctsBytesNumber of bytes total in CTS packet.

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

References ns3::Time::As(), ns3::EventId::Cancel(), ns3::Mac8Address::ConvertFrom(), ns3::UanMac::GetAddress(), ns3::UanHeaderRcCts::GetDelayToTx(), ns3::UanHeaderRcCts::GetFrameNo(), ns3::UanHeaderRcCtsGlobal::GetTxTimeStamp(), GWPSENT, IDLE, ns3::EventId::IsPending(), m_assocAddr, m_currentRate, m_ev, m_learnedProp, m_phy, m_pktQueue, m_resList, m_retryRate, m_rtsEvent, m_sifs, m_state, ns3::Now(), ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, RTSSENT, ns3::Time::S, ns3::Simulator::Schedule(), ns3::Seconds(), SendPacket(), SendRts(), ns3::UanHeaderCommon::SetDest(), ns3::UanHeaderRcData::SetFrameNo(), ns3::UanHeaderRcData::SetPropDelay(), ns3::UanHeaderCommon::SetSrc(), ns3::UanHeaderCommon::SetType(), timeout, and TYPE_DATA.

Referenced by ReceiveOkFromPhy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendPacket()

void ns3::UanMacRc::SendPacket ( Ptr< Packet > pkt,
uint32_t rate )
private

Send on packet on the PHY.

Parameters
pktThe packet.
rateThe transmission rate.

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

References ns3::Mac8Address::ConvertFrom(), ns3::UanMac::GetAddress(), ns3::UanHeaderCommon::GetDest(), ns3::UanHeaderCommon::GetType(), m_dequeueLogger, m_phy, ns3::Now(), NS_LOG_DEBUG, ns3::Time::S, TYPE_ACK, TYPE_CTS, TYPE_DATA, TYPE_GWPING, and TYPE_RTS.

Referenced by Associate(), AssociateTimeout(), RtsTimeout(), ScheduleData(), and SendRts().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendRts()

void ns3::UanMacRc::SendRts ( )
private

Send RTS packet.

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

References ns3::Mac8Address::ConvertFrom(), ns3::Create(), CreateRtsHeader(), ns3::UanMac::GetAddress(), ns3::Mac8Address::GetBroadcast(), ns3::EventId::IsPending(), IsPhy1Ok(), 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(), ns3::Seconds(), SendPacket(), timeout, and TYPE_RTS.

Referenced by Enqueue(), and ScheduleData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetForwardUpCb()

void ns3::UanMacRc::SetForwardUpCb ( Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > cb)
overridevirtual

Set the callback to forward packets up to higher layers.

Parameters
cbThe callback. packet The packet. address The source address.

Implements ns3::UanMac.

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

References m_forwardUpCb.

Member Data Documentation

◆ m_assocAddr

Mac8Address ns3::UanMacRc::m_assocAddr
private

Next hop address.

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

Referenced by ReceiveOkFromPhy(), and ScheduleData().

◆ m_cleared

bool ns3::UanMacRc::m_cleared
private

Flag when we've been cleared.

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

Referenced by Clear().

◆ m_cntrlSends

uint32_t ns3::UanMacRc::m_cntrlSends = 0
staticprivate

Global count of calls to Associate, AssociateTimeout, SendRts, and RtsTimeout.

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

Referenced by Associate(), AssociateTimeout(), RtsTimeout(), and SendRts().

◆ m_ctsSizeG

uint32_t ns3::UanMacRc::m_ctsSizeG
private

Size of UanHeaderCommon and UanHeaderRcCtsGlobal.

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

Referenced by UanMacRc().

◆ m_ctsSizeN

uint32_t ns3::UanMacRc::m_ctsSizeN
private

Size of UanHeaderRcCts.

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

Referenced by UanMacRc().

◆ m_currentRate

uint32_t ns3::UanMacRc::m_currentRate
private

Rate number corresponding to data rate of current cycle.

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

Referenced by Associate(), AssociateTimeout(), ReceiveOkFromPhy(), RtsTimeout(), ScheduleData(), and SendRts().

◆ m_dequeueLogger

TracedCallback<Ptr<const Packet>, uint32_t> ns3::UanMacRc::m_dequeueLogger
private

A was passed down to the PHY from the MAC.

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

Referenced by GetTypeId(), and SendPacket().

◆ m_enqueueLogger

TracedCallback<Ptr<const Packet>, uint32_t> ns3::UanMacRc::m_enqueueLogger
private

A packet arrived at the MAC for transmission.

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

Referenced by GetTypeId().

◆ m_ev

Ptr<ExponentialRandomVariable> ns3::UanMacRc::m_ev
private

Provides exponential random variables.

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

Referenced by UanMacRc(), AssignStreams(), Associate(), AssociateTimeout(), RtsTimeout(), ScheduleData(), and SendRts().

◆ m_forwardUpCb

Callback<void, Ptr<Packet>, uint16_t, const Mac8Address&> ns3::UanMacRc::m_forwardUpCb
private

The callback to forward a packet up to higher layer.

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

Referenced by ReceiveOkFromPhy(), and SetForwardUpCb().

◆ m_frameNo

uint8_t ns3::UanMacRc::m_frameNo
private

Current frame number.

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

Referenced by Associate(), and SendRts().

◆ m_learnedProp

Time ns3::UanMacRc::m_learnedProp
private

Propagation delay to gateway.

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

Referenced by GetTypeId(), and ScheduleData().

◆ m_maxFrames

uint32_t ns3::UanMacRc::m_maxFrames
private

Maximum number of frames to include in a single RTS.

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

Referenced by Associate(), GetTypeId(), and SendRts().

◆ m_minRetryRate

double ns3::UanMacRc::m_minRetryRate
private

Smallest allowed RTS retry rate.

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

Referenced by GetTypeId(), and ReceiveOkFromPhy().

◆ m_numRates

uint32_t ns3::UanMacRc::m_numRates
private

Number of rates per Phy layer.

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

Referenced by Associate(), AssociateTimeout(), GetTypeId(), RtsTimeout(), and SendRts().

◆ m_phy

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

PHY layer attached to this MAC.

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

Referenced by Associate(), AssociateTimeout(), AttachPhy(), Clear(), IsPhy1Ok(), RtsTimeout(), ScheduleData(), SendPacket(), and SendRts().

◆ m_pktQueue

std::list<std::pair<Ptr<Packet>, Mac8Address> > ns3::UanMacRc::m_pktQueue
private

Pending packets.

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

Referenced by Associate(), Clear(), Enqueue(), ProcessAck(), ScheduleData(), and SendRts().

◆ m_queueLimit

uint32_t ns3::UanMacRc::m_queueLimit
private

Maximum packets to queue at MAC.

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

Referenced by Enqueue(), and GetTypeId().

◆ m_resList

std::list<Reservation> ns3::UanMacRc::m_resList
private

List of scheduled reservations.

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

Referenced by Associate(), AssociateTimeout(), Clear(), ProcessAck(), RtsTimeout(), ScheduleData(), and SendRts().

◆ m_retryRate

double ns3::UanMacRc::m_retryRate
private

Number of retry attempts per second (of RTS/GWPING.

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

Referenced by Associate(), AssociateTimeout(), GetTypeId(), ReceiveOkFromPhy(), RtsTimeout(), ScheduleData(), and SendRts().

◆ m_retryStep

double ns3::UanMacRc::m_retryStep
private

Retry rate increment.

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

Referenced by GetTypeId(), and ReceiveOkFromPhy().

◆ m_rtsBlocked

bool ns3::UanMacRc::m_rtsBlocked
private

RTS blocked while processing ACK.

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

Referenced by Associate(), AssociateTimeout(), BlockRtsing(), ReceiveOkFromPhy(), RtsTimeout(), and SendRts().

◆ m_rtsEvent

EventId ns3::UanMacRc::m_rtsEvent
private

The RTS event.

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

Referenced by Associate(), AssociateTimeout(), Clear(), Enqueue(), RtsTimeout(), ScheduleData(), and SendRts().

◆ m_rxLogger

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

A packet was destined for and received at this MAC layer.

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

Referenced by GetTypeId(), and ReceiveOkFromPhy().

◆ m_sifs

Time ns3::UanMacRc::m_sifs
private

Spacing between frames to account for timing error and processing delay.

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

Referenced by GetTypeId(), and ScheduleData().

◆ m_startAgain

EventId ns3::UanMacRc::m_startAgain
private

(Unused).

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

Referenced by Clear().

◆ m_state

State ns3::UanMacRc::m_state
private

MAC state.

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

Referenced by Associate(), AssociateTimeout(), Enqueue(), ReceiveOkFromPhy(), RtsTimeout(), ScheduleData(), and SendRts().


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