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

Manages all block ack agreements for an originator station. More...

#include "block-ack-manager.h"

+ Inheritance diagram for ns3::BlockAckManager:
+ Collaboration diagram for ns3::BlockAckManager:

Public Types

typedef void(* AgreementStateTracedCallback) (Time now, Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state)
 TracedCallback signature for state changes. More...
 
typedef Callback< void, Ptr< const WifiMacQueueItem > > DroppedOldMpdu
 typedef for a callback to invoke when an MPDU is dropped. More...
 
typedef Callback< void, Ptr< const WifiMacQueueItem > > TxFailed
 typedef for a callback to invoke when an MPDU is negatively ack'ed. More...
 
typedef Callback< void, Ptr< const WifiMacQueueItem > > TxOk
 typedef for a callback to invoke when an MPDU is successfully ack'ed. More...
 

Public Member Functions

 BlockAckManager ()
 
 ~BlockAckManager ()
 
void CreateAgreement (const MgtAddBaRequestHeader *reqHdr, Mac48Address recipient, bool htSupported=true)
 
void DestroyAgreement (Mac48Address recipient, uint8_t tid)
 
bool ExistsAgreement (Mac48Address recipient, uint8_t tid) const
 
bool ExistsAgreementInState (Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state) const
 
Ptr< const WifiMacQueueItemGetBar (bool remove=true, uint8_t tid=8, Mac48Address recipient=Mac48Address::GetBroadcast())
 Returns the next BlockAckRequest or MU-BAR Trigger Frame to send, if any. More...
 
CtrlBAckRequestHeader GetBlockAckReqHeader (Mac48Address recipient, uint8_t tid) const
 
BlockAckReqType GetBlockAckReqType (Mac48Address recipient, uint8_t tid) const
 This function returns the type of Block Acks sent to the recipient. More...
 
BlockAckType GetBlockAckType (Mac48Address recipient, uint8_t tid) const
 This function returns the type of Block Acks sent by the recipient. More...
 
uint32_t GetNBufferedPackets (Mac48Address recipient, uint8_t tid) const
 
uint16_t GetOriginatorStartingSequence (Mac48Address recipient, uint8_t tid) const
 This function returns the starting sequence number of the transmit window. More...
 
uint16_t GetRecipientBufferSize (Mac48Address recipient, uint8_t tid) const
 This function returns the buffer size negotiated with the recipient. More...
 
bool NeedBarRetransmission (uint8_t tid, Mac48Address recipient)
 This function returns true if a block ack agreement is established with the given recipient for the given TID and there is at least an outstanding MPDU for such agreement whose lifetime is not expired. More...
 
void NotifyAgreementEstablished (Mac48Address recipient, uint8_t tid, uint16_t startingSeq)
 
void NotifyAgreementNoReply (Mac48Address recipient, uint8_t tid)
 
void NotifyAgreementRejected (Mac48Address recipient, uint8_t tid)
 
void NotifyAgreementReset (Mac48Address recipient, uint8_t tid)
 
void NotifyDiscardedMpdu (Ptr< const WifiMacQueueItem > mpdu)
 
void NotifyGotAck (Ptr< const WifiMacQueueItem > mpdu)
 Invoked upon receipt of an Ack frame after the transmission of a QoS data frame sent under an established block ack agreement. More...
 
std::pair< uint16_t, uint16_t > NotifyGotBlockAck (const CtrlBAckResponseHeader &blockAck, Mac48Address recipient, const std::set< uint8_t > &tids, size_t index=0)
 
void NotifyMissedAck (Ptr< WifiMacQueueItem > mpdu)
 Invoked upon missed reception of an Ack frame after the transmission of a QoS data frame sent under an established block ack agreement. More...
 
void NotifyMissedBlockAck (Mac48Address recipient, uint8_t tid)
 
void ScheduleBar (Ptr< const WifiMacQueueItem > bar, bool skipIfNoDataQueued=false)
 
void SetBlockAckInactivityCallback (Callback< void, Mac48Address, uint8_t, bool > callback)
 Set block ack inactivity callback. More...
 
void SetBlockAckThreshold (uint8_t nPackets)
 
void SetBlockDestinationCallback (Callback< void, Mac48Address, uint8_t > callback)
 Set block destination callback. More...
 
void SetDroppedOldMpduCallback (DroppedOldMpdu callback)
 
void SetQueue (const Ptr< WifiMacQueue > queue)
 
void SetTxFailedCallback (TxFailed callback)
 
void SetTxOkCallback (TxOk callback)
 
void SetUnblockDestinationCallback (Callback< void, Mac48Address, uint8_t > callback)
 Set unblock destination callback. More...
 
void StorePacket (Ptr< WifiMacQueueItem > mpdu)
 
