Maintains the scoreboard and the receive reordering buffer used by a recipient of a Block Ack agreement. More...
#include "recipient-block-ack-agreement.h"
Classes | |
struct | Compare |
Comparison functor used to sort the buffered MPDUs. More... | |
Public Member Functions | |
RecipientBlockAckAgreement (Mac48Address originator, bool amsduSupported, uint8_t tid, uint16_t bufferSize, uint16_t timeout, uint16_t startingSeq, bool htSupported) | |
Constructor. More... | |
~RecipientBlockAckAgreement () override | |
void | FillBlockAckBitmap (CtrlBAckResponseHeader *blockAckHeader, std::size_t index=0) const |
Set the Starting Sequence Number subfield of the Block Ack Starting Sequence Control subfield of the Block Ack frame and fill the block ack bitmap. More... | |
void | Flush () |
This is called when a Block Ack agreement is destroyed to flush the received packets. More... | |
void | NotifyReceivedBar (uint16_t startingSequenceNumber) |
Update both the scoreboard and the receive reordering buffer upon reception of a Block Ack Request. More... | |
void | NotifyReceivedMpdu (Ptr< const WifiMpdu > mpdu) |
Update both the scoreboard and the receive reordering buffer upon reception of the given MPDU. More... | |
void | SetMacRxMiddle (const Ptr< MacRxMiddle > rxMiddle) |
Set the MAC RX Middle to use. More... | |
Public Member Functions inherited from ns3::BlockAckAgreement | |
BlockAckAgreement (Mac48Address peer, uint8_t tid) | |
Constructor for BlockAckAgreement with given peer and TID. More... | |
virtual | ~BlockAckAgreement () |
BlockAckReqType | GetBlockAckReqType () const |
Get the type of the Block Ack Requests sent by the originator of this agreement. More... | |
BlockAckType | GetBlockAckType () const |
Get the type of the Block Acks sent by the recipient of this agreement. More... | |
uint16_t | GetBufferSize () const |
Return the buffer size. More... | |
Mac48Address | GetPeer () const |
Return the peer address. More... | |
virtual uint16_t | GetStartingSequence () const |
Return the starting sequence number. More... | |
uint16_t | GetStartingSequenceControl () const |
Return the starting sequence control. More... | |
uint8_t | GetTid () const |
Return the Traffic ID (TID). More... | |
uint16_t | GetTimeout () const |
Return the timeout. More... | |
uint16_t | GetWinEnd () const |
Return the last sequence number covered by the ack window. More... | |
bool | IsAmsduSupported () const |
Check whether A-MSDU is supported. More... | |
bool | IsHtSupported () const |
Check whether HT is supported. More... | |
bool | IsImmediateBlockAck () const |
Check whether the current ack policy is immediate BlockAck. More... | |
void | SetAmsduSupport (bool supported) |
Enable or disable A-MSDU support. More... | |
void | SetBufferSize (uint16_t bufferSize) |
Set buffer size. More... | |
void | SetDelayedBlockAck () |
Set block ack policy to delayed Ack. More... | |
void | SetHtSupported (bool htSupported) |
Enable or disable HT support. More... | |
void | SetImmediateBlockAck () |
Set block ack policy to immediate Ack. More... | |
void | SetStartingSequence (uint16_t seq) |
Set starting sequence number. More... | |
void | SetStartingSequenceControl (uint16_t seq) |
Set starting sequence control. More... | |
void | SetTimeout (uint16_t timeout) |
Set timeout. More... | |
Private Types | |
typedef std::pair< uint16_t, uint16_t * > | Key |
The key of a buffered MPDU is the pair (MPDU sequence number, pointer to WinStartB) More... | |
Private Member Functions | |
void | PassBufferedMpdusUntilFirstLost () |
Pass MSDUs or A-MSDUs up to the next MAC process if they are stored in the buffer in order of increasing value of the Sequence Number subfield starting with the MSDU or A-MSDU that has SN=WinStartB. More... | |
void | PassBufferedMpdusWithSeqNumberLessThan (uint16_t newWinStartB) |
Pass any complete MSDUs or A-MSDUs stored in the buffer with Sequence Number subfield values that are lower than the new value of WinStartB up to the next MAC process in order of increasing Sequence Number subfield value. More... | |
Private Attributes | |
std::map< Key, Ptr< const WifiMpdu >, Compare > | m_bufferedMpdus |
buffered MPDUs sorted by Seq Number More... | |
Ptr< MacRxMiddle > | m_rxMiddle |
the MAC RX Middle on this station More... | |
BlockAckWindow | m_scoreboard |
recipient's scoreboard More... | |
std::size_t | m_winSizeB |
size of the receive reordering buffer More... | |
uint16_t | m_winStartB |
starting SN for the reordering buffer More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ns3::BlockAckAgreement | |
static std::size_t | GetDistance (uint16_t seqNumber, uint16_t startingSeqNumber) |
Get the distance between the given starting sequence number and the given sequence number. More... | |
Protected Attributes inherited from ns3::BlockAckAgreement | |
uint8_t | m_amsduSupported |
Flag whether MSDU aggregation is supported. More... | |
uint8_t | m_blockAckPolicy |
Type of block ack: immediate or delayed. More... | |
uint16_t | m_bufferSize |
Buffer size. More... | |
uint8_t | m_htSupported |
Flag whether HT is supported. More... | |
EventId | m_inactivityEvent |
inactivity event More... | |
Mac48Address | m_peer |
Peer address. More... | |
uint16_t | m_startingSeq |
Starting sequence control. More... | |
uint8_t | m_tid |
Traffic ID. More... | |
uint16_t | m_timeout |
Timeout. More... | |
uint16_t | m_winEnd |
Ending sequence number. More... | |
Maintains the scoreboard and the receive reordering buffer used by a recipient of a Block Ack agreement.
Definition at line 39 of file recipient-block-ack-agreement.h.
|
private |
The key of a buffered MPDU is the pair (MPDU sequence number, pointer to WinStartB)
Definition at line 120 of file recipient-block-ack-agreement.h.
ns3::RecipientBlockAckAgreement::RecipientBlockAckAgreement | ( | Mac48Address | originator, |
bool | amsduSupported, | ||
uint8_t | tid, | ||
uint16_t | bufferSize, | ||
uint16_t | timeout, | ||
uint16_t | startingSeq, | ||
bool | htSupported | ||
) |
Constructor.
originator | MAC address |
amsduSupported | whether A-MSDU support is enabled |
tid | Traffic ID |
bufferSize | the buffer size (in number of MPDUs) |
timeout | the timeout value |
startingSeq | the starting sequence number |
htSupported | whether HT support is enabled |
Definition at line 44 of file recipient-block-ack-agreement.cc.
References ns3::BlockAckWindow::Init(), ns3::BlockAckAgreement::m_amsduSupported, ns3::BlockAckAgreement::m_bufferSize, ns3::BlockAckAgreement::m_htSupported, m_scoreboard, ns3::BlockAckAgreement::m_startingSeq, ns3::BlockAckAgreement::m_timeout, m_winSizeB, m_winStartB, NS_LOG_FUNCTION, and timeout.
|
override |
Definition at line 67 of file recipient-block-ack-agreement.cc.
References m_bufferedMpdus, m_rxMiddle, and NS_LOG_FUNCTION_NOARGS.
void ns3::RecipientBlockAckAgreement::FillBlockAckBitmap | ( | CtrlBAckResponseHeader * | blockAckHeader, |
std::size_t | index = 0 |
||
) | const |
Set the Starting Sequence Number subfield of the Block Ack Starting Sequence Control subfield of the Block Ack frame and fill the block ack bitmap.
For Multi-STA Block Acks, index identifies the Per AID TID Info subfield whose bitmap has to be filled.
blockAckHeader | the block ack header |
index | the index of the Per AID TID Info subfield (Multi-STA Block Ack only) |
Definition at line 232 of file recipient-block-ack-agreement.cc.
References ns3::BlockAckWindow::At(), ns3::BlockAckWindow::GetWinSize(), ns3::BlockAckWindow::GetWinStart(), ns3::CtrlBAckResponseHeader::IsBasic(), ns3::CtrlBAckResponseHeader::IsCompressed(), ns3::CtrlBAckResponseHeader::IsExtendedCompressed(), ns3::CtrlBAckResponseHeader::IsMultiSta(), ns3::CtrlBAckResponseHeader::IsMultiTid(), m_scoreboard, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::CtrlBAckResponseHeader::ResetBitmap(), ns3::SEQNO_SPACE_SIZE, ns3::CtrlBAckResponseHeader::SetReceivedPacket(), and ns3::CtrlBAckResponseHeader::SetStartingSequence().
Referenced by ns3::HtFrameExchangeManager::SendBlockAck().
void ns3::RecipientBlockAckAgreement::Flush | ( | ) |
This is called when a Block Ack agreement is destroyed to flush the received packets.
Definition at line 185 of file recipient-block-ack-agreement.cc.
References ns3::BlockAckWindow::GetWinStart(), m_scoreboard, NS_LOG_FUNCTION, PassBufferedMpdusUntilFirstLost(), and PassBufferedMpdusWithSeqNumberLessThan().
void ns3::RecipientBlockAckAgreement::NotifyReceivedBar | ( | uint16_t | startingSequenceNumber | ) |
Update both the scoreboard and the receive reordering buffer upon reception of a Block Ack Request.
startingSequenceNumber | the starting sequence number included in the received Block Ack Request |
Definition at line 193 of file recipient-block-ack-agreement.cc.
References ns3::BlockAckWindow::Advance(), ns3::BlockAckAgreement::GetDistance(), ns3::BlockAckWindow::GetWinSize(), ns3::BlockAckWindow::GetWinStart(), m_scoreboard, m_winStartB, NS_ASSERT, NS_LOG_FUNCTION, PassBufferedMpdusUntilFirstLost(), PassBufferedMpdusWithSeqNumberLessThan(), ns3::BlockAckWindow::Reset(), and ns3::SEQNO_SPACE_HALF_SIZE.
Referenced by BlockAckRecipientBufferTest::DoRun().
Update both the scoreboard and the receive reordering buffer upon reception of the given MPDU.
mpdu | the received MPDU |
Definition at line 125 of file recipient-block-ack-agreement.cc.
References ns3::BlockAckWindow::Advance(), ns3::BlockAckWindow::At(), ns3::BlockAckAgreement::GetDistance(), ns3::BlockAckWindow::GetWinSize(), ns3::BlockAckWindow::GetWinStart(), m_bufferedMpdus, m_scoreboard, m_winSizeB, m_winStartB, NS_LOG_FUNCTION, PassBufferedMpdusUntilFirstLost(), PassBufferedMpdusWithSeqNumberLessThan(), and ns3::SEQNO_SPACE_HALF_SIZE.
Referenced by BlockAckRecipientBufferTest::DoRun().
|
private |
Pass MSDUs or A-MSDUs up to the next MAC process if they are stored in the buffer in order of increasing value of the Sequence Number subfield starting with the MSDU or A-MSDU that has SN=WinStartB.
Set WinStartB to the value of the Sequence Number subfield of the last MSDU or A-MSDU that was passed up to the next MAC process plus one.
Definition at line 82 of file recipient-block-ack-agreement.cc.
References ns3::BlockAckAgreement::GetDistance(), m_bufferedMpdus, m_rxMiddle, m_winStartB, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::SEQNO_SPACE_HALF_SIZE, ns3::SEQNO_SPACE_SIZE, and ns3::WIFI_LINKID_UNDEFINED.
Referenced by Flush(), NotifyReceivedBar(), and NotifyReceivedMpdu().
|
private |
Pass any complete MSDUs or A-MSDUs stored in the buffer with Sequence Number subfield values that are lower than the new value of WinStartB up to the next MAC process in order of increasing Sequence Number subfield value.
newWinStartB | the new value of WinStartB |
Definition at line 103 of file recipient-block-ack-agreement.cc.
References ns3::BlockAckAgreement::GetDistance(), m_bufferedMpdus, m_rxMiddle, m_winStartB, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::SEQNO_SPACE_HALF_SIZE, and ns3::WIFI_LINKID_UNDEFINED.
Referenced by Flush(), NotifyReceivedBar(), and NotifyReceivedMpdu().
void ns3::RecipientBlockAckAgreement::SetMacRxMiddle | ( | const Ptr< MacRxMiddle > | rxMiddle | ) |
Set the MAC RX Middle to use.
rxMiddle | the MAC RX Middle to use |
Definition at line 75 of file recipient-block-ack-agreement.cc.
References m_rxMiddle, and NS_LOG_FUNCTION.
Referenced by ns3::BlockAckManager::CreateRecipientAgreement(), and BlockAckRecipientBufferTest::DoRun().
|
private |
buffered MPDUs sorted by Seq Number
Definition at line 139 of file recipient-block-ack-agreement.h.
Referenced by ~RecipientBlockAckAgreement(), NotifyReceivedMpdu(), PassBufferedMpdusUntilFirstLost(), and PassBufferedMpdusWithSeqNumberLessThan().
|
private |
the MAC RX Middle on this station
Definition at line 140 of file recipient-block-ack-agreement.h.
Referenced by ~RecipientBlockAckAgreement(), PassBufferedMpdusUntilFirstLost(), PassBufferedMpdusWithSeqNumberLessThan(), and SetMacRxMiddle().
|
private |
recipient's scoreboard
Definition at line 135 of file recipient-block-ack-agreement.h.
Referenced by RecipientBlockAckAgreement(), FillBlockAckBitmap(), Flush(), NotifyReceivedBar(), and NotifyReceivedMpdu().
|
private |
size of the receive reordering buffer
Definition at line 137 of file recipient-block-ack-agreement.h.
Referenced by RecipientBlockAckAgreement(), and NotifyReceivedMpdu().
|
private |
starting SN for the reordering buffer
Definition at line 136 of file recipient-block-ack-agreement.h.
Referenced by RecipientBlockAckAgreement(), NotifyReceivedBar(), NotifyReceivedMpdu(), PassBufferedMpdusUntilFirstLost(), and PassBufferedMpdusWithSeqNumberLessThan().