Manages all block ack agreements for an originator station. More...
#include "block-ack-manager.h"
Public Types | |
typedef void(* | AgreementStateTracedCallback) (Time now, Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state) |
TracedCallback signature for state changes. More... | |
typedef Callback< void, const WifiMacHeader & > | TxFailed |
typedef for a callback to invoke when a packet transmission was failed. More... | |
typedef Callback< void, const WifiMacHeader & > | TxOk |
typedef for a callback to invoke when a packet transmission was completed successfully. More... | |
Public Member Functions | |
BlockAckManager () | |
~BlockAckManager () | |
void | CreateAgreement (const MgtAddBaRequestHeader *reqHdr, Mac48Address recipient) |
void | DestroyAgreement (Mac48Address recipient, uint8_t tid) |
void | DiscardOutstandingMpdus (Mac48Address recipient, uint8_t tid) |
bool | ExistsAgreement (Mac48Address recipient, uint8_t tid) const |
bool | ExistsAgreementInState (Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state) const |
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 negociated with the recipient. More... | |
Ptr< WifiMacQueue > | GetRetransmitQueue (void) |
bool | HasBar (Bar &bar, bool remove=true) |
Returns true if the BAR is scheduled. More... | |
bool | HasPackets (void) const |
Returns true if there are packets that need of retransmission or at least a BAR is scheduled. More... | |
bool | NeedBarRetransmission (uint8_t tid, uint16_t seqNumber, Mac48Address recipient) |
This function returns true if the lifetime of the packets a BAR refers to didn't expire yet otherwise it returns false. 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... | |
void | NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, WifiMode txMode, double dataSnr) |
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 | NotifyMpduTransmission (Mac48Address recipient, uint8_t tid, uint16_t nextSeqNumber, WifiMacHeader::QosAckPolicy policy) |
void | ScheduleBlockAckReq (Mac48Address recipient, uint8_t tid) |
void | SetBlockAckInactivityCallback (Callback< void, Mac48Address, uint8_t, bool > callback) |
Set block ack inactivity callback. More... | |
void | SetBlockAckThreshold (uint8_t nPackets) |
void | SetBlockAckType (BlockAckType bAckType) |
void | SetBlockDestinationCallback (Callback< void, Mac48Address, uint8_t > callback) |
Set block destination callback. More... | |
void | SetQueue (const Ptr< WifiMacQueue > queue) |
void | SetTxFailedCallback (TxFailed callback) |
void | SetTxMiddle (const Ptr< MacTxMiddle > txMiddle) |
Set the MacTxMiddle. More... | |
void | SetTxOkCallback (TxOk callback) |
void | SetUnblockDestinationCallback (Callback< void, Mac48Address, uint8_t > callback) |
Set unblock destination callback. More... | |
void | SetWifiRemoteStationManager (const Ptr< WifiRemoteStationManager > manager) |
Set up WifiRemoteStationManager associated with this BlockAckManager. More... | |
void | StorePacket (Ptr< WifiMacQueueItem > mpdu) |
bool | SwitchToBlockAckIfNeeded (Mac48Address recipient, uint8_t tid, uint16_t startingSeq) |
void | UpdateAgreement (const MgtAddBaResponseHeader *respHdr, Mac48Address recipient) |
![]() | |
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<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. 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... | |
![]() | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
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... | |
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 TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. 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... | |
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... | |
void | InactivityTimeout (Mac48Address recipient, uint8_t tid) |
Inactivity timeout function. More... | |
void | InsertInRetryQueue (Ptr< WifiMacQueueItem > mpdu) |
BlockAckManager & | operator= (const BlockAckManager &block) |
assignment operator More... | |
void | RemoveFromRetryQueue (Mac48Address address, uint8_t tid, uint16_t seq) |
Remove an item from retransmission queue. More... | |
void | RemoveFromRetryQueue (Mac48Address address, uint8_t tid, uint16_t startSeq, uint16_t endSeq) |
Remove a range of items from retransmission queue. More... | |
void | SetStartingSequence (Mac48Address recipient, uint8_t tid, uint16_t startingSeq) |
Set the starting sequence number for the agreement with recipient equal to recipient and TID equal to tid to the given startingSeq. More... | |
Private Attributes | |
Mac48Address | m_address |
address More... | |
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::State > | m_agreementState |
The trace source fired when a state transition occured. More... | |
std::list< Bar > | m_bars |
list of BARs More... | |
Callback< void, Mac48Address, uint8_t, bool > | m_blockAckInactivityTimeout |
block ack inactivity timeout callback More... | |
uint8_t | m_blockAckThreshold |
block ack threshold More... | |
BlockAckType | m_blockAckType |
block ack type More... | |
Callback< void, Mac48Address, uint8_t > | m_blockPackets |
block packets callback More... | |
Ptr< WifiMacQueue > | m_queue |
queue More... | |
Ptr< WifiMacQueue > | m_retryPackets |
This list contains all iterators to stored packets that need to be retransmitted. More... | |
Ptr< WifiRemoteStationManager > | m_stationManager |
the station manager More... | |
TxFailed | m_txFailedCallback |
transmit failed callback More... | |
Ptr< MacTxMiddle > | m_txMiddle |
the MacTxMiddle More... | |
TxOk | m_txOkCallback |
transmit ok callback More... | |
Callback< void, Mac48Address, uint8_t > | m_unblockPackets |
unblock packets callback More... | |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Manages all block ack agreements for an originator station.
ns3::BlockAckManager is accessible through the following paths with Config::Set and Config::Connect:
No Attributes are defined for this type.
Size of this type is 200 bytes (on a 64-bit architecture).
Definition at line 75 of file block-ack-manager.h.
|
private |
typedef for a map between MAC address and block ACK agreement.
Definition at line 460 of file block-ack-manager.h.
|
private |
typedef for a const iterator for Agreements.
Definition at line 470 of file block-ack-manager.h.
|
private |
typedef for an iterator for Agreements.
Definition at line 465 of file block-ack-manager.h.
typedef void(* ns3::BlockAckManager::AgreementStateTracedCallback) (Time now, Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state) |
TracedCallback signature for state changes.
[in] | now | Time when the state changed. |
[in] | recipient | MAC address of the recipient. |
[in] | tid | the TID. |
[in] | state | The state. |
Definition at line 398 of file block-ack-manager.h.
|
private |
typedef for a list of WifiMacQueueItem.
Definition at line 447 of file block-ack-manager.h.
|
private |
typedef for a const iterator for PacketQueue.
Definition at line 455 of file block-ack-manager.h.
|
private |
typedef for an iterator for PacketQueue.
Definition at line 451 of file block-ack-manager.h.
typedef Callback<void, const WifiMacHeader&> ns3::BlockAckManager::TxFailed |
typedef for a callback to invoke when a packet transmission was failed.
Definition at line 378 of file block-ack-manager.h.
typedef Callback<void, const WifiMacHeader&> ns3::BlockAckManager::TxOk |
typedef for a callback to invoke when a packet transmission was completed successfully.
Definition at line 373 of file block-ack-manager.h.
|
private |
type conversion operator
ns3::BlockAckManager::BlockAckManager | ( | ) |
Definition at line 66 of file block-ack-manager.cc.
References m_retryPackets, ns3::MakeCallback(), NotifyDiscardedMpdu(), and NS_LOG_FUNCTION.
ns3::BlockAckManager::~BlockAckManager | ( | ) |
Definition at line 73 of file block-ack-manager.cc.
References m_agreements, m_queue, m_retryPackets, and NS_LOG_FUNCTION.
void ns3::BlockAckManager::CreateAgreement | ( | const MgtAddBaRequestHeader * | reqHdr, |
Mac48Address | recipient | ||
) |
reqHdr | Relative Add block ack request (action frame). |
recipient | Address of peer station involved in block ack mechanism. |
Creates a new block ack agreement in pending state. When a ADDBA response with a successful status code is received, the relative agreement becomes established.
Definition at line 116 of file block-ack-manager.cc.
References ExistsAgreement(), ExistsAgreementInState(), ns3::MgtAddBaRequestHeader::GetBufferSize(), ns3::WifiRemoteStationManager::GetHtSupported(), ns3::MgtAddBaRequestHeader::GetStartingSequence(), ns3::MgtAddBaRequestHeader::GetTid(), ns3::MgtAddBaRequestHeader::GetTimeout(), ns3::MgtAddBaRequestHeader::IsAmsduSupported(), ns3::MgtAddBaRequestHeader::IsImmediateBlockAck(), m_agreements, m_agreementState, m_blockPackets, m_stationManager, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, ns3::OriginatorBlockAckAgreement::PENDING, ns3::OriginatorBlockAckAgreement::RESET, ns3::SEQNO_SPACE_SIZE, and ns3::BlockAckAgreement::SetStartingSequence().
void ns3::BlockAckManager::DestroyAgreement | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) |
recipient | Address of peer station involved in block ack mechanism. |
tid | Tid Traffic id of transmitted packet. |
Invoked when a recipient reject a block ack agreement or when a Delba frame is Received/Transmitted.
Definition at line 153 of file block-ack-manager.cc.
References m_agreements, m_bars, m_retryPackets, and NS_LOG_FUNCTION.
void ns3::BlockAckManager::DiscardOutstandingMpdus | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) |
recipient | outstanding frames' receiver. |
tid | Traffic ID. |
Discard all the outstanding MPDUs destined to the given receiver and belonging to the given TID. Typically, this function is called by ns3::QosTxop object when it gives up retransmitting either a Block Ack Request or the data frames.
Definition at line 529 of file block-ack-manager.cc.
References ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), m_agreements, and NS_LOG_FUNCTION.
bool ns3::BlockAckManager::ExistsAgreement | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) | const |
recipient | Address of peer station involved in block ack mechanism. |
tid | Traffic ID. |
Checks if a block ack agreement exists with station addressed by recipient for tid tid.
Definition at line 82 of file block-ack-manager.cc.
References m_agreements, and NS_LOG_FUNCTION.
Referenced by CreateAgreement(), and SwitchToBlockAckIfNeeded().
bool ns3::BlockAckManager::ExistsAgreementInState | ( | Mac48Address | recipient, |
uint8_t | tid, | ||
OriginatorBlockAckAgreement::State | state | ||
) | const |
recipient | Address of peer station involved in block ack mechanism. |
tid | Traffic ID. |
state | The state for block ack agreement |
Checks if a block ack agreement with a state equals to state exists with station addressed by recipient for tid tid.
Definition at line 89 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(), DiscardOutstandingMpdus(), NotifyDiscardedMpdu(), NotifyGotAck(), NotifyGotBlockAck(), NotifyMissedAck(), NotifyMissedBlockAck(), and SwitchToBlockAckIfNeeded().
uint32_t ns3::BlockAckManager::GetNBufferedPackets | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) | const |
recipient | Address of peer station involved in block ack mechanism. |
tid | Traffic ID. |
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 300 of file block-ack-manager.cc.
References m_agreements, and NS_LOG_FUNCTION.
Referenced by SwitchToBlockAckIfNeeded().
uint16_t ns3::BlockAckManager::GetOriginatorStartingSequence | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) | const |
This function returns the starting sequence number of the transmit window.
tid | Traffic ID |
recipient | MAC address |
Definition at line 917 of file block-ack-manager.cc.
References m_agreements.
uint16_t ns3::BlockAckManager::GetRecipientBufferSize | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) | const |
This function returns the buffer size negociated with the recipient.
tid | Traffic ID |
recipient | MAC address |
Definition at line 905 of file block-ack-manager.cc.
References m_agreements.
Ptr< WifiMacQueue > ns3::BlockAckManager::GetRetransmitQueue | ( | void | ) |
Return the retransmit queue.
Definition at line 227 of file block-ack-manager.cc.
References m_retryPackets.
|
static |
Get the type ID.
Definition at line 52 of file block-ack-manager.cc.
References m_agreementState, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
bool ns3::BlockAckManager::HasBar | ( | Bar & | bar, |
bool | remove = true |
||
) |
Returns true if the BAR is scheduled.
Returns false otherwise.
bar | |
remove | true if the BAR has to be removed from the queue |
Definition at line 278 of file block-ack-manager.cc.
References m_bars.
bool ns3::BlockAckManager::HasPackets | ( | void | ) | const |
Returns true if there are packets that need of retransmission or at least a BAR is scheduled.
Returns false otherwise.
Definition at line 293 of file block-ack-manager.cc.
References m_bars, m_retryPackets, and NS_LOG_FUNCTION.
|
private |
Inactivity timeout function.
recipient | the recipient MAC address |
tid | Traffic ID |
Definition at line 613 of file block-ack-manager.cc.
References m_blockAckInactivityTimeout, and NS_LOG_FUNCTION.
Referenced by NotifyGotBlockAck(), and UpdateAgreement().
|
private |
mpdu | the packet to insert in the retransmission queue |
Insert mpdu in retransmission queue. This method ensures packets are retransmitted in the correct order.
Definition at line 861 of file block-ack-manager.cc.
References m_agreements, m_retryPackets, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_INFO, ns3::SEQNO_SPACE_HALF_SIZE, and ns3::SEQNO_SPACE_SIZE.
Referenced by NotifyGotBlockAck(), NotifyMissedAck(), and NotifyMissedBlockAck().
bool ns3::BlockAckManager::NeedBarRetransmission | ( | uint8_t | tid, |
uint16_t | seqNumber, | ||
Mac48Address | recipient | ||
) |
This function returns true if the lifetime of the packets a BAR refers to didn't expire yet otherwise it returns false.
If it return false then the BAR will be discarded (i.e. will not be re-transmitted)
tid | Traffic ID |
seqNumber | sequence number |
recipient | MAC address |
Definition at line 710 of file block-ack-manager.cc.
References m_agreements, NS_ASSERT, and ns3::QosUtilsIsOldPacket().
void ns3::BlockAckManager::NotifyAgreementEstablished | ( | Mac48Address | recipient, |
uint8_t | tid, | ||
uint16_t | startingSeq | ||
) |
recipient | Address of peer station involved in block ack mechanism. |
tid | Traffic ID of transmitted packet. |
startingSeq | starting 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 620 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().
void ns3::BlockAckManager::NotifyAgreementNoReply | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) |
recipient | Address of peer station involved in block ack mechanism. |
tid | Traffic 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 adress.
Definition at line 647 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.
void ns3::BlockAckManager::NotifyAgreementRejected | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) |
recipient | Address of peer station involved in block ack mechanism. |
tid | Traffic 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 634 of file block-ack-manager.cc.
References m_agreements, m_agreementState, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::OriginatorBlockAckAgreement::REJECTED.
void ns3::BlockAckManager::NotifyAgreementReset | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) |
recipient | Address of peer station involved in block ack mechanism. |
tid | Traffic ID of transmitted packet. |
Set BA agreement to a transitory state to reset it after not receiving response to ADDBA request.
Definition at line 661 of file block-ack-manager.cc.
References m_agreements, m_agreementState, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::OriginatorBlockAckAgreement::RESET.
void ns3::BlockAckManager::NotifyDiscardedMpdu | ( | Ptr< const WifiMacQueueItem > | mpdu | ) |
mpdu | the 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 block ack request.
Definition at line 547 of file block-ack-manager.cc.
References ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), m_agreements, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QosUtilsIsOldPacket(), ScheduleBlockAckReq(), ns3::SEQNO_SPACE_SIZE, and SetStartingSequence().
Referenced by BlockAckManager().
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.
mpdu | The acknowledged MPDU. |
Definition at line 338 of file block-ack-manager.cc.
References ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), m_agreements, NS_ASSERT, NS_LOG_FUNCTION, and ns3::SEQNO_SPACE_SIZE.
void ns3::BlockAckManager::NotifyGotBlockAck | ( | const CtrlBAckResponseHeader * | blockAck, |
Mac48Address | recipient, | ||
double | rxSnr, | ||
WifiMode | txMode, | ||
double | dataSnr | ||
) |
blockAck | The received block ack frame. |
recipient | Sender of block ack frame. |
rxSnr | received SNR of the block ack frame itself |
txMode | mode of block ack frame. |
dataSnr | data SNR reported by remote station |
Invoked upon receipt 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, were correctly received by the recipient. An acknowledged MPDU is removed from the buffer, retransmitted otherwise.
Definition at line 405 of file block-ack-manager.cc.
References ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), ns3::CtrlBAckResponseHeader::GetTidInfo(), ns3::WifiMode::GetUniqueName(), InactivityTimeout(), InsertInRetryQueue(), ns3::CtrlBAckResponseHeader::IsBasic(), ns3::CtrlBAckResponseHeader::IsCompressed(), ns3::CtrlBAckResponseHeader::IsExtendedCompressed(), ns3::CtrlBAckResponseHeader::IsFragmentReceived(), ns3::CtrlBAckResponseHeader::IsMultiTid(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::CtrlBAckResponseHeader::IsPacketReceived(), m_agreements, m_stationManager, m_txFailedCallback, m_txOkCallback, ns3::MicroSeconds(), NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::QosUtilsIsOldPacket(), ns3::WifiRemoteStationManager::ReportAmpduTxStatus(), ns3::Simulator::Schedule(), ns3::SEQNO_SPACE_SIZE, SetStartingSequence(), and timeout.
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.
mpdu | The unacknowledged MPDU. |
Definition at line 373 of file block-ack-manager.cc.
References ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), InsertInRetryQueue(), m_agreements, NS_ASSERT, and NS_LOG_FUNCTION.
void ns3::BlockAckManager::NotifyMissedBlockAck | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) |
recipient | Sender of the expected block ack frame. |
tid | Traffic 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 511 of file block-ack-manager.cc.
References ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), InsertInRetryQueue(), m_agreements, and NS_LOG_FUNCTION.
void ns3::BlockAckManager::NotifyMpduTransmission | ( | Mac48Address | recipient, |
uint8_t | tid, | ||
uint16_t | nextSeqNumber, | ||
WifiMacHeader::QosAckPolicy | policy | ||
) |
recipient | Address of peer station involved in block ack mechanism. |
tid | Traffic ID of transmitted packet. |
nextSeqNumber | Sequence number of the next packet that would be trasmitted by QosTxop. |
policy | ack policy of the transmitted packet. |
This method is typically invoked by ns3::QosTxop object every time that a MPDU with ack policy subfield in Qos Control field set to Block Ack is transmitted. The nextSeqNumber parameter is used to block transmission of packets that are out of bitmap.
Definition at line 674 of file block-ack-manager.cc.
References ns3::WifiMacHeader::BLOCK_ACK, m_agreements, NS_ASSERT, NS_LOG_FUNCTION, and ScheduleBlockAckReq().
|
private |
|
private |
Remove an item from retransmission queue.
This method should be called when packets are acknowledged.
address | recipient mac address of the packet to be removed |
tid | Traffic ID of the packet to be removed |
seq | sequence number of the packet to be removed |
Definition at line 740 of file block-ack-manager.cc.
References first::address.
Referenced by SetStartingSequence().
|
private |
Remove a range of items from retransmission queue.
This method should be called when packets are acknowledged.
address | recipient mac address of the packet to be removed |
tid | Traffic ID of the packet to be removed |
startSeq | sequence number of the first packet to be removed |
endSeq | sequence number of the last packet to be removed |
Definition at line 746 of file block-ack-manager.cc.
References first::address, m_agreements, m_retryPackets, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::SEQNO_SPACE_SIZE.
void ns3::BlockAckManager::ScheduleBlockAckReq | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) |
recipient | the recipient |
tid | the TID |
Enqueue a block ack request for the established BA agreement (recipient,tid) into the queue storing the next BAR frames to transmit. If a BAR for the given agreement is already present in the queue, it is replaced by the new one.
Definition at line 582 of file block-ack-manager.cc.
References ns3::Packet::AddHeader(), m_agreements, m_bars, m_blockAckType, NS_ASSERT, NS_LOG_FUNCTION, ns3::CtrlBAckRequestHeader::SetStartingSequence(), ns3::CtrlBAckRequestHeader::SetTidInfo(), and ns3::CtrlBAckRequestHeader::SetType().
Referenced by NotifyDiscardedMpdu(), and NotifyMpduTransmission().
void ns3::BlockAckManager::SetBlockAckInactivityCallback | ( | Callback< void, Mac48Address, uint8_t, bool > | callback | ) |
Set block ack inactivity callback.
callback | the block ack inactivity callback function |
Definition at line 821 of file block-ack-manager.cc.
References m_blockAckInactivityTimeout, and NS_LOG_FUNCTION.
void ns3::BlockAckManager::SetBlockAckThreshold | ( | uint8_t | nPackets | ) |
nPackets | Minimum number of packets for use of block ack. |
Upon receipt of a block ack 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 324 of file block-ack-manager.cc.
References m_blockAckThreshold, and NS_LOG_FUNCTION.
void ns3::BlockAckManager::SetBlockAckType | ( | BlockAckType | bAckType | ) |
bAckType | Type of block ack |
See ctrl-headers.h for more details.
Definition at line 540 of file block-ack-manager.cc.
References m_blockAckType, and NS_LOG_FUNCTION.
void ns3::BlockAckManager::SetBlockDestinationCallback | ( | Callback< void, Mac48Address, uint8_t > | callback | ) |
Set block destination callback.
callback | the block destination callback |
Definition at line 828 of file block-ack-manager.cc.
References m_blockPackets, and NS_LOG_FUNCTION.
void ns3::BlockAckManager::SetQueue | ( | const Ptr< WifiMacQueue > | queue | ) |
queue | The WifiMacQueue object. |
Definition at line 686 of file block-ack-manager.cc.
References m_queue, and NS_LOG_FUNCTION.
|
private |
Set the starting sequence number for the agreement with recipient equal to recipient and TID equal to tid to the given startingSeq.
Also, remove packets that became old from the retransmit queue and from the queue of outstanding packets.
recipient | the recipient MAC address |
tid | Traffic ID |
startingSeq | the new starting sequence number |
Definition at line 778 of file block-ack-manager.cc.
References m_agreements, NS_ABORT_MSG_IF, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, RemoveFromRetryQueue(), ns3::SEQNO_SPACE_HALF_SIZE, and ns3::SEQNO_SPACE_SIZE.
Referenced by NotifyDiscardedMpdu(), and NotifyGotBlockAck().
void ns3::BlockAckManager::SetTxFailedCallback | ( | TxFailed | callback | ) |
callback | the callback to invoke when a packet transmission was completed unsuccessfully. |
Definition at line 855 of file block-ack-manager.cc.
References m_txFailedCallback.
void ns3::BlockAckManager::SetTxMiddle | ( | const Ptr< MacTxMiddle > | txMiddle | ) |
Set the MacTxMiddle.
txMiddle | the MacTxMiddle |
Definition at line 842 of file block-ack-manager.cc.
References m_txMiddle, and NS_LOG_FUNCTION.
void ns3::BlockAckManager::SetTxOkCallback | ( | TxOk | callback | ) |
callback | the callback to invoke when a packet transmission was completed successfully. |
Definition at line 849 of file block-ack-manager.cc.
References m_txOkCallback.
void ns3::BlockAckManager::SetUnblockDestinationCallback | ( | Callback< void, Mac48Address, uint8_t > | callback | ) |
Set unblock destination callback.
callback | the unblock destination callback |
Definition at line 835 of file block-ack-manager.cc.
References m_unblockPackets, and NS_LOG_FUNCTION.
void ns3::BlockAckManager::SetWifiRemoteStationManager | ( | const Ptr< WifiRemoteStationManager > | manager | ) |
Set up WifiRemoteStationManager associated with this BlockAckManager.
manager | WifiRemoteStationManager associated with this BlockAckManager |
Definition at line 331 of file block-ack-manager.cc.
References m_stationManager, and NS_LOG_FUNCTION.
void ns3::BlockAckManager::StorePacket | ( | Ptr< WifiMacQueueItem > | mpdu | ) |
mpdu | MPDU to store. |
Stores mpdu for a possible future retransmission. Retransmission occurs if the packet, in a block ack frame, is indicated by recipient as not received.
Definition at line 233 of file block-ack-manager.cc.
References m_agreements, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::SEQNO_SPACE_HALF_SIZE, and ns3::SEQNO_SPACE_SIZE.
bool ns3::BlockAckManager::SwitchToBlockAckIfNeeded | ( | Mac48Address | recipient, |
uint8_t | tid, | ||
uint16_t | startingSeq | ||
) |
recipient | the destination address |
tid | the Traffic ID |
startingSeq |
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 693 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.
void ns3::BlockAckManager::UpdateAgreement | ( | const MgtAddBaResponseHeader * | respHdr, |
Mac48Address | recipient | ||
) |
respHdr | Relative Add block ack response (action frame). |
recipient | Address of peer station involved in block ack mechanism. |
Invoked upon receipt of a ADDBA response frame from recipient.
Definition at line 187 of file block-ack-manager.cc.
References ns3::OriginatorBlockAckAgreement::ESTABLISHED, ns3::MgtAddBaResponseHeader::GetBufferSize(), ns3::MgtAddBaResponseHeader::GetTid(), ns3::BlockAckAgreement::GetTimeout(), ns3::MgtAddBaResponseHeader::GetTimeout(), InactivityTimeout(), ns3::MgtAddBaResponseHeader::IsAmsduSupported(), ns3::MgtAddBaResponseHeader::IsImmediateBlockAck(), m_agreements, m_agreementState, ns3::BlockAckAgreement::m_inactivityEvent, m_txMiddle, m_unblockPackets, ns3::MicroSeconds(), ns3::Simulator::Now(), NS_LOG_FUNCTION, ns3::Simulator::Schedule(), ns3::BlockAckAgreement::SetAmsduSupport(), ns3::BlockAckAgreement::SetBufferSize(), ns3::BlockAckAgreement::SetDelayedBlockAck(), ns3::BlockAckAgreement::SetImmediateBlockAck(), ns3::BlockAckAgreement::SetStartingSequence(), ns3::OriginatorBlockAckAgreement::SetState(), ns3::BlockAckAgreement::SetTimeout(), and timeout.
|
private |
address
Definition at line 520 of file block-ack-manager.h.
|
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 block ack frame is erased from this data structure. Pushed back in retransmission queue otherwise.
Definition at line 507 of file block-ack-manager.h.
Referenced by CreateAgreement(), DestroyAgreement(), DiscardOutstandingMpdus(), ExistsAgreement(), ExistsAgreementInState(), GetNBufferedPackets(), GetOriginatorStartingSequence(), GetRecipientBufferSize(), InsertInRetryQueue(), NeedBarRetransmission(), NotifyAgreementEstablished(), NotifyAgreementNoReply(), NotifyAgreementRejected(), NotifyAgreementReset(), NotifyDiscardedMpdu(), NotifyGotAck(), NotifyGotBlockAck(), NotifyMissedAck(), NotifyMissedBlockAck(), NotifyMpduTransmission(), RemoveFromRetryQueue(), ScheduleBlockAckReq(), SetStartingSequence(), StorePacket(), UpdateAgreement(), and ~BlockAckManager().
|
private |
The trace source fired when a state transition occured.
Definition at line 532 of file block-ack-manager.h.
Referenced by CreateAgreement(), GetTypeId(), NotifyAgreementEstablished(), NotifyAgreementNoReply(), NotifyAgreementRejected(), NotifyAgreementReset(), and UpdateAgreement().
list of BARs
Definition at line 515 of file block-ack-manager.h.
Referenced by DestroyAgreement(), HasBar(), HasPackets(), and ScheduleBlockAckReq().
|
private |
block ack inactivity timeout callback
Definition at line 522 of file block-ack-manager.h.
Referenced by InactivityTimeout(), and SetBlockAckInactivityCallback().
|
private |
block ack threshold
Definition at line 517 of file block-ack-manager.h.
Referenced by SetBlockAckThreshold(), and SwitchToBlockAckIfNeeded().
|
private |
block ack type
Definition at line 518 of file block-ack-manager.h.
Referenced by ScheduleBlockAckReq(), and SetBlockAckType().
|
private |
block packets callback
Definition at line 523 of file block-ack-manager.h.
Referenced by CreateAgreement(), and SetBlockDestinationCallback().
|
private |
queue
Definition at line 521 of file block-ack-manager.h.
Referenced by SetQueue(), SwitchToBlockAckIfNeeded(), and ~BlockAckManager().
|
private |
This list contains all iterators to stored packets that need to be retransmitted.
A packet needs retransmission if it's indicated as not correctly received in a block ack frame.
Definition at line 514 of file block-ack-manager.h.
Referenced by BlockAckManager(), DestroyAgreement(), GetRetransmitQueue(), HasPackets(), InsertInRetryQueue(), RemoveFromRetryQueue(), and ~BlockAckManager().
|
private |
the station manager
Definition at line 527 of file block-ack-manager.h.
Referenced by CreateAgreement(), NotifyGotBlockAck(), and SetWifiRemoteStationManager().
|
private |
transmit failed callback
Definition at line 526 of file block-ack-manager.h.
Referenced by NotifyGotBlockAck(), and SetTxFailedCallback().
|
private |
the MacTxMiddle
Definition at line 519 of file block-ack-manager.h.
Referenced by SetTxMiddle(), and UpdateAgreement().
|
private |
transmit ok callback
Definition at line 525 of file block-ack-manager.h.
Referenced by NotifyGotBlockAck(), and SetTxOkCallback().
|
private |
unblock packets callback
Definition at line 524 of file block-ack-manager.h.
Referenced by NotifyAgreementNoReply(), SetUnblockDestinationCallback(), and UpdateAgreement().