add support for block ack in MacLowTransmissionListener

This commit is contained in:
Mirko Banchi
2010-02-03 20:34:50 +01:00
parent e2faaaf1df
commit 07008cf638
4 changed files with 34 additions and 0 deletions

View File

@@ -32,6 +32,7 @@
#include "wifi-mac-queue.h"
#include "msdu-aggregator.h"
#include "mgt-headers.h"
#include "ctrl-headers.h"
NS_LOG_COMPONENT_DEFINE ("EdcaTxopN");
@@ -83,6 +84,9 @@ public:
virtual void MissedAck (void) {
m_txop->MissedAck ();
}
virtual void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address source) {
m_txop->GotBlockAck (blockAck, source);
}
virtual void StartNext (void) {
m_txop->StartNext ();
}
@@ -709,4 +713,14 @@ EdcaTxopN::GotAddBaResponse (const MgtAddBaResponseHeader *respHdr, Mac48Address
RestartAccessIfNeeded ();
}
void
EdcaTxopN::GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient)
{
MY_DEBUG ("got block ack from="<<recipient);
m_currentPacket = 0;
m_dcf->ResetCw ();
m_dcf->StartBackoffNow (m_rng->GetNext (0, m_dcf->GetCw ()));
RestartAccessIfNeeded ();
}
} //namespace ns3

View File

@@ -46,6 +46,7 @@ class WifiMacQueue;
class RandomStream;
class MsduAggregator;
class MgtAddBaResponseHeader;
class CtrlBAckResponseHeader;
/* This queue contains packets for a particular access class.
@@ -112,6 +113,7 @@ public:
void GotCts (double snr, WifiMode txMode);
void MissedCts (void);
void GotAck (double snr, WifiMode txMode);
void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient);
void GotAddBaResponse (const MgtAddBaResponseHeader *respHdr, Mac48Address recipient);
void MissedAck (void);
void StartNext (void);

View File

@@ -110,6 +110,10 @@ MacLowTransmissionListener::MacLowTransmissionListener ()
{}
MacLowTransmissionListener::~MacLowTransmissionListener ()
{}
void
MacLowTransmissionListener::GotBlockAck (const CtrlBAckResponseHeader *blockAck,
Mac48Address source)
{}
MacLowDcfListener::MacLowDcfListener ()
{}
MacLowDcfListener::~MacLowDcfListener ()

View File

@@ -28,6 +28,7 @@
#include "wifi-mode.h"
#include "wifi-preamble.h"
#include "wifi-remote-station-manager.h"
#include "ctrl-headers.h"
#include "ns3/mac48-address.h"
#include "ns3/callback.h"
#include "ns3/event-id.h"
@@ -75,6 +76,19 @@ public:
* AckTimeout.
*/
virtual void MissedAck (void) = 0;
/**
* \param blockAck Block ack response header
* \param source Address of block ack sender
*
* Invoked when ns3::MacLow receives a block ack frame.
* Block ack frame is received after a block ack request
* and contains information about the correct reception
* of a set of packet for which a normal ack wasn't send.
* Default implementation for this method is empty. Every
* queue that intends to be notified by MacLow of reception
* of a block ack must redefine this function.
*/
virtual void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address source);
/**
* Invoked when ns3::MacLow wants to start a new transmission
* as configured by MacLowTransmissionParameters::EnableNextData.