A Discrete-Event Network Simulator
API
ns3::DcfState Class Reference

keep track of the state needed for a single DCF function. More...

#include "dcf-state.h"

+ Inheritance diagram for ns3::DcfState:
+ Collaboration diagram for ns3::DcfState:

Public Member Functions

 DcfState (Ptr< DcaTxop > txop)
 Constructor. More...
 
virtual ~DcfState ()
 
uint32_t GetAifsn (void) const
 Return the number of slots that make up an AIFS. More...
 
uint32_t GetCw (void) const
 
uint32_t GetCwMax (void) const
 Return the maximum congestion window size. More...
 
uint32_t GetCwMin (void) const
 Return the minimum congestion window size. More...
 
Time GetTxopLimit (void) const
 Return the TXOP limit. More...
 
bool IsAccessRequested (void) const
 
bool IsEdca (void) const
 
void ResetCw (void)
 Update the value of the CW variable to take into account a transmission success or a transmission abort (stop transmission of a packet after the maximum number of retransmissions has been reached). More...
 
void SetAifsn (uint32_t aifsn)
 
void SetCwMax (uint32_t maxCw)
 Set the maximum congestion window size. More...
 
void SetCwMin (uint32_t minCw)
 Set the minimum congestion window size. More...
 
void SetTxopLimit (Time txopLimit)
 Set the TXOP limit. More...
 
void StartBackoffNow (uint32_t nSlots)
 
void UpdateFailedCw (void)
 Update the value of the CW variable to take into account a transmission failure. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

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

Protected Member Functions

void DoDispose (void)
 Destructor implementation. More...
 
uint32_t GetBackoffSlots (void) const
 Return the current number of backoff slots. More...
 
Time GetBackoffStart (void) const
 Return the time when the backoff procedure started. More...
 
void NotifyAccessGranted (void)
 Notify that access has been granted. More...
 
void NotifyAccessRequested (void)
 Notify that access request has been received. More...
 
void NotifyChannelSwitching (void)
 Notify that the device is switching channel. More...
 
void NotifyCollision (void)
 Notify that collision has occurred. More...
 
void NotifyInternalCollision (void)
 Notify that internal collision has occurred. More...
 
void NotifySleep (void)
 Notify that the device has started to sleep. More...
 
void NotifyWakeUp (void)
 Notify that the device has started to wake up. More...
 
void UpdateBackoffSlotsNow (uint32_t nSlots, Time backoffUpdateBound)
 Update backoff slots that nSlots has passed. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
virtual void NotifyNewAggregate (void)
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Protected Attributes

bool m_accessRequested
 flag whether channel access is already requested More...
 
uint32_t m_aifsn
 the AIFSN More...
 
uint32_t m_backoffSlots
 the backoff slots More...
 
Time m_backoffStart
 the backoffStart variable is used to keep track of the time at which a backoff was started or the time at which the backoff counter was last updated. More...
 
uint32_t m_cw
 the current CW More...
 
uint32_t m_cwMax
 the CW maximum More...
 
uint32_t m_cwMin
 the CW minimum More...
 
Ptr< DcaTxopm_txop
 the DCA TXOP More...
 
Time m_txopLimit
 the txop limit time More...
 

Friends

class DcfManager
 DcfManager associated class. More...
 

Additional Inherited Members

Detailed Description

keep track of the state needed for a single DCF function.

Introspection did not find any typical Config paths.

Multiple instances of a DcfState can be registered in a single DcfManager to implement 802.11e-style relative QoS. DcfState::SetAifsn and DcfState::SetCwBounds allow the user to control the relative QoS differentiation.


No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 88 bytes (on a 64-bit architecture).

Definition at line 41 of file dcf-state.h.

Constructor & Destructor Documentation

ns3::DcfState::DcfState ( Ptr< DcaTxop txop)

Constructor.

Parameters
txopthe DCA txop

Definition at line 41 of file dcf-state.cc.

