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 * Notify that the given link is switched off.
334 *
335 * @param linkId the ID of the given link
336 */
337 virtual void NotifyOff(uint8_t linkId);
338 /**
339 * When wake up operation occurs on a link, channel access on that link
340 * will be restarted.
341 *
342 * @param linkId the ID of the link
343 */
344 virtual void NotifyWakeUp(uint8_t linkId);
345 /**
346 * When on operation occurs, channel access will be started.
347 */
348 virtual void NotifyOn();
349
350 /* Event handlers */
351 /**
352 * @param mpdu the given MPDU
353 *
354 * Store the given MPDU in the internal queue until it
355 * can be sent safely.
356 */
357 virtual void Queue(Ptr<WifiMpdu> mpdu);
358
359 /**
360 * Called by the FrameExchangeManager to notify that channel access has
361 * been granted on the given link for the given amount of time.
362 *
363 * @param linkId the ID of the given link
364 * @param txopDuration the duration of the TXOP gained (zero for DCF)
365 */
366 virtual void NotifyChannelAccessed(uint8_t linkId, Time txopDuration = Seconds(0));
367 /**
368 * Called by the FrameExchangeManager to notify the completion of the transmissions.
369 * This method generates a new backoff and restarts access if needed.
370 *
371 * @param linkId the ID of the link the FrameExchangeManager is operating on
372 */
373 virtual void NotifyChannelReleased(uint8_t linkId);
374
375 /**
376 * Assign a fixed random variable stream number to the random variables
377 * used by this model. Return the number of streams (possibly zero) that
378 * have been assigned.
379 *
380 * @param stream first stream index to use.
381 *
382 * @return the number of stream indices assigned by this model.
383 */
384 int64_t AssignStreams(int64_t stream);
385
386 /**
387 * @param linkId the ID of the given link
388 * @return the current channel access status for the given link
389 */
390 virtual ChannelAccessStatus GetAccessStatus(uint8_t linkId) const;
391
392 /**
393 * Request channel access on the given link after the occurrence of an event that possibly
394 * requires to generate a new backoff value. Examples of such an event are: a packet has been
395 * enqueued by the upper layer; the given link has been unblocked after being blocked for some
396 * reason (e.g., wait for ADDBA Response, wait for TX on another EMLSR link to finish, etc.);
397 * the PHY operating on the given link just woke up from sleep mode. The <i>checkMediumBusy</i>
398 * argument is forwarded to the NeedBackoffUponAccess method of the ChannelAccessManager.
399 *
400 * @param linkId the ID of the given link
401 * @param hadFramesToTransmit whether packets available for transmission were queued just
402 * before the occurrence of the event causing this channel access
403 * request
404 * @param checkMediumBusy whether generation of backoff (also) depends on the busy/idle state
405 * of the medium
406 */
407 void StartAccessAfterEvent(uint8_t linkId, bool hadFramesToTransmit, bool checkMediumBusy);
408
409 static constexpr bool HAD_FRAMES_TO_TRANSMIT =
410 true; //!< packets available for transmission were in the queue
411 static constexpr bool DIDNT_HAVE_FRAMES_TO_TRANSMIT =
412 false; //!< no packet available for transmission was in the queue
413 static constexpr bool CHECK_MEDIUM_BUSY =
414 true; //!< generation of backoff (also) depends on the busy/idle state of the medium
415 static constexpr bool DONT_CHECK_MEDIUM_BUSY =
416 false; //!< generation of backoff is independent of the busy/idle state of the medium
417
418 /**
419 * @param nSlots the number of slots of the backoff.
420 * @param linkId the ID of the given link
421 *
422 * Start a backoff for the given link by initializing the backoff counter to
423 * the number of slots specified.
424 */
425 void StartBackoffNow(uint32_t nSlots, uint8_t linkId);
426
427 /**
428 * Return the current number of backoff slots on the given link.
429 *
430 * @param linkId the ID of the given link
431 * @return the current number of backoff slots
432 */
433 uint32_t GetBackoffSlots(uint8_t linkId) const;
434
435 /**
436 * Check if the Txop has frames to transmit over the given link
437 * @param linkId the ID of the given link.
438 * @return true if the Txop has frames to transmit.
439 */
440 virtual bool HasFramesToTransmit(uint8_t linkId);
441
442 /**
443 * Swap the links based on the information included in the given map. This method
444 * is normally called by the WifiMac of a non-AP MLD upon completing ML setup to have
445 * its link IDs match AP MLD's link IDs.
446 *
447 * @param links a set of pairs (from, to) each mapping a current link ID to the
448 * link ID it has to become (i.e., link 'from' becomes link 'to')
449 */
450 void SwapLinks(std::map<uint8_t, uint8_t> links);
451
452 /**
453 * DCF/EDCA access parameters for all the links provided by users via this class' attributes
454 * or the corresponding setter methods. For each access parameter, values are sorted in
455 * increasing order of link ID. If user provides access parameters, they are used by WifiMac
456 * instead of the default values specified by Table 9-155 of 802.11-2020.
457 */
459 {
460 std::vector<uint32_t> cwMins; //!< the minimum contention window values for all the links
461 std::vector<uint32_t> cwMaxs; //!< the maximum contention window values for all the links
462 std::vector<uint8_t> aifsns; //!< the AIFSN values for all the links
463 std::vector<Time> txopLimits; //!< TXOP limit values for all the links
464 };
465
466 /**
467 * @return a const reference to user-provided access parameters
468 */
470
471 protected:
472 ///< ChannelAccessManager associated class
474 friend class ::EmlsrUlTxopTest;
475
476 void DoDispose() override;
477 void DoInitialize() override;
478
479 /**
480 * Create a wifi MAC queue containing packets of the given AC
481 *
482 * @param aci the index of the given AC
483 */
484 virtual void CreateQueue(AcIndex aci);
485
486 /* Txop notifications forwarded here */
487 /**
488 * Notify that access request has been received for the given link.
489 *
490 * @param linkId the ID of the given link
491 */
492 virtual void NotifyAccessRequested(uint8_t linkId);
493
494 /**
495 * Generate a new backoff for the given link now.
496 *
497 * @param linkId the ID of the given link
498 */
499 virtual void GenerateBackoff(uint8_t linkId);
500 /**
501 * Request access to the ChannelAccessManager associated with the given link
502 *
503 * @param linkId the ID of the given link
504 */
505 void RequestAccess(uint8_t linkId);
506
507 /**
508 * Return the time when the backoff procedure started on the given link.
509 *
510 * @param linkId the ID of the given link
511 * @return the time when the backoff procedure started
512 */
513 Time GetBackoffStart(uint8_t linkId) const;
514 /**
515 * Update backoff slots for the given link that nSlots has passed.
516 *
517 * @param nSlots the number of slots to decrement
518 * @param backoffUpdateBound the time at which backoff should start
519 * @param linkId the ID of the given link
520 */
521 void UpdateBackoffSlotsNow(uint32_t nSlots, Time backoffUpdateBound, uint8_t linkId);
522
523 /**
524 * Structure holding information specific to a single link. Here, the meaning of
525 * "link" is that of the 11be amendment which introduced multi-link devices. For
526 * previous amendments, only one link can be created.
527 */
529 {
530 /// Destructor (a virtual method is needed to make this struct polymorphic)
531 virtual ~LinkEntity() = default;
532
533 uint32_t backoffSlots{0}; //!< the number of backoff slots
534 Time backoffStart{0}; /**< the backoffStart variable is used to keep
535 track of the time at which a backoff was
536 started or the time at which the backoff
537 counter was last updated */
538 uint32_t cw{0}; //!< the current contention window
539 uint32_t cwMin{0}; //!< the minimum contention window
540 uint32_t cwMax{0}; //!< the maximum contention window
541 uint8_t aifsn{0}; //!< the AIFSN
542 Time txopLimit{0}; //!< the TXOP limit time
543 std::size_t staRetryCount{0}; //!< the Station Short Retry Count (SSRC) maintained by
544 //!< non-QoS stations or the QoS STA Retry Count (QSRC)
545 //!< maintained by QoS STAs for each AC
546 ChannelAccessStatus access{NOT_REQUESTED}; //!< channel access status
547
548 mutable class
549 {
550 friend void Txop::Queue(Ptr<WifiMpdu>);
552 } accessRequest; //!< access request event, to be used by Txop::Queue() only
553 };
554
555 /**
556 * Get a reference to the link associated with the given ID.
557 *
558 * @param linkId the given link ID
559 * @return a reference to the link associated with the given ID
560 */
561 LinkEntity& GetLink(uint8_t linkId) const;
562
563 /**
564 * @return a const reference to the map of link entities
565 */
566 const std::map<uint8_t, std::unique_ptr<LinkEntity>>& GetLinks() const;
567
568 DroppedMpdu m_droppedMpduCallback; //!< the dropped MPDU callback
569 Ptr<WifiMacQueue> m_queue; //!< the wifi MAC queue
570 Ptr<MacTxMiddle> m_txMiddle; //!< the MacTxMiddle
571 Ptr<WifiMac> m_mac; //!< the wifi MAC
572 Ptr<UniformRandomVariable> m_rng; //!< the random stream
573 UniformRandomBitGenerator m_shuffleLinkIdsGen; //!< random number generator to shuffle link IDs
574
575 /// TracedCallback for backoff trace value typedef
576 typedef TracedCallback<uint32_t /* value */, uint8_t /* linkId */> BackoffValueTracedCallback;
577 /// TracedCallback for CW trace value typedef
578 typedef TracedCallback<uint32_t /* value */, uint8_t /* linkId */> CwValueTracedCallback;
579
581 CwValueTracedCallback m_cwTrace; //!< CW trace value
582
583 private:
584 /**
585 * Create a LinkEntity object.
586 *
587 * @return a unique pointer to the created LinkEntity object
588 */
589 virtual std::unique_ptr<LinkEntity> CreateLinkEntity() const;
590
591 std::map<uint8_t, std::unique_ptr<LinkEntity>>
592 m_links; //!< ID-indexed map of LinkEntity objects
593
594 UserDefinedAccessParams m_userAccessParams; //!< user-defined DCF/EDCA access parameters
595};
596
597} // namespace ns3
598
599#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:96
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:571
Time GetTxopLimit() const
Return the TXOP limit.
Definition txop.cc:609
virtual std::unique_ptr< LinkEntity > CreateLinkEntity() const
Create a LinkEntity object.
Definition txop.cc:204
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition txop.cc:704
virtual ChannelAccessStatus GetAccessStatus(uint8_t linkId) const
Definition txop.cc:756
Ptr< WifiMacQueue > m_queue
the wifi MAC queue
Definition txop.h:569
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:712
virtual bool HasFramesToTransmit(uint8_t linkId)
Check if the Txop has frames to transmit over the given link.
Definition txop.cc:633
UniformRandomBitGenerator m_shuffleLinkIdsGen
random number generator to shuffle link IDs
Definition txop.h:573
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:369
Ptr< UniformRandomVariable > m_rng
the random stream
Definition txop.h:572
CwValueTracedCallback m_cwTrace
CW trace value.
Definition txop.h:581
void DoDispose() override
Destructor implementation.
Definition txop.cc:185
void SetMaxCw(uint32_t maxCw)
Set the maximum contention window size.
Definition txop.cc:320
void SetMaxCws(const std::vector< uint32_t > &maxCws)
Set the maximum contention window size for each link.
Definition txop.cc:326
uint32_t GetMinCw() const
Return the minimum contention window size.
Definition txop.cc:537
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:827
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:385
void SetAifsns(const std::vector< uint8_t > &aifsns)
Set the number of slots that make up an AIFS for each link.
Definition txop.cc:460
static constexpr bool DIDNT_HAVE_FRAMES_TO_TRANSMIT
no packet available for transmission was in the queue
Definition txop.h:411
Ptr< WifiMacQueue > GetWifiMacQueue() const
Return the packet queue associated with this Txop.
Definition txop.cc:271
virtual void SetWifiMac(const Ptr< WifiMac > mac)
Set the wifi MAC this Txop is associated to.
Definition txop.cc:249
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:819
virtual void NotifyChannelReleased(uint8_t linkId)
Called by the FrameExchangeManager to notify the completion of the transmissions.
Definition txop.cc:776
std::vector< uint32_t > GetMaxCws() const
Return the maximum contention window size for each link.
Definition txop.cc:567
virtual void Queue(Ptr< WifiMpdu > mpdu)
Definition txop.cc:642
void SetTxopLimit(Time txopLimit)
Set the TXOP limit.
Definition txop.cc:491
virtual void CreateQueue(AcIndex aci)
Create a wifi MAC queue containing packets of the given AC.
Definition txop.cc:196
TracedCallback< uint32_t, uint8_t > BackoffValueTracedCallback
TracedCallback for backoff trace value typedef.
Definition txop.h:576
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:375
LinkEntity & GetLink(uint8_t linkId) const
Get a reference to the link associated with the given ID.
Definition txop.cc:210
virtual bool IsQosTxop() const
Check for QoS TXOP.
Definition txop.cc:838
std::vector< uint32_t > GetMinCws() const
Return the minimum contention window size for each link.
Definition txop.cc:543
std::vector< uint8_t > GetAifsns() const
Return the number of slots that make up an AIFS for each link.
Definition txop.cc:591
void UpdateBackoffSlotsNow(uint32_t nSlots, Time backoffUpdateBound, uint8_t linkId)
Update backoff slots for the given link that nSlots has passed.
Definition txop.cc:425
TracedCallback< uint32_t, uint8_t > CwValueTracedCallback
TracedCallback for CW trace value typedef.
Definition txop.h:578
Time GetBackoffStart(uint8_t linkId) const
Return the time when the backoff procedure started on the given link.
Definition txop.cc:419
void SetTxopLimits(const std::vector< Time > &txopLimits)
Set the TXOP limit for each link.
Definition txop.cc:497
DroppedMpdu m_droppedMpduCallback
the dropped MPDU callback
Definition txop.h:568
void SwapLinks(std::map< uint8_t, uint8_t > links)
Swap the links based on the information included in the given map.
Definition txop.cc:225
const UserDefinedAccessParams & GetUserAccessParams() const
Definition txop.cc:531
void SetTxMiddle(const Ptr< MacTxMiddle > txMiddle)
Set MacTxMiddle this Txop is associated to.
Definition txop.cc:242
std::vector< Time > GetTxopLimits() const
Return the TXOP limit for each link.
Definition txop.cc:615
const std::map< uint8_t, std::unique_ptr< LinkEntity > > & GetLinks() const
Definition txop.cc:219
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:454
uint32_t GetCw(uint8_t linkId) const
Get the current value of the CW variable for the given link.
Definition txop.cc:363
virtual void SetDroppedMpduCallback(DroppedMpdu callback)
Definition txop.cc:260
UserDefinedAccessParams m_userAccessParams
user-defined DCF/EDCA access parameters
Definition txop.h:594
virtual void GenerateBackoff(uint8_t linkId)
Generate a new backoff for the given link now.
Definition txop.cc:798
BackoffValueTracedCallback m_backoffTrace
backoff trace value
Definition txop.h:580
virtual void NotifyAccessRequested(uint8_t linkId)
Notify that access request has been received for the given link.
Definition txop.cc:762
virtual void NotifyOff(uint8_t linkId)
Notify that the given link is switched off.
Definition txop.cc:813
Ptr< MacTxMiddle > m_txMiddle
the MacTxMiddle
Definition txop.h:570
static constexpr bool CHECK_MEDIUM_BUSY
generation of backoff (also) depends on the busy/idle state of the medium
Definition txop.h:413
~Txop() override
Definition txop.cc:179
void StartBackoffNow(uint32_t nSlots, uint8_t linkId)
Definition txop.cc:436
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:769
std::map< uint8_t, std::unique_ptr< LinkEntity > > m_links
ID-indexed map of LinkEntity objects.
Definition txop.h:592
void SetMinCws(const std::vector< uint32_t > &minCws)
Set the minimum contention window size for each link.
Definition txop.cc:283
void RequestAccess(uint8_t linkId)
Request access to the ChannelAccessManager associated with the given link.
Definition txop.cc:788
void SetMinCw(uint32_t minCw)
Set the minimum contention window size.
Definition txop.cc:277
uint8_t GetAifsn() const
Return the number of slots that make up an AIFS.
Definition txop.cc:585
uint32_t GetBackoffSlots(uint8_t linkId) const
Return the current number of backoff slots on the given link.
Definition txop.cc:413
virtual void NotifySleep(uint8_t linkId)
Notify that the given link switched to sleep mode.
Definition txop.cc:807
static constexpr bool DONT_CHECK_MEDIUM_BUSY
generation of backoff is independent of the busy/idle state of the medium
Definition txop.h:415
uint32_t GetMaxCw() const
Return the maximum contention window size.
Definition txop.cc:561
static constexpr bool HAD_FRAMES_TO_TRANSMIT
packets available for transmission were in the queue
Definition txop.h:409
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:745
a unique identifier for an interface.
Definition type-id.h:49
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:1369
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:459
std::vector< uint32_t > cwMins
the minimum contention window values for all the links
Definition txop.h:460
std::vector< uint8_t > aifsns
the AIFSN values for all the links
Definition txop.h:462
std::vector< uint32_t > cwMaxs
the maximum contention window values for all the links
Definition txop.h:461
std::vector< Time > txopLimits
TXOP limit values for all the links.
Definition txop.h:463