Manages all block ack agreements for an originator station. More...
#include <block-ack-manager.h>
Classes | |
struct | Item |
A struct for packet, Wifi header, and timestamp. More... | |
Public Types | |
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 () | |
bool | AlreadyExists (uint16_t currentSeq, Mac48Address recipient, uint8_t tid) |
Checks if the packet already exists in the retransmit queue or not if it does then it doesn't add it again. More... | |
void | CompleteAmpduExchange (Mac48Address recipient, uint8_t tid) |
void | CreateAgreement (const MgtAddBaRequestHeader *reqHdr, Mac48Address recipient) |
void | DestroyAgreement (Mac48Address recipient, uint8_t tid) |
bool | ExistsAgreement (Mac48Address recipient, uint8_t tid) const |
bool | ExistsAgreementInState (Mac48Address recipient, uint8_t tid, enum OriginatorBlockAckAgreement::State state) const |
uint32_t | GetNBufferedPackets (Mac48Address recipient, uint8_t tid) const |
Ptr< const Packet > | GetNextPacket (WifiMacHeader &hdr) |
uint32_t | GetNextPacketSize (void) const |
uint32_t | GetNRetryNeededPackets (Mac48Address recipient, uint8_t tid) const |
uint16_t | GetSeqNumOfNextRetryPacket (Mac48Address recipient, uint8_t tid) const |
bool | HasBar (struct Bar &bar) |
bool | HasOtherFragments (uint16_t sequenceNumber) const |
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 else it returns false. More... | |
void | NotifyAgreementEstablished (Mac48Address recipient, uint8_t tid, uint16_t startingSeq) |
void | NotifyAgreementUnsuccessful (Mac48Address recipient, uint8_t tid) |
void | NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, WifiMode txMode) |
void | NotifyMpduTransmission (Mac48Address recipient, uint8_t tid, uint16_t nextSeqNumber, WifiMacHeader::QosAckPolicy policy) |
Ptr< const Packet > | PeekNextPacket (WifiMacHeader &hdr, Mac48Address recipient, uint8_t tid, Time *timestamp) |
bool | RemovePacket (uint8_t tid, Mac48Address recipient, uint16_t seqnumber) |
Remove a packet after you peek in the queue and get it. More... | |
void | SetBlockAckInactivityCallback (Callback< void, Mac48Address, uint8_t, bool > callback) |
void | SetBlockAckThreshold (uint8_t nPackets) |
void | SetBlockAckType (enum BlockAckType bAckType) |
void | SetBlockDestinationCallback (Callback< void, Mac48Address, uint8_t > callback) |
void | SetMaxPacketDelay (Time maxDelay) |
void | SetQueue (Ptr< WifiMacQueue > queue) |
void | SetTxFailedCallback (TxFailed callback) |
void | SetTxMiddle (MacTxMiddle *txMiddle) |
void | SetTxOkCallback (TxOk callback) |
void | SetUnblockDestinationCallback (Callback< void, Mac48Address, uint8_t > callback) |
void | SetWifiRemoteStationManager (Ptr< WifiRemoteStationManager > manager) |
Set up WifiRemoteStationManager associated with this BlockAckManager. More... | |
void | StorePacket (Ptr< const Packet > packet, const WifiMacHeader &hdr, Time tStamp) |
bool | SwitchToBlockAckIfNeeded (Mac48Address recipient, uint8_t tid, uint16_t startingSeq) |
void | TearDownBlockAck (Mac48Address recipient, uint8_t tid) |
void | UpdateAgreement (const MgtAddBaResponseHeader *respHdr, Mac48Address recipient) |
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< Item > | PacketQueue |
typedef for a list of Item struct. More... | |
typedef std::list< Item >::const_iterator | PacketQueueCI |
typedef for a const iterator for PacketQueue. More... | |
typedef std::list< Item >::iterator | PacketQueueI |
typedef for an iterator for PacketQueue. More... | |
Private Member Functions | |
BlockAckManager (const BlockAckManager &) | |
void | CleanupBuffers (void) |
This method removes packets whose lifetime was exceeded. More... | |
void | InactivityTimeout (Mac48Address, uint8_t) |
void | InsertInRetryQueue (PacketQueueI item) |
BlockAckManager & | operator= (const BlockAckManager &) |
Ptr< Packet > | ScheduleBlockAckReqIfNeeded (Mac48Address recipient, uint8_t tid) |
Private Attributes | |
Mac48Address | m_address |
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... | |
std::list< Bar > | m_bars |
Callback< void, Mac48Address, uint8_t, bool > | m_blockAckInactivityTimeout |
uint8_t | m_blockAckThreshold |
enum BlockAckType | m_blockAckType |
Callback< void, Mac48Address, uint8_t > | m_blockPackets |
Time | m_maxDelay |
Ptr< WifiMacQueue > | m_queue |
std::list< PacketQueueI > | m_retryPackets |
This list contains all iterators to stored packets that need to be retransmitted. More... | |
Ptr< WifiRemoteStationManager > | m_stationManager |
TxFailed | m_txFailedCallback |
MacTxMiddle * | m_txMiddle |
TxOk | m_txOkCallback |
Callback< void, Mac48Address, uint8_t > | m_unblockPackets |
Manages all block ack agreements for an originator station.
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 377 of file block-ack-manager.h.
|
private |
typedef for a const iterator for Agreements.
Definition at line 387 of file block-ack-manager.h.
|
private |
typedef for an iterator for Agreements.
Definition at line 382 of file block-ack-manager.h.
|
private |
typedef for a list of Item struct.
Definition at line 359 of file block-ack-manager.h.
|
private |
typedef for a const iterator for PacketQueue.
Definition at line 371 of file block-ack-manager.h.
|
private |
typedef for an iterator for PacketQueue.
Definition at line 367 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 329 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 324 of file block-ack-manager.h.
|
private |
ns3::BlockAckManager::BlockAckManager | ( | ) |
Definition at line 66 of file block-ack-manager.cc.
References NS_LOG_FUNCTION.
ns3::BlockAckManager::~BlockAckManager | ( | ) |
Definition at line 71 of file block-ack-manager.cc.
References m_agreements, m_queue, m_retryPackets, and NS_LOG_FUNCTION.
bool ns3::BlockAckManager::AlreadyExists | ( | uint16_t | currentSeq, |
Mac48Address | recipient, | ||
uint8_t | tid | ||
) |
Checks if the packet already exists in the retransmit queue or not if it does then it doesn't add it again.
Definition at line 489 of file block-ack-manager.cc.
References m_retryPackets, and NS_LOG_FUNCTION.
Referenced by NotifyGotBlockAck().
|
private |
This method removes packets whose lifetime was exceeded.
Definition at line 790 of file block-ack-manager.cc.
References m_agreements, m_maxDelay, m_retryPackets, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
Referenced by GetNextPacket(), NeedBarRetransmission(), and PeekNextPacket().
void ns3::BlockAckManager::CompleteAmpduExchange | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) |
recipient | Address of peer station involved in block ack mechanism. |
tid | Traffic ID of transmitted packet. |
This method to set the number of packets waitin for blockAck = 0 since the receiver will send the blockAck right away
Definition at line 240 of file block-ack-manager.cc.
References ns3::OriginatorBlockAckAgreement::CompleteExchange(), m_agreements, and NS_ASSERT.
Referenced by ns3::EdcaTxopN::CompleteAmpduTransfer().
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 113 of file block-ack-manager.cc.
References ns3::MgtAddBaRequestHeader::GetStartingSequence(), ns3::MgtAddBaRequestHeader::GetTid(), ns3::MgtAddBaRequestHeader::GetTimeout(), ns3::MgtAddBaRequestHeader::IsAmsduSupported(), ns3::MgtAddBaRequestHeader::IsImmediateBlockAck(), m_agreements, m_blockPackets, m_stationManager, NS_LOG_FUNCTION, ns3::OriginatorBlockAckAgreement::PENDING, and ns3::BlockAckAgreement::SetStartingSequence().
Referenced by ns3::EdcaTxopN::SendAddBaRequest().
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 142 of file block-ack-manager.cc.
References m_agreements, m_bars, m_retryPackets, and NS_LOG_FUNCTION.
Referenced by TearDownBlockAck().
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 80 of file block-ack-manager.cc.
References m_agreements, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::GetBaAgreementExists(), GetNBufferedPackets(), GetNRetryNeededPackets(), ns3::EdcaTxopN::NotifyAccessGranted(), and SwitchToBlockAckIfNeeded().
bool ns3::BlockAckManager::ExistsAgreementInState | ( | Mac48Address | recipient, |
uint8_t | tid, | ||
enum 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 87 of file block-ack-manager.cc.
References ns3::OriginatorBlockAckAgreement::ESTABLISHED, ns3::OriginatorBlockAckAgreement::INACTIVE, m_agreements, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::OriginatorBlockAckAgreement::PENDING, and ns3::OriginatorBlockAckAgreement::UNSUCCESSFUL.
Referenced by GetNextPacket(), ns3::EdcaTxopN::GotAddBaResponse(), NotifyGotBlockAck(), PeekNextPacket(), SwitchToBlockAckIfNeeded(), and ns3::EdcaTxopN::VerifyBlockAck().
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 number of packets buffered for a specified agreement. This methods doesn't return number of buffered MPDUs but number of buffered MSDUs.
Definition at line 419 of file block-ack-manager.cc.
References ExistsAgreement(), m_agreements, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::GetNOutstandingPacketsInBa(), and SwitchToBlockAckIfNeeded().
Ptr< const Packet > ns3::BlockAckManager::GetNextPacket | ( | WifiMacHeader & | hdr | ) |
hdr | 802.11 header of returned packet (if exists). |
This methods returns a packet (if exists) indicated as not received in corresponding block ack bitmap.
Definition at line 249 of file block-ack-manager.cc.
References ns3::WifiMacHeader::BLOCK_ACK, CleanupBuffers(), ns3::Packet::Copy(), ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiMacHeader::GetSequenceNumber(), ns3::WifiMacHeader::IsQosData(), m_agreements, m_retryPackets, ns3::WifiMacHeader::NORMAL_ACK, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::QosUtilsIsOldPacket(), ns3::WifiMacHeader::SetQosAckPolicy(), ns3::WifiMacHeader::SetRetry(), and SwitchToBlockAckIfNeeded().
Referenced by ns3::EdcaTxopN::NotifyAccessGranted().
uint32_t ns3::BlockAckManager::GetNextPacketSize | ( | void | ) | const |
Returns size of the next packet that needs retransmission.
Definition at line 765 of file block-ack-manager.cc.
References ns3::Packet::GetSize(), m_retryPackets, NS_LOG_FUNCTION, and ns3::BlockAckManager::Item::packet.
uint32_t ns3::BlockAckManager::GetNRetryNeededPackets | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) | const |
recipient | Address of peer station involved in block ack mechanism. |
tid | Traffic ID. |
Returns number of packets for a specific agreement that need retransmission. This method doesn't return number of MPDUs that need retransmission but number of MSDUs.
Definition at line 444 of file block-ack-manager.cc.
References ExistsAgreement(), m_retryPackets, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::GetNRetryNeededPackets(), NotifyMpduTransmission(), and ScheduleBlockAckReqIfNeeded().
uint16_t ns3::BlockAckManager::GetSeqNumOfNextRetryPacket | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) | const |
recipient | |
tid |
Returns the sequence number of the next retry packet for a specific agreement. If there are no packets that need retransmission for the specified agreement or the agreement doesn't exist the function returns 4096;
Definition at line 867 of file block-ack-manager.cc.
References m_retryPackets, and NS_LOG_FUNCTION.
Referenced by NotifyMpduTransmission().
bool ns3::BlockAckManager::HasBar | ( | struct Bar & | bar | ) |
Definition at line 399 of file block-ack-manager.cc.
References m_bars, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::NotifyAccessGranted().
bool ns3::BlockAckManager::HasOtherFragments | ( | uint16_t | sequenceNumber | ) | const |
sequenceNumber | Sequence number of the packet which fragment is part of. |
Returns true if another fragment with sequence number sequenceNumber is scheduled for retransmission.
Definition at line 749 of file block-ack-manager.cc.
References ns3::WifiMacHeader::GetSequenceNumber(), ns3::BlockAckManager::Item::hdr, m_retryPackets, and NS_LOG_FUNCTION.
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 412 of file block-ack-manager.cc.
References m_bars, m_retryPackets, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::NeedsAccess(), ns3::EdcaTxopN::NotifyAccessGranted(), ns3::EdcaTxopN::RestartAccessIfNeeded(), and ns3::EdcaTxopN::StartAccessIfNeeded().
|
private |
Definition at line 658 of file block-ack-manager.cc.
References m_blockAckInactivityTimeout, and NS_LOG_FUNCTION.
Referenced by NotifyGotBlockAck(), and UpdateAgreement().
|
private |
item | Insert item in retransmission queue. This method ensures packets are retransmitted in the correct order. |
Definition at line 895 of file block-ack-manager.cc.
References m_retryPackets, and NS_LOG_INFO.
Referenced by NotifyGotBlockAck().
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 else it returns false.
If it return false then the BAR will be discarded (i.e. will not be re-transmitted)
Definition at line 777 of file block-ack-manager.cc.
References CleanupBuffers(), m_agreements, and NS_ASSERT.
Referenced by ns3::EdcaTxopN::NeedBarRetransmission().
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 665 of file block-ack-manager.cc.
References ns3::OriginatorBlockAckAgreement::ESTABLISHED, m_agreements, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by SwitchToBlockAckIfNeeded().
void ns3::BlockAckManager::NotifyAgreementUnsuccessful | ( | 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 unsuccessful. 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 676 of file block-ack-manager.cc.
References m_agreements, NS_ASSERT, NS_LOG_FUNCTION, and ns3::OriginatorBlockAckAgreement::UNSUCCESSFUL.
Referenced by ns3::EdcaTxopN::GotAddBaResponse().
void ns3::BlockAckManager::NotifyGotBlockAck | ( | const CtrlBAckResponseHeader * | blockAck, |
Mac48Address | recipient, | ||
WifiMode | txMode | ||
) |
blockAck | The received block ack frame. |
recipient | Sender of block ack frame. |
txMode | mode of block ack frame. |
Invoked upon receipt of a block ack frame. Typically, this function, is called by ns3::EdcaTxopN 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 503 of file block-ack-manager.cc.
References AlreadyExists(), ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), ns3::MacTxMiddle::GetNextSeqNumberByTidAndAddress(), ns3::CtrlBAckResponseHeader::GetTidInfo(), InactivityTimeout(), InsertInRetryQueue(), ns3::CtrlBAckResponseHeader::IsBasic(), ns3::CtrlBAckResponseHeader::IsCompressed(), 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_txMiddle, m_txOkCallback, ns3::MicroSeconds(), NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), SwitchToBlockAckIfNeeded(), and timeout.
Referenced by ns3::EdcaTxopN::GotBlockAck().
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 EdcaTxopN. |
policy | ack policy of the transmitted packet. |
This method is typically invoked by ns3::EdcaTxopN 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 688 of file block-ack-manager.cc.
References ns3::WifiMacHeader::BLOCK_ACK, GetNRetryNeededPackets(), GetSeqNumOfNextRetryPacket(), m_agreements, m_bars, NS_ASSERT, NS_LOG_FUNCTION, and ScheduleBlockAckReqIfNeeded().
Referenced by ns3::EdcaTxopN::CompleteMpduTx(), and ns3::EdcaTxopN::CompleteTx().
|
private |
Ptr< const Packet > ns3::BlockAckManager::PeekNextPacket | ( | WifiMacHeader & | hdr, |
Mac48Address | recipient, | ||
uint8_t | tid, | ||
Time * | timestamp | ||
) |
Definition at line 319 of file block-ack-manager.cc.
References ns3::WifiMacHeader::BLOCK_ACK, CleanupBuffers(), ns3::Packet::Copy(), ns3::OriginatorBlockAckAgreement::ESTABLISHED, ExistsAgreementInState(), ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetSequenceNumber(), m_agreements, m_retryPackets, ns3::WifiMacHeader::NORMAL_ACK, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::QosUtilsIsOldPacket(), ns3::WifiMacHeader::SetQosAckPolicy(), ns3::WifiMacHeader::SetRetry(), and SwitchToBlockAckIfNeeded().
Referenced by ns3::EdcaTxopN::PeekNextRetransmitPacket().
bool ns3::BlockAckManager::RemovePacket | ( | uint8_t | tid, |
Mac48Address | recipient, | ||
uint16_t | seqnumber | ||
) |
Remove a packet after you peek in the queue and get it.
Definition at line 375 of file block-ack-manager.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiMacHeader::GetSequenceNumber(), m_agreements, m_retryPackets, and NS_LOG_DEBUG.
Referenced by ns3::EdcaTxopN::RemoveRetransmitPacket().
|
private |
recipient | |
tid |
Checks if all packets, for which a block ack agreement was established or refreshed, have been transmitted. If yes, adds a pair in m_bAckReqs to indicate that at next channel access a block ack request (for established agreement recipient,tid) is needed.
Definition at line 617 of file block-ack-manager.cc.
References ns3::Packet::AddHeader(), ns3::WifiMacHeader::ADDR1, ns3::BASIC_BLOCK_ACK, ns3::OriginatorBlockAckAgreement::CompleteExchange(), ns3::COMPRESSED_BLOCK_ACK, GetNRetryNeededPackets(), ns3::BlockAckAgreement::GetStartingSequence(), ns3::BlockAckAgreement::GetTid(), m_agreements, m_blockAckType, m_queue, ns3::MULTI_TID_BLOCK_ACK, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::CtrlBAckRequestHeader::SetStartingSequence(), ns3::CtrlBAckRequestHeader::SetTidInfo(), and ns3::CtrlBAckRequestHeader::SetType().
Referenced by NotifyMpduTransmission().
void ns3::BlockAckManager::SetBlockAckInactivityCallback | ( | Callback< void, Mac48Address, uint8_t, bool > | callback | ) |
Definition at line 839 of file block-ack-manager.cc.
References m_blockAckInactivityTimeout, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::CompleteConfig().
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 475 of file block-ack-manager.cc.
References m_blockAckThreshold, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::SetBlockAckThreshold().
void ns3::BlockAckManager::SetBlockAckType | ( | enum BlockAckType | bAckType | ) |
bAckType | Type of block ack |
See ctrl-headers.h for more details.
Definition at line 610 of file block-ack-manager.cc.
References m_blockAckType, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::EdcaTxopN().
void ns3::BlockAckManager::SetBlockDestinationCallback | ( | Callback< void, Mac48Address, uint8_t > | callback | ) |
Definition at line 846 of file block-ack-manager.cc.
References m_blockPackets, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::EdcaTxopN().
void ns3::BlockAckManager::SetMaxPacketDelay | ( | Time | maxDelay | ) |
maxDelay | Max delay for a buffered packet. |
This method is always called by ns3::WifiMacQueue object and sets max delay equals to ns3:WifiMacQueue delay value.
Definition at line 832 of file block-ack-manager.cc.
References m_maxDelay, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::EdcaTxopN().
void ns3::BlockAckManager::SetQueue | ( | Ptr< WifiMacQueue > | queue | ) |
queue | The WifiMacQueue object. |
Definition at line 717 of file block-ack-manager.cc.
References m_queue, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::EdcaTxopN().
void ns3::BlockAckManager::SetTxFailedCallback | ( | TxFailed | callback | ) |
callback | the callback to invoke when a packet transmission was completed unsuccessfully. |
Definition at line 889 of file block-ack-manager.cc.
References m_txFailedCallback.
Referenced by ns3::EdcaTxopN::EdcaTxopN().
void ns3::BlockAckManager::SetTxMiddle | ( | MacTxMiddle * | txMiddle | ) |
Definition at line 860 of file block-ack-manager.cc.
References m_txMiddle, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::CompleteConfig().
void ns3::BlockAckManager::SetTxOkCallback | ( | TxOk | callback | ) |
callback | the callback to invoke when a packet transmission was completed successfully. |
Definition at line 883 of file block-ack-manager.cc.
References m_txOkCallback.
Referenced by ns3::EdcaTxopN::EdcaTxopN().
void ns3::BlockAckManager::SetUnblockDestinationCallback | ( | Callback< void, Mac48Address, uint8_t > | callback | ) |
Definition at line 853 of file block-ack-manager.cc.
References m_unblockPackets, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::EdcaTxopN().
void ns3::BlockAckManager::SetWifiRemoteStationManager | ( | Ptr< WifiRemoteStationManager > | manager | ) |
Set up WifiRemoteStationManager associated with this BlockAckManager.
manager | WifiRemoteStationManager associated with this BlockAckManager |
Definition at line 482 of file block-ack-manager.cc.
References m_stationManager, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::SetWifiRemoteStationManager().
void ns3::BlockAckManager::StorePacket | ( | Ptr< const Packet > | packet, |
const WifiMacHeader & | hdr, | ||
Time | tStamp | ||
) |
packet | Packet to store. |
hdr | 802.11 header for packet. |
tStamp | time stamp for packet |
Stores packet 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 209 of file block-ack-manager.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiMacHeader::GetSequenceNumber(), ns3::WifiMacHeader::IsQosData(), m_agreements, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::CompleteMpduTx(), and ns3::EdcaTxopN::CompleteTx().
bool ns3::BlockAckManager::SwitchToBlockAckIfNeeded | ( | Mac48Address | recipient, |
uint8_t | tid, | ||
uint16_t | startingSeq | ||
) |
recipient | |
tid | |
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 724 of file block-ack-manager.cc.
References ns3::WifiMacHeader::ADDR1, ExistsAgreement(), ExistsAgreementInState(), GetNBufferedPackets(), m_blockAckThreshold, m_queue, NotifyAgreementEstablished(), NS_ASSERT, NS_LOG_FUNCTION, ns3::OriginatorBlockAckAgreement::PENDING, and ns3::OriginatorBlockAckAgreement::UNSUCCESSFUL.
Referenced by GetNextPacket(), NotifyGotBlockAck(), PeekNextPacket(), and ns3::EdcaTxopN::VerifyBlockAck().
void ns3::BlockAckManager::TearDownBlockAck | ( | Mac48Address | recipient, |
uint8_t | tid | ||
) |
recipient | Address of station involved in block ack mechanism. |
tid | Traffic ID. |
This method is invoked by EdcaTxopN object upon receipt of a DELBA frame from recipient. The relative block ack agreement is destroyed.
Definition at line 742 of file block-ack-manager.cc.
References DestroyAgreement(), and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::GotAck(), and ns3::EdcaTxopN::GotDelBaFrame().
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 176 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, ns3::BlockAckAgreement::m_inactivityEvent, m_unblockPackets, ns3::MicroSeconds(), NS_LOG_FUNCTION, ns3::Simulator::Schedule(), ns3::BlockAckAgreement::SetAmsduSupport(), ns3::BlockAckAgreement::SetBufferSize(), ns3::BlockAckAgreement::SetDelayedBlockAck(), ns3::BlockAckAgreement::SetImmediateBlockAck(), ns3::OriginatorBlockAckAgreement::SetState(), ns3::BlockAckAgreement::SetTimeout(), and timeout.
Referenced by ns3::EdcaTxopN::GotAddBaResponse().
|
private |
Definition at line 430 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 417 of file block-ack-manager.h.
Referenced by CleanupBuffers(), CompleteAmpduExchange(), CreateAgreement(), DestroyAgreement(), ExistsAgreement(), ExistsAgreementInState(), GetNBufferedPackets(), GetNextPacket(), NeedBarRetransmission(), NotifyAgreementEstablished(), NotifyAgreementUnsuccessful(), NotifyGotBlockAck(), NotifyMpduTransmission(), PeekNextPacket(), RemovePacket(), ScheduleBlockAckReqIfNeeded(), StorePacket(), UpdateAgreement(), and ~BlockAckManager().
Definition at line 424 of file block-ack-manager.h.
Referenced by DestroyAgreement(), HasBar(), HasPackets(), and NotifyMpduTransmission().
|
private |
Definition at line 432 of file block-ack-manager.h.
Referenced by InactivityTimeout(), and SetBlockAckInactivityCallback().
|
private |
Definition at line 426 of file block-ack-manager.h.
Referenced by SetBlockAckThreshold(), and SwitchToBlockAckIfNeeded().
|
private |
Definition at line 427 of file block-ack-manager.h.
Referenced by ScheduleBlockAckReqIfNeeded(), and SetBlockAckType().
|
private |
Definition at line 433 of file block-ack-manager.h.
Referenced by CreateAgreement(), and SetBlockDestinationCallback().
|
private |
Definition at line 428 of file block-ack-manager.h.
Referenced by CleanupBuffers(), and SetMaxPacketDelay().
|
private |
Definition at line 431 of file block-ack-manager.h.
Referenced by ScheduleBlockAckReqIfNeeded(), 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 423 of file block-ack-manager.h.
Referenced by AlreadyExists(), CleanupBuffers(), DestroyAgreement(), GetNextPacket(), GetNextPacketSize(), GetNRetryNeededPackets(), GetSeqNumOfNextRetryPacket(), HasOtherFragments(), HasPackets(), InsertInRetryQueue(), PeekNextPacket(), RemovePacket(), and ~BlockAckManager().
|
private |
Definition at line 437 of file block-ack-manager.h.
Referenced by CreateAgreement(), NotifyGotBlockAck(), and SetWifiRemoteStationManager().
|
private |
Definition at line 436 of file block-ack-manager.h.
Referenced by NotifyGotBlockAck(), and SetTxFailedCallback().
|
private |
Definition at line 429 of file block-ack-manager.h.
Referenced by NotifyGotBlockAck(), and SetTxMiddle().
|
private |
Definition at line 435 of file block-ack-manager.h.
Referenced by NotifyGotBlockAck(), and SetTxOkCallback().
|
private |
Definition at line 434 of file block-ack-manager.h.
Referenced by SetUnblockDestinationCallback(), and UpdateAgreement().