References NS_LOG_FUNCTION.

ns3::DcfState::~DcfState ( )
virtual

Definition at line 53 of file dcf-state.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

void ns3::DcfState::DoDispose ( void  )
protectedvirtual

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 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 59 of file dcf-state.cc.

References m_txop, and NS_LOG_FUNCTION.

uint32_t ns3::DcfState::GetAifsn ( void  ) const

Return the number of slots that make up an AIFS.

Returns
the number of slots that make up an AIFS

Definition at line 106 of file dcf-state.cc.

References m_aifsn.

Referenced by ns3::DcaTxop::GetAifsn(), ns3::DcfManager::GetBackoffStartFor(), and ns3::DcfManager::IsWithinAifs().

+ Here is the caller graph for this function:

uint32_t ns3::DcfState::GetBackoffSlots ( void  ) const
protected

Return the current number of backoff slots.

Returns
the current number of backoff slots

Definition at line 176 of file dcf-state.cc.

References m_backoffSlots.

Referenced by ns3::DcfManager::DoGrantAccess(), ns3::DcfManager::GetBackoffEndFor(), ns3::DcfManager::NotifySwitchingStartNow(), ns3::DcfManager::NotifyWakeupNow(), ns3::DcfManager::RequestAccess(), and ns3::DcfManager::UpdateBackoff().

+ Here is the caller graph for this function:

Time ns3::DcfState::GetBackoffStart ( void  ) const
protected

Return the time when the backoff procedure started.

Returns
the time when the backoff procedure started

Definition at line 182 of file dcf-state.cc.

References m_backoffStart.

Referenced by ns3::DcfManager::GetBackoffStartFor().

+ Here is the caller graph for this function:

uint32_t ns3::DcfState::GetCwMax ( void  ) const

Return the maximum congestion window size.

Returns
the maximum congestion window size

Definition at line 124 of file dcf-state.cc.

References m_cwMax.

Referenced by ns3::DcaTxop::GetMaxCw().

+ Here is the caller graph for this function:

uint32_t ns3::DcfState::GetCwMin ( void  ) const

Return the minimum congestion window size.

Returns
the minimum congestion window size

Definition at line 118 of file dcf-state.cc.

References m_cwMin.

Referenced by ns3::DcaTxop::GetMinCw().

+ Here is the caller graph for this function:

Time ns3::DcfState::GetTxopLimit ( void  ) const

Return the TXOP limit.

Returns
the TXOP limit

Definition at line 112 of file dcf-state.cc.

References m_txopLimit.

Referenced by ns3::DcaTxop::GetTxopLimit().

+ Here is the caller graph for this function:

TypeId ns3::DcfState::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 32 of file dcf-state.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

bool ns3::DcfState::IsAccessRequested ( void  ) const
Returns
true if access has been requested for this DcfState and has not been granted already, false otherwise.

Definition at line 188 of file dcf-state.cc.

References m_accessRequested.

Referenced by ns3::DcfManager::DoGrantAccess(), ns3::DcfManager::DoRestartAccessTimeoutIfNeeded(), ns3::DcfManager::RequestAccess(), ns3::EdcaTxopN::RestartAccessIfNeeded(), ns3::DcaTxop::RestartAccessIfNeeded(), ns3::EdcaTxopN::StartAccessIfNeeded(), and ns3::DcaTxop::StartAccessIfNeeded().

+ Here is the caller graph for this function:

bool ns3::DcfState::IsEdca ( void  ) const
Returns
whether this DCF state is an EDCA state

Definition at line 245 of file dcf-state.cc.

References m_txop, and NS_LOG_FUNCTION.

Referenced by ns3::DcfManager::UpdateBackoff().

+ Here is the caller graph for this function:

void ns3::DcfState::NotifyAccessGranted ( void  )
protected

Notify that access has been granted.

Definition at line 201 of file dcf-state.cc.

References m_accessRequested, m_txop, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by ns3::DcfManager::DoGrantAccess().

