keep track of the state needed for a single DCF function. More...
#include "dcf-state.h"
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... | |
![]() | |
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... | |
![]() | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
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 TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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< DcaTxop > | m_txop |
the DCA TXOP More... | |
Time | m_txopLimit |
the txop limit time More... | |
Friends | |
class | DcfManager |
DcfManager associated class. More... | |
Additional Inherited Members | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
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.
txop | the DCA txop |
Definition at line 41 of file dcf-state.cc.
References NS_LOG_FUNCTION.
|
virtual |
Definition at line 53 of file dcf-state.cc.
References NS_LOG_FUNCTION.
|
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.
Definition at line 106 of file dcf-state.cc.
References m_aifsn.
Referenced by ns3::DcaTxop::GetAifsn(), ns3::DcfManager::GetBackoffStartFor(), and ns3::DcfManager::IsWithinAifs().
|
protected |
Return 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().
|
protected |
Return the time when the backoff procedure started.
Definition at line 182 of file dcf-state.cc.
References m_backoffStart.
Referenced by ns3::DcfManager::GetBackoffStartFor().
uint32_t ns3::DcfState::GetCw | ( | void | ) | const |
Definition at line 170 of file dcf-state.cc.
References m_cw.
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::NotifyCollision(), ns3::DcaTxop::NotifyCollision(), and ns3::EdcaTxopN::NotifyInternalCollision().
uint32_t ns3::DcfState::GetCwMax | ( | void | ) | const |
Return the maximum congestion window size.
Definition at line 124 of file dcf-state.cc.
References m_cwMax.
Referenced by ns3::DcaTxop::GetMaxCw().
uint32_t ns3::DcfState::GetCwMin | ( | void | ) | const |
Return the minimum congestion window size.
Definition at line 118 of file dcf-state.cc.
References m_cwMin.
Referenced by ns3::DcaTxop::GetMinCw().
Time ns3::DcfState::GetTxopLimit | ( | void | ) | const |
Return the TXOP limit.
Definition at line 112 of file dcf-state.cc.
References m_txopLimit.
Referenced by ns3::DcaTxop::GetTxopLimit().
|
static |
Get the type ID.
Definition at line 32 of file dcf-state.cc.
References ns3::TypeId::SetParent().
bool ns3::DcfState::IsAccessRequested | ( | void | ) | const |
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().
bool ns3::DcfState::IsEdca | ( | void | ) | const |
Definition at line 245 of file dcf-state.cc.
References m_txop, and NS_LOG_FUNCTION.
Referenced by ns3::DcfManager::UpdateBackoff().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
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().
void ns3::DcfState::SetAifsn | ( | uint32_t | aifsn | ) |
aifsn | the 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().
void ns3::DcfState::SetCwMax | ( | uint32_t | maxCw | ) |
Set the maximum congestion window size.
maxCw | the 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().
void ns3::DcfState::SetCwMin | ( | uint32_t | minCw | ) |
Set the minimum congestion window size.
minCw | the 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().
void ns3::DcfState::SetTxopLimit | ( | Time | txopLimit | ) |
Set the TXOP limit.
txopLimit | the 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().
void ns3::DcfState::StartBackoffNow | ( | uint32_t | nSlots | ) |
nSlots | the number of slots of the backoff. |
Start a backoff by initializing the backoff counter to the number of slots specified.
Definition at line 154 of file dcf-state.cc.
References m_backoffSlots, m_backoffStart, ns3::Simulator::Now(), NS_LOG_DEBUG, 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(), DcfManagerTest::NotifyCollision(), ns3::EdcaTxopN::NotifyCollision(), ns3::DcaTxop::NotifyCollision(), DcfManagerTest::NotifyInternalCollision(), and ns3::EdcaTxopN::NotifyInternalCollision().
|
protected |
Update backoff slots that nSlots has passed.
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().
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().
|
friend |
DcfManager associated class.
Definition at line 148 of file dcf-state.h.
|
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().
|
protected |
|
protected |
the backoff slots
Definition at line 202 of file dcf-state.h.
Referenced by GetBackoffSlots(), StartBackoffNow(), and UpdateBackoffSlotsNow().
|
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().
|
protected |
the current CW
Definition at line 211 of file dcf-state.h.
Referenced by GetCw(), ResetCw(), and UpdateFailedCw().
|
protected |
the CW maximum
Definition at line 210 of file dcf-state.h.
Referenced by GetCwMax(), SetCwMax(), and UpdateFailedCw().
|
protected |
the CW minimum
Definition at line 209 of file dcf-state.h.
Referenced by GetCwMin(), ResetCw(), and SetCwMin().
the DCA TXOP
Definition at line 214 of file dcf-state.h.
Referenced by DoDispose(), IsEdca(), NotifyAccessGranted(), NotifyChannelSwitching(), NotifyCollision(), NotifyInternalCollision(), NotifySleep(), and NotifyWakeUp().
|
protected |
the txop limit time
Definition at line 212 of file dcf-state.h.
Referenced by GetTxopLimit(), and SetTxopLimit().