keep track of the state needed for a single DCF function.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. More...
#include <dcf-manager.h>
Public Member Functions | |
uint32_t | GetAifsn (void) const |
uint32_t | GetCw (void) const |
uint32_t | GetCwMax (void) const |
uint32_t | GetCwMin (void) const |
bool | IsAccessRequested (void) const |
void | ResetCw (void) |
void | SetAifsn (uint32_t aifsn) |
void | SetCwMax (uint32_t maxCw) |
void | SetCwMin (uint32_t minCw) |
void | StartBackoffNow (uint32_t nSlots) |
void | UpdateFailedCw (void) |
Private Member Functions | |
virtual void | DoNotifyAccessGranted (void)=0 |
virtual void | DoNotifyChannelSensing ()=0 |
virtual void | DoNotifyChannelSwitching (Time duration, uint16_t toChannel)=0 |
virtual void | DoNotifyCollision (void)=0 |
virtual void | DoNotifyInternalCollision (void)=0 |
uint32_t | GetBackoffSlots (void) const |
Time | GetBackoffStart (void) const |
void | NotifyAccessGranted (void) |
void | NotifyAccessRequested (void) |
void | NotifyChannelSensing (void) |
void | NotifyChannelSwitching (Time duration, uint16_t toChannel) |
void | NotifyCollision (void) |
void | NotifyInternalCollision (void) |
void | UpdateBackoffSlotsNow (uint32_t nSlots, Time backoffUpdateBound) |
Private Attributes | |
bool | m_accessRequested |
uint32_t | m_aifsn |
uint32_t | m_backoffSlots |
Time | m_backoffStart |
uint32_t | m_cw |
uint32_t | m_cwMax |
uint32_t | m_cwMin |
Friends | |
class | DcfManager |
keep track of the state needed for a single DCF function.
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.
Definition at line 46 of file dcf-manager.h.
|
privatepure virtual |
Called by DcfManager to notify a DcfState subclass that access to the medium is granted and can start immediately.
Implemented in ns3::DcaTxop::Dcf, ns3::EdcaTxopN::Dcf, and ns3::DcfStateTest.
|
privatepure virtual |
Called by DcfManager to notify a DcfState subclass that a channel switching occured.
The subclass is expected to flush the queue of packets.
Implemented in ns3::DcaTxop::Dcf, and ns3::EdcaTxopN::Dcf.
|
privatepure virtual |
Called by DcfManager to notify a DcfState subclass that a normal collision occured, that is, that the medium was busy when access was requested.
The subclass is expected to start a new backoff by calling DcfState::StartBackoffNow and DcfManager::RequestAccess is access is still needed.
Implemented in ns3::DcaTxop::Dcf, ns3::EdcaTxopN::Dcf, and ns3::DcfStateTest.
|
privatepure virtual |
Called by DcfManager to notify a DcfState subclass that an 'internal' collision occured, that is, that the backoff timer of a higher priority DcfState expired at the same time and that access was granted to this higher priority DcfState.
The subclass is expected to start a new backoff by calling DcfState::StartBackoffNow and DcfManager::RequestAccess is access is still needed.
Implemented in ns3::DcaTxop::Dcf, ns3::EdcaTxopN::Dcf, and ns3::DcfStateTest.
uint32_t ns3::DcfState::GetCw | ( | void | ) | const |
Definition at line 118 of file dcf-manager.cc.
Referenced by ns3::DcaTxop::DoInitialize(), and ns3::EdcaTxopN::DoInitialize().
bool ns3::DcfState::IsAccessRequested | ( | void | ) | const |
Definition at line 133 of file dcf-manager.cc.
Referenced by ns3::DcfManager::DoGrantAccess(), ns3::DcfManager::DoRestartAccessTimeoutIfNeeded(), ns3::DcfManager::RequestAccess(), and ns3::DcaTxop::RestartAccessIfNeeded().
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 90 of file dcf-manager.cc.
Referenced by ns3::DcaTxop::DoInitialize(), ns3::EdcaTxopN::DoInitialize(), and ns3::DcfManager::NotifySwitchingStartNow().
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 57 of file dcf-manager.cc.
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 109 of file dcf-manager.cc.
References ns3::Simulator::Now(), and NS_ASSERT.
Referenced by ns3::DcaTxop::DoInitialize(), and ns3::EdcaTxopN::DoInitialize().
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 95 of file dcf-manager.cc.