+ Here is the caller graph for this function:

void ns3::DcfState::NotifyAccessRequested ( void  )
protected

Notify that access request has been received.

Definition at line 194 of file dcf-state.cc.

References m_accessRequested, and NS_LOG_FUNCTION.

Referenced by ns3::DcfManager::RequestAccess().

+ Here is the caller graph for this function:

void ns3::DcfState::NotifyChannelSwitching ( void  )
protected

Notify that the device is switching channel.

Definition at line 224 of file dcf-state.cc.

References m_txop, and NS_LOG_FUNCTION.

Referenced by ns3::DcfManager::NotifySwitchingStartNow().

+ Here is the caller graph for this function:

void ns3::DcfState::NotifyCollision ( void  )
protected

Notify that collision has occurred.

Definition at line 210 of file dcf-state.cc.

References m_txop, and NS_LOG_FUNCTION.

Referenced by ns3::DcfManager::RequestAccess().

+ Here is the caller graph for this function:

void ns3::DcfState::NotifyInternalCollision ( void  )
protected

Notify that internal collision has occurred.

Definition at line 217 of file dcf-state.cc.

References m_txop, and NS_LOG_FUNCTION.

Referenced by ns3::DcfManager::RequestAccess().

+ Here is the caller graph for this function:

void ns3::DcfState::NotifySleep ( void  )
protected

Notify that the device has started to sleep.

Definition at line 231 of file dcf-state.cc.

References m_txop, and NS_LOG_FUNCTION.

Referenced by ns3::DcfManager::NotifySleepNow().

+ Here is the caller graph for this function:

void ns3::DcfState::NotifyWakeUp ( void  )
protected

Notify that the device has started to wake up.

Definition at line 238 of file dcf-state.cc.

References m_txop, and NS_LOG_FUNCTION.

Referenced by ns3::DcfManager::NotifyWakeupNow().

+ Here is the caller graph for this function:

void ns3::DcfState::ResetCw ( void  )

Update the value of the CW variable to take into account a transmission success or a transmission abort (stop transmission of a packet after the maximum number of retransmissions has been reached).

By default, this resets the CW variable to minCW.

Definition at line 130 of file dcf-state.cc.

References m_cw, m_cwMin, and NS_LOG_FUNCTION.

Referenced by ns3::DcaTxop::DoInitialize(), ns3::EdcaTxopN::DoInitialize(), ns3::EdcaTxopN::EndTxNoAck(), ns3::DcaTxop::EndTxNoAck(), ns3::EdcaTxopN::GotAck(), ns3::DcaTxop::GotAck(), ns3::EdcaTxopN::GotBlockAck(), ns3::EdcaTxopN::MissedAck(), ns3::DcaTxop::MissedAck(), ns3::EdcaTxopN::MissedBlockAck(), ns3::EdcaTxopN::MissedCts(), ns3::DcaTxop::MissedCts(), ns3::EdcaTxopN::NotifyInternalCollision(), ns3::DcfManager::NotifySwitchingStartNow(), ns3::DcfManager::NotifyWakeupNow(), SetCwMax(), and SetCwMin().

+ Here is the caller graph for this function:

void ns3::DcfState::SetAifsn ( uint32_t  aifsn)
Parameters
aifsnthe number of slots which make up an AIFS for a specific DCF. a DIFS corresponds to an AIFSN = 2.

Calling this method after DcfManager::Add has been called is not recommended.

Definition at line 67 of file dcf-state.cc.

References m_aifsn, and NS_LOG_FUNCTION.

Referenced by DcfManagerTest::AddDcfState(), and ns3::DcaTxop::SetAifsn().

+ Here is the caller graph for this function:

void ns3::DcfState::SetCwMax ( uint32_t  maxCw)

Set the maximum congestion window size.

Parameters
maxCwthe maximum congestion window size

Definition at line 94 of file dcf-state.cc.

References m_cwMax, NS_LOG_FUNCTION, and ResetCw().