bool SwitchToBlockAckIfNeeded (Mac48Address recipient, uint8_t tid, uint16_t startingSeq)
 
void UpdateAgreement (const MgtAddBaResponseHeader *respHdr, Mac48Address recipient, uint16_t startingSeq)
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
virtual TypeId GetInstanceTypeId (void) const =0
 Get the most derived TypeId for this Object. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Protected Member Functions

void DoDispose () override
 Destructor implementation. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoDispose (void)
 Destructor implementation. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
virtual void NotifyNewAggregate (void)
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Private Types

typedef std::map< std::pair< Mac48Address, uint8_t >, std::pair< OriginatorBlockAckAgreement, PacketQueue > > Agreements
 typedef for a map between MAC address and block ack agreement. More...
 
typedef std::map< std::pair< Mac48Address, uint8_t >, std::pair< OriginatorBlockAckAgreement, PacketQueue > >::const_iterator AgreementsCI
 typedef for a const iterator for Agreements. More...
 
typedef std::map< std::pair< Mac48Address, uint8_t >, std::pair< OriginatorBlockAckAgreement, PacketQueue > >::iterator AgreementsI
 typedef for an iterator for Agreements. More...
 
enum  MpduStatus : uint8_t { STAY_INFLIGHT = 0 , TO_RETRANSMIT , ACKNOWLEDGED }
 Enumeration for the statuses of a buffered MPDU. More...
 
typedef std::list< Ptr< WifiMacQueueItem > > PacketQueue
 typedef for a list of WifiMacQueueItem. More...
 
typedef std::list< Ptr< WifiMacQueueItem > >::const_iterator PacketQueueCI
 typedef for a const iterator for PacketQueue. More...
 
typedef std::list< Ptr< WifiMacQueueItem > >::iterator PacketQueueI
 typedef for an iterator for PacketQueue. More...
 

Private Member Functions

 BlockAckManager (const BlockAckManager &)
 type conversion operator More...
 
PacketQueueI HandleInFlightMpdu (PacketQueueI mpduIt, MpduStatus status, const AgreementsI &it, const Time &now)
 Handle the given in flight MPDU based on its given status. More...
 
void InactivityTimeout (Mac48Address recipient, uint8_t tid)
 Inactivity timeout function. More...
 
BlockAckManageroperator= (const BlockAckManager &block)
 assignment operator More...
 

Private Attributes

Agreements m_agreements
 This data structure contains, for each block ack agreement (recipient, TID), a set of packets for which an ack by block ack is requested. More...
 
TracedCallback< Time, Mac48Address, uint8_t, OriginatorBlockAckAgreement::Statem_agreementState
 The trace source fired when a state transition occurred. More...
 
std::list< Barm_bars
 list of BARs More...
 
Callback< void, Mac48Address, uint8_t, bool > m_blockAckInactivityTimeout
 BlockAck inactivity timeout callback. More...
 
uint8_t m_blockAckThreshold
 block ack threshold More...
 
Callback< void, Mac48Address, uint8_t > m_blockPackets
 block packets callback More...
 
DroppedOldMpdu m_droppedOldMpduCallback
 the dropped MPDU callback More...
 
Ptr< WifiMacQueuem_queue
 queue More...
 
TxFailed m_txFailedCallback
 transmit failed callback More...
 
TxOk m_txOkCallback
 transmit OK callback More...
 
Callback< void, Mac48Address, uint8_t > m_unblockPackets
 unblock packets callback More...
 

Additional Inherited Members

Detailed Description

Manages all block ack agreements for an originator station.

Config Paths

ns3::BlockAckManager is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/Txop/$ns3::QosTxop/BlockAckManager"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/VO_Txop/BlockAckManager"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/VI_Txop/BlockAckManager"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/BE_Txop/BlockAckManager"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/BK_Txop/BlockAckManager"

No Attributes are defined for this type.

TraceSources

Size of this type is 176 bytes (on a 64-bit architecture).

Definition at line 69 of file block-ack-manager.h.

Member Typedef Documentation

◆ Agreements

typedef std::map<std::pair<Mac48Address, uint8_t>, std::pair<OriginatorBlockAckAgreement, PacketQueue> > ns3::BlockAckManager::Agreements
private

typedef for a map between MAC address and block ack agreement.

Definition at line 449 of file block-ack-manager.h.

◆ AgreementsCI

typedef std::map<std::pair<Mac48Address,uint8_t>,std::pair<OriginatorBlockAckAgreement,PacketQueue>>::const_iterator ns3::BlockAckManager::AgreementsCI
private

typedef for a const iterator for Agreements.

Definition at line 459 of file block-ack-manager.h.

◆ AgreementsI

typedef std::map<std::pair<Mac48Address,uint8_t>,std::pair<OriginatorBlockAckAgreement,PacketQueue>>::iterator ns3::BlockAckManager::AgreementsI
private

