|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #ifndef BLOCK_ACK_MANAGER_H
22 #define BLOCK_ACK_MANAGER_H
25 #include "ns3/nstime.h"
26 #include "ns3/traced-callback.h"
35 class MgtAddBaResponseHeader;
36 class MgtAddBaRequestHeader;
37 class CtrlBAckResponseHeader;
38 class CtrlBAckRequestHeader;
148 uint16_t startingSeq);
448 typedef std::map<std::pair<Mac48Address, uint8_t>,
449 std::pair<OriginatorBlockAckAgreement, PacketQueue> >
Agreements;
453 typedef std::map<std::pair<Mac48Address, uint8_t>,
454 std::pair<OriginatorBlockAckAgreement, PacketQueue> >::iterator
AgreementsI;
458 typedef std::map<std::pair<Mac48Address, uint8_t>,
459 std::pair<OriginatorBlockAckAgreement, PacketQueue> >::const_iterator
AgreementsCI;
CtrlBAckRequestHeader GetBlockAckReqHeader(Mac48Address recipient, uint8_t tid) const
a unique identifier for an interface.
uint32_t GetNBufferedPackets(Mac48Address recipient, uint8_t tid) const
bool SwitchToBlockAckIfNeeded(Mac48Address recipient, uint8_t tid, uint16_t startingSeq)
void CreateAgreement(const MgtAddBaRequestHeader *reqHdr, Mac48Address recipient, bool htSupported=true)
void NotifyAgreementReset(Mac48Address recipient, uint8_t tid)
BlockAckRequest frame information.
BlockAckManager & operator=(const BlockAckManager &block)
assignment operator
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetTxOkCallback(TxOk callback)
void DestroyAgreement(Mac48Address recipient, uint8_t tid)
Ptr< const WifiMacQueueItem > bar
BlockAckRequest or MU-BAR Trigger Frame.
std::map< std::pair< Mac48Address, uint8_t >, std::pair< OriginatorBlockAckAgreement, PacketQueue > > Agreements
typedef for a map between MAC address and block ack agreement.
void SetQueue(const Ptr< WifiMacQueue > queue)
Callback< void, Ptr< const WifiMacQueueItem > > TxOk
typedef for a callback to invoke when an MPDU is successfully ack'ed.
bool NeedBarRetransmission(uint8_t tid, Mac48Address recipient)
This function returns true if a block ack agreement is established with the given recipient for the g...
Manages all block ack agreements for an originator station.
void NotifyMissedBlockAck(Mac48Address recipient, uint8_t tid)
std::map< std::pair< Mac48Address, uint8_t >, std::pair< OriginatorBlockAckAgreement, PacketQueue > >::const_iterator AgreementsCI
typedef for a const iterator for Agreements.
void NotifyAgreementEstablished(Mac48Address recipient, uint8_t tid, uint16_t startingSeq)
void UpdateAgreement(const MgtAddBaResponseHeader *respHdr, Mac48Address recipient, uint16_t startingSeq)
Ptr< const WifiMacQueueItem > 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.
std::list< Ptr< WifiMacQueueItem > >::iterator PacketQueueI
typedef for an iterator for PacketQueue.
Callback< void, Ptr< const WifiMacQueueItem > > DroppedOldMpdu
typedef for a callback to invoke when an MPDU is dropped.
void NotifyAgreementNoReply(Mac48Address recipient, uint8_t tid)
Callback< void, Mac48Address, uint8_t > m_unblockPackets
unblock packets callback
BlockAckManager(const BlockAckManager &)
type conversion operator
std::list< Bar > m_bars
list of BARs
bool skipIfNoDataQueued
do not send if there is no data queued (unused if MU-BAR)
bool ExistsAgreementInState(Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state) const
bool ExistsAgreement(Mac48Address recipient, uint8_t tid) const
DroppedOldMpdu m_droppedOldMpduCallback
the dropped MPDU callback
Smart pointer class similar to boost::intrusive_ptr.
void SetUnblockDestinationCallback(Callback< void, Mac48Address, uint8_t > callback)
Set unblock destination callback.
static Mac48Address GetBroadcast(void)
The different BlockAckRequest variants.
std::list< Ptr< WifiMacQueueItem > >::const_iterator PacketQueueCI
typedef for a const iterator for PacketQueue.
Callback< void, Mac48Address, uint8_t, bool > m_blockAckInactivityTimeout
BlockAck inactivity timeout callback.
MpduStatus
Enumeration for the statuses of a buffered MPDU.
void SetDroppedOldMpduCallback(DroppedOldMpdu callback)
void SetBlockAckInactivityCallback(Callback< void, Mac48Address, uint8_t, bool > callback)
Set block ack inactivity callback.
A base class which provides memory management and object aggregation.
void DoDispose() override
Destructor implementation.
State
Represents the state for this agreement.
The different BlockAck variants.
Callback< void, Mac48Address, uint8_t > m_blockPackets
block packets callback
void SetTxFailedCallback(TxFailed callback)
Simulation virtual time values and global simulation resolution.
BlockAckReqType GetBlockAckReqType(Mac48Address recipient, uint8_t tid) const
This function returns the type of Block Acks sent to the recipient.
PacketQueueI HandleInFlightMpdu(PacketQueueI mpduIt, MpduStatus status, const AgreementsI &it, const Time &now)
Handle the given in flight MPDU based on its given status.
uint16_t GetRecipientBufferSize(Mac48Address recipient, uint8_t tid) const
This function returns the buffer size negotiated with the recipient.
void NotifyGotAck(Ptr< const WifiMacQueueItem > mpdu)
Invoked upon receipt of an Ack frame after the transmission of a QoS data frame sent under an establi...
void StorePacket(Ptr< WifiMacQueueItem > mpdu)
static TypeId GetTypeId(void)
Get the type ID.
Callback< void, Ptr< const WifiMacQueueItem > > TxFailed
typedef for a callback to invoke when an MPDU is negatively ack'ed.
std::list< Ptr< WifiMacQueueItem > > PacketQueue
typedef for a list of WifiMacQueueItem.
TxOk m_txOkCallback
transmit OK callback
void SetBlockAckThreshold(uint8_t nPackets)
std::pair< uint16_t, uint16_t > NotifyGotBlockAck(const CtrlBAckResponseHeader &blockAck, Mac48Address recipient, const std::set< uint8_t > &tids, size_t index=0)
TracedCallback< Time, Mac48Address, uint8_t, OriginatorBlockAckAgreement::State > m_agreementState
The trace source fired when a state transition occurred.
void NotifyDiscardedMpdu(Ptr< const WifiMacQueueItem > mpdu)
void SetBlockDestinationCallback(Callback< void, Mac48Address, uint8_t > callback)
Set block destination callback.
Forward calls to a chain of Callback.
BlockAckType GetBlockAckType(Mac48Address recipient, uint8_t tid) const
This function returns the type of Block Acks sent by the recipient.
uint8_t tid
TID (unused if MU-BAR)
TxFailed m_txFailedCallback
transmit failed callback
uint8_t m_blockAckThreshold
block ack threshold
void ScheduleBar(Ptr< const WifiMacQueueItem > bar, bool skipIfNoDataQueued=false)
uint16_t GetOriginatorStartingSequence(Mac48Address recipient, uint8_t tid) const
This function returns the starting sequence number of the transmit window.
std::map< std::pair< Mac48Address, uint8_t >, std::pair< OriginatorBlockAckAgreement, PacketQueue > >::iterator AgreementsI
typedef for an iterator for Agreements.
Ptr< WifiMacQueue > m_queue
queue
void NotifyAgreementRejected(Mac48Address recipient, uint8_t tid)
void NotifyMissedAck(Ptr< WifiMacQueueItem > mpdu)
Invoked upon missed reception of an Ack frame after the transmission of a QoS data frame sent under a...
void InactivityTimeout(Mac48Address recipient, uint8_t tid)
Inactivity timeout function.
void(* AgreementStateTracedCallback)(Time now, Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state)
TracedCallback signature for state changes.
Agreements m_agreements
This data structure contains, for each block ack agreement (recipient, TID), a set of packets for whi...