Referenced by ns3::DcaTxop::SetMaxCw().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfState::SetCwMin ( uint32_t  minCw)

Set the minimum congestion window size.

Parameters
minCwthe minimum congestion window size

Definition at line 82 of file dcf-state.cc.

References m_cwMin, NS_LOG_FUNCTION, and ResetCw().

Referenced by ns3::DcaTxop::SetMinCw().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfState::SetTxopLimit ( Time  txopLimit)

Set the TXOP limit.

Parameters
txopLimitthe TXOP limit

Definition at line 74 of file dcf-state.cc.

References ns3::Time::GetMicroSeconds(), m_txopLimit, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by ns3::DcaTxop::SetTxopLimit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfState::UpdateBackoffSlotsNow ( uint32_t  nSlots,
Time  backoffUpdateBound 
)
protected

Update backoff slots that nSlots has passed.

Parameters
nSlots
backoffUpdateBound

Definition at line 145 of file dcf-state.cc.

References m_backoffSlots, m_backoffStart, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by ns3::DcfManager::NotifySwitchingStartNow(), ns3::DcfManager::NotifyWakeupNow(), and ns3::DcfManager::UpdateBackoff().

+ Here is the caller graph for this function:

void ns3::DcfState::UpdateFailedCw ( void  )

Update the value of the CW variable to take into account a transmission failure.

By default, this triggers a doubling of CW (capped by maxCW).

Definition at line 137 of file dcf-state.cc.

References m_cw, m_cwMax, min, and NS_LOG_FUNCTION.

Referenced by ns3::EdcaTxopN::MissedAck(), ns3::DcaTxop::MissedAck(), ns3::EdcaTxopN::MissedBlockAck(), ns3::EdcaTxopN::MissedCts(), ns3::DcaTxop::MissedCts(), and ns3::EdcaTxopN::NotifyInternalCollision().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class DcfManager
friend

DcfManager associated class.

Definition at line 148 of file dcf-state.h.

Member Data Documentation

bool ns3::DcfState::m_accessRequested
protected

flag whether channel access is already requested

Definition at line 213 of file dcf-state.h.

Referenced by IsAccessRequested(), NotifyAccessGranted(), NotifyAccessRequested(), ns3::DcfManager::NotifySwitchingStartNow(), and ns3::DcfManager::NotifyWakeupNow().

uint32_t ns3::DcfState::m_aifsn
protected

the AIFSN

Definition at line 201 of file dcf-state.h.

Referenced by GetAifsn(), and SetAifsn().

uint32_t ns3::DcfState::m_backoffSlots
protected

the backoff slots

Definition at line 202 of file dcf-state.h.

Referenced by GetBackoffSlots(), StartBackoffNow(), and UpdateBackoffSlotsNow().

Time ns3::DcfState::m_backoffStart
protected

the backoffStart variable is used to keep track of the time at which a backoff was started or the time at which the backoff counter was last updated.

Definition at line 208 of file dcf-state.h.

Referenced by GetBackoffStart(), StartBackoffNow(), and UpdateBackoffSlotsNow().

uint32_t ns3::DcfState::m_cw
protected

the current CW

Definition at line 211 of file dcf-state.h.

Referenced by GetCw(), ResetCw(), and UpdateFailedCw().

uint32_t ns3::DcfState::m_cwMax
protected

the CW maximum

Definition at line 210 of file dcf-state.h.

Referenced by GetCwMax(), SetCwMax(), and UpdateFailedCw().

uint32_t ns3::DcfState::m_cwMin
protected

the CW minimum

Definition at line 209 of file dcf-state.h.

Referenced by GetCwMin(), ResetCw(), and SetCwMin().

Ptr<DcaTxop> ns3::DcfState::m_txop
protected
Time ns3::DcfState::m_txopLimit
protected

the txop limit time

Definition at line 212 of file dcf-state.h.

Referenced by GetTxopLimit(), and SetTxopLimit().


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