A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
channel-access-manager.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005,2006 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 */
8
9#ifndef CHANNEL_ACCESS_MANAGER_H
10#define CHANNEL_ACCESS_MANAGER_H
11
12#include "wifi-phy-common.h"
14
15#include "ns3/event-id.h"
16#include "ns3/nstime.h"
17#include "ns3/object.h"
18#include "ns3/traced-callback.h"
19
20#include <algorithm>
21#include <map>
22#include <memory>
23#include <unordered_map>
24#include <vector>
25
26class EmlsrUlTxopTest;
28
29namespace ns3
30{
31
32class WifiPhy;
33class PhyListener;
34class Txop;
35class FrameExchangeManager;
36class WifiTxVector;
37enum AcIndex : uint8_t; // opaque enum declaration
38
39/**
40 * @brief Manage a set of ns3::Txop
41 * @ingroup wifi
42 *
43 * Handle a set of independent ns3::Txop, each of which represents
44 * a single DCF within a MAC stack. Each ns3::Txop has a priority
45 * implicitly associated with it (the priority is determined when the
46 * ns3::Txop is added to the ChannelAccessManager: the first Txop to be
47 * added gets the highest priority, the second, the second highest
48 * priority, and so on.) which is used to handle "internal" collisions.
49 * i.e., when two local Txop are expected to get access to the
50 * medium at the same time, the highest priority local Txop wins
51 * access to the medium and the other Txop suffers a "internal"
52 * collision.
53 */
55{
56 /// Allow test cases to access private members
57 friend class ::EmlsrUlTxopTest;
58 friend class ::EmlsrCcaBusyTest;
59
60 public:
62 ~ChannelAccessManager() override;
63
64 /**
65 * @brief Get the type ID.
66 * @return the object TypeId
67 */
68 static TypeId GetTypeId();
69
70 /**
71 * Set up (or reactivate) listener for PHY events on the given PHY. The new (or reactivated)
72 * listener becomes the active listener and the previous active listener attached to another
73 * PHY, if any, is deactivated.
74 *
75 * @param phy the WifiPhy to listen to
76 */
78 /**
79 * Remove current registered listener for PHY events on the given PHY.
80 *
81 * @param phy the WifiPhy to listen to
82 */
84 /**
85 * Deactivate current registered listener for PHY events on the given PHY. All notifications
86 * but channel switch notifications coming from an inactive listener are ignored.
87 *
88 * @param phy the WifiPhy to listen to
89 */
91 /**
92 * Set the ID of the link this Channel Access Manager is associated with.
93 *
94 * @param linkId the ID of the link this Channel Access Manager is associated with
95 */
96 void SetLinkId(uint8_t linkId);
97 /**
98 * Set up the Frame Exchange Manager.
99 *
100 * @param feManager the Frame Exchange Manager
101 */
103
104 /**
105 * @param txop a new Txop.
106 *
107 * The ChannelAccessManager does not take ownership of this pointer so, the callee
108 * must make sure that the Txop pointer will stay valid as long
109 * as the ChannelAccessManager is valid. Note that the order in which Txop
110 * objects are added to a ChannelAccessManager matters: the first Txop added
111 * has the highest priority, the second Txop added, has the second
112 * highest priority, etc.
113 */
114 void Add(Ptr<Txop> txop);
115
116 /**
117 * Determine if a new backoff needs to be generated as per letter a) of Section 10.23.2.2
118 * of IEEE 802.11-2020 ("EDCA backoff procedure"). This method is called upon the occurrence
119 * of events such as the enqueuing of a packet or the unblocking of some links after they
120 * have been blocked for some reason (e.g., wait for ADDBA Response, wait for TX on another
121 * EMLSR link to finish, etc.). The <i>checkMediumBusy</i> argument allows to generate a new
122 * backoff regardless of the busy/idle state of the medium, as per Section 35.3.16.4 of
123 * 802.11be D4.0.
124 *
125 * @param txop the Txop requesting to generate a backoff
126 * @param hadFramesToTransmit whether packets available for transmission were queued just
127 * before the occurrence of the event triggering this call
128 * @param checkMediumBusy whether generation of backoff (also) depends on the busy/idle state
129 * of the medium
130 * @return true if backoff needs to be generated, false otherwise
131 */
132 bool NeedBackoffUponAccess(Ptr<Txop> txop, bool hadFramesToTransmit, bool checkMediumBusy);
133
134 /**
135 * @param txop a Txop
136 *
137 * Notify the ChannelAccessManager that a specific Txop needs access to the
138 * medium. The ChannelAccessManager is then responsible for starting an access
139 * timer and, invoking FrameExchangeManager::StartTransmission when the access
140 * is granted if it ever gets granted.
141 */
142 void RequestAccess(Ptr<Txop> txop);
143
144 /**
145 * Access will never be granted to the medium _before_
146 * the time returned by this method.
147 *
148 * @param ignoreNav flag whether NAV should be ignored
149 *
150 * @returns the absolute time at which access could start to be granted
151 */
152 Time GetAccessGrantStart(bool ignoreNav = false) const;
153
154 /**
155 * Return the time when the backoff procedure
156 * started for the given Txop.
157 *
158 * @param txop the Txop
159 *
160 * @return the time when the backoff procedure started
161 */
163
164 /**
165 * Return the time when the backoff procedure
166 * ended (or will end) for the given Txop.
167 *
168 * @param txop the Txop
169 *
170 * @return the time when the backoff procedure ended (or will end)
171 */
172 Time GetBackoffEndFor(Ptr<Txop> txop) const;
173
174 /**
175 * @return the time until the NAV has been set
176 */
177 Time GetNavEnd() const;
178
179 /**
180 * @param qosTxop a QosTxop that needs to be disabled
181 * @param duration the amount of time during which the QosTxop is disabled
182 *
183 * Disable the given EDCA for the given amount of time. This EDCA will not be
184 * granted channel access during this period and the backoff timer will be frozen.
185 * After this period, the EDCA will start normal operations again by resuming
186 * the backoff timer.
187 */
188 void DisableEdcaFor(Ptr<Txop> qosTxop, Time duration);
189
190 /**
191 * Set the member variable indicating whether the backoff should be invoked when an AC gains
192 * the right to start a TXOP but it does not transmit any frame (e.g., due to constraints
193 * associated with EMLSR operations), provided that the queue is not actually empty.
194 *
195 * @param enable whether to enable backoff generation when no TX is performed in a TXOP
196 */
197 void SetGenerateBackoffOnNoTx(bool enable);
198
199 /**
200 * @return whether the backoff should be invoked when an AC gains the right to start a TXOP
201 * but it does not transmit any frame (e.g., due to constraints associated with EMLSR
202 * operations), provided that the queue is not actually empty
203 */
204 bool GetGenerateBackoffOnNoTx() const;
205
206 /**
207 * Return the width of the largest primary channel that has been idle for the
208 * given time interval before the given time, if any primary channel has been
209 * idle, or zero, otherwise.
210 *
211 * @param interval the given time interval
212 * @param end the given end time
213 * @return the width of the largest primary channel that has been idle for the given time
214 * interval before the given time, if any primary channel has been idle, or zero, otherwise
215 */
217
218 /**
219 * @param indices a set of indices (starting at 0) specifying the 20 MHz channels to test
220 * @return true if per-20 MHz CCA indicates busy for at least one of the
221 * specified 20 MHz channels, false otherwise
222 */
223 bool GetPer20MHzBusy(const std::set<uint8_t>& indices) const;
224
225 /**
226 * @param duration expected duration of reception
227 *
228 * Notify the Txop that a packet reception started
229 * for the expected duration.
230 */
231 void NotifyRxStartNow(Time duration);
232 /**
233 * Notify the Txop that a packet reception was just
234 * completed successfully.
235 */
236 void NotifyRxEndOkNow();
237 /**
238 * Notify the Txop that a packet reception was just
239 * completed unsuccessfuly.
240 *
241 * @param txVector the TXVECTOR used for transmission
242 */
243 void NotifyRxEndErrorNow(const WifiTxVector& txVector);
244 /**
245 * @param duration expected duration of transmission
246 *
247 * Notify the Txop that a packet transmission was
248 * just started and is expected to last for the specified
249 * duration.
250 */
251 void NotifyTxStartNow(Time duration);
252 /**
253 * @param duration expected duration of CCA busy period
254 * @param channelType the channel type for which the CCA busy state is reported.
255 * @param per20MhzDurations vector that indicates for how long each 20 MHz subchannel
256 * (corresponding to the index of the element in the vector) is busy and where a zero
257 * duration indicates that the subchannel is idle. The vector is non-empty if the PHY supports
258 * 802.11ax or later and if the operational channel width is larger than 20 MHz.
259 *
260 * Notify the Txop that a CCA busy period has just started.
261 */
262 void NotifyCcaBusyStartNow(Time duration,
263 WifiChannelListType channelType,
264 const std::vector<Time>& per20MhzDurations);
265 /**
266 * @param phyListener the PHY listener that sent this notification
267 * @param duration expected duration of channel switching period
268 *
269 * Notify the Txop that a channel switching period has just started.
270 * During switching state, new packets can be enqueued in Txop/QosTxop
271 * but they won't access to the medium until the end of the channel switching.
272 */
273 void NotifySwitchingStartNow(PhyListener* phyListener, Time duration);
274 /**
275 * Notify the Txop that the device has been put in sleep mode.
276 */
277 void NotifySleepNow();
278 /**
279 * Notify the Txop that the device has been put in off mode.
280 */
281 void NotifyOffNow();
282 /**
283 * Notify the Txop that the device has been resumed from sleep mode.
284 */
285 void NotifyWakeupNow();
286 /**
287 * Notify the Txop that the device has been resumed from off mode.
288 */
289 void NotifyOnNow();
290 /**
291 * @param duration the value of the received NAV.
292 *
293 * Called at end of RX
294 */
295 void NotifyNavResetNow(Time duration);
296 /**
297 * @param duration the value of the received NAV.
298 *
299 * Called at end of RX
300 */
301 void NotifyNavStartNow(Time duration);
302 /**
303 * Notify that ack timer has started for the given duration.
304 *
305 * @param duration the duration of the timer
306 */
307 void NotifyAckTimeoutStartNow(Time duration);
308 /**
309 * Notify that ack timer has reset.
310 */
312 /**
313 * Notify that CTS timer has started for the given duration.
314 *
315 * @param duration the duration of the timer
316 */
317 void NotifyCtsTimeoutStartNow(Time duration);
318 /**
319 * Notify that CTS timer has reset.
320 */
322
323 /**
324 * Check if the device is busy sending or receiving,
325 * or NAV or CCA busy.
326 *
327 * @return true if the device is busy,
328 * false otherwise
329 */
330 bool IsBusy() const;
331
332 /**
333 * Reset the state variables of this channel access manager.
334 */
335 void ResetState();
336 /**
337 * Reset the backoff for the given DCF/EDCAF.
338 *
339 * @param txop the given DCF/EDCAF
340 */
341 void ResetBackoff(Ptr<Txop> txop);
342
343 /**
344 * Reset the backoff for all the DCF/EDCAF. Additionally, cancel the access timeout event.
345 */
346 void ResetAllBackoffs();
347
348 /**
349 * Notify that the given PHY is about to switch to the given operating channel, which is
350 * used by the given link. This notification is sent by the EMLSR Manager when a PHY object
351 * switches operating channel to operate on another link.
352 *
353 * @param phy the PHY object that is going to switch channel
354 * @param channel the new operating channel of the given PHY
355 * @param linkId the ID of the link on which the given PHY is going to operate
356 */
358 const WifiPhyOperatingChannel& channel,
359 uint8_t linkId);
360
361 protected:
362 void DoInitialize() override;
363 void DoDispose() override;
364
365 private:
366 /**
367 * Get current registered listener for PHY events on the given PHY.
368 *
369 * @param phy the given PHY
370 * @return the current registered listener for PHY events on the given PHY
371 */
372 std::shared_ptr<PhyListener> GetPhyListener(Ptr<WifiPhy> phy) const;
373
374 /**
375 * Initialize the structures holding busy end times per channel type (primary, secondary, etc.)
376 * and per 20 MHz channel. All values are set to the current time.
377 */
378 void InitLastBusyStructs();
379
380 /**
381 * Resize the structures holding busy end times per channel type (primary, secondary, etc.)
382 * and per 20 MHz channel. If a value (e.g., the busy end time for secondary40 channel) already
383 * exists, it is not changed; otherwise, it is set to the current time.
384 */
386 /**
387 * Update backoff slots for all Txops.
388 */
389 void UpdateBackoff();
390
391 /**
392 * This overload is provided to enable caching the value returned by GetAccessGrantStart(),
393 * which is independent of the given Txop object.
394 *
395 * @param txop the Txop
396 * @param accessGrantStart the value returned by GetAccessGrantStart()
397 *
398 * @return the time when the backoff procedure started
399 */
400 Time GetBackoffStartFor(Ptr<Txop> txop, Time accessGrantStart) const;
401
402 /**
403 * This overload is provided to enable caching the value returned by GetAccessGrantStart(),
404 * which is independent of the given Txop object.
405 *
406 * @param txop the Txop
407 * @param accessGrantStart the value returned by GetAccessGrantStart()
408 *
409 * @return the time when the backoff procedure ended (or will end)
410 */
411 Time GetBackoffEndFor(Ptr<Txop> txop, Time accessGrantStart) const;
412
413 /**
414 * This method determines whether the medium has been idle during a period (of
415 * non-null duration) immediately preceding the time this method is called. If
416 * so, the last idle start time and end time for each channel type are updated.
417 * Otherwise, no change is made by this method.
418 * This method is normally called when we are notified of the start of a
419 * transmission, reception, CCA Busy or switching to correctly maintain the
420 * information about the last idle period.
421 */
423
425
426 /**
427 * Called when access timeout should occur
428 * (e.g. backoff procedure expired).
429 */
430 void AccessTimeout();
431
432 /**
433 * Grant access to Txop using DCF/EDCF contention rules
434 */
435 void DoGrantDcfAccess();
436
437 /**
438 * Return the Short Interframe Space (SIFS) for this PHY.
439 *
440 * @return the SIFS duration
441 */
442 virtual Time GetSifs() const;
443
444 /**
445 * Return the slot duration for this PHY.
446 *
447 * @return the slot duration
448 */
449 virtual Time GetSlot() const;
450
451 /**
452 * Return the EIFS duration minus a DIFS.
453 *
454 * @return the EIFS duration minus a DIFS
455 */
456 virtual Time GetEifsNoDifs() const;
457
458 /**
459 * Structure defining start time and end time for a given state.
460 */
461 struct Timespan
462 {
463 Time start{0}; //!< start time
464 Time end{0}; //!< end time
465 };
466
467 /**
468 * typedef for a vector of Txops
469 */
470 typedef std::vector<Ptr<Txop>> Txops;
471
472 Txops m_txops; //!< the vector of managed Txops
473 Time m_lastAckTimeoutEnd; //!< the last Ack timeout end time
474 Time m_lastCtsTimeoutEnd; //!< the last CTS timeout end time
475 Time m_lastNavEnd; //!< the last NAV end time
476 Timespan m_lastRx; //!< the last receive start and end time
477 bool m_lastRxReceivedOk; //!< the last receive OK
478 Time m_lastTxEnd; //!< the last transmit end time
479 std::map<WifiChannelListType, Time>
480 m_lastBusyEnd; //!< the last busy end time for each channel type
481 std::vector<Time> m_lastPer20MHzBusyEnd; /**< the last busy end time per 20 MHz channel
482 (HE stations and channel width > 20 MHz only) */
483 std::map<WifiChannelListType, Timespan>
484 m_lastIdle; //!< the last idle start and end time for each channel type
485 Time m_lastSwitchingEnd; //!< the last switching end time
486 Time m_lastSleepEnd; //!< the last sleep end time
487 Time m_lastOffEnd; //!< the last off end time
488 Time m_eifsNoDifs; //!< EIFS no DIFS time
489 Timespan m_lastNoPhy; //!< the last start and end time no PHY was operating on the link
490 mutable Time m_cachedSifs; //!< cached value for SIFS, to be only used without a PHY
491 mutable Time m_cachedSlot; //!< cached value for slot, to be only used without a PHY
492 EventId m_accessTimeout; //!< the access timeout ID
493 bool m_generateBackoffOnNoTx; //!< whether the backoff should be invoked when the AC gains the
494 //!< right to start a TXOP but it does not transmit any frame
495 //!< (e.g., due to constraints associated with EMLSR operations),
496 //!< provided that the queue is not actually empty
497 bool m_proactiveBackoff; //!< whether a new backoff value is generated when a CCA busy period
498 //!< starts and the backoff counter is zero
499 Time m_resetBackoffThreshold; //!< if no PHY operates on a link for a period greater than this
500 //!< threshold, the backoff on that link is reset
501
502 /// Information associated with each PHY that is going to operate on another EMLSR link
504 {
505 WifiPhyOperatingChannel channel; //!< new operating channel
506 uint8_t linkId; //!< ID of the EMLSR link on which the PHY is going to operate
507 };
508
509 /// Store information about the PHY objects that are going to operate on another EMLSR link
510 std::unordered_map<Ptr<WifiPhy>, EmlsrLinkSwitchInfo> m_switchingEmlsrLinks;
511
512 /// Maps each PHY listener to the associated PHY
513 using PhyListenerMap = std::unordered_map<Ptr<WifiPhy>, std::shared_ptr<PhyListener>>;
514
515 PhyListenerMap m_phyListeners; //!< the PHY listeners
516 Ptr<WifiPhy> m_phy; //!< pointer to the unique active PHY
517 Ptr<FrameExchangeManager> m_feManager; //!< pointer to the Frame Exchange Manager
518 uint8_t m_linkId; //!< the ID of the link this object is associated with
519 uint8_t m_nSlotsLeft; //!< fire the NSlotsLeftAlert trace source when the
520 //!< backoff counter with the minimum value among all
521 //!< ACs reaches this value
522 Time m_nSlotsLeftMinDelay; //!< the minimum gap between the end of a medium busy event and
523 //!< the time the NSlotsLeftAlert trace source can be fired
524
525 /// default value for the NSlotsLeftMinDelay attribute, corresponds to a PIFS in 5GHz/6GHz bands
527
528 /**
529 * TracedCallback signature for NSlotsLeft alerts.
530 *
531 * @param linkId the ID of this link
532 * @param aci the index of the AC that triggered the NSlotsLeft alert
533 * @param backoffDelay delay until backoff counts down to zero
534 */
535 typedef void (*NSlotsLeftCallback)(uint8_t linkId, AcIndex aci, const Time& backoffDelay);
536
537 /// TracedCallback for NSlotsLeft alerts typedef
539
540 NSlotsLeftTracedCallback m_nSlotsLeftCallback; //!< traced callback for NSlotsLeft alerts
541};
542
543} // namespace ns3
544
545#endif /* CHANNEL_ACCESS_MANAGER_H */
Test CCA busy notifications on EMLSR clients.
Test the transmission of UL frames from EMLSR clients.
Manage a set of ns3::Txop.
bool m_proactiveBackoff
whether a new backoff value is generated when a CCA busy period starts and the backoff counter is zer...
std::vector< Time > m_lastPer20MHzBusyEnd
the last busy end time per 20 MHz channel (HE stations and channel width > 20 MHz only)
bool IsBusy() const
Check if the device is busy sending or receiving, or NAV or CCA busy.
void ResetBackoff(Ptr< Txop > txop)
Reset the backoff for the given DCF/EDCAF.
void NotifySwitchingStartNow(PhyListener *phyListener, Time duration)
NSlotsLeftTracedCallback m_nSlotsLeftCallback
traced callback for NSlotsLeft alerts
Time GetBackoffStartFor(Ptr< Txop > txop) const
Return the time when the backoff procedure started for the given Txop.
void ResetState()
Reset the state variables of this channel access manager.
void NotifySwitchingEmlsrLink(Ptr< WifiPhy > phy, const WifiPhyOperatingChannel &channel, uint8_t linkId)
Notify that the given PHY is about to switch to the given operating channel, which is used by the giv...
void ResetAllBackoffs()
Reset the backoff for all the DCF/EDCAF.
void NotifyWakeupNow()
Notify the Txop that the device has been resumed from sleep mode.
bool m_lastRxReceivedOk
the last receive OK
std::unordered_map< Ptr< WifiPhy >, EmlsrLinkSwitchInfo > m_switchingEmlsrLinks
Store information about the PHY objects that are going to operate on another EMLSR link.
std::map< WifiChannelListType, Timespan > m_lastIdle
the last idle start and end time for each channel type
Ptr< WifiPhy > m_phy
pointer to the unique active PHY
void NotifyAckTimeoutResetNow()
Notify that ack timer has reset.
void SetGenerateBackoffOnNoTx(bool enable)
Set the member variable indicating whether the backoff should be invoked when an AC gains the right t...
void NotifyRxEndOkNow()
Notify the Txop that a packet reception was just completed successfully.
virtual Time GetEifsNoDifs() const
Return the EIFS duration minus a DIFS.
uint8_t m_linkId
the ID of the link this object is associated with
uint8_t m_nSlotsLeft
fire the NSlotsLeftAlert trace source when the backoff counter with the minimum value among all ACs r...
void NotifyCcaBusyStartNow(Time duration, WifiChannelListType channelType, const std::vector< Time > &per20MhzDurations)
Time m_lastAckTimeoutEnd
the last Ack timeout end time
Timespan m_lastNoPhy
the last start and end time no PHY was operating on the link
Time m_cachedSlot
cached value for slot, to be only used without a PHY
Time m_eifsNoDifs
EIFS no DIFS time.
virtual Time GetSlot() const
Return the slot duration for this PHY.
Time m_nSlotsLeftMinDelay
the minimum gap between the end of a medium busy event and the time the NSlotsLeftAlert trace source ...
void NotifyAckTimeoutStartNow(Time duration)
Notify that ack timer has started for the given duration.
void AccessTimeout()
Called when access timeout should occur (e.g.
void(* NSlotsLeftCallback)(uint8_t linkId, AcIndex aci, const Time &backoffDelay)
TracedCallback signature for NSlotsLeft alerts.
Time GetBackoffEndFor(Ptr< Txop > txop) const
Return the time when the backoff procedure ended (or will end) for the given Txop.
void UpdateBackoff()
Update backoff slots for all Txops.
void DeactivatePhyListener(Ptr< WifiPhy > phy)
Deactivate current registered listener for PHY events on the given PHY.
void SetLinkId(uint8_t linkId)
Set the ID of the link this Channel Access Manager is associated with.
void SetupFrameExchangeManager(Ptr< FrameExchangeManager > feManager)
Set up the Frame Exchange Manager.
bool NeedBackoffUponAccess(Ptr< Txop > txop, bool hadFramesToTransmit, bool checkMediumBusy)
Determine if a new backoff needs to be generated as per letter a) of Section 10.23....
void NotifyCtsTimeoutStartNow(Time duration)
Notify that CTS timer has started for the given duration.
void RequestAccess(Ptr< Txop > txop)
Time m_lastSwitchingEnd
the last switching end time
Timespan m_lastRx
the last receive start and end time
Time m_lastSleepEnd
the last sleep end time
std::map< WifiChannelListType, Time > m_lastBusyEnd
the last busy end time for each channel type
void RemovePhyListener(Ptr< WifiPhy > phy)
Remove current registered listener for PHY events on the given PHY.
bool m_generateBackoffOnNoTx
whether the backoff should be invoked when the AC gains the right to start a TXOP but it does not tra...
Time m_lastTxEnd
the last transmit end time
void SetupPhyListener(Ptr< WifiPhy > phy)
Set up (or reactivate) listener for PHY events on the given PHY.
Time m_lastCtsTimeoutEnd
the last CTS timeout end time
MHz_u GetLargestIdlePrimaryChannel(Time interval, Time end)
Return the width of the largest primary channel that has been idle for the given time interval before...
void DoDispose() override
Destructor implementation.
void NotifySleepNow()
Notify the Txop that the device has been put in sleep mode.
Ptr< FrameExchangeManager > m_feManager
pointer to the Frame Exchange Manager
void NotifyRxEndErrorNow(const WifiTxVector &txVector)
Notify the Txop that a packet reception was just completed unsuccessfuly.
void UpdateLastIdlePeriod()
This method determines whether the medium has been idle during a period (of non-null duration) immedi...
std::vector< Ptr< Txop > > Txops
typedef for a vector of Txops
std::unordered_map< Ptr< WifiPhy >, std::shared_ptr< PhyListener > > PhyListenerMap
Maps each PHY listener to the associated PHY.
void DisableEdcaFor(Ptr< Txop > qosTxop, Time duration)
void DoInitialize() override
Initialize() implementation.
Time m_lastOffEnd
the last off end time
Txops m_txops
the vector of managed Txops
bool GetPer20MHzBusy(const std::set< uint8_t > &indices) const
static TypeId GetTypeId()
Get the type ID.
void DoGrantDcfAccess()
Grant access to Txop using DCF/EDCF contention rules.
void ResizeLastBusyStructs()
Resize the structures holding busy end times per channel type (primary, secondary,...
std::shared_ptr< PhyListener > GetPhyListener(Ptr< WifiPhy > phy) const
Get current registered listener for PHY events on the given PHY.
Time m_lastNavEnd
the last NAV end time
void NotifyCtsTimeoutResetNow()
Notify that CTS timer has reset.
void NotifyOffNow()
Notify the Txop that the device has been put in off mode.
Time GetAccessGrantStart(bool ignoreNav=false) const
Access will never be granted to the medium before the time returned by this method.
Time m_cachedSifs
cached value for SIFS, to be only used without a PHY
void NotifyOnNow()
Notify the Txop that the device has been resumed from off mode.
PhyListenerMap m_phyListeners
the PHY listeners
virtual Time GetSifs() const
Return the Short Interframe Space (SIFS) for this PHY.
static const Time DEFAULT_N_SLOTS_LEFT_MIN_DELAY
default value for the NSlotsLeftMinDelay attribute, corresponds to a PIFS in 5GHz/6GHz bands
Time m_resetBackoffThreshold
if no PHY operates on a link for a period greater than this threshold, the backoff on that link is re...
EventId m_accessTimeout
the access timeout ID
void InitLastBusyStructs()
Initialize the structures holding busy end times per channel type (primary, secondary,...
An identifier for simulation events.
Definition event-id.h:45
A base class which provides memory management and object aggregation.
Definition object.h:78
Listener for PHY events.
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:49
Class that keeps track of all information about the current PHY operating channel.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiChannelListType
Enumeration of the possible channel-list parameter elements defined in Table 8-5 of IEEE 802....
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.
Structure defining start time and end time for a given state.
Declaration of the following enums: