A Discrete-Event Network Simulator
API
ns3::RecipientBlockAckAgreement Class Reference

Maintains the scoreboard and the receive reordering buffer used by a recipient of a Block Ack agreement. More...

#include "recipient-block-ack-agreement.h"

+ Inheritance diagram for ns3::RecipientBlockAckAgreement:
+ Collaboration diagram for ns3::RecipientBlockAckAgreement:

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 >, Comparem_bufferedMpdus
 buffered MPDUs sorted by Seq Number More...
 
Ptr< MacRxMiddlem_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...
 

Detailed Description

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.

Member Typedef Documentation

◆ Key

typedef std::pair<uint16_t, uint16_t*> ns3::RecipientBlockAckAgreement::Key
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.

Constructor & Destructor Documentation

◆ RecipientBlockAckAgreement()

ns3::RecipientBlockAckAgreement::RecipientBlockAckAgreement ( Mac48Address  originator,
bool  amsduSupported,
uint8_t  tid,
uint16_t  bufferSize,
uint16_t  timeout,
uint16_t  startingSeq,
bool  htSupported 
)

Constructor.

Parameters
originatorMAC address
amsduSupportedwhether A-MSDU support is enabled
tidTraffic ID
bufferSizethe buffer size (in number of MPDUs)
timeoutthe timeout value
startingSeqthe starting sequence number
htSupportedwhether 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.

+ Here is the call graph for this function:

◆ ~RecipientBlockAckAgreement()

ns3::RecipientBlockAckAgreement::~RecipientBlockAckAgreement ( )
override

Member Function Documentation

◆ FillBlockAckBitmap()

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.

Parameters
blockAckHeaderthe block ack header
indexthe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Flush()

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().

+ Here is the call graph for this function:

◆ NotifyReceivedBar()

void ns3::RecipientBlockAckAgreement::NotifyReceivedBar ( uint16_t  startingSequenceNumber)

Update both the scoreboard and the receive reordering buffer upon reception of a Block Ack Request.

Parameters
startingSequenceNumberthe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotifyReceivedMpdu()

void ns3::RecipientBlockAckAgreement::NotifyReceivedMpdu ( Ptr< const WifiMpdu mpdu)

Update both the scoreboard and the receive reordering buffer upon reception of the given MPDU.

Parameters
mpduthe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PassBufferedMpdusUntilFirstLost()

void ns3::RecipientBlockAckAgreement::PassBufferedMpdusUntilFirstLost ( )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PassBufferedMpdusWithSeqNumberLessThan()

void ns3::RecipientBlockAckAgreement::PassBufferedMpdusWithSeqNumberLessThan ( uint16_t  newWinStartB)
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.

Parameters
newWinStartBthe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetMacRxMiddle()

void ns3::RecipientBlockAckAgreement::SetMacRxMiddle ( const Ptr< MacRxMiddle rxMiddle)

Set the MAC RX Middle to use.

Parameters
rxMiddlethe 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().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_bufferedMpdus

std::map<Key, Ptr<const WifiMpdu>, Compare> ns3::RecipientBlockAckAgreement::m_bufferedMpdus
private

◆ m_rxMiddle

Ptr<MacRxMiddle> ns3::RecipientBlockAckAgreement::m_rxMiddle
private

◆ m_scoreboard

BlockAckWindow ns3::RecipientBlockAckAgreement::m_scoreboard
private

◆ m_winSizeB

std::size_t ns3::RecipientBlockAckAgreement::m_winSizeB
private

size of the receive reordering buffer

Definition at line 137 of file recipient-block-ack-agreement.h.

Referenced by RecipientBlockAckAgreement(), and NotifyReceivedMpdu().

◆ m_winStartB

uint16_t ns3::RecipientBlockAckAgreement::m_winStartB
private

The documentation for this class was generated from the following files: