A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
block-ack-manager.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009, 2010 MIRKO BANCHI
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Mirko Banchi <mk.banchi@gmail.com>
18 */
19
20#ifndef BLOCK_ACK_MANAGER_H
21#define BLOCK_ACK_MANAGER_H
22
23#include "block-ack-type.h"
26#include "wifi-mac-header.h"
27#include "wifi-mpdu.h"
28#include "wifi-tx-vector.h"
29
30#include "ns3/nstime.h"
31#include "ns3/object.h"
32#include "ns3/traced-callback.h"
33
34#include <map>
35#include <optional>
36
37namespace ns3
38{
39
40class MgtAddBaResponseHeader;
41class MgtAddBaRequestHeader;
42class CtrlBAckResponseHeader;
43class CtrlBAckRequestHeader;
44class WifiMacQueue;
45class MacRxMiddle;
46
47/**
48 * \brief Manages all block ack agreements for an originator station.
49 * \ingroup wifi
50 */
51class BlockAckManager : public Object
52{
53 private:
54 /**
55 * Enumeration for the statuses of a buffered MPDU
56 */
57 enum MpduStatus : uint8_t
58 {
62 };
63
64 public:
65 /**
66 * \brief Get the type ID.
67 * \return the object TypeId
68 */
69 static TypeId GetTypeId();
70
72 ~BlockAckManager() override;
73
74 // Delete copy constructor and assignment operator to avoid misuse
77
78 /// optional const reference to OriginatorBlockAckAgreement
80 std::optional<std::reference_wrapper<const OriginatorBlockAckAgreement>>;
81 /// optional const reference to RecipientBlockAckAgreement
83 std::optional<std::reference_wrapper<const RecipientBlockAckAgreement>>;
84
85 /**
86 * \param recipient MAC address of the recipient
87 * \param tid Traffic ID
88 *
89 * \return a const reference to the block ack agreement with the given recipient, if it exists
90 *
91 * Check if we are the originator of an existing block ack agreement with the given recipient.
92 */
94 uint8_t tid) const;
95 /**
96 * \param originator MAC address of the originator
97 * \param tid Traffic ID
98 *
99 * \return a const reference to the block ack agreement with the given originator, if it exists
100 *
101 * Check if we are the recipient of an existing block ack agreement with the given originator.
102 */
104 uint8_t tid) const;
105
106 /**
107 * \param reqHdr Relative Add block ack request (action frame).
108 * \param recipient Address of peer station involved in block ack mechanism.
109 * \param htSupported Whether both originator and recipient support HT
110 *
111 * Creates a new originator block ack agreement in pending state. When a ADDBA response
112 * with a successful status code is received, the relative agreement becomes established.
113 */
115 const Mac48Address& recipient,
116 bool htSupported = true);
117 /**
118 * \param recipient Address of peer station involved in block ack mechanism.
119 * \param tid traffic ID of transmitted packet.
120 *
121 * Invoked when a recipient reject a block ack agreement or when a DELBA frame
122 * is Received/Transmitted.
123 */
124 void DestroyOriginatorAgreement(const Mac48Address& recipient, uint8_t tid);
125 /**
126 * \param respHdr Relative Add block ack response (action frame).
127 * \param recipient Address of peer station involved in block ack mechanism.
128 * \param startingSeq the updated starting sequence number
129 *
130 * Invoked upon receipt of a ADDBA response frame from <i>recipient</i>.
131 */
133 const Mac48Address& recipient,
134 uint16_t startingSeq);
135
136 /**
137 * \param respHdr Add block ack response from originator (action
138 * frame).
139 * \param originator Address of peer station involved in block ack
140 * mechanism.
141 * \param startingSeq Sequence number of the first MPDU of all
142 * packets for which block ack was negotiated.
143 * \param htSupported whether HT support is enabled
144 * \param rxMiddle the MAC RX Middle on this station
145 *
146 * This function is typically invoked only by ns3::WifiMac
147 * when the STA (which may be non-AP in ESS, or in an IBSS) has
148 * received an ADDBA Request frame and is transmitting an ADDBA
149 * Response frame. At this point the frame exchange manager must
150 * allocate buffers to collect all correctly received packets belonging
151 * to the category for which block ack was negotiated.
152 */
154 const Mac48Address& originator,
155 uint16_t startingSeq,
156 bool htSupported,
157 Ptr<MacRxMiddle> rxMiddle);
158 /**
159 * Destroy a recipient Block Ack agreement.
160 *
161 * \param originator the originator MAC address
162 * \param tid the TID associated with the Block Ack agreement
163 */
164 void DestroyRecipientAgreement(const Mac48Address& originator, uint8_t tid);
165
166 /**
167 * \param mpdu MPDU to store.
168 *
169 * Stores <i>mpdu</i> for a possible future retransmission. Retransmission occurs
170 * if the packet, in a BlockAck frame, is indicated by recipient as not received.
171 */
172 void StorePacket(Ptr<WifiMpdu> mpdu);
173 /**
174 * Invoked upon receipt of an Ack frame on the given link after the transmission of a
175 * QoS data frame sent under an established block ack agreement. Remove the acknowledged
176 * frame from the outstanding packets and update the starting sequence number of the
177 * transmit window, if needed.
178 *
179 * \param linkId the ID of the given link
180 * \param mpdu The acknowledged MPDU.
181 */
182 void NotifyGotAck(uint8_t linkId, Ptr<const WifiMpdu> mpdu);
183 /**
184 * Invoked upon missed reception of an Ack frame on the given link after the
185 * transmission of a QoS data frame sent under an established block ack agreement.
186 * Remove the acknowledged frame from the outstanding packets and insert it in the
187 * retransmission queue.
188 *
189 * \param linkId the ID of the given link
190 * \param mpdu The unacknowledged MPDU.
191 */
192 void NotifyMissedAck(uint8_t linkId, Ptr<WifiMpdu> mpdu);
193 /**
194 * \param linkId the ID of the given link
195 * \param blockAck The received BlockAck frame.
196 * \param recipient Sender of BlockAck frame.
197 * \param tids the set of TIDs the acknowledged MPDUs belong to
198 * \param index the index of the Per AID TID Info subfield, in case of Multi-STA
199 * Block Ack, or 0, otherwise
200 * \return a pair of values indicating the number of successfully received MPDUs
201 * and the number of failed MPDUs
202 *
203 * Invoked upon receipt of a BlockAck frame on the given link. Typically, this function
204 * is called by ns3::QosTxop object. Performs a check on which MPDUs, previously sent
205 * with Ack Policy set to Block Ack, were correctly received by the recipient.
206 * An acknowledged MPDU is removed from the buffer, retransmitted otherwise.
207 * Note that <i>tids</i> is only used if <i>blockAck</i> is a Multi-STA Block Ack
208 * using All-ack context.
209 */
210 std::pair<uint16_t, uint16_t> NotifyGotBlockAck(uint8_t linkId,
211 const CtrlBAckResponseHeader& blockAck,
212 const Mac48Address& recipient,
213 const std::set<uint8_t>& tids,
214 size_t index = 0);
215 /**
216 * \param linkId the ID of the given link
217 * \param recipient Sender of the expected BlockAck frame.
218 * \param tid Traffic ID.
219 *
220 * Invoked upon missed reception of a block ack frame on the given link. Typically, this
221 * function is called by ns3::QosTxop object. Performs a check on which MPDUs, previously
222 * sent with ack policy set to Block Ack, should be placed in the retransmission queue.
223 */
224 void NotifyMissedBlockAck(uint8_t linkId, const Mac48Address& recipient, uint8_t tid);
225 /**
226 * \param originator MAC address of the sender of the Block Ack Request
227 * \param tid Traffic ID
228 * \param startingSeq the starting sequence number in the Block Ack Request
229 *
230 * Perform required actions upon receiving a Block Ack Request frame.
231 */
232 void NotifyGotBlockAckRequest(const Mac48Address& originator,
233 uint8_t tid,
234 uint16_t startingSeq);
235 /**
236 * \param mpdu the received MPDU
237 *
238 * Perform required actions upon receiving an MPDU.
239 */
241 /**
242 * \param recipient Address of peer station involved in block ack mechanism.
243 * \param tid Traffic ID.
244 *
245 * \return the number of packets buffered for a specified agreement
246 *
247 * Returns the number of packets buffered for a specified agreement. This methods doesn't return
248 * the number of buffered MPDUs but the number of buffered MSDUs.
249 */
250 uint32_t GetNBufferedPackets(const Mac48Address& recipient, uint8_t tid) const;
251 /**
252 * \param recipient Address of peer station involved in block ack mechanism.
253 * \param tid Traffic ID of transmitted packet.
254 * \param startingSeq starting sequence field
255 *
256 * Puts corresponding originator agreement in established state and updates number of packets
257 * and starting sequence field. Invoked typically after a block ack refresh.
258 */
260 uint8_t tid,
261 uint16_t startingSeq);
262 /**
263 * \param recipient Address of peer station involved in block ack mechanism.
264 * \param tid Traffic ID of transmitted packet.
265 *
266 * Marks an originator agreement as rejected. This happens if <i>recipient</i> station reject
267 * block ack setup by an ADDBA Response frame with a failure status code. For now we assume
268 * that every QoS station accepts a block ack setup.
269 */
270 void NotifyOriginatorAgreementRejected(const Mac48Address& recipient, uint8_t tid);
271 /**
272 * \param recipient Address of peer station involved in block ack mechanism.
273 * \param tid Traffic ID of transmitted packet.
274 *
275 * Marks an originator agreement after not receiving response to ADDBA request. During this
276 * state any packets in queue will be transmitted using normal MPDU. This also unblocks
277 * recipient address.
278 */
279 void NotifyOriginatorAgreementNoReply(const Mac48Address& recipient, uint8_t tid);
280 /**
281 * \param recipient Address of peer station involved in block ack mechanism.
282 * \param tid Traffic ID of transmitted packet.
283 *
284 * Set Originator BA agreement to a transitory state to reset it after not receiving response
285 * to ADDBA request.
286 */
287 void NotifyOriginatorAgreementReset(const Mac48Address& recipient, uint8_t tid);
288 /**
289 * \param nPackets Minimum number of packets for use of block ack.
290 *
291 * Upon receipt of a BlockAck frame, if total number of packets (packets in WifiMacQueue
292 * and buffered packets) is greater of <i>nPackets</i>, they are transmitted using block ack
293 * mechanism.
294 */
295 void SetBlockAckThreshold(uint8_t nPackets);
296
297 /**
298 * \param queue The WifiMacQueue object.
299 */
300 void SetQueue(const Ptr<WifiMacQueue> queue);
301
302 /**
303 * Set block ack inactivity callback
304 * \param callback the block ack inactivity callback function
305 */
307 /**
308 * Set block destination callback
309 * \param callback the block destination callback
310 */
312 /**
313 * Set unblock destination callback
314 * \param callback the unblock destination callback
315 */
317
318 /**
319 * This function returns true if a block ack agreement is established with the
320 * given recipient for the given TID and there is at least an outstanding MPDU
321 * for such agreement whose lifetime is not expired.
322 *
323 * \param tid Traffic ID
324 * \param recipient MAC address of the recipient
325 *
326 * \returns true if BAR retransmission needed
327 */
328 bool NeedBarRetransmission(uint8_t tid, const Mac48Address& recipient);
329 /**
330 * This function returns the buffer size negotiated with the recipient.
331 *
332 * \param tid Traffic ID
333 * \param recipient MAC address of the recipient
334 *
335 * \returns the buffer size negotiated with the recipient
336 */
337 uint16_t GetRecipientBufferSize(const Mac48Address& recipient, uint8_t tid) const;
338 /**
339 * This function returns the starting sequence number of the transmit window.
340 *
341 * \param tid Traffic ID
342 * \param recipient MAC address of the recipient
343 *
344 * \returns the starting sequence number of the transmit window (WinStartO)
345 */
346 uint16_t GetOriginatorStartingSequence(const Mac48Address& recipient, uint8_t tid) const;
347
348 /**
349 * typedef for a callback to invoke when an MPDU is successfully ack'ed.
350 */
352 /**
353 * typedef for a callback to invoke when an MPDU is negatively ack'ed.
354 */
356 /**
357 * typedef for a callback to invoke when an MPDU is dropped.
358 */
360
361 /**
362 * \param callback the callback to invoke when a
363 * packet transmission was completed successfully.
364 */
365 void SetTxOkCallback(TxOk callback);
366 /**
367 * \param callback the callback to invoke when a
368 * packet transmission was completed unsuccessfuly.
369 */
370 void SetTxFailedCallback(TxFailed callback);
371 /**
372 * \param callback the callback to invoke when an old MPDU is dropped
373 */
375
376 /**
377 * TracedCallback signature for state changes.
378 *
379 * \param [in] now Time when the \pname{state} changed.
380 * \param [in] recipient MAC address of the recipient.
381 * \param [in] tid the TID.
382 * \param [in] state The state.
383 */
385 const Mac48Address& recipient,
386 uint8_t tid,
388
389 /**
390 * \param mpdu the discarded frame
391 *
392 * Notify the block ack manager that an MPDU has been discarded, e.g., because
393 * the MSDU lifetime expired. If there is an established block ack agreement,
394 * make the transmit window advance beyond the discarded frame. This also
395 * involves (i) the removal of frames that consequently become old from the
396 * retransmit queue and from the queue of the block ack agreement, and (ii) the
397 * scheduling of a BlockAckRequest.
398 */
400
401 /**
402 * \param recipient the recipient
403 * \param tid the TID
404 * \return the BlockAckRequest header for the established BA agreement
405 *
406 * Get the BlockAckRequest header for the established BA agreement
407 * (<i>recipient</i>,<i>tid</i>).
408 */
409 CtrlBAckRequestHeader GetBlockAckReqHeader(const Mac48Address& recipient, uint8_t tid) const;
410
411 /**
412 * \param reqHdr the BlockAckRequest header
413 * \param hdr the 802.11 MAC header
414 *
415 * Enqueue the given BlockAckRequest into the queue storing the next BAR
416 * frames to transmit. If a BAR for the same recipient and TID is already present
417 * in the queue, it is replaced by the new one. If the given BAR is retransmitted,
418 * it is placed at the head of the queue, otherwise at the tail.
419 */
420 void ScheduleBar(const CtrlBAckRequestHeader& reqHdr, const WifiMacHeader& hdr);
421
422 /// agreement key typedef (MAC address and TID)
423 using AgreementKey = std::pair<Mac48Address, uint8_t>;
424
425 /**
426 * \return the list of BA agreements (identified by the recipient and TID pair) for which a BAR
427 * shall only be sent if there are queued data frames belonging to those agreements
428 */
429 const std::list<AgreementKey>& GetSendBarIfDataQueuedList() const;
430 /**
431 * Add the given (recipient, TID) pair to the list of BA agreements for which a BAR
432 * shall only be sent if there are queued data frames belonging to those agreements
433 *
434 * \param recipient the recipient
435 * \param tid the TID
436 */
437 void AddToSendBarIfDataQueuedList(const Mac48Address& recipient, uint8_t tid);
438 /**
439 * Remove the given (recipient, TID) pair from the list of BA agreements for which a BAR
440 * shall only be sent if there are queued data frames belonging to those agreements
441 *
442 * \param recipient the recipient
443 * \param tid the TID
444 */
445 void RemoveFromSendBarIfDataQueuedList(const Mac48Address& recipient, uint8_t tid);
446
447 protected:
448 void DoDispose() override;
449
450 private:
451 /**
452 * Inactivity timeout function
453 * \param recipient the recipient MAC address
454 * \param tid Traffic ID
455 */
456 void InactivityTimeout(const Mac48Address& recipient, uint8_t tid);
457
458 /**
459 * typedef for a list of WifiMpdu.
460 */
461 typedef std::list<Ptr<WifiMpdu>> PacketQueue;
462 /**
463 * typedef for an iterator for PacketQueue.
464 */
465 typedef std::list<Ptr<WifiMpdu>>::iterator PacketQueueI;
466
467 /// AgreementKey-indexed map of originator block ack agreements
469 std::map<AgreementKey, std::pair<OriginatorBlockAckAgreement, PacketQueue>>;
470 /// typedef for an iterator for Agreements
471 using OriginatorAgreementsI = OriginatorAgreements::iterator;
472
473 /// AgreementKey-indexed map of recipient block ack agreements
474 using RecipientAgreements = std::map<AgreementKey, RecipientBlockAckAgreement>;
475
476 /**
477 * Handle the given in flight MPDU based on its given status. If the status is
478 * ACKNOWLEDGED, the MPDU is removed from both the EDCA queue and the queue of
479 * in flight MPDUs. If the status is TO_RETRANSMIT, the MPDU is only removed
480 * from the queue of in flight MPDUs. Note that the MPDU is removed from both
481 * queues (independently of the status) if the MPDU is not stored in the EDCA
482 * queue, is an old packet or its lifetime expired.
483 *
484 * \param linkId the ID of the link on which the MPDU has been transmitted
485 * \param mpduIt an iterator pointing to the MPDU in the queue of in flight MPDUs
486 * \param status the status of the in flight MPDU
487 * \param it iterator pointing to the Block Ack agreement
488 * \param now the current time
489 * \return an iterator pointing to the next MPDU in the queue of in flight MPDUs
490 */
491 PacketQueueI HandleInFlightMpdu(uint8_t linkId,
492 PacketQueueI mpduIt,
493 MpduStatus status,
494 const OriginatorAgreementsI& it,
495 const Time& now);
496
497 /**
498 * This data structure contains, for each originator block ack agreement (recipient, TID),
499 * a set of packets for which an ack by block ack is requested.
500 * Every packet or fragment indicated as correctly received in BlockAck frame is
501 * erased from this data structure. Pushed back in retransmission queue otherwise.
502 */
504 RecipientAgreements m_recipientAgreements; //!< Recipient Block Ack agreements
505
506 std::list<AgreementKey> m_sendBarIfDataQueued; ///< list of BA agreements for which a BAR shall
507 ///< only be sent if data is queued
508
509 uint8_t m_blockAckThreshold; ///< block ack threshold
512 m_blockAckInactivityTimeout; ///< BlockAck inactivity timeout callback
515 TxOk m_txOkCallback; ///< transmit OK callback
516 TxFailed m_txFailedCallback; ///< transmit failed callback
517 DroppedOldMpdu m_droppedOldMpduCallback; ///< the dropped MPDU callback
518
519 /**
520 * The trace source fired when a state transition occurred.
521 */
524};
525
526} // namespace ns3
527
528#endif /* BLOCK_ACK_MANAGER_H */
Manages all block ack agreements for an originator station.
void SetTxFailedCallback(TxFailed callback)
RecipientAgreementOptConstRef GetAgreementAsRecipient(const Mac48Address &originator, uint8_t tid) const
void NotifyOriginatorAgreementEstablished(const Mac48Address &recipient, uint8_t tid, uint16_t startingSeq)
void CreateOriginatorAgreement(const MgtAddBaRequestHeader &reqHdr, const Mac48Address &recipient, bool htSupported=true)
std::pair< Mac48Address, uint8_t > AgreementKey
agreement key typedef (MAC address and TID)
void UpdateOriginatorAgreement(const MgtAddBaResponseHeader &respHdr, const Mac48Address &recipient, uint16_t startingSeq)
Callback< void, Mac48Address, uint8_t > m_unblockPackets
unblock packets callback
OriginatorAgreements::iterator OriginatorAgreementsI
typedef for an iterator for Agreements
void SetQueue(const Ptr< WifiMacQueue > queue)
void DestroyRecipientAgreement(const Mac48Address &originator, uint8_t tid)
Destroy a recipient Block Ack agreement.
void SetTxOkCallback(TxOk callback)
void InactivityTimeout(const Mac48Address &recipient, uint8_t tid)
Inactivity timeout function.
uint8_t m_blockAckThreshold
block ack threshold
std::list< Ptr< WifiMpdu > > PacketQueue
typedef for a list of WifiMpdu.
RecipientAgreements m_recipientAgreements
Recipient Block Ack agreements.
std::optional< std::reference_wrapper< const OriginatorBlockAckAgreement > > OriginatorAgreementOptConstRef
optional const reference to OriginatorBlockAckAgreement
static TypeId GetTypeId()
Get the type ID.
TracedCallback< Time, Mac48Address, uint8_t, OriginatorBlockAckAgreement::State > m_originatorAgreementState
The trace source fired when a state transition occurred.
void SetBlockAckThreshold(uint8_t nPackets)
DroppedOldMpdu m_droppedOldMpduCallback
the dropped MPDU callback
std::map< AgreementKey, RecipientBlockAckAgreement > RecipientAgreements
AgreementKey-indexed map of recipient block ack agreements.
std::optional< std::reference_wrapper< const RecipientBlockAckAgreement > > RecipientAgreementOptConstRef
optional const reference to RecipientBlockAckAgreement
void SetDroppedOldMpduCallback(DroppedOldMpdu callback)
TxFailed m_txFailedCallback
transmit failed callback
void SetUnblockDestinationCallback(Callback< void, Mac48Address, uint8_t > callback)
Set unblock destination callback.
void NotifyOriginatorAgreementRejected(const Mac48Address &recipient, uint8_t tid)
Ptr< WifiMacQueue > m_queue
queue
uint16_t GetRecipientBufferSize(const Mac48Address &recipient, uint8_t tid) const
This function returns the buffer size negotiated with the recipient.
void CreateRecipientAgreement(const MgtAddBaResponseHeader &respHdr, const Mac48Address &originator, uint16_t startingSeq, bool htSupported, Ptr< MacRxMiddle > rxMiddle)
void NotifyOriginatorAgreementNoReply(const Mac48Address &recipient, uint8_t tid)
void NotifyMissedBlockAck(uint8_t linkId, const Mac48Address &recipient, uint8_t tid)
OriginatorAgreements m_originatorAgreements
This data structure contains, for each originator block ack agreement (recipient, TID),...
void StorePacket(Ptr< WifiMpdu > mpdu)
void NotifyOriginatorAgreementReset(const Mac48Address &recipient, uint8_t tid)
void RemoveFromSendBarIfDataQueuedList(const Mac48Address &recipient, uint8_t tid)
Remove the given (recipient, TID) pair from the list of BA agreements for which a BAR shall only be s...
BlockAckManager & operator=(const BlockAckManager &)=delete
void NotifyGotAck(uint8_t linkId, Ptr< const WifiMpdu > mpdu)
Invoked upon receipt of an Ack frame on the given link after the transmission of a QoS data frame sen...
void AddToSendBarIfDataQueuedList(const Mac48Address &recipient, uint8_t tid)
Add the given (recipient, TID) pair to the list of BA agreements for which a BAR shall only be sent i...
void NotifyDiscardedMpdu(Ptr< const WifiMpdu > mpdu)
void NotifyGotMpdu(Ptr< const WifiMpdu > mpdu)
Callback< void, Ptr< const WifiMpdu > > TxFailed
typedef for a callback to invoke when an MPDU is negatively ack'ed.
bool NeedBarRetransmission(uint8_t tid, const Mac48Address &recipient)
This function returns true if a block ack agreement is established with the given recipient for the g...
Callback< void, Ptr< const WifiMpdu > > TxOk
typedef for a callback to invoke when an MPDU is successfully ack'ed.
void SetBlockDestinationCallback(Callback< void, Mac48Address, uint8_t > callback)
Set block destination callback.
std::list< Ptr< WifiMpdu > >::iterator PacketQueueI
typedef for an iterator for PacketQueue.
std::list< AgreementKey > m_sendBarIfDataQueued
list of BA agreements for which a BAR shall only be sent if data is queued
uint32_t GetNBufferedPackets(const Mac48Address &recipient, uint8_t tid) const
PacketQueueI HandleInFlightMpdu(uint8_t linkId, PacketQueueI mpduIt, MpduStatus status, const OriginatorAgreementsI &it, const Time &now)
Handle the given in flight MPDU based on its given status.
std::map< AgreementKey, std::pair< OriginatorBlockAckAgreement, PacketQueue > > OriginatorAgreements
AgreementKey-indexed map of originator block ack agreements.
void SetBlockAckInactivityCallback(Callback< void, Mac48Address, uint8_t, bool > callback)
Set block ack inactivity callback.
uint16_t GetOriginatorStartingSequence(const Mac48Address &recipient, uint8_t tid) const
This function returns the starting sequence number of the transmit window.
BlockAckManager(const BlockAckManager &)=delete
Callback< void, Mac48Address, uint8_t, bool > m_blockAckInactivityTimeout
BlockAck inactivity timeout callback.
Callback< void, Ptr< const WifiMpdu > > DroppedOldMpdu
typedef for a callback to invoke when an MPDU is dropped.
TxOk m_txOkCallback
transmit OK callback
MpduStatus
Enumeration for the statuses of a buffered MPDU.
void(* AgreementStateTracedCallback)(Time now, const Mac48Address &recipient, uint8_t tid, OriginatorBlockAckAgreement::State state)
TracedCallback signature for state changes.
std::pair< uint16_t, uint16_t > NotifyGotBlockAck(uint8_t linkId, const CtrlBAckResponseHeader &blockAck, const Mac48Address &recipient, const std::set< uint8_t > &tids, size_t index=0)
void DoDispose() override
Destructor implementation.
void ScheduleBar(const CtrlBAckRequestHeader &reqHdr, const WifiMacHeader &hdr)
Callback< void, Mac48Address, uint8_t > m_blockPackets
block packets callback
void DestroyOriginatorAgreement(const Mac48Address &recipient, uint8_t tid)
OriginatorAgreementOptConstRef GetAgreementAsOriginator(const Mac48Address &recipient, uint8_t tid) const
CtrlBAckRequestHeader GetBlockAckReqHeader(const Mac48Address &recipient, uint8_t tid) const
const std::list< AgreementKey > & GetSendBarIfDataQueuedList() const
void NotifyGotBlockAckRequest(const Mac48Address &originator, uint8_t tid, uint16_t startingSeq)
void NotifyMissedAck(uint8_t linkId, Ptr< WifiMpdu > mpdu)
Invoked upon missed reception of an Ack frame on the given link after the transmission of a QoS data ...
Callback template class.
Definition: callback.h:438
Headers for BlockAckRequest.
Definition: ctrl-headers.h:52
Headers for BlockAck response.
Definition: ctrl-headers.h:203
an EUI-48 address
Definition: mac48-address.h:46
Implement the header for management frames of type Add Block Ack request.
Implement the header for management frames of type Add Block Ack response.
A base class which provides memory management and object aggregation.
Definition: object.h:89
State
Represents the state for this agreement.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
Implements the IEEE 802.11 MAC header.
Every class exported by the ns3 library is enclosed in the ns3 namespace.