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

Maintains the state and information about transmitted MPDUs with Ack Policy set to Block Ack for an originator station. More...

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

+ Inheritance diagram for ns3::OriginatorBlockAckAgreement:
+ Collaboration diagram for ns3::OriginatorBlockAckAgreement:

Public Types

enum  State {
  PENDING , ESTABLISHED , NO_REPLY , RESET ,
  REJECTED
}
 Represents the state for this agreement. More...
 

Public Member Functions

 OriginatorBlockAckAgreement (Mac48Address recipient, uint8_t tid)
 Constructor. More...
 
 ~OriginatorBlockAckAgreement ()
 
std::size_t GetDistance (uint16_t seqNumber) const
 Get the distance between the current starting sequence number and the given sequence number. More...
 
uint16_t GetStartingSequence (void) const override
 Return the starting sequence number of the transmit window, if a transmit window has been initialized. More...
 
void InitTxWindow (void)
 Initialize the originator's transmit window by setting its size and starting sequence number equal to the values stored by the BlockAckAgreement base class. More...
 
bool IsEstablished (void) const
 Check if the current state of this agreement is ESTABLISHED. More...
 
bool IsNoReply (void) const
 Check if the current state of this agreement is NO_REPLY. More...
 
bool IsPending (void) const
 Check if the current state of this agreement is PENDING. More...
 
bool IsRejected (void) const
 Check if the current state of this agreement is REJECTED. More...
 
bool IsReset (void) const
 Check if the current state of this agreement is RESET. More...
 
void NotifyAckedMpdu (Ptr< const WifiMacQueueItem > mpdu)
 Record that the given MPDU has been acknowledged and advance the transmit window if possible. More...
 
void NotifyDiscardedMpdu (Ptr< const WifiMacQueueItem > mpdu)
 Advance the transmit window beyond the MPDU that has been reported to be discarded. More...
 
void NotifyTransmittedMpdu (Ptr< const WifiMacQueueItem > mpdu)
 Advance the transmit window so as to include the transmitted MPDU, if the latter is not an old packet and is beyond the current transmit window. More...
 
void SetState (State state)
 Set the current state. 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 (void) const
 Get the type of the Block Ack Requests sent by the originator of this agreement. More...
 
BlockAckType GetBlockAckType (void) const
 Get the type of the Block Acks sent by the recipient of this agreement. More...
 
uint16_t GetBufferSize (void) const
 Return the buffer size. More...
 
Mac48Address GetPeer (void) const
 Return the peer address. More...
 
uint16_t GetStartingSequenceControl (void) const
 Return the starting sequence control. More...
 
uint8_t GetTid (void) const
 Return the Traffic ID (TID). More...
 
uint16_t GetTimeout (void) const
 Return the timeout. More...
 
uint16_t GetWinEnd (void) const
 Return the last sequence number covered by the ack window. More...
 
bool IsAmsduSupported (void) const
 Check whether A-MSDU is supported. More...
 
bool IsHtSupported (void) const
 Check whether HT is supported. More...
 
bool IsImmediateBlockAck (void) 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 (void)
 Set block ack policy to delayed Ack. More...
 
void SetHtSupported (bool htSupported)
 Enable or disable HT support. More...
 
void SetImmediateBlockAck (void)
 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 Member Functions

void AdvanceTxWindow (void)
 Advance the transmit window so that the starting sequence number is the nearest unacknowledged MPDU. More...
 

Private Attributes

State m_state
 state More...
 
BlockAckWindow m_txWindow
 originator's transmit window More...
 

Friends

class ::OriginatorBlockAckWindowTest
 allow OriginatorBlockAckWindowTest class access More...
 
class BlockAckManager
 allow BlockAckManager class access 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 state and information about transmitted MPDUs with Ack Policy set to Block Ack for an originator station.

The state diagram is as follows:

 /------------\ send ADDBARequest ----------------
 |   START    |------------------>|   PENDING    |-------
 \------------/                   ----------------       \
       ^            receive     /        |                \
       |        ADDBAResponse  /         |                 \
       |          (failure)   v          |                  \
       |        ---------------          |                   --------------------->  ----------------
       |        |  REJECTED   |          |          receive ADDBAResponse (success)  |  ESTABLISHED |
       |        ---------------          |      no            -------------------->  ----------------
       |           receive    ^          | ADDBAResponse     /
       |        ADDBAResponse  \         |                  /
       |          (failure)     \        v                 /
       |                         ----------------         /
       |-------------------------|   NO_REPLY   |---------
         Reset after timeout     ----------------

See also OriginatorBlockAckAgreement::State

Definition at line 58 of file originator-block-ack-agreement.h.

Member Enumeration Documentation

◆ State

Represents the state for this agreement.

PENDING: If an agreement is in PENDING state it means that an ADDBARequest frame was sent to recipient in order to setup the block ack and the originator is waiting for the relative ADDBAResponse frame.

ESTABLISHED: The block ack is active and all packets relative to this agreement are transmitted with Ack Policy set to Block Ack.

NO_REPLY No reply after an ADDBA request. In this state the originator will send the rest of packets in queue using normal MPDU.

RESET A transient state to mark the agreement for reinitialization after failed ADDBA request. Since it is a temporary state, it is not included in the state diagram above. In this state the next transmission will be treated as if the BA agreement is not created yet.

REJECTED (not used for now): The agreement's state becomes REJECTED if an ADDBAResponse frame is received from recipient and the Status Code field is set to failure. State enumeration

Enumerator
PENDING 
ESTABLISHED 
NO_REPLY 
RESET 
REJECTED 

Definition at line 101 of file originator-block-ack-agreement.h.

Constructor & Destructor Documentation

◆ OriginatorBlockAckAgreement()

ns3::OriginatorBlockAckAgreement::OriginatorBlockAckAgreement ( Mac48Address  recipient,
uint8_t  tid 
)

Constructor.

Parameters
recipientMAC address
tidTraffic ID

Definition at line 31 of file originator-block-ack-agreement.cc.

◆ ~OriginatorBlockAckAgreement()

ns3::OriginatorBlockAckAgreement::~OriginatorBlockAckAgreement ( )

Definition at line 37 of file originator-block-ack-agreement.cc.

Member Function Documentation

◆ AdvanceTxWindow()

void ns3::OriginatorBlockAckAgreement::AdvanceTxWindow ( void  )
private

Advance the transmit window so that the starting sequence number is the nearest unacknowledged MPDU.

Definition at line 101 of file originator-block-ack-agreement.cc.

References ns3::BlockAckWindow::Advance(), ns3::BlockAckWindow::At(), and m_txWindow.

Referenced by NotifyAckedMpdu(), NotifyDiscardedMpdu(), and NotifyTransmittedMpdu().

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

◆ GetDistance()

std::size_t ns3::OriginatorBlockAckAgreement::GetDistance ( uint16_t  seqNumber) const

Get the distance between the current starting sequence number and the given sequence number.

Parameters
seqNumberthe given sequence number
Returns
the distance of the given sequence number from the current winstart

Definition at line 89 of file originator-block-ack-agreement.cc.

References ns3::BlockAckAgreement::GetDistance(), ns3::BlockAckWindow::GetWinStart(), and m_txWindow.

Referenced by NotifyAckedMpdu(), NotifyDiscardedMpdu(), and NotifyTransmittedMpdu().

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

◆ GetStartingSequence()

uint16_t ns3::OriginatorBlockAckAgreement::GetStartingSequence ( void  ) const
overridevirtual

Return the starting sequence number of the transmit window, if a transmit window has been initialized.

Otherwise, return the starting sequence number stored by the BlockAckAgreement base class.

Returns
the starting sequence number.

Reimplemented from ns3::BlockAckAgreement.

Definition at line 78 of file originator-block-ack-agreement.cc.

References ns3::BlockAckWindow::GetWinSize(), ns3::BlockAckWindow::GetWinStart(), ns3::BlockAckAgreement::m_startingSeq, and m_txWindow.

Referenced by OriginatorBlockAckWindowTest::DoRun().

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

◆ InitTxWindow()

void ns3::OriginatorBlockAckAgreement::InitTxWindow ( void  )

Initialize the originator's transmit window by setting its size and starting sequence number equal to the values stored by the BlockAckAgreement base class.

Definition at line 95 of file originator-block-ack-agreement.cc.

References ns3::BlockAckWindow::Init(), ns3::BlockAckAgreement::m_bufferSize, ns3::BlockAckAgreement::m_startingSeq, and m_txWindow.

Referenced by OriginatorBlockAckWindowTest::DoRun(), and ns3::BlockAckManager::UpdateAgreement().

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

◆ IsEstablished()

bool ns3::OriginatorBlockAckAgreement::IsEstablished ( void  ) const

Check if the current state of this agreement is ESTABLISHED.

Returns
true if the current state of this agreement is ESTABLISHED, false otherwise

Definition at line 54 of file originator-block-ack-agreement.cc.

References ESTABLISHED, and m_state.

◆ IsNoReply()

bool ns3::OriginatorBlockAckAgreement::IsNoReply ( void  ) const

Check if the current state of this agreement is NO_REPLY.

Returns
true if the current state of this agreement is NO_REPLY, false otherwise

Definition at line 66 of file originator-block-ack-agreement.cc.

References m_state, and NO_REPLY.

◆ IsPending()

bool ns3::OriginatorBlockAckAgreement::IsPending ( void  ) const

Check if the current state of this agreement is PENDING.

Returns
true if the current state of this agreement is PENDING, false otherwise

Definition at line 48 of file originator-block-ack-agreement.cc.

References m_state, and PENDING.

◆ IsRejected()

bool ns3::OriginatorBlockAckAgreement::IsRejected ( void  ) const

Check if the current state of this agreement is REJECTED.

Returns
true if the current state of this agreement is REJECTED, false otherwise

Definition at line 60 of file originator-block-ack-agreement.cc.

References m_state, and REJECTED.

◆ IsReset()

bool ns3::OriginatorBlockAckAgreement::IsReset ( void  ) const

Check if the current state of this agreement is RESET.

Returns
true if the current state of this agreement is RESET, false otherwise

Definition at line 72 of file originator-block-ack-agreement.cc.

References m_state, and RESET.

◆ NotifyAckedMpdu()

void ns3::OriginatorBlockAckAgreement::NotifyAckedMpdu ( Ptr< const WifiMacQueueItem mpdu)

Record that the given MPDU has been acknowledged and advance the transmit window if possible.

Parameters
mpduthe acknowledged MPDU

Definition at line 135 of file originator-block-ack-agreement.cc.

References AdvanceTxWindow(), ns3::BlockAckWindow::At(), GetDistance(), ns3::BlockAckWindow::GetWinStart(), m_txWindow, NS_LOG_DEBUG, and ns3::SEQNO_SPACE_HALF_SIZE.

Referenced by OriginatorBlockAckWindowTest::DoRun().

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

◆ NotifyDiscardedMpdu()

void ns3::OriginatorBlockAckAgreement::NotifyDiscardedMpdu ( Ptr< const WifiMacQueueItem mpdu)

Advance the transmit window beyond the MPDU that has been reported to be discarded.

Parameters
mpduthe discarded MPDU

Definition at line 158 of file originator-block-ack-agreement.cc.

References ns3::BlockAckWindow::Advance(), AdvanceTxWindow(), GetDistance(), ns3::BlockAckWindow::GetWinStart(), m_txWindow, NS_LOG_DEBUG, and ns3::SEQNO_SPACE_HALF_SIZE.

Referenced by OriginatorBlockAckWindowTest::DoRun().

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

◆ NotifyTransmittedMpdu()

void ns3::OriginatorBlockAckAgreement::NotifyTransmittedMpdu ( Ptr< const WifiMacQueueItem mpdu)

Advance the transmit window so as to include the transmitted MPDU, if the latter is not an old packet and is beyond the current transmit window.

Parameters
mpduthe transmitted MPDU

Definition at line 110 of file originator-block-ack-agreement.cc.

References ns3::BlockAckWindow::Advance(), AdvanceTxWindow(), GetDistance(), ns3::BlockAckWindow::GetWinSize(), ns3::BlockAckWindow::GetWinStart(), m_txWindow, NS_LOG_DEBUG, and ns3::SEQNO_SPACE_HALF_SIZE.

Referenced by OriginatorBlockAckWindowTest::DoRun().

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

◆ SetState()

void ns3::OriginatorBlockAckAgreement::SetState ( State  state)

Set the current state.

Parameters
stateto set

Definition at line 42 of file originator-block-ack-agreement.cc.

References m_state.

Referenced by ns3::BlockAckManager::CreateAgreement(), and ns3::BlockAckManager::UpdateAgreement().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ ::OriginatorBlockAckWindowTest

friend class ::OriginatorBlockAckWindowTest
friend

allow OriginatorBlockAckWindowTest class access

Definition at line 63 of file originator-block-ack-agreement.h.

◆ BlockAckManager

friend class BlockAckManager
friend

allow BlockAckManager class access

Definition at line 61 of file originator-block-ack-agreement.h.

Member Data Documentation

◆ m_state

State ns3::OriginatorBlockAckAgreement::m_state
private

◆ m_txWindow

BlockAckWindow ns3::OriginatorBlockAckAgreement::m_txWindow
private

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