21 #ifndef BLOCK_ACK_MANAGER_H 22 #define BLOCK_ACK_MANAGER_H 25 #include "ns3/nstime.h" 32 class WifiRemoteStationManager;
33 class MgtAddBaResponseHeader;
34 class MgtAddBaRequestHeader;
35 class CtrlBAckResponseHeader;
428 typedef std::map<std::pair<Mac48Address, uint8_t>,
429 std::pair<OriginatorBlockAckAgreement, PacketQueue> >
Agreements;
433 typedef std::map<std::pair<Mac48Address, uint8_t>,
434 std::pair<OriginatorBlockAckAgreement, PacketQueue> >::iterator
AgreementsI;
438 typedef std::map<std::pair<Mac48Address, uint8_t>,
439 std::pair<OriginatorBlockAckAgreement, PacketQueue> >::const_iterator
AgreementsCI;
std::map< std::pair< Mac48Address, uint8_t >, std::pair< OriginatorBlockAckAgreement, PacketQueue > > Agreements
typedef for a map between MAC address and block ACK agreement.
void SetUnblockDestinationCallback(Callback< void, Mac48Address, uint8_t > callback)
Set unblock destination callback.
Simulation virtual time values and global simulation resolution.
void NotifyGotBlockAck(const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, WifiMode txMode, double dataSnr)
std::list< Item > PacketQueue
typedef for a list of Item struct.
uint32_t GetNRetryNeededPackets(Mac48Address recipient, uint8_t tid) const
std::map< std::pair< Mac48Address, uint8_t >, std::pair< OriginatorBlockAckAgreement, PacketQueue > >::const_iterator AgreementsCI
typedef for a const iterator for Agreements.
void CreateAgreement(const MgtAddBaRequestHeader *reqHdr, Mac48Address recipient)
uint32_t GetNBufferedPackets(Mac48Address recipient, uint8_t tid) const
void StorePacket(Ptr< const Packet > packet, const WifiMacHeader &hdr, Time tStamp)
uint8_t m_blockAckThreshold
block ack threshold
Agreements m_agreements
This data structure contains, for each block ack agreement (recipient, tid), a set of packets for whi...
std::map< std::pair< Mac48Address, uint8_t >, std::pair< OriginatorBlockAckAgreement, PacketQueue > >::iterator AgreementsI
typedef for an iterator for Agreements.
Ptr< const Packet > GetNextPacket(WifiMacHeader &hdr, bool removePacket)
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
TxOk m_txOkCallback
transmit ok callback
bool ExistsAgreementInState(Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state) const
void RemoveFromRetryQueue(Mac48Address address, uint8_t tid, uint16_t seq)
Remove items from retransmission queue.
void SetTxFailedCallback(TxFailed callback)
Ptr< Packet > ScheduleBlockAckReqIfNeeded(Mac48Address recipient, uint8_t tid)
void NotifyAgreementEstablished(Mac48Address recipient, uint8_t tid, uint16_t startingSeq)
void UpdateAgreement(const MgtAddBaResponseHeader *respHdr, Mac48Address recipient)
void SetQueue(const Ptr< WifiMacQueue > queue)
void SetBlockAckType(BlockAckType bAckType)
void SetWifiRemoteStationManager(const Ptr< WifiRemoteStationManager > manager)
Set up WifiRemoteStationManager associated with this BlockAckManager.
void NotifyAgreementUnsuccessful(Mac48Address recipient, uint8_t tid)
static TypeId GetTypeId(void)
Get the type ID.
void InsertInRetryQueue(PacketQueueI item)
std::list< PacketQueueI > m_retryPackets
This list contains all iterators to stored packets that need to be retransmitted. ...
bool ExistsAgreement(Mac48Address recipient, uint8_t tid) const
bool AlreadyExists(uint16_t currentSeq, Mac48Address recipient, uint8_t tid) const
Checks if the packet already exists in the retransmit queue or not if it does then it doesn't add it ...
Ptr< MacTxMiddle > m_txMiddle
the MacTxMiddle
void SetBlockDestinationCallback(Callback< void, Mac48Address, uint8_t > callback)
Set block destination callback.
void DestroyAgreement(Mac48Address recipient, uint8_t tid)
Item(Ptr< const Packet > packet, const WifiMacHeader &hdr, Time tStamp)
Constructor.
void SetTxOkCallback(TxOk callback)
bool HasBar(Bar &bar)
Returns true if the BAR is scheduled.
Mac48Address recipient
recipient
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint16_t GetSeqNumOfNextRetryPacket(Mac48Address recipient, uint8_t tid) const
void InactivityTimeout(Mac48Address recipient, uint8_t tid)
Inactivity timeout function.
bool RemovePacket(uint8_t tid, Mac48Address recipient, uint16_t seqnumber)
Remove a packet after you peek in the queue and get it.
Callback< void, Mac48Address, uint8_t, bool > m_blockAckInactivityTimeout
block ack inactivity timeout callback
Callback< void, Mac48Address, uint8_t > m_blockPackets
block packets callback
Callback< void, const WifiMacHeader & > TxOk
typedef for a callback to invoke when a packet transmission was completed successfully.
Callback< void, const WifiMacHeader & > TxFailed
typedef for a callback to invoke when a packet transmission was failed.
State
Represents the state for this agreement.
void SetBlockAckInactivityCallback(Callback< void, Mac48Address, uint8_t, bool > callback)
Set block ack inactivity callback.
void SetMaxPacketDelay(Time maxDelay)
void NotifyMpduTransmission(Mac48Address recipient, uint8_t tid, uint16_t nextSeqNumber, WifiMacHeader::QosAckPolicy policy)
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 r...
A struct for packet, Wifi header, and timestamp.
bool SwitchToBlockAckIfNeeded(Mac48Address recipient, uint8_t tid, uint16_t startingSeq)
std::list< Item >::const_iterator PacketQueueCI
typedef for a const iterator for PacketQueue.
Callback< void, Mac48Address, uint8_t > m_unblockPackets
unblock packets callback
bool HasPackets(void) const
Returns true if there are packets that need of retransmission or at least a BAR is scheduled...
std::list< Bar > m_bars
list of BARs
void CleanupBuffers(void)
This method removes packets whose lifetime was exceeded.
void SetTxMiddle(const Ptr< MacTxMiddle > txMiddle)
Set the MacTxMiddle.
void SetBlockAckThreshold(uint8_t nPackets)
void CompleteAmpduExchange(Mac48Address recipient, uint8_t tid)
BlockAckType m_blockAckType
block ack type
Ptr< const Packet > bar
block ack request
Time m_maxDelay
maximum delay
BlockAckManager & operator=(const BlockAckManager &block)
assignment operator
A base class which provides memory management and object aggregation.
Mac48Address m_address
address
Manages all block ack agreements for an originator station.
TxFailed m_txFailedCallback
transmit failed callback
Ptr< WifiRemoteStationManager > m_stationManager
the station manager
a unique identifier for an interface.
Ptr< const Packet > packet
packet
Ptr< const Packet > PeekNextPacketByTidAndAddress(WifiMacHeader &hdr, uint8_t tid, Time *timestamp)
Peek in retransmit queue and get the next packet having address indicated by type equals to addr...
Ptr< WifiMacQueue > m_queue
queue
std::list< Item >::iterator PacketQueueI
typedef for an iterator for PacketQueue.
BlockAckType
The different block ACK policies.