typedef for an iterator for Agreements.

Definition at line 454 of file block-ack-manager.h.

◆ AgreementStateTracedCallback

typedef void(* ns3::BlockAckManager::AgreementStateTracedCallback) (Time now, Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state)

TracedCallback signature for state changes.

Parameters
[in]nowTime when the state changed.
[in]recipientMAC address of the recipient.
[in]tidthe TID.
[in]stateThe state.

Definition at line 387 of file block-ack-manager.h.

◆ DroppedOldMpdu

typedef for a callback to invoke when an MPDU is dropped.

Definition at line 362 of file block-ack-manager.h.

◆ PacketQueue

typedef for a list of WifiMacQueueItem.

Definition at line 436 of file block-ack-manager.h.

◆ PacketQueueCI

typedef for a const iterator for PacketQueue.

Definition at line 444 of file block-ack-manager.h.

◆ PacketQueueI

typedef for an iterator for PacketQueue.

Definition at line 440 of file block-ack-manager.h.

◆ TxFailed

typedef for a callback to invoke when an MPDU is negatively ack'ed.

Definition at line 358 of file block-ack-manager.h.

◆ TxOk

typedef for a callback to invoke when an MPDU is successfully ack'ed.

Definition at line 354 of file block-ack-manager.h.

Member Enumeration Documentation

◆ MpduStatus

enum ns3::BlockAckManager::MpduStatus : uint8_t
private

Enumeration for the statuses of a buffered MPDU.

Enumerator
STAY_INFLIGHT 
TO_RETRANSMIT 
ACKNOWLEDGED 

Definition at line 84 of file block-ack-manager.h.

Constructor & Destructor Documentation

◆ BlockAckManager() [1/2]

ns3::BlockAckManager::BlockAckManager ( const BlockAckManager )
private

type conversion operator

◆ BlockAckManager() [2/2]

ns3::BlockAckManager::BlockAckManager ( )

Definition at line 66 of file block-ack-manager.cc.

References NS_LOG_FUNCTION.

◆ ~BlockAckManager()

ns3::BlockAckManager::~BlockAckManager ( )

Definition at line 71 of file block-ack-manager.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ CreateAgreement()

void ns3::BlockAckManager::CreateAgreement ( const MgtAddBaRequestHeader reqHdr,
Mac48Address  recipient,
bool  htSupported = true 
)

◆ DestroyAgreement()

void ns3::BlockAckManager::DestroyAgreement ( Mac48Address  recipient,
uint8_t  tid 
)
Parameters
recipientAddress of peer station involved in block ack mechanism.
tidtraffic ID of transmitted packet.

Invoked when a recipient reject a block ack agreement or when a DELBA frame is Received/Transmitted.

Definition at line 156 of file block-ack-manager.cc.

References m_agreements, m_bars, and NS_LOG_FUNCTION.

◆ DoDispose()

void ns3::BlockAckManager::DoDispose ( void  )
overrideprotectedvirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 77 of file block-ack-manager.cc.

References m_agreements, m_bars, m_queue, and NS_LOG_FUNCTION.

◆ ExistsAgreement()

bool ns3::BlockAckManager::ExistsAgreement ( Mac48Address  recipient,
uint8_t  tid 
) const
Parameters
recipientAddress of peer station involved in block ack mechanism.
tidTraffic ID.
Returns
true if a block ack agreement exists, false otherwise

Checks if a block ack agreement exists with station addressed by recipient for TID tid.

Definition at line 86 of file block-ack-manager.cc.

References m_agreements, and NS_LOG_FUNCTION.

Referenced by CreateAgreement(), and SwitchToBlockAckIfNeeded().

+ Here is the caller graph for this function:

◆ ExistsAgreementInState()

bool ns3::BlockAckManager::ExistsAgreementInState ( Mac48Address  recipient,
uint8_t  tid,
OriginatorBlockAckAgreement::State  state 
) const
Parameters
recipientAddress of peer station involved in block ack mechanism.
tidTraffic ID.
stateThe state for block ack agreement
Returns
true if a block ack agreement exists, false otherwise

Checks if a block ack agreement with a state equals to state exists with station addressed by recipient for TID tid.

Definition at line 93 of file block-ack-manager.cc.

References ns3::OriginatorBlockAckAgreement::ESTABLISHED, m_agreements, ns3::OriginatorBlockAckAgreement::NO_REPLY, NS_FATAL_ERROR, ns3::OriginatorBlockAckAgreement::PENDING, ns3::OriginatorBlockAckAgreement::REJECTED, and ns3::OriginatorBlockAckAgreement::RESET.

Referenced by CreateAgreement(), NeedBarRetransmission(), NotifyDiscardedMpdu(), NotifyGotAck(), NotifyGotBlockAck(), NotifyMissedAck(), NotifyMissedBlockAck(), and SwitchToBlockAckIfNeeded().

+ Here is the caller graph for this function:

◆ GetBar()

Ptr< const WifiMacQueueItem > ns3::BlockAckManager::GetBar ( bool  remove = true,
uint8_t  tid = 8,
Mac48Address  recipient = Mac48Address::GetBroadcast () 
)

Returns the next BlockAckRequest or MU-BAR Trigger Frame to send, if any.

If the given recipient is not the broadcast address and the given TID is less than 8, then only return a BlockAckRequest, if any, addressed to that recipient and for the given TID.

Parameters
removetrue if the BAR has to be removed from the queue
tidthe TID
recipientthe recipient of the BAR
Returns
the next BAR to be sent, if any

Definition at line 265 of file block-ack-manager.cc.

References ns3::Packet::AddHeader(), first::address, ns3::Mac48Address::GetBroadcast(), ns3::CtrlBAckRequestHeader::GetStartingSequence(), m_agreements, m_bars, m_queue, ns3::Simulator::Now(), and ns3::CtrlBAckRequestHeader::SetStartingSequence().

+ Here is the call graph for this function:

◆ GetBlockAckReqHeader()

CtrlBAckRequestHeader ns3::BlockAckManager::GetBlockAckReqHeader ( Mac48Address  recipient,
uint8_t  tid 
) const
Parameters
recipientthe recipient
tidthe TID
Returns
the BlockAckRequest header for the established BA agreement

Get the BlockAckRequest header for the established BA agreement (recipient,tid).

Definition at line 646 of file block-ack-manager.cc.

References m_agreements, NS_ASSERT, NS_LOG_FUNCTION, ns3::CtrlBAckRequestHeader::SetStartingSequence(), ns3::CtrlBAckRequestHeader::SetTidInfo(), and ns3::CtrlBAckRequestHeader::SetType().

Referenced by NotifyDiscardedMpdu().

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

◆ GetBlockAckReqType()

BlockAckReqType ns3::BlockAckManager::GetBlockAckReqType ( Mac48Address  recipient,
uint8_t  tid 
) const

This function returns the type of Block Acks sent to the recipient.

Parameters
recipientMAC address of recipient
tidTraffic ID
Returns
the type of Block Acks sent to the recipient

Definition at line 874 of file block-ack-manager.cc.

References m_agreements, and NS_ABORT_MSG_IF.

◆ GetBlockAckType()

BlockAckType ns3::BlockAckManager::GetBlockAckType ( Mac48Address  recipient,
uint8_t  tid 
) const

This function returns the type of Block Acks sent by the recipient.

Parameters
recipientMAC address
tidTraffic ID
Returns
the type of Block Acks sent by the recipient

Definition at line 882 of file block-ack-manager.cc.

References m_agreements, and NS_ABORT_MSG_IF.

◆ GetNBufferedPackets()

uint32_t ns3::BlockAckManager::GetNBufferedPackets ( Mac48Address  recipient,
uint8_t  tid 
) const
Parameters
recipientAddress of peer station involved in block ack mechanism.
tidTraffic ID.
Returns
the number of packets buffered for a specified agreement

Returns the number of packets buffered for a specified agreement. This methods doesn't return the number of buffered MPDUs but the number of buffered MSDUs.

Definition at line 353 of file block-ack-manager.cc.

References m_agreements, and NS_LOG_FUNCTION.

Referenced by SwitchToBlockAckIfNeeded().

+ Here is the caller graph for this function:

◆ GetOriginatorStartingSequence()

uint16_t ns3::BlockAckManager::GetOriginatorStartingSequence ( Mac48Address  recipient,
uint8_t  tid 
) const

This function returns the starting sequence number of the transmit window.

Parameters
tidTraffic ID
recipientMAC address of the recipient
Returns
the starting sequence number of the transmit window (WinStartO)

Definition at line 890 of file block-ack-manager.cc.

References m_agreements.

◆ GetRecipientBufferSize()

uint16_t ns3::BlockAckManager::GetRecipientBufferSize ( Mac48Address  recipient,
uint8_t  tid 
) const

This function returns the buffer size negotiated with the recipient.

Parameters
tidTraffic ID
recipientMAC address of the recipient
Returns
the buffer size negotiated with the recipient

Definition at line 862 of file block-ack-manager.cc.

References m_agreements.

◆ GetTypeId()

TypeId ns3::BlockAckManager::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 52 of file block-ack-manager.cc.

References m_agreementState, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ HandleInFlightMpdu()

BlockAckManager::PacketQueueI ns3::BlockAckManager::HandleInFlightMpdu ( PacketQueueI  mpduIt,
MpduStatus  status,
const AgreementsI it,
const Time now 
)
private

Handle the given in flight MPDU based on its given status.

If the status is ACKNOWLEDGED, the MPDU is removed from both the EDCA queue and the queue of in flight MPDUs. If the status is TO_RETRANSMIT, the MPDU is only removed from the queue of in flight MPDUs. Note that the MPDU is removed from both queues (independently of the status) if the MPDU is not stored in the EDCA queue, is an old packet or its lifetime expired.

Parameters
mpduItan iterator pointing to the MPDU in the queue of in flight MPDUs
statusthe status of the in flight MPDU
ititerator pointing to the Block Ack agreement
nowthe current time
Returns
an iterator pointing to the next MPDU in the queue of in flight MPDUs

Definition at line 372 of file block-ack-manager.cc.

References ACKNOWLEDGED, ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiMacHeader::GetSequenceNumber(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::WifiMacHeader::IsQosData(), m_droppedOldMpduCallback, m_queue, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, prev, ns3::SEQNO_SPACE_HALF_SIZE, STAY_INFLIGHT, and TO_RETRANSMIT.

Referenced by NeedBarRetransmission(), NotifyGotAck(), NotifyGotBlockAck(), NotifyMissedAck(), and NotifyMissedBlockAck().

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

◆ InactivityTimeout()

void ns3::BlockAckManager::InactivityTimeout ( Mac48Address  recipient,
uint8_t  tid 
)
private

Inactivity timeout function.

Parameters
recipientthe recipient MAC address
tidTraffic ID

Definition at line 709 of file block-ack-manager.cc.

References m_blockAckInactivityTimeout, and NS_LOG_FUNCTION.

Referenced by NotifyGotBlockAck(), and UpdateAgreement().

+ Here is the caller graph for this function:

◆ NeedBarRetransmission()

bool ns3::BlockAckManager::NeedBarRetransmission ( uint8_t  tid,
Mac48Address  recipient 
)

This function returns true if a block ack agreement is established with the given recipient for the given TID and there is at least an outstanding MPDU for such agreement whose lifetime is not expired.

Parameters
tidTraffic ID
recipientMAC address of the recipient
Returns
true if BAR retransmission needed

Definition at line 794 of file block-ack-manager.cc.

References ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), HandleInFlightMpdu(), m_agreements, ns3::Simulator::Now(), NS_ASSERT, and STAY_INFLIGHT.

+ Here is the call graph for this function:

◆ NotifyAgreementEstablished()

void ns3::BlockAckManager::NotifyAgreementEstablished ( Mac48Address  recipient,
uint8_t  tid,
uint16_t  startingSeq 
)
Parameters
recipientAddress of peer station involved in block ack mechanism.
tidTraffic ID of transmitted packet.
startingSeqstarting sequence field

Puts corresponding agreement in established state and updates number of packets and starting sequence field. Invoked typically after a block ack refresh.

Definition at line 716 of file block-ack-manager.cc.

References ns3::OriginatorBlockAckAgreement::ESTABLISHED, m_agreements, m_agreementState, ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by SwitchToBlockAckIfNeeded().

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

◆ NotifyAgreementNoReply()

void ns3::BlockAckManager::NotifyAgreementNoReply ( Mac48Address  recipient,
uint8_t  tid 
)
Parameters
recipientAddress of peer station involved in block ack mechanism.
tidTraffic ID of transmitted packet.

Marks an agreement after not receiving response to ADDBA request. During this state any packets in queue will be transmitted using normal MPDU. This also unblock recipient address.

Definition at line 743 of file block-ack-manager.cc.

References m_agreements, m_agreementState, m_unblockPackets, ns3::OriginatorBlockAckAgreement::NO_REPLY, ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ NotifyAgreementRejected()

void ns3::BlockAckManager::NotifyAgreementRejected ( Mac48Address  recipient,
uint8_t  tid 
)
Parameters
recipientAddress of peer station involved in block ack mechanism.
tidTraffic ID of transmitted packet.

Marks an agreement as rejected. This happens if recipient station reject block ack setup by an ADDBA Response frame with a failure status code. For now we assume that every QoS station accepts a block ack setup.

Definition at line 730 of file block-ack-manager.cc.

References m_agreements, m_agreementState, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::OriginatorBlockAckAgreement::REJECTED.

+ Here is the call graph for this function:

◆ NotifyAgreementReset()

void ns3::BlockAckManager::NotifyAgreementReset ( Mac48Address  recipient,
uint8_t  tid 
)
Parameters
recipientAddress of peer station involved in block ack mechanism.
tidTraffic ID of transmitted packet.

Set BA agreement to a transitory state to reset it after not receiving response to ADDBA request.

Definition at line 757 of file block-ack-manager.cc.

References m_agreements, m_agreementState, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::OriginatorBlockAckAgreement::RESET.

+ Here is the call graph for this function:

◆ NotifyDiscardedMpdu()

void ns3::BlockAckManager::NotifyDiscardedMpdu ( Ptr< const WifiMacQueueItem mpdu)
Parameters
mpduthe discarded frame

Notify the block ack manager that an MPDU has been discarded, e.g., because the MSDU lifetime expired. If there is an established block ack agreement, make the transmit window advance beyond the discarded frame. This also involves (i) the removal of frames that consequently become old from the retransmit queue and from the queue of the block ack agreement, and (ii) the scheduling of a BlockAckRequest.

Definition at line 572 of file block-ack-manager.cc.

References ns3::Packet::AddHeader(), ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), GetBlockAckReqHeader(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_agreements, m_droppedOldMpduCallback, m_queue, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QosUtilsIsOldPacket(), ScheduleBar(), ns3::SEQNO_SPACE_HALF_SIZE, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiMacHeader::SetNoMoreFragments(), ns3::WifiMacHeader::SetNoRetry(), ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_CTL_BACKREQ.

Referenced by ns3::QosTxop::QosTxop().

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

◆ NotifyGotAck()

void ns3::BlockAckManager::NotifyGotAck ( Ptr< const WifiMacQueueItem mpdu)

Invoked upon receipt of an Ack frame after the transmission of a QoS data frame sent under an established block ack agreement.

Remove the acknowledged frame from the outstanding packets and update the starting sequence number of the transmit window, if needed.

Parameters
mpduThe acknowledged MPDU.

Definition at line 437 of file block-ack-manager.cc.

References ACKNOWLEDGED, ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), HandleInFlightMpdu(), m_agreements, ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ NotifyGotBlockAck()

std::pair< uint16_t, uint16_t > ns3::BlockAckManager::NotifyGotBlockAck ( const CtrlBAckResponseHeader blockAck,
Mac48Address  recipient,
const std::set< uint8_t > &  tids,
size_t  index = 0 
)
Parameters
blockAckThe received BlockAck frame.
recipientSender of BlockAck frame.
tidsthe set of TIDs the acknowledged MPDUs belong to
indexthe index of the Per AID TID Info subfield, in case of Multi-STA Block Ack, or 0, otherwise
Returns
a pair of values indicating the number of successfully received MPDUs and the number of failed MPDUs

Invoked upon receipt of a BlockAck frame. Typically, this function, is called by ns3::QosTxop object. Performs a check on which MPDUs, previously sent with Ack Policy set to Block Ack, were correctly received by the recipient. An acknowledged MPDU is removed from the buffer, retransmitted otherwise. Note that tids is only used if blockAck is a Multi-STA Block Ack using All-ack context.

Definition at line 488 of file block-ack-manager.cc.

References ACKNOWLEDGED, ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), ns3::CtrlBAckResponseHeader::GetAckType(), ns3::CtrlBAckResponseHeader::GetTidInfo(), HandleInFlightMpdu(), InactivityTimeout(), ns3::CtrlBAckResponseHeader::IsBasic(), ns3::CtrlBAckResponseHeader::IsCompressed(), ns3::CtrlBAckResponseHeader::IsExtendedCompressed(), ns3::CtrlBAckResponseHeader::IsMultiSta(), ns3::CtrlBAckResponseHeader::IsMultiTid(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::CtrlBAckResponseHeader::IsPacketReceived(), m_agreements, m_txFailedCallback, m_txOkCallback, ns3::MicroSeconds(), ns3::Simulator::Now(), NS_ABORT_MSG_IF, NS_ASSERT, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), timeout, and TO_RETRANSMIT.

+ Here is the call graph for this function:

◆ NotifyMissedAck()

void ns3::BlockAckManager::NotifyMissedAck ( Ptr< WifiMacQueueItem mpdu)

Invoked upon missed reception of an Ack frame after the transmission of a QoS data frame sent under an established block ack agreement.

Remove the acknowledged frame from the outstanding packets and insert it in the retransmission queue.

Parameters
mpduThe unacknowledged MPDU.

Definition at line 463 of file block-ack-manager.cc.

References ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), HandleInFlightMpdu(), m_agreements, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, and TO_RETRANSMIT.

+ Here is the call graph for this function:

◆ NotifyMissedBlockAck()

void ns3::BlockAckManager::NotifyMissedBlockAck ( Mac48Address  recipient,
uint8_t  tid 
)
Parameters
recipientSender of the expected BlockAck frame.
tidTraffic ID.

Invoked upon missed reception of a block ack frame. Typically, this function, is called by ns3::QosTxop object. Performs a check on which MPDUs, previously sent with ack policy set to Block Ack, should be placed in the retransmission queue.

Definition at line 554 of file block-ack-manager.cc.

References ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), HandleInFlightMpdu(), m_agreements, ns3::Simulator::Now(), NS_LOG_FUNCTION, and TO_RETRANSMIT.

+ Here is the call graph for this function:

◆ operator=()

BlockAckManager & ns3::BlockAckManager::operator= ( const BlockAckManager block)
private

assignment operator

Parameters
blockBlockAckManager to assign
Returns
the assigned BlockAckManager

◆ ScheduleBar()

void ns3::BlockAckManager::ScheduleBar ( Ptr< const WifiMacQueueItem bar,
bool  skipIfNoDataQueued = false 
)
Parameters
barthe BlockAckRequest to enqueue
skipIfNoDataQueueddo not send if there is no data queued

Enqueue the given BlockAckRequest into the queue storing the next BAR frames to transmit. If a BAR for the same recipient and TID is already present in the queue, it is replaced by the new one. If the given BAR is retransmitted, it is placed at the head of the queue, otherwise at the tail.

Definition at line 660 of file block-ack-manager.cc.

References ns3::CtrlBAckRequestHeader::GetTidInfo(), ns3::CtrlTriggerHeader::IsMuBar(), m_bars, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by NotifyDiscardedMpdu().

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

◆ SetBlockAckInactivityCallback()

void ns3::BlockAckManager::SetBlockAckInactivityCallback ( Callback< void, Mac48Address, uint8_t, bool >  callback)

Set block ack inactivity callback.

Parameters
callbackthe block ack inactivity callback function

Definition at line 823 of file block-ack-manager.cc.

References m_blockAckInactivityTimeout, and NS_LOG_FUNCTION.

◆ SetBlockAckThreshold()

void ns3::BlockAckManager::SetBlockAckThreshold ( uint8_t  nPackets)
Parameters
nPacketsMinimum number of packets for use of block ack.

Upon receipt of a BlockAck frame, if total number of packets (packets in WifiMacQueue and buffered packets) is greater of nPackets, they are transmitted using block ack mechanism.

Definition at line 365 of file block-ack-manager.cc.

References m_blockAckThreshold, and NS_LOG_FUNCTION.

◆ SetBlockDestinationCallback()

void ns3::BlockAckManager::SetBlockDestinationCallback ( Callback< void, Mac48Address, uint8_t >  callback)

Set block destination callback.

Parameters
callbackthe block destination callback

Definition at line 830 of file block-ack-manager.cc.

References m_blockPackets, and NS_LOG_FUNCTION.

◆ SetDroppedOldMpduCallback()

void ns3::BlockAckManager::SetDroppedOldMpduCallback ( DroppedOldMpdu  callback)
Parameters
callbackthe callback to invoke when an old MPDU is dropped

Definition at line 856 of file block-ack-manager.cc.

References m_droppedOldMpduCallback.

◆ SetQueue()

void ns3::BlockAckManager::SetQueue ( const Ptr< WifiMacQueue queue)
Parameters
queueThe WifiMacQueue object.

Definition at line 770 of file block-ack-manager.cc.

References m_queue, and NS_LOG_FUNCTION.

◆ SetTxFailedCallback()

void ns3::BlockAckManager::SetTxFailedCallback ( TxFailed  callback)
Parameters
callbackthe callback to invoke when a packet transmission was completed unsuccessfully.

Definition at line 850 of file block-ack-manager.cc.

References m_txFailedCallback.

◆ SetTxOkCallback()

void ns3::BlockAckManager::SetTxOkCallback ( TxOk  callback)
Parameters
callbackthe callback to invoke when a packet transmission was completed successfully.

Definition at line 844 of file block-ack-manager.cc.

References m_txOkCallback.

◆ SetUnblockDestinationCallback()

void ns3::BlockAckManager::SetUnblockDestinationCallback ( Callback< void, Mac48Address, uint8_t >  callback)

Set unblock destination callback.

Parameters
callbackthe unblock destination callback

Definition at line 837 of file block-ack-manager.cc.

References m_unblockPackets, and NS_LOG_FUNCTION.

◆ StorePacket()

void ns3::BlockAckManager::StorePacket ( Ptr< WifiMacQueueItem mpdu)
Parameters
mpduMPDU to store.

Stores mpdu for a possible future retransmission. Retransmission occurs if the packet, in a BlockAck frame, is indicated by recipient as not received.

Definition at line 219 of file block-ack-manager.cc.

References m_agreements, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::SEQNO_SPACE_HALF_SIZE.

◆ SwitchToBlockAckIfNeeded()

bool ns3::BlockAckManager::SwitchToBlockAckIfNeeded ( Mac48Address  recipient,
uint8_t  tid,
uint16_t  startingSeq 
)
Parameters
recipientthe destination address
tidthe Traffic ID
startingSeqthe starting sequence number
Returns
true if there are packets in the queue that could be sent under block ack, false otherwise

Checks if there are in the queue other packets that could be send under block ack. If yes adds these packets in current block ack exchange. However, number of packets exchanged in the current block ack, will not exceed the value of BufferSize in the corresponding OriginatorBlockAckAgreement object.

Definition at line 777 of file block-ack-manager.cc.

References ExistsAgreement(), ExistsAgreementInState(), GetNBufferedPackets(), m_blockAckThreshold, m_queue, NotifyAgreementEstablished(), NS_ASSERT, NS_LOG_FUNCTION, ns3::OriginatorBlockAckAgreement::PENDING, and ns3::OriginatorBlockAckAgreement::REJECTED.

+ Here is the call graph for this function:

◆ UpdateAgreement()

Member Data Documentation

◆ m_agreements

Agreements ns3::BlockAckManager::m_agreements
private

This data structure contains, for each block ack agreement (recipient, TID), a set of packets for which an ack by block ack is requested.

Every packet or fragment indicated as correctly received in BlockAck frame is erased from this data structure. Pushed back in retransmission queue otherwise.

Definition at line 484 of file block-ack-manager.h.

Referenced by CreateAgreement(), DestroyAgreement(), DoDispose(), ExistsAgreement(), ExistsAgreementInState(), GetBar(), GetBlockAckReqHeader(), GetBlockAckReqType(), GetBlockAckType(), GetNBufferedPackets(), GetOriginatorStartingSequence(), GetRecipientBufferSize(), NeedBarRetransmission(), NotifyAgreementEstablished(), NotifyAgreementNoReply(), NotifyAgreementRejected(), NotifyAgreementReset(), NotifyDiscardedMpdu(), NotifyGotAck(), NotifyGotBlockAck(), NotifyMissedAck(), NotifyMissedBlockAck(), StorePacket(), and UpdateAgreement().

◆ m_agreementState

TracedCallback<Time, Mac48Address, uint8_t, OriginatorBlockAckAgreement::State> ns3::BlockAckManager::m_agreementState
private

The trace source fired when a state transition occurred.

Definition at line 500 of file block-ack-manager.h.

Referenced by CreateAgreement(), GetTypeId(), NotifyAgreementEstablished(), NotifyAgreementNoReply(), NotifyAgreementRejected(), NotifyAgreementReset(), and UpdateAgreement().

◆ m_bars

std::list<Bar> ns3::BlockAckManager::m_bars
private

list of BARs

Definition at line 486 of file block-ack-manager.h.

Referenced by DestroyAgreement(), DoDispose(), GetBar(), and ScheduleBar().

◆ m_blockAckInactivityTimeout

Callback<void, Mac48Address, uint8_t, bool> ns3::BlockAckManager::m_blockAckInactivityTimeout
private

BlockAck inactivity timeout callback.

Definition at line 490 of file block-ack-manager.h.

Referenced by InactivityTimeout(), and SetBlockAckInactivityCallback().

◆ m_blockAckThreshold

uint8_t ns3::BlockAckManager::m_blockAckThreshold
private

block ack threshold

Definition at line 488 of file block-ack-manager.h.

Referenced by SetBlockAckThreshold(), and SwitchToBlockAckIfNeeded().

◆ m_blockPackets

Callback<void, Mac48Address, uint8_t> ns3::BlockAckManager::m_blockPackets
private

block packets callback

Definition at line 491 of file block-ack-manager.h.

Referenced by CreateAgreement(), and SetBlockDestinationCallback().

◆ m_droppedOldMpduCallback

DroppedOldMpdu ns3::BlockAckManager::m_droppedOldMpduCallback
private

the dropped MPDU callback

Definition at line 495 of file block-ack-manager.h.

Referenced by HandleInFlightMpdu(), NotifyDiscardedMpdu(), and SetDroppedOldMpduCallback().

◆ m_queue

Ptr<WifiMacQueue> ns3::BlockAckManager::m_queue
private

◆ m_txFailedCallback

TxFailed ns3::BlockAckManager::m_txFailedCallback
private

transmit failed callback

Definition at line 494 of file block-ack-manager.h.

Referenced by NotifyGotBlockAck(), and SetTxFailedCallback().

◆ m_txOkCallback

TxOk ns3::BlockAckManager::m_txOkCallback
private

transmit OK callback

Definition at line 493 of file block-ack-manager.h.

Referenced by NotifyGotBlockAck(), and SetTxOkCallback().

◆ m_unblockPackets

Callback<void, Mac48Address, uint8_t> ns3::BlockAckManager::m_unblockPackets
private

unblock packets callback

Definition at line 492 of file block-ack-manager.h.

Referenced by NotifyAgreementNoReply(), SetUnblockDestinationCallback(), and UpdateAgreement().


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