A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
txop.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 */
8
9#ifndef TXOP_H
10#define TXOP_H
11
12#include "wifi-mac-header.h"
13
14#include "ns3/nstime.h"
15#include "ns3/object.h"
16#include "ns3/traced-value.h"
17#include "ns3/uniform-random-bit-generator.h"
18
19#include <map>
20#include <memory>
21#include <vector>
22
23#define WIFI_TXOP_NS_LOG_APPEND_CONTEXT \
24 if (m_mac) \
25 { \
26 std::clog << "[mac=" << m_mac->GetAddress() << "] "; \
27 }
28
29class EmlsrUlTxopTest;
30
31namespace ns3
32{
33
34class Packet;
35class ChannelAccessManager;
36class MacTxMiddle;
37class WifiMode;
38class WifiMacQueue;
39class WifiMpdu;
40class UniformRandomVariable;
41class CtrlBAckResponseHeader;
42class WifiMac;
43enum AcIndex : uint8_t; // opaque enum declaration
44enum WifiMacDropReason : uint8_t; // opaque enum declaration
45
46/**
47 * @brief Handles the packet queue and stores DCF/EDCA access parameters
48 * (one Txop per AC).
49 * @ingroup wifi
50 *
51 * This class handles the packet queue and stores DCF/EDCA access
52 * parameters (one Txop per AC). It generates backoff values and stores the channel access status
53 * (not requested, requested, granted) for the corresponding DCF/EDCA and for each link.
54 */
55class Txop : public Object
56{
57 public:
58 Txop();
59 ~Txop() override;
60
61 /**
62 * @brief Get the type ID.
63 * @return the object TypeId
64 */
65 static TypeId GetTypeId();
66
67 /**
68 * typedef for a callback to invoke when an MPDU is dropped.
69 */
71
72 /**
73 * Enumeration for channel access status
74 */
81
82 /**
83 * Check for QoS TXOP.
84 *
85 * @returns true if QoS TXOP.
86 */
87 virtual bool IsQosTxop() const;
88
89 /**
90 * Set the wifi MAC this Txop is associated to.
91 *
92 * @param mac associated wifi MAC
93 */
94 virtual void SetWifiMac(const Ptr<WifiMac> mac);
95 /**
96 * Set MacTxMiddle this Txop is associated to.
97 *
98 * @param txMiddle MacTxMiddle to associate.
99 */
100 void SetTxMiddle(const Ptr<MacTxMiddle> txMiddle);
101
102 /**
103 * @param callback the callback to invoke when an MPDU is dropped
104 */
105 virtual void SetDroppedMpduCallback(DroppedMpdu callback);
106
107 /**
108 * Return the packet queue associated with this Txop.
109 *
110 * @return the associated WifiMacQueue
111 */
113
114 /**
115 * Set the minimum contention window size. For 11be multi-link devices,
116 * set the minimum contention window size on the first link.
117 *
118 * @param minCw the minimum contention window size.
119 */
120 void SetMinCw(uint32_t minCw);
121 /**
122 * Set the minimum contention window size for each link.
123 * Note that an empty <i>minCws</i> is ignored, otherwise its size must match the number
124 * of links.
125 *
126 * @param minCws the minimum contention window size for each link (links are sorted in
127 * increasing order of link ID).
128 */
129 void SetMinCws(const std::vector<uint32_t>& minCws);
130 /**
131 * Set the minimum contention window size for the given link. Note that this function can
132 * only be called after that links have been created.
133 *
134 * @param minCw the minimum contention window size.
135 * @param linkId the ID of the given link
136 */
137 void SetMinCw(uint32_t minCw, uint8_t linkId);
138 /**
139 * Set the maximum contention window size. For 11be multi-link devices,
140 * set the maximum contention window size on the first link.
141 *
142 * @param maxCw the maximum contention window size.
143 */
144 void SetMaxCw(uint32_t maxCw);
145 /**
146 * Set the maximum contention window size for each link.
147 * Note that an empty <i>maxCws</i> is ignored, otherwise its size must match the number
148 * of links.
149 *
150 * @param maxCws the maximum contention window size for each link (links are sorted in
151 * increasing order of link ID).
152 */
153 void SetMaxCws(const std::vector<uint32_t>& maxCws);
154 /**
155 * Set the maximum contention window size for the given link. Note that this function can
156 * only be called after that links have been created.
157 *
158 * @param maxCw the maximum contention window size.
159 * @param linkId the ID of the given link
160 */
161 void SetMaxCw(uint32_t maxCw, uint8_t linkId);
162 /**
163 * Set the number of slots that make up an AIFS. For 11be multi-link devices,
164 * set the number of slots that make up an AIFS on the first link.
165 *
166 * @param aifsn the number of slots that make up an AIFS.
167 */
168 void SetAifsn(uint8_t aifsn);
169 /**
170 * Set the number of slots that make up an AIFS for each link.
171 * Note that an empty <i>aifsns</i> is ignored, otherwise its size must match the number
172 * of links.
173 *
174 * @param aifsns the number of slots that make up an AIFS for each link (links are sorted in
175 * increasing order of link ID).
176 */
177 void SetAifsns(const std::vector<uint8_t>& aifsns);
178 /**
179 * Set the number of slots that make up an AIFS for the given link. Note that this function
180 * can only be called after that links have been created.
181 *
182 * @param aifsn the number of slots that make up an AIFS.
183 * @param linkId the ID of the given link
184 */
185 void SetAifsn(uint8_t aifsn, uint8_t linkId);
186 /**
187 * Set the TXOP limit.
188 *
189 * @param txopLimit the TXOP limit.
190 * Value zero corresponds to default Txop.
191 */
192 void SetTxopLimit(Time txopLimit);
193 /**
194 * Set the TXOP limit for each link.
195 * Note that an empty <i>txopLimits</i> is ignored, otherwise its size must match the number
196 * of links.
197 *
198 * @param txopLimits the TXOP limit for each link (links are sorted in increasing order of
199 * link ID).
200 */
201 void SetTxopLimits(const std::vector<Time>& txopLimits);
202 /**
203 * Set the TXOP limit for the given link. Note that this function can only be called after
204 * that links have been created.
205 *
206 * @param txopLimit the TXOP limit (must not be negative)
207 * @param linkId the ID of the given link
208 */
209 void SetTxopLimit(Time txopLimit, uint8_t linkId);
210 /**
211 * Return the minimum contention window size. For 11be multi-link devices,
212 * return the minimum contention window size on the first link.
213 *
214 * @return the minimum contention window size.
215 */
216 uint32_t GetMinCw() const;
217 /**
218 * Return the minimum contention window size for each link.
219 *
220 * @return the minimum contention window size values.
221 */
222 std::vector<uint32_t> GetMinCws() const;
223 /**
224 * Return the minimum contention window size for the given link.
225 *
226 * @param linkId the ID of the given link
227 * @return the minimum contention window size.
228 */
229 virtual uint32_t GetMinCw(uint8_t linkId) const;
230 /**
231 * Return the maximum contention window size. For 11be multi-link devices,
232 * return the maximum contention window size on the first link.
233 *
234 * @return the maximum contention window size.
235 */
236 uint32_t GetMaxCw() const;
237 /**
238 * Return the maximum contention window size for each link.
239 *
240 * @return the maximum contention window size values.
241 */
242 std::vector<uint32_t> GetMaxCws() const;
243 /**
244 * Return the maximum contention window size for the given link.
245 *
246 * @param linkId the ID of the given link
247 * @return the maximum contention window size.
248 */
249 virtual uint32_t GetMaxCw(uint8_t linkId) const;
250 /**
251 * Return the number of slots that make up an AIFS. For 11be multi-link devices,
252 * return the number of slots that make up an AIFS on the first link.
253 *
254 * @return the number of slots that make up an AIFS.
255 */
256 uint8_t GetAifsn() const;
257 /**
258 * Return the number of slots that make up an AIFS for each link.
259 *
260 * @return the number of slots that make up an AIFS for each link.
261 */
262 std::vector<uint8_t> GetAifsns() const;
263 /**
264 * Return the number of slots that make up an AIFS for the given link.
265 *
266 * @param linkId the ID of the given link
267 * @return the number of slots that make up an AIFS.
268 */
269 virtual uint8_t GetAifsn(uint8_t linkId) const;
270 /**
271 * Return the TXOP limit.
272 *
273 * @return the TXOP limit.
274 */
275 Time GetTxopLimit() const;
276 /**
277 * Return the TXOP limit for each link.
278 *
279 * @return the TXOP limit for each link.
280 */
281 std::vector<Time> GetTxopLimits() const;
282 /**
283 * Return the TXOP limit for the given link.
284 *
285 * @param linkId the ID of the given link
286 * @return the TXOP limit.
287 */
288 Time GetTxopLimit(uint8_t linkId) const;
289 /**
290 * Update the value of the CW variable for the given link to take into account
291 * a transmission success or a transmission abort (stop transmission
292 * of a packet after the maximum number of retransmissions has been
293 * reached). By default, this resets the CW variable to minCW.
294 *
295 * @param linkId the ID of the given link
296 */
297 void ResetCw(uint8_t linkId);
298 /**
299 * Update the value of the CW variable for the given link to take into account
300 * a transmission failure. By default, this triggers a doubling
301 * of CW (capped by maxCW).
302 *
303 * @param linkId the ID of the given link
304 */
305 void UpdateFailedCw(uint8_t linkId);
306
307 /**
308 * Get the current value of the CW variable for the given link. The initial
309 * value is minCw.
310 *
311 * @param linkId the ID of the given link
312 * @return the current value of the CW variable for the given link
313 */
314 uint32_t GetCw(uint8_t linkId) const;
315
316 /**
317 * Get the Station Short Retry Count (SSRC) maintained by non-QoS stations or the QoS STA
318 * Retry Count (QSRC) maintained by QoS STAs for each AC on the given link.
319 *
320 * @param linkId the ID of the given link
321 * @return the Station Short Retry Count (SSRC) maintained by non-QoS stations or the QoS STA
322 * Retry Count (QSRC) maintained by QoS STAs for each AC on the given link
323 */
324 std::size_t GetStaRetryCount(uint8_t linkId) const;
325
326 /**
327 * Notify that the given link switched to sleep mode.
328 *
329 * @param linkId the ID of the given link
330 */
331 virtual void NotifySleep(uint8_t linkId);
332 /**
333 * When off operation occurs, the queue gets cleaned up.
334 */
335 virtual void NotifyOff();
336 /**
337 * When wake up operation occurs on a link, channel access on that link
338 * will be restarted.
339 *
340 * @param linkId the ID of the link
341 */
342 virtual void NotifyWakeUp(uint8_t linkId);
343 /**
344 * When on operation occurs, channel access will be started.
345 */
346 virtual void NotifyOn();
347
348 /* Event handlers */
349 /**
350 * @param mpdu the given MPDU
351 *
352 * Store the given MPDU in the internal queue until it
353 * can be sent safely.
354 */
355 virtual void Queue(Ptr<WifiMpdu> mpdu);
356
357 /**
358 * Called by the FrameExchangeManager to notify that channel access has
359 * been granted on the given link for the given amount of time.
360 *
361 * @param linkId the ID of the given link
362 * @param txopDuration the duration of the TXOP gained (zero for DCF)
363 */
364 virtual void NotifyChannelAccessed(uint8_t linkId, Time txopDuration = Seconds(0));
365 /**
366 * Called by the FrameExchangeManager to notify the completion of the transmissions.
367 * This method generates a new backoff and restarts access if needed.
368 *
369 * @param linkId the ID of the link the FrameExchangeManager is operating on
370 */
371 virtual void NotifyChannelReleased(uint8_t linkId);
372
373 /**
374 * Assign a fixed random variable stream number to the random variables
375 * used by this model. Return the number of streams (possibly zero) that
376 * have been assigned.
377 *
378 * @param stream first stream index to use.
379 *
380 * @return the number of stream indices assigned by this model.
381 */
382 int64_t AssignStreams(int64_t stream);
383
384 /**
385 * @param linkId the ID of the given link
386 * @return the current channel access status for the given link
387 */
388 virtual ChannelAccessStatus GetAccessStatus(uint8_t linkId) const;
389
390 /**
391 * Request channel access on the given link after the occurrence of an event that possibly
392 * requires to generate a new backoff value. Examples of such an event are: a packet has been
393 * enqueued by the upper layer; the given link has been unblocked after being blocked for some
394 * reason (e.g., wait for ADDBA Response, wait for TX on another EMLSR link to finish, etc.);
395 * the PHY operating on the given link just woke up from sleep mode. The <i>checkMediumBusy</i>
396 * argument is forwarded to the NeedBackoffUponAccess method of the ChannelAccessManager.
397 *
398 * @param linkId the ID of the given link
399 * @param hadFramesToTransmit whether packets available for transmission were queued just
400 * before the occurrence of the event causing this channel access
401 * request
402 * @param checkMediumBusy whether generation of backoff (also) depends on the busy/idle state
403 * of the medium
404 */
405 void StartAccessAfterEvent(uint8_t linkId, bool hadFramesToTransmit, bool checkMediumBusy);
406
407 static constexpr bool HAD_FRAMES_TO_TRANSMIT =
408 true; //!< packets available for transmission were in the queue
409 static constexpr bool DIDNT_HAVE_FRAMES_TO_TRANSMIT =
410 false; //!< no packet available for transmission was in the queue
411 static constexpr bool CHECK_MEDIUM_BUSY =
412 true; //!< generation of backoff (also) depends on the busy/idle state of the medium
413 static constexpr bool DONT_CHECK_MEDIUM_BUSY =
414 false; //!< generation of backoff is independent of the busy/idle state of the medium
415
416 /**
417 * @param nSlots the number of slots of the backoff.
418 * @param linkId the ID of the given link
419 *
420 * Start a backoff for the given link by initializing the backoff counter to
421 * the number of slots specified.
422 */
423 void StartBackoffNow(uint32_t nSlots, uint8_t linkId);
424
425 /**
426 * Check if the Txop has frames to transmit over the given link
427 * @param linkId the ID of the given link.
428 * @return true if the Txop has frames to transmit.
429 */
430 virtual bool HasFramesToTransmit(uint8_t linkId);
431
432 /**
433 * Swap the links based on the information included in the given map. This method
434 * is normally called by the WifiMac of a non-AP MLD upon completing ML setup to have
435 * its link IDs match AP MLD's link IDs.
436 *
437 * @param links a set of pairs (from, to) each mapping a current link ID to the
438 * link ID it has to become (i.e., link 'from' becomes link 'to')
439 */
440 void SwapLinks(std::map<uint8_t, uint8_t> links);
441
442 /**
443 * DCF/EDCA access parameters for all the links provided by users via this class' attributes
444 * or the corresponding setter methods. For each access parameter, values are sorted in
445 * increasing order of link ID. If user provides access parameters, they are used by WifiMac
446 * instead of the default values specified by Table 9-155 of 802.11-2020.
447 */
449 {
450 std::vector<uint32_t> cwMins; //!< the minimum contention window values for all the links
451 std::vector<uint32_t> cwMaxs; //!< the maximum contention window values for all the links
452 std::vector<uint8_t> aifsns; //!< the AIFSN values for all the links
453 std::vector<Time> txopLimits; //!< TXOP limit values for all the links
454 };
455
456 /**
457 * @return a const reference to user-provided access parameters
458 */
460
461 protected:
462 ///< ChannelAccessManager associated class
464 friend class ::EmlsrUlTxopTest;
465
466 void DoDispose() override;
467 void DoInitialize() override;
468
469 /**
470 * Create a wifi MAC queue containing packets of the given AC
471 *
472 * @param aci the index of the given AC
473 */
474 virtual void CreateQueue(AcIndex aci);
475
476 /* Txop notifications forwarded here */
477 /**
478 * Notify that access request has been received for the given link.
479 *
480 * @param linkId the ID of the given link
481 */
482 virtual void NotifyAccessRequested(uint8_t linkId);
483
484 /**
485 * Generate a new backoff for the given link now.
486 *
487 * @param linkId the ID of the given link
488 */
489 virtual void GenerateBackoff(uint8_t linkId);
490 /**
491 * Request access to the ChannelAccessManager associated with the given link
492 *
493 * @param linkId the ID of the given link
494 */
495 void RequestAccess(uint8_t linkId);
496
497 /**
498 * Return the current number of backoff slots on the given link.
499 *
500 * @param linkId the ID of the given link
501 * @return the current number of backoff slots
502 */
503 uint32_t GetBackoffSlots(uint8_t linkId) const;
504 /**
505 * Return the time when the backoff procedure started on the given link.
506 *
507 * @param linkId the ID of the given link
508 * @return the time when the backoff procedure started
509 */
510 Time GetBackoffStart(uint8_t linkId) const;
511 /**
512 * Update backoff slots for the given link that nSlots has passed.
513 *
514 * @param nSlots the number of slots to decrement
515 * @param backoffUpdateBound the time at which backoff should start
516 * @param linkId the ID of the given link
517 */
518 void UpdateBackoffSlotsNow(uint32_t nSlots, Time backoffUpdateBound, uint8_t linkId);
519
520 /**
521 * Structure holding information specific to a single link. Here, the meaning of
522 * "link" is that of the 11be amendment which introduced multi-link devices. For
523 * previous amendments, only one link can be created.
524 */
526 {
527 /// Destructor (a virtual method is needed to make this struct polymorphic)
528 virtual ~LinkEntity() = default;
529
530 uint32_t backoffSlots{0}; //!< the number of backoff slots
531 Time backoffStart{0}; /**< the backoffStart variable is used to keep
532 track of the time at which a backoff was
533 started or the time at which the backoff
534 counter was last updated */
535 uint32_t cw{0}; //!< the current contention window
536 uint32_t cwMin{0}; //!< the minimum contention window
537 uint32_t cwMax{0}; //!< the maximum contention window
538 uint8_t aifsn{0}; //!< the AIFSN
539 Time txopLimit{0}; //!< the TXOP limit time
540 std::size_t staRetryCount{0}; //!< the Station Short Retry Count (SSRC) maintained by
541 //!< non-QoS stations or the QoS STA Retry Count (QSRC)
542 //!< maintained by QoS STAs for each AC
543 ChannelAccessStatus access{NOT_REQUESTED}; //!< channel access status
544
545 mutable class
546 {
547 friend void Txop::Queue(Ptr<WifiMpdu>);
549 } accessRequest; //!< access request event, to be used by Txop::Queue() only
550 };
551
552 /**
553 * Get a reference to the link associated with the given ID.
554 *
555 * @param linkId the given link ID
556 * @return a reference to the link associated with the given ID
557 */
558 LinkEntity& GetLink(uint8_t linkId) const;
559
560 /**
561 * @return a const reference to the map of link entities
562 */
563 const std::map<uint8_t, std::unique_ptr<LinkEntity>>& GetLinks() const;
564
565 DroppedMpdu m_droppedMpduCallback; //!< the dropped MPDU callback
566 Ptr<WifiMacQueue> m_queue; //!< the wifi MAC queue
567 Ptr<MacTxMiddle> m_txMiddle; //!< the MacTxMiddle
568 Ptr<WifiMac> m_mac; //!< the wifi MAC
569 Ptr<UniformRandomVariable> m_rng; //!< the random stream
570 UniformRandomBitGenerator m_shuffleLinkIdsGen; //!< random number generator to shuffle link IDs
571
572 /// TracedCallback for backoff trace value typedef
573 typedef TracedCallback<uint32_t /* value */, uint8_t /* linkId */> BackoffValueTracedCallback;
574 /// TracedCallback for CW trace value typedef
575 typedef TracedCallback<uint32_t /* value */, uint8_t /* linkId */> CwValueTracedCallback;
576
578 CwValueTracedCallback m_cwTrace; //!< CW trace value
579
580 private:
581 /**
582 * Create a LinkEntity object.
583 *
584 * @return a unique pointer to the created LinkEntity object
585 */
586 virtual std::unique_ptr<LinkEntity> CreateLinkEntity() const;
587
588 std::map<uint8_t, std::unique_ptr<LinkEntity>>
589 m_links; //!< ID-indexed map of LinkEntity objects
590
591 UserDefinedAccessParams m_userAccessParams; //!< user-defined DCF/EDCA access parameters
592};
593
594} // namespace ns3
595
596#endif /* TXOP_H */
Test the transmission of UL frames from EMLSR clients.
Callback template class.
Definition callback.h:422
Manage a set of ns3::Txop.
An identifier for simulation events.
Definition event-id.h:45
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Forward calls to a chain of Callback.
Handles the packet queue and stores DCF/EDCA access parameters (one Txop per AC).
Definition txop.h:56
Ptr< WifiMac > m_mac
the wifi MAC
Definition txop.h:568
Time GetTxopLimit() const
Return the TXOP limit.
Definition txop.cc:602
virtual std::unique_ptr< LinkEntity > CreateLinkEntity() const
Create a LinkEntity object.
Definition txop.cc:197
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition txop.cc:697
virtual ChannelAccessStatus GetAccessStatus(uint8_t linkId) const
Definition txop.cc:749
Ptr< WifiMacQueue > m_queue
the wifi MAC queue
Definition txop.h:566
void StartAccessAfterEvent(uint8_t linkId, bool hadFramesToTransmit, bool checkMediumBusy)
Request channel access on the given link after the occurrence of an event that possibly requires to g...
Definition txop.cc:705
virtual bool HasFramesToTransmit(uint8_t linkId)
Check if the Txop has frames to transmit over the given link.
Definition txop.cc:626
virtual void NotifyOff()
When off operation occurs, the queue gets cleaned up.
Definition txop.cc:806
UniformRandomBitGenerator m_shuffleLinkIdsGen
random number generator to shuffle link IDs
Definition txop.h:570
std::size_t GetStaRetryCount(uint8_t linkId) const
Get the Station Short Retry Count (SSRC) maintained by non-QoS stations or the QoS STA Retry Count (Q...
Definition txop.cc:362
Ptr< UniformRandomVariable > m_rng
the random stream
Definition txop.h:569
CwValueTracedCallback m_cwTrace
CW trace value.
Definition txop.h:578
void DoDispose() override
Destructor implementation.
Definition txop.cc:178
void SetMaxCw(uint32_t maxCw)
Set the maximum contention window size.
Definition txop.cc:313
void SetMaxCws(const std::vector< uint32_t > &maxCws)
Set the maximum contention window size for each link.
Definition txop.cc:319
uint32_t GetMinCw() const
Return the minimum contention window size.
Definition txop.cc:530
ChannelAccessStatus
Enumeration for channel access status.
Definition txop.h:76
@ GRANTED
Definition txop.h:79
@ NOT_REQUESTED
Definition txop.h:77
@ REQUESTED
Definition txop.h:78
virtual void NotifyOn()
When on operation occurs, channel access will be started.
Definition txop.cc:821
void UpdateFailedCw(uint8_t linkId)
Update the value of the CW variable for the given link to take into account a transmission failure.
Definition txop.cc:378
void SetAifsns(const std::vector< uint8_t > &aifsns)
Set the number of slots that make up an AIFS for each link.
Definition txop.cc:453
static constexpr bool DIDNT_HAVE_FRAMES_TO_TRANSMIT
no packet available for transmission was in the queue
Definition txop.h:409
Ptr< WifiMacQueue > GetWifiMacQueue() const
Return the packet queue associated with this Txop.
Definition txop.cc:264
virtual void SetWifiMac(const Ptr< WifiMac > mac)
Set the wifi MAC this Txop is associated to.
Definition txop.cc:242
virtual void NotifyWakeUp(uint8_t linkId)
When wake up operation occurs on a link, channel access on that link will be restarted.
Definition txop.cc:813
virtual void NotifyChannelReleased(uint8_t linkId)
Called by the FrameExchangeManager to notify the completion of the transmissions.
Definition txop.cc:769
std::vector< uint32_t > GetMaxCws() const
Return the maximum contention window size for each link.
Definition txop.cc:560
virtual void Queue(Ptr< WifiMpdu > mpdu)
Definition txop.cc:635
void SetTxopLimit(Time txopLimit)
Set the TXOP limit.
Definition txop.cc:484
virtual void CreateQueue(AcIndex aci)
Create a wifi MAC queue containing packets of the given AC.
Definition txop.cc:189
TracedCallback< uint32_t, uint8_t > BackoffValueTracedCallback
TracedCallback for backoff trace value typedef.
Definition txop.h:573
void ResetCw(uint8_t linkId)
Update the value of the CW variable for the given link to take into account a transmission success or...
Definition txop.cc:368
LinkEntity & GetLink(uint8_t linkId) const
Get a reference to the link associated with the given ID.
Definition txop.cc:203
virtual bool IsQosTxop() const
Check for QoS TXOP.
Definition txop.cc:832
std::vector< uint32_t > GetMinCws() const
Return the minimum contention window size for each link.
Definition txop.cc:536
std::vector< uint8_t > GetAifsns() const
Return the number of slots that make up an AIFS for each link.
Definition txop.cc:584
void UpdateBackoffSlotsNow(uint32_t nSlots, Time backoffUpdateBound, uint8_t linkId)
Update backoff slots for the given link that nSlots has passed.
Definition txop.cc:418
TracedCallback< uint32_t, uint8_t > CwValueTracedCallback
TracedCallback for CW trace value typedef.
Definition txop.h:575
Time GetBackoffStart(uint8_t linkId) const
Return the time when the backoff procedure started on the given link.
Definition txop.cc:412
void SetTxopLimits(const std::vector< Time > &txopLimits)
Set the TXOP limit for each link.
Definition txop.cc:490
DroppedMpdu m_droppedMpduCallback
the dropped MPDU callback
Definition txop.h:565
void SwapLinks(std::map< uint8_t, uint8_t > links)
Swap the links based on the information included in the given map.
Definition txop.cc:218
const UserDefinedAccessParams & GetUserAccessParams() const
Definition txop.cc:524
void SetTxMiddle(const Ptr< MacTxMiddle > txMiddle)
Set MacTxMiddle this Txop is associated to.
Definition txop.cc:235
std::vector< Time > GetTxopLimits() const
Return the TXOP limit for each link.
Definition txop.cc:608
const std::map< uint8_t, std::unique_ptr< LinkEntity > > & GetLinks() const
Definition txop.cc:212
static TypeId GetTypeId()
Get the type ID.
Definition txop.cc:40
void SetAifsn(uint8_t aifsn)
Set the number of slots that make up an AIFS.
Definition txop.cc:447
uint32_t GetCw(uint8_t linkId) const
Get the current value of the CW variable for the given link.
Definition txop.cc:356
virtual void SetDroppedMpduCallback(DroppedMpdu callback)
Definition txop.cc:253
UserDefinedAccessParams m_userAccessParams
user-defined DCF/EDCA access parameters
Definition txop.h:591
virtual void GenerateBackoff(uint8_t linkId)
Generate a new backoff for the given link now.
Definition txop.cc:791
BackoffValueTracedCallback m_backoffTrace
backoff trace value
Definition txop.h:577
virtual void NotifyAccessRequested(uint8_t linkId)
Notify that access request has been received for the given link.
Definition txop.cc:755
Ptr< MacTxMiddle > m_txMiddle
the MacTxMiddle
Definition txop.h:567
static constexpr bool CHECK_MEDIUM_BUSY
generation of backoff (also) depends on the busy/idle state of the medium
Definition txop.h:411
~Txop() override
Definition txop.cc:172
void StartBackoffNow(uint32_t nSlots, uint8_t linkId)
Definition txop.cc:429
virtual void NotifyChannelAccessed(uint8_t linkId, Time txopDuration=Seconds(0))
Called by the FrameExchangeManager to notify that channel access has been granted on the given link f...
Definition txop.cc:762
std::map< uint8_t, std::unique_ptr< LinkEntity > > m_links
ID-indexed map of LinkEntity objects.
Definition txop.h:589
void SetMinCws(const std::vector< uint32_t > &minCws)
Set the minimum contention window size for each link.
Definition txop.cc:276
void RequestAccess(uint8_t linkId)
Request access to the ChannelAccessManager associated with the given link.
Definition txop.cc:781
void SetMinCw(uint32_t minCw)
Set the minimum contention window size.
Definition txop.cc:270
uint8_t GetAifsn() const
Return the number of slots that make up an AIFS.
Definition txop.cc:578
uint32_t GetBackoffSlots(uint8_t linkId) const
Return the current number of backoff slots on the given link.
Definition txop.cc:406
virtual void NotifySleep(uint8_t linkId)
Notify that the given link switched to sleep mode.
Definition txop.cc:800
static constexpr bool DONT_CHECK_MEDIUM_BUSY
generation of backoff is independent of the busy/idle state of the medium
Definition txop.h:413
uint32_t GetMaxCw() const
Return the maximum contention window size.
Definition txop.cc:554
static constexpr bool HAD_FRAMES_TO_TRANSMIT
packets available for transmission were in the queue
Definition txop.h:407
Callback< void, WifiMacDropReason, Ptr< const WifiMpdu > > DroppedMpdu
typedef for a callback to invoke when an MPDU is dropped.
Definition txop.h:70
void DoInitialize() override
Initialize() implementation.
Definition txop.cc:738
a unique identifier for an interface.
Definition type-id.h:48
Wraps a UniformRandomVariable into a class that meets the requirements of a UniformRandomBitGenerator...
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1344
WifiMacDropReason
The reason why an MPDU was dropped.
Definition wifi-mac.h:71
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition qos-utils.h:62
Every class exported by the ns3 library is enclosed in the ns3 namespace.
DCF/EDCA access parameters for all the links provided by users via this class' attributes or the corr...
Definition txop.h:449
std::vector< uint32_t > cwMins
the minimum contention window values for all the links
Definition txop.h:450
std::vector< uint8_t > aifsns
the AIFSN values for all the links
Definition txop.h:452
std::vector< uint32_t > cwMaxs
the maximum contention window values for all the links
Definition txop.h:451
std::vector< Time > txopLimits
TXOP limit values for all the links.
Definition txop.h:453