wifi: (fixes #1205) Make EDCA more standard compliant
This commit is contained in:
@@ -55,6 +55,7 @@ New user-visible features
|
||||
Bugs fixed
|
||||
----------
|
||||
- Bug 1132 - useless for loops in block-ack-test-suite.cc
|
||||
- Bug 1205 - EDCA is incorrectly modelled as DCF
|
||||
- Bug 1571 - TCP zero-window and flow control window updates by the receiver
|
||||
- Bug 1761 - Rounding with olsr::EmfToSeconds
|
||||
- Bug 1954 - Serialized size of wifi-net-device differ for TX and RX trace
|
||||
|
||||
@@ -48,7 +48,10 @@ public:
|
||||
: m_txop (txop)
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool IsEdca (void) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
private:
|
||||
virtual void DoNotifyAccessGranted (void)
|
||||
{
|
||||
|
||||
@@ -645,6 +645,21 @@ DcfManager::UpdateBackoff (void)
|
||||
{
|
||||
uint32_t nus = (Simulator::Now () - backoffStart).GetMicroSeconds ();
|
||||
uint32_t nIntSlots = nus / m_slotTimeUs;
|
||||
/*
|
||||
* EDCA behaves slightly different to DCA. For EDCA we
|
||||
* decrement once at the slot boundary at the end of AIFS as
|
||||
* well as once at the end of each clear slot
|
||||
* thereafter. For DCA we only decrement at the end of each
|
||||
* clear slot after DIFS. We account for the extra backoff
|
||||
* by incrementing the slot count here in the case of
|
||||
* EDCA. The if statement whose body we are in has confirmed
|
||||
* that a minimum of AIFS has elapsed since last busy
|
||||
* medium.
|
||||
*/
|
||||
if (state->IsEdca ())
|
||||
{
|
||||
nIntSlots++;
|
||||
}
|
||||
uint32_t n = std::min (nIntSlots, state->GetBackoffSlots ());
|
||||
MY_DEBUG ("dcf " << k << " dec backoff slots=" << n);
|
||||
Time backoffUpdateBound = backoffStart + MicroSeconds (n * m_slotTimeUs);
|
||||
|
||||
@@ -49,6 +49,16 @@ public:
|
||||
DcfState ();
|
||||
virtual ~DcfState ();
|
||||
|
||||
/**
|
||||
* \return whether this DCF state is an EDCA state
|
||||
*
|
||||
* This method, which must be overridden in derived classes,
|
||||
* indicates whether DCF or EDCAF rules should be used for this
|
||||
* channel access function. This affects the behavior of DcfManager
|
||||
* when dealing with this instance.
|
||||
*/
|
||||
virtual bool IsEdca (void) const = 0;
|
||||
|
||||
/**
|
||||
* \param aifsn the number of slots which make up an AIFS for a specific DCF.
|
||||
* a DIFS corresponds to an AIFSN = 2.
|
||||
|
||||
@@ -51,6 +51,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool IsEdca (void) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void DoNotifyAccessGranted (void)
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@ class DcfStateTest : public DcfState
|
||||
public:
|
||||
DcfStateTest (DcfManagerTest *test, uint32_t i);
|
||||
void QueueTx (uint64_t txTime, uint64_t expectedGrantTime);
|
||||
bool IsEdca (void) const;
|
||||
|
||||
|
||||
private:
|
||||
@@ -113,6 +114,12 @@ DcfStateTest::DcfStateTest (DcfManagerTest *test, uint32_t i)
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
DcfStateTest::IsEdca (void) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
DcfStateTest::QueueTx (uint64_t txTime, uint64_t expectedGrantTime)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user