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 Enumeration values for the outcome of the check whether channel access is expected to be
41 * gained within a given time interval
42 * @see ChannelAccessManager::GetExpectedAccessWithin
43 * @ingroup wifi
44 */
62
63/**
64 * @brief Manage a set of ns3::Txop
65 * @ingroup wifi
66 *
67 * Handle a set of independent ns3::Txop, each of which represents
68 * a single DCF within a MAC stack. Each ns3::Txop has a priority
69 * implicitly associated with it (the priority is determined when the
70 * ns3::Txop is added to the ChannelAccessManager: the first Txop to be
71 * added gets the highest priority, the second, the second highest
72 * priority, and so on.) which is used to handle "internal" collisions.
73 * i.e., when two local Txop are expected to get access to the
74 * medium at the same time, the highest priority local Txop wins
75 * access to the medium and the other Txop suffers a "internal"
76 * collision.
77 */
79{
80 /// Allow test cases to access private members
81 friend class ::EmlsrUlTxopTest;
82 friend class ::EmlsrCcaBusyTest;
83
84 public:
86 ~ChannelAccessManager() override;
87
88 /**
89 * @brief Get the type ID.
90 * @return the object TypeId
91 */
92 static TypeId GetTypeId();
93
94 /**
95 * Set up (or reactivate) listener for PHY events on the given PHY. The new (or reactivated)
96 * listener becomes the active listener and the previous active listener attached to another
97 * PHY, if any, is deactivated.
98 *
99 * @param phy the WifiPhy to listen to
100 */
102 /**
103 * Remove current registered listener for PHY events on the given PHY.
104 *
105 * @param phy the WifiPhy to listen to
106 */
108 /**
109 * Deactivate current registered listener for PHY events on the given PHY. All notifications
110 * but channel switch notifications coming from an inactive listener are ignored.
111 *
112 * @param phy the WifiPhy to listen to
113 */
115 /**
116 * Set the ID of the link this Channel Access Manager is associated with.
117 *
118 * @param linkId the ID of the link this Channel Access Manager is associated with
119 */
120 void SetLinkId(uint8_t linkId);
121 /**
122 * Set up the Frame Exchange Manager.
123 *
124 * @param feManager the Frame Exchange Manager
125 */
127
128 /**
129 * @param txop a new Txop.
130 *
131 * The ChannelAccessManager does not take ownership of this pointer so, the callee
132 * must make sure that the Txop pointer will stay valid as long
133 * as the ChannelAccessManager is valid. Note that the order in which Txop
134 * objects are added to a ChannelAccessManager matters: the first Txop added
135 * has the highest priority, the second Txop added, has the second
136 * highest priority, etc.
137 */
138 void Add(Ptr<Txop> txop);
139
140 /**
141 * Determine if a new backoff needs to be generated as per letter a) of Section 10.23.2.2
142 * of IEEE 802.11-2020 ("EDCA backoff procedure"). This method is called upon the occurrence
143 * of events such as the enqueuing of a packet or the unblocking of some links after they
144 * have been blocked for some reason (e.g., wait for ADDBA Response, wait for TX on another
145 * EMLSR link to finish, etc.). The <i>checkMediumBusy</i> argument allows to generate a new
146 * backoff regardless of the busy/idle state of the medium, as per Section 35.3.16.4 of
147 * 802.11be D4.0.
148 *
149 * @param txop the Txop requesting to generate a backoff
150 * @param hadFramesToTransmit whether packets available for transmission were queued just
151 * before the occurrence of the event triggering this call
152 * @param checkMediumBusy whether generation of backoff (also) depends on the busy/idle state
153 * of the medium
154 * @return true if backoff needs to be generated, false otherwise
155 */
156 bool NeedBackoffUponAccess(Ptr<Txop> txop, bool hadFramesToTransmit, bool checkMediumBusy);
157
158 /**
159 * @param txop a Txop
160 *
161 * Notify the ChannelAccessManager that a specific Txop needs access to the
162 * medium. The ChannelAccessManager is then responsible for starting an access
163 * timer and, invoking FrameExchangeManager::StartTransmission when the access
164 * is granted if it ever gets granted.
165 */
166 void RequestAccess(Ptr<Txop> txop);
167
168 /**
169 * Access will never be granted to the medium _before_
170 * the time returned by this method.
171 *
172 * @param ignoreNav flag whether NAV should be ignored
173 *
174 * @returns the absolute time at which access could start to be granted
175 */
176 Time GetAccessGrantStart(bool ignoreNav = false) const;
177
178 /**
179 * Return the time when the backoff procedure
180 * started for the given Txop.
181 *
182 * @param txop the Txop
183 *
184 * @return the time when the backoff procedure started
185 */
187
188 /**
189 * Return the time when the backoff procedure
190 * ended (or will end) for the given Txop.
191 *
192 * @param txop the Txop
193 *
194 * @return the time when the backoff procedure ended (or will end)
195 */
196 Time GetBackoffEndFor(Ptr<Txop> txop) const;
197
198 /**
199 * Check whether channel access is expected to be granted within the given delay. If it is,
200 * ACCESS_EXPECTED is returned. If channel access is not expected to be granted because no
201 * AC has requested channel access, NOT_REQUESTED is returned. If no AC has frames to send,
202 * NOTHING_TO_TX is returned. If any of the times returned by DoGetAccessGrantStart() exceeds
203 * the given deadline, the reason corresponding to the earliest of such times is returned.
204 * Otherwise, it means that access cannot be granted in time due to the backoff slots to wait
205 * and BACKOFF_END is returned.
206 *
207 * @see DoGetAccessGrantStart
208 * @param delay the given delay
209 * @return ACCESS_EXPECTED or the reason why channel access is not expected to be gained in time
210 */
212
213 /**
214 * @return the time until the NAV has been set
215 */
216 Time GetNavEnd() const;
217
218 /**
219 * @param qosTxop a QosTxop that needs to be disabled
220 * @param duration the amount of time during which the QosTxop is disabled
221 *
222 * Disable the given EDCA for the given amount of time. This EDCA will not be
223 * granted channel access during this period and the backoff timer will be frozen.
224 * After this period, the EDCA will start normal operations again by resuming
225 * the backoff timer.
226 */
227 void DisableEdcaFor(Ptr<Txop> qosTxop, Time duration);
228
229 /**
230 * Set the member variable indicating whether the backoff should be invoked when an AC gains
231 * the right to start a TXOP but it does not transmit any frame (e.g., due to constraints
232 * associated with EMLSR operations), provided that the queue is not actually empty.
233 *
234 * @param enable whether to enable backoff generation when no TX is performed in a TXOP
235 */
236 void SetGenerateBackoffOnNoTx(bool enable);
237
238 /**
239 * @return whether the backoff should be invoked when an AC gains the right to start a TXOP
240 * but it does not transmit any frame (e.g., due to constraints associated with EMLSR
241 * operations), provided that the queue is not actually empty
242 */
243 bool GetGenerateBackoffOnNoTx() const;
244
245 /**
246 * Return the width of the largest primary channel that has been idle for the
247 * given time interval before the given time, if any primary channel has been
248 * idle, or zero, otherwise.
249 *
250 * @param interval the given time interval
251 * @param end the given end time
252 * @return the width of the largest primary channel that has been idle for the given time
253 * interval before the given time, if any primary channel has been idle, or zero, otherwise
254 */
256
257 /**
258 * @param indices a set of indices (starting at 0) specifying the 20 MHz channels to test
259 * @return true if per-20 MHz CCA indicates busy for at least one of the
260 * specified 20 MHz channels, false otherwise
261 */
262 bool GetPer20MHzBusy(const std::set<uint8_t>& indices) const;
263
264 /**
265 * @param duration expected duration of reception
266 *
267 * Notify the Txop that a packet reception started
268 * for the expected duration.
269 */
270 void NotifyRxStartNow(Time duration);
271 /**
272 * Notify the Txop that a packet reception was just
273 * completed successfully.
274 */
275 void NotifyRxEndOkNow();
276 /**
277 * Notify the Txop that a packet reception was just
278 * completed unsuccessfuly.
279 *
280 * @param txVector the TXVECTOR used for transmission
281 */
282 void NotifyRxEndErrorNow(const WifiTxVector& txVector);
283 /**
284 * @param duration expected duration of transmission
285 *
286 * Notify the Txop that a packet transmission was
287 * just started and is expected to last for the specified
288 * duration.
289 */
290 void NotifyTxStartNow(Time duration);
291 /**
292 * @param duration expected duration of CCA busy period
293 * @param channelType the channel type for which the CCA busy state is reported.
294 * @param per20MhzDurations vector that indicates for how long each 20 MHz subchannel
295 * (corresponding to the index of the element in the vector) is busy and where a zero
296 * duration indicates that the subchannel is idle. The vector is non-empty if the PHY supports
297 * 802.11ax or later and if the operational channel width is larger than 20 MHz.
298 *
299 * Notify the Txop that a CCA busy period has just started.
300 */
301 void NotifyCcaBusyStartNow(Time duration,
302 WifiChannelListType channelType,
303 const std::vector<Time>& per20MhzDurations);
304 /**
305 * @param phyListener the PHY listener that sent this notification
306 * @param duration expected duration of channel switching period
307 *
308 * Notify the Txop that a channel switching period has just started.
309 * During switching state, new packets can be enqueued in Txop/QosTxop
310 * but they won't access to the medium until the end of the channel switching.
311 */
312 void NotifySwitchingStartNow(PhyListener* phyListener, Time duration);
313 /**
314 * Notify the Txop that the device has been put in sleep mode.
315 */
316 void NotifySleepNow();
317 /**
318 * Notify the Txop that the device has been put in off mode.
319 */
320 void NotifyOffNow();
321 /**
322 * Notify the Txop that the device has been resumed from sleep mode.
323 */
324 void NotifyWakeupNow();
325 /**
326 * Notify the Txop that the device has been resumed from off mode.
327 */
328 void NotifyOnNow();
329 /**
330 * @param duration the value of the received NAV.
331 *
332 * Called at end of RX
333 */
334 void NotifyNavResetNow(Time duration);
335 /**
336 * @param duration the value of the received NAV.
337 *
338 * Called at end of RX
339 */
340 void NotifyNavStartNow(Time duration);
341 /**
342 * Notify that ack timer has started for the given duration.
343 *
344 * @param duration the duration of the timer
345 */
346 void NotifyAckTimeoutStartNow(Time duration);
347 /**
348 * Notify that ack timer has reset.
349 */
351 /**
352 * Notify that CTS timer has started for the given duration.
353 *
354 * @param duration the duration of the timer
355 */
356 void NotifyCtsTimeoutStartNow(Time duration);
357 /**
358 * Notify that CTS timer has reset.
359 */
361
362 /**
363 * Check if the device is busy sending or receiving,
364 * or NAV or CCA busy.
365 *
366 * @return true if the device is busy,
367 * false otherwise
368 */
369 bool IsBusy() const;
370
371 /**
372 * Reset the state variables of this channel access manager.
373 */
374 void ResetState();
375 /**
376 * Reset the backoff for the given DCF/EDCAF.
377 *
378 * @param txop the given DCF/EDCAF
379 */
380 void ResetBackoff(Ptr<Txop> txop);
381
382 /**
383 * Reset the backoff for all the DCF/EDCAF. Additionally, cancel the access timeout event.
384 */
385 void ResetAllBackoffs();
386
387 /**
388 * Notify that the given PHY is about to switch to the given operating channel, which is
389 * used by the given link. This notification is sent by the EMLSR Manager when a PHY object
390 * switches operating channel to operate on another link.
391 *
392 * @param phy the PHY object that is going to switch channel
393 * @param channel the new operating channel of the given PHY
394 * @param linkId the ID of the link on which the given PHY is going to operate
395 */
397 const WifiPhyOperatingChannel& channel,
398 uint8_t linkId);
399
400 protected:
401 void DoInitialize() override;
402 void DoDispose() override;
403
404 private:
405 /**
406 * Get current registered listener for PHY events on the given PHY.
407 *
408 * @param phy the given PHY
409 * @return the current registered listener for PHY events on the given PHY
410 */
411 std::shared_ptr<PhyListener> GetPhyListener(Ptr<WifiPhy> phy) const;
412
413 /**
414 * Initialize the structures holding busy end times per channel type (primary, secondary, etc.)
415 * and per 20 MHz channel. All values are set to the current time.
416 */
417 void InitLastBusyStructs();
418
419 /**
420 * Resize the structures holding busy end times per channel type (primary, secondary, etc.)
421 * and per 20 MHz channel. If a value (e.g., the busy end time for secondary40 channel) already
422 * exists, it is not changed; otherwise, it is set to the current time.
423 */
425 /**
426 * Update backoff slots for all Txops.
427 */
428 void UpdateBackoff();
429
430 /**
431 * This overload is provided to enable caching the value returned by GetAccessGrantStart(),
432 * which is independent of the given Txop object.
433 *
434 * @param txop the Txop
435 * @param accessGrantStart the value returned by GetAccessGrantStart()
436 *
437 * @return the time when the backoff procedure started
438 */
439 Time GetBackoffStartFor(Ptr<Txop> txop, Time accessGrantStart) const;
440
441 /**
442 * This overload is provided to enable caching the value returned by GetAccessGrantStart(),
443 * which is independent of the given Txop object.
444 *
445 * @param txop the Txop
446 * @param accessGrantStart the value returned by GetAccessGrantStart()
447 *
448 * @return the time when the backoff procedure ended (or will end)
449 */
450 Time GetBackoffEndFor(Ptr<Txop> txop, Time accessGrantStart) const;
451
452 /**
453 * Return a map containing (Time, WifiExpectedAccessReason) pairs sorted in increasing order
454 * of times. For each of the events preventing channel access (e.g., medium busy, RX state,
455 * TX state, etc), a pair is present in the map indicating the latest known time for which
456 * channel access cannot be granted due to that event. Therefore, the returned map does not
457 * contain a pair for some WifiExpectedAccessReason enum values (ACCESS_EXPECTED, NOTHING_TO_TX,
458 * NOT_REQUESTED and BACKOFF_END).
459 *
460 * @param ignoreNav whether NAV should be ignored
461 * @return a map containing (Time, WifiExpectedAccessReason) pairs sorted in increasing order
462 * of times
463 */
464 std::multimap<Time, WifiExpectedAccessReason> DoGetAccessGrantStart(bool ignoreNav) const;
465
466 /**
467 * This method determines whether the medium has been idle during a period (of
468 * non-null duration) immediately preceding the time this method is called. If
469 * so, the last idle start time and end time for each channel type are updated.
470 * Otherwise, no change is made by this method.
471 * This method is normally called when we are notified of the start of a
472 * transmission, reception, CCA Busy or switching to correctly maintain the
473 * information about the last idle period.
474 */
476
478
479 /**
480 * Called when access timeout should occur
481 * (e.g. backoff procedure expired).
482 */
483 void AccessTimeout();
484
485 /**
486 * Grant access to Txop using DCF/EDCF contention rules
487 */
488 void DoGrantDcfAccess();
489
490 /**
491 * Return the Short Interframe Space (SIFS) for this PHY.
492 *
493 * @return the SIFS duration
494 */
495 virtual Time GetSifs() const;
496
497 /**
498 * Return the slot duration for this PHY.
499 *
500 * @return the slot duration
501 */
502 virtual Time GetSlot() const;
503
504 /**
505 * Return the EIFS duration minus a DIFS.
506 *
507 * @return the EIFS duration minus a DIFS
508 */
509 virtual Time GetEifsNoDifs() const;
510
511 /**
512 * Structure defining start time and end time for a given state.
513 */
514 struct Timespan
515 {
516 Time start{0}; //!< start time
517 Time end{0}; //!< end time
518 };
519
520 /**
521 * typedef for a vector of Txops
522 */
523 typedef std::vector<Ptr<Txop>> Txops;
524
525 Txops m_txops; //!< the vector of managed Txops
526 Time m_lastAckTimeoutEnd; //!< the last Ack timeout end time
527 Time m_lastCtsTimeoutEnd; //!< the last CTS timeout end time
528 Time m_lastNavEnd; //!< the last NAV end time
529 Timespan m_lastRx; //!< the last receive start and end time
530 bool m_lastRxReceivedOk; //!< the last receive OK
531 Time m_lastTxEnd; //!< the last transmit end time
532 std::map<WifiChannelListType, Time>
533 m_lastBusyEnd; //!< the last busy end time for each channel type
534 std::vector<Time> m_lastPer20MHzBusyEnd; /**< the last busy end time per 20 MHz channel
535 (HE stations and channel width > 20 MHz only) */
536 std::map<WifiChannelListType, Timespan>
537 m_lastIdle; //!< the last idle start and end time for each channel type
538 Time m_lastSwitchingEnd; //!< the last switching end time
539 Time m_lastSleepEnd; //!< the last sleep end time
540 Time m_lastOffEnd; //!< the last off end time
541 Time m_eifsNoDifs; //!< EIFS no DIFS time
542 Timespan m_lastNoPhy; //!< the last start and end time no PHY was operating on the link
543 mutable Time m_cachedSifs; //!< cached value for SIFS, to be only used without a PHY
544 mutable Time m_cachedSlot; //!< cached value for slot, to be only used without a PHY
545 EventId m_accessTimeout; //!< the access timeout ID
546 bool m_generateBackoffOnNoTx; //!< whether the backoff should be invoked when the AC gains the
547 //!< right to start a TXOP but it does not transmit any frame
548 //!< (e.g., due to constraints associated with EMLSR operations),
549 //!< provided that the queue is not actually empty
550 bool m_proactiveBackoff; //!< whether a new backoff value is generated when a CCA busy period
551 //!< starts and the backoff counter is zero
552 Time m_resetBackoffThreshold; //!< if no PHY operates on a link for a period greater than this
553 //!< threshold, the backoff on that link is reset
554
555 /// Information associated with each PHY that is going to operate on another EMLSR link
557 {
558 WifiPhyOperatingChannel channel; //!< new operating channel
559 uint8_t linkId; //!< ID of the EMLSR link on which the PHY is going to operate
560 };
561
562 /// Store information about the PHY objects that are going to operate on another EMLSR link
563 std::unordered_map<Ptr<WifiPhy>, EmlsrLinkSwitchInfo> m_switchingEmlsrLinks;
564
565 /// Maps each PHY listener to the associated PHY
566 using PhyListenerMap = std::unordered_map<Ptr<WifiPhy>, std::shared_ptr<PhyListener>>;
567
568 PhyListenerMap m_phyListeners; //!< the PHY listeners
569 Ptr<WifiPhy> m_phy; //!< pointer to the unique active PHY
570 Ptr<FrameExchangeManager> m_feManager; //!< pointer to the Frame Exchange Manager
571 uint8_t m_linkId; //!< the ID of the link this object is associated with
572 uint8_t m_nSlotsLeft; //!< fire the NSlotsLeftAlert trace source when the
573 //!< backoff counter with the minimum value among all
574 //!< ACs reaches this value
575 Time m_nSlotsLeftMinDelay; //!< the minimum gap between the end of a medium busy event and
576 //!< the time the NSlotsLeftAlert trace source can be fired
577
578 /// default value for the NSlotsLeftMinDelay attribute, corresponds to a PIFS in 5GHz/6GHz bands
580
581 /**
582 * TracedCallback signature for NSlotsLeft alerts.
583 *
584 * @param linkId the ID of this link
585 * @param aci the index of the AC that triggered the NSlotsLeft alert
586 * @param backoffDelay delay until backoff counts down to zero
587 */
588 typedef void (*NSlotsLeftCallback)(uint8_t linkId, AcIndex aci, const Time& backoffDelay);
589
590 /// TracedCallback for NSlotsLeft alerts typedef
592
593 NSlotsLeftTracedCallback m_nSlotsLeftCallback; //!< traced callback for NSlotsLeft alerts
594};
595
596/**
597 * @brief Stream insertion operator.
598 *
599 * @param os the stream
600 * @param reason the expected access reason
601 * @return a reference to the stream
602 */
603std::ostream& operator<<(std::ostream& os, const WifiExpectedAccessReason& reason);
604
605} // namespace ns3
606
607#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.
WifiExpectedAccessReason GetExpectedAccessWithin(const Time &delay) const
Check whether channel access is expected to be granted within the given delay.
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
std::multimap< Time, WifiExpectedAccessReason > DoGetAccessGrantStart(bool ignoreNav) const
Return a map containing (Time, WifiExpectedAccessReason) pairs sorted in increasing order of times.
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...
WifiExpectedAccessReason
Enumeration values for the outcome of the check whether channel access is expected to be gained withi...
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.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition angles.cc:148
Structure defining start time and end time for a given state.
Declaration of the following enums: