A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
emlsr-manager.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Universita' degli Studi di Napoli Federico II
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Stefano Avallone <stavallo@unina.it>
7 */
8
9#ifndef EMLSR_MANAGER_H
10#define EMLSR_MANAGER_H
11
12#include "ns3/ctrl-headers.h"
13#include "ns3/mac48-address.h"
14#include "ns3/object.h"
15#include "ns3/sta-wifi-mac.h"
16#include "ns3/wifi-phy-operating-channel.h"
17
18#include <map>
19#include <optional>
20#include <set>
21#include <utility>
22
24
25namespace ns3
26{
27
28class EhtFrameExchangeManager;
29class MgtEmlOmn;
30class WifiMpdu;
31
32/**
33 * \ingroup wifi
34 *
35 * EmlsrManager is an abstract base class defining the API that EHT non-AP MLDs
36 * with EMLSR activated can use to handle the operations on the EMLSR links
37 */
38class EmlsrManager : public Object
39{
40 /// Allow test cases to access private members
41 friend class ::EmlsrCcaBusyTest;
42
43 public:
44 /**
45 * \brief Get the type ID.
46 * \return the object TypeId
47 */
48 static TypeId GetTypeId();
50 ~EmlsrManager() override;
51
52 /**
53 * Set the wifi MAC. Note that it must be the MAC of an EHT non-AP MLD.
54 *
55 * \param mac the wifi MAC
56 */
58
59 /**
60 * Set the Transition Timeout advertised by the associated AP with EMLSR activated.
61 *
62 * \param timeout the advertised Transition Timeout
63 */
65
66 /**
67 * \return the Transition Timeout, if advertised by the associated AP
68 */
69 std::optional<Time> GetTransitionTimeout() const;
70
71 /**
72 * Set the duration of the MediumSyncDelay timer.
73 *
74 * \param duration the duration of the MediumSyncDelay timer
75 */
76 void SetMediumSyncDuration(Time duration);
77
78 /**
79 * \return the duration of the MediumSyncDelay timer
80 */
82
83 /**
84 * Set the Medium Synchronization OFDM ED threshold (dBm) to use while the MediumSyncDelay
85 * timer is running.
86 *
87 * \param threshold the threshold in dBm (ranges from -72 to -62 dBm)
88 */
90
91 /**
92 * \return the Medium Synchronization OFDM ED threshold (dBm) to use while the MediumSyncDelay
93 * timer is running.
94 */
96
97 /**
98 * Set the maximum number of TXOPs a non-AP STA is allowed to attempt to initiate while
99 * the MediumSyncDelay timer is running. No value indicates no limit.
100 *
101 * \param nTxops the maximum number of TXOPs a non-AP STA is allowed to attempt to
102 * initiate while the MediumSyncDelay timer is running
103 */
104 void SetMediumSyncMaxNTxops(std::optional<uint8_t> nTxops);
105
106 /**
107 * \return the maximum number of TXOPs a non-AP STA is allowed to attempt to initiate while
108 * the MediumSyncDelay timer is running. No value indicates no limit.
109 */
110 std::optional<uint8_t> GetMediumSyncMaxNTxops() const;
111
112 /**
113 * \return the ID of main PHY (position in the vector of PHYs held by WifiNetDevice)
114 */
115 uint8_t GetMainPhyId() const;
116
117 /**
118 * Take actions to enable EMLSR mode on the given set of links, if non-empty, or
119 * disable EMLSR mode, otherwise.
120 *
121 * \param linkIds the IDs of the links on which EMLSR mode should be enabled
122 * (empty to disable EMLSR mode)
123 */
124 void SetEmlsrLinks(const std::set<uint8_t>& linkIds);
125
126 /**
127 * \return the set of links on which EMLSR mode is enabled
128 */
129 const std::set<uint8_t>& GetEmlsrLinks() const;
130
131 /**
132 * Set the member variable indicating whether the state of the CAM should be reset when
133 * the main PHY switches channel and operates on the link associated with the CAM.
134 *
135 * \param enable whether the CAM state should be reset
136 */
137 void SetCamStateReset(bool enable);
138
139 /**
140 * \return the value of the member variable indicating whether the state of the CAM should be
141 * reset when the main PHY switches channel and operates on the link associated with the CAM.
142 */
143 bool GetCamStateReset() const;
144
145 /**
146 * Notify that an UL TXOP is gained on the given link by the given AC. This method has to
147 * determine whether to start the UL TXOP or release the channel.
148 *
149 * \param linkId the ID of the given link
150 * \param aci the index of the given AC
151 * \return a pair consisting of a boolean value indicating whether the UL TXOP can be started
152 * and a Time value indicating the delay after which the EMLSR client must restart
153 * channel access (if needed) in case the UL TXOP is not started
154 */
155 std::pair<bool, Time> GetDelayUntilAccessRequest(uint8_t linkId, AcIndex aci);
156
157 /**
158 * Set the member variable indicating whether Aux PHYs are capable of transmitting PPDUs.
159 *
160 * \param capable whether Aux PHYs are capable of transmitting PPDUs
161 */
162 void SetAuxPhyTxCapable(bool capable);
163
164 /**
165 * \return whether Aux PHYs are capable of transmitting PPDUs
166 */
167 bool GetAuxPhyTxCapable() const;
168
169 /**
170 * Set the member variable indicating whether in-device interference is such that a PHY cannot
171 * decode anything and cannot decrease the backoff counter when another PHY is transmitting.
172 *
173 * \param enable whether in-device interference is such that a PHY cannot decode anything
174 * and cannot decrease the backoff counter when another PHY is transmitting
175 */
176 void SetInDeviceInterference(bool enable);
177
178 /**
179 * \return whether in-device interference is such that a PHY cannot decode anything and cannot
180 * decrease the backoff counter when another PHY is transmitting
181 */
182 bool GetInDeviceInterference() const;
183
184 /**
185 * Notify the reception of a management frame addressed to us.
186 *
187 * \param mpdu the received MPDU
188 * \param linkId the ID of the link over which the MPDU was received
189 */
190 void NotifyMgtFrameReceived(Ptr<const WifiMpdu> mpdu, uint8_t linkId);
191
192 /**
193 * Notify the reception of an initial Control frame on the given link.
194 *
195 * \param linkId the ID of the link on which the initial Control frame was received
196 */
197 void NotifyIcfReceived(uint8_t linkId);
198
199 /**
200 * Notify the start of an UL TXOP on the given link
201 *
202 * \param linkId the ID of the given link
203 */
204 void NotifyUlTxopStart(uint8_t linkId);
205
206 /**
207 * Notify the end of a TXOP on the given link.
208 *
209 * \param linkId the ID of the given link
210 * \param ulTxopNotStarted whether this is a notification of the end of an UL TXOP that did
211 * not even start (no frame transmitted)
212 * \param ongoingDlTxop whether a DL TXOP is ongoing on the given link (if true, this is
213 * a notification of the end of an UL TXOP)
214 */
215 void NotifyTxopEnd(uint8_t linkId, bool ulTxopNotStarted = false, bool ongoingDlTxop = false);
216
217 /**
218 * Check whether the MediumSyncDelay timer is running for the STA operating on the given link.
219 * If so, returns the time elapsed since the timer started.
220 *
221 * \param linkId the ID of the given link
222 * \return the time elapsed since the MediumSyncDelay timer started, if this timer is running
223 * for the STA operating on the given link
224 */
225 std::optional<Time> GetElapsedMediumSyncDelayTimer(uint8_t linkId) const;
226
227 /**
228 * Cancel the MediumSyncDelay timer associated with the given link and take the appropriate
229 * actions. This function must not be called when the MediumSyncDelay timer is not running
230 * on the given link.
231 *
232 * \param linkId the ID of the link associated with the MediumSyncDelay timer to cancel
233 */
234 void CancelMediumSyncDelayTimer(uint8_t linkId);
235
236 /**
237 * Decrement the counter indicating the number of TXOP attempts left while the MediumSyncDelay
238 * timer is running. This function must not be called when the MediumSyncDelay timer is not
239 * running on the given link.
240 *
241 * \param linkId the ID of the link on which a new TXOP attempt may be carried out
242 */
243 void DecrementMediumSyncDelayNTxops(uint8_t linkId);
244
245 /**
246 * Reset the counter indicating the number of TXOP attempts left while the MediumSyncDelay
247 * timer is running, so as to remove the limit on the number of attempts that can be made
248 * while the MediumSyncDelay timer is running. This function is normally called when a TXOP
249 * attempt is successful. This function must not be called when the MediumSyncDelay timer is
250 * not running on the given link.
251 *
252 * \param linkId the ID of the link for which the counter of the TXOP attempts is reset
253 */
254 void ResetMediumSyncDelayNTxops(uint8_t linkId);
255
256 /**
257 * Return whether no more TXOP attempt is allowed on the given link. This function must not
258 * be called when the MediumSyncDelay timer is not running on the given link.
259 *
260 * \param linkId the ID of the link on which a new TXOP attempt may be carried out
261 * \return whether no more TXOP attempt on the given link is allowed
262 */
263 bool MediumSyncDelayNTxopsExceeded(uint8_t linkId);
264
265 protected:
266 void DoDispose() override;
267
268 /**
269 * Allow subclasses to take actions when the MAC is set.
270 *
271 * \param mac the wifi MAC
272 */
273 virtual void DoSetWifiMac(Ptr<StaWifiMac> mac);
274
275 /**
276 * \return the MAC of the non-AP MLD managed by this EMLSR Manager.
277 */
279
280 /**
281 * \param linkId the ID of the given link
282 * \return the EHT FrameExchangeManager attached to the non-AP STA operating on the given link
283 */
284 Ptr<EhtFrameExchangeManager> GetEhtFem(uint8_t linkId) const;
285
286 /**
287 * \return the ID of the link on which the EML Operating Mode Notification frame has to be sent
288 */
289 virtual uint8_t GetLinkToSendEmlOmn() = 0;
290
291 /**
292 * A previous EML Operating Mode Notification frame was dropped. Ask the subclass whether
293 * the frame needs to be re-sent on the given link (if any).
294 *
295 * \param mpdu the dropped MPDU that includes the EML Operating Mode Notification frame
296 * \return the ID of the link over which to re-send the frame, if needed
297 */
298 virtual std::optional<uint8_t> ResendNotification(Ptr<const WifiMpdu> mpdu) = 0;
299
300 /**
301 * \param linkId the ID of the given link
302 * \return the operating channel the main PHY must switch to in order to operate
303 * on the given link
304 */
305 const WifiPhyOperatingChannel& GetChannelForMainPhy(uint8_t linkId) const;
306
307 /**
308 * \param linkId the ID of the given link
309 * \return the operating channel an aux PHY must switch to in order to operate
310 * on the given link
311 */
312 const WifiPhyOperatingChannel& GetChannelForAuxPhy(uint8_t linkId) const;
313
314 /**
315 * Switch channel on the Main PHY so that it operates on the given link.
316 *
317 * \param linkId the ID of the link on which the main PHY has to operate
318 * \param noSwitchDelay whether switching delay should be zero
319 * \param resetBackoff whether backoff should be reset on the link on which the main PHY
320 * is operating
321 * \param requestAccess whether channel access should be requested on the link on which the
322 * main PHY is moving onto
323 */
324 void SwitchMainPhy(uint8_t linkId, bool noSwitchDelay, bool resetBackoff, bool requestAccess);
325
326 static constexpr bool RESET_BACKOFF = true; //!< reset backoff on main PHY switch
327 static constexpr bool DONT_RESET_BACKOFF = false; //!< do not reset backoff on main PHY switch
328 static constexpr bool REQUEST_ACCESS = true; //!< request channel access when PHY switch ends
329 static constexpr bool DONT_REQUEST_ACCESS =
330 false; //!< do not request channel access when PHY switch ends
331
332 /**
333 * Switch channel on the Aux PHY operating on the given current link so that it operates
334 * on the given next link.
335 *
336 * \param auxPhy the Aux PHY
337 * \param currLinkId the ID of the link on which the aux PHY is currently operating
338 * \param nextLinkId the ID of the link on which the aux PHY will be operating
339 */
340 void SwitchAuxPhy(Ptr<WifiPhy> auxPhy, uint8_t currLinkId, uint8_t nextLinkId);
341
342 /**
343 * Set the CCA ED threshold (if needed) on the given PHY that is switching channel to
344 * operate on the given link.
345 *
346 * \param phy the given PHY
347 * \param linkId the ID of the given link
348 */
349 void SetCcaEdThresholdOnLinkSwitch(Ptr<WifiPhy> phy, uint8_t linkId);
350
351 /**
352 * \return the EML Operating Mode Notification to send
353 */
355
356 /**
357 * Subclasses have to provide an implementation for this method, that is called by the base
358 * class when the EMLSR client gets channel access on the given link. This method has to
359 * check possible reasons to give up the TXOP that apply to both main PHY and aux PHYs.
360 *
361 * \param linkId the ID of the given link
362 * \return a pair consisting of a boolean value indicating whether the UL TXOP can be started
363 * and a Time value indicating the delay after which the EMLSR client must restart
364 * channel access (if needed) in case the UL TXOP is not started
365 */
366 virtual std::pair<bool, Time> DoGetDelayUntilAccessRequest(uint8_t linkId) = 0;
367
368 /**
369 * Subclasses have to provide an implementation for this method, that is called by the base
370 * class when the given AC of the EMLSR client gets channel access on the given link, on which
371 * an aux PHY that is not TX capable is operating. This method has to request the main PHY to
372 * switch to the given link to take over the TXOP, unless it is decided to give up the TXOP.
373 *
374 * \param linkId the ID of the given link
375 * \param aci the index of the given AC
376 */
377 virtual void SwitchMainPhyIfTxopGainedByAuxPhy(uint8_t linkId, AcIndex aci) = 0;
378
379 /**
380 * Subclasses have to provide an implementation for this method, that is called by the base
381 * class when the EMLSR client gets channel access on the given link, on which an aux PHY that
382 * is TX capable is operating. This method has to request the main PHY to switch to the
383 * given link to take over the TXOP, if possible, or determine the delay after which the
384 * EMLSR client restarts channel access on the given link, otherwise.
385 *
386 * \param linkId the ID of the given link
387 * \return a pair consisting of a boolean value indicating whether the UL TXOP can be started
388 * and a Time value indicating the delay after which the EMLSR client must restart
389 * channel access (if needed) in case the UL TXOP is not started
390 */
391 virtual std::pair<bool, Time> GetDelayUnlessMainPhyTakesOverUlTxop(uint8_t linkId) = 0;
392
393 Time m_emlsrPaddingDelay; //!< EMLSR Padding delay
394 Time m_emlsrTransitionDelay; //!< EMLSR Transition delay
395 uint8_t m_mainPhyId; //!< ID of main PHY (position in the vector of PHYs held by WifiNetDevice)
396 MHz_u m_auxPhyMaxWidth; //!< max channel width supported by aux PHYs
397 WifiModulationClass m_auxPhyMaxModClass; //!< max modulation class supported by aux PHYs
398 bool m_auxPhyTxCapable; //!< whether Aux PHYs are capable of transmitting PPDUs
399 std::map<uint8_t, EventId> m_ulMainPhySwitch; //!< link ID-indexed map of timers started when
400 //!< an aux PHY gains an UL TXOP and schedules
401 //!< a channel switch for the main PHY
402
403 private:
404 /**
405 * Set the ID of main PHY (position in the vector of PHYs held by WifiNetDevice). This
406 * method cannot be called during or after initialization.
407 *
408 * \param mainPhyId the ID of the main PHY
409 */
410 void SetMainPhyId(uint8_t mainPhyId);
411
412 /**
413 * Compute the operating channels that the main PHY and the aux PHY(s) must switch to in order
414 * to operate on each of the setup links. The operating channels may be different due to
415 * limited channel width capabilities of the aux PHY(s). This method shall be called upon
416 * completion of ML setup.
417 */
419
420 /**
421 * Send an EML Operating Mode Notification frame.
422 */
423 void SendEmlOmn();
424
425 /**
426 * Start the MediumSyncDelay timer and take the appropriate actions, if the timer is not
427 * already running.
428 *
429 * \param linkId the ID of the link on which a TXOP was carried out that caused the STAs
430 * operating on other links to lose medium synchronization
431 */
432 void StartMediumSyncDelayTimer(uint8_t linkId);
433
434 /**
435 * Take the appropriate actions when the MediumSyncDelay timer expires or is cancelled.
436 *
437 * \param linkId the ID of the link associated with the MediumSyncDelay timer to cancel
438 */
439 void MediumSyncDelayTimerExpired(uint8_t linkId);
440
441 /**
442 * Notify the subclass of the reception of a management frame addressed to us.
443 *
444 * \param mpdu the received MPDU
445 * \param linkId the ID of the link over which the MPDU was received
446 */
447 virtual void DoNotifyMgtFrameReceived(Ptr<const WifiMpdu> mpdu, uint8_t linkId) = 0;
448
449 /**
450 * Notify the subclass of the reception of an initial Control frame on the given link.
451 *
452 * \param linkId the ID of the link on which the initial Control frame was received
453 */
454 virtual void DoNotifyIcfReceived(uint8_t linkId) = 0;
455
456 /**
457 * Notify the subclass of the start of an UL TXOP on the given link
458 *
459 * \param linkId the ID of the given link
460 */
461 virtual void DoNotifyUlTxopStart(uint8_t linkId) = 0;
462
463 /**
464 * Notify the subclass of the end of a TXOP on the given link.
465 *
466 * \param linkId the ID of the given link
467 */
468 virtual void DoNotifyTxopEnd(uint8_t linkId) = 0;
469
470 /**
471 * Notify the acknowledgment of the given MPDU.
472 *
473 * \param mpdu the acknowledged MPDU
474 */
475 void TxOk(Ptr<const WifiMpdu> mpdu);
476
477 /**
478 * Notify that the given MPDU has been discarded for the given reason.
479 *
480 * \param reason the reason why the MPDU was dropped
481 * \param mpdu the dropped MPDU
482 */
484
485 /**
486 * This method is called to make an EMLSR mode change effective after the transition
487 * delay has elapsed or a notification response has been received from the AP.
488 */
489 void ChangeEmlsrMode();
490
491 /**
492 * Adjust the operating channel of all the aux PHYs to meet the constraint on the maximum
493 * channel width supported by aux PHYs.
494 */
496
497 /**
498 * Notify subclass that EMLSR mode changed.
499 */
500 virtual void NotifyEmlsrModeChanged() = 0;
501
502 /**
503 * Notify subclass that the main PHY is switching channel to operate on another link.
504 *
505 * \param currLinkId the ID of the link on which the main PHY is operating (if any)
506 * \param nextLinkId the ID of the link on which the main PHY will be operating
507 * \param duration the channel switch duration
508 */
509 virtual void NotifyMainPhySwitch(std::optional<uint8_t> currLinkId,
510 uint8_t nextLinkId,
511 Time duration) = 0;
512
513 /**
514 * Information about the status of the MediumSyncDelay timer associated with a link.
515 */
517 {
518 EventId timer; //!< the MediumSyncDelay timer
519 std::optional<uint8_t> msdNTxopsLeft; //!< number of TXOP attempts left while the
520 //!< MediumSyncDelay timer is running
521 };
522
523 Ptr<StaWifiMac> m_staMac; //!< the MAC of the managed non-AP MLD
524 std::optional<Time> m_emlsrTransitionTimeout; /**< Transition timeout advertised by APs with
525 EMLSR activated */
526 Time m_mediumSyncDuration; //!< duration of the MediumSyncDelay timer
527 int8_t m_msdOfdmEdThreshold; //!< MediumSyncDelay OFDM ED threshold
528 std::optional<uint8_t> m_msdMaxNTxops; //!< MediumSyncDelay max number of TXOPs
529
530 std::map<uint8_t, MediumSyncDelayStatus>
531 m_mediumSyncDelayStatus; //!< the status of MediumSyncDelay timers (link ID-indexed)
532 std::map<Ptr<WifiPhy>, dBm_u> m_prevCcaEdThreshold; //!< the CCA sensitivity threshold
533 //!< to restore once the MediumSyncDelay
534 //!< timer expires or the PHY moves to a
535 //!< link on which the timer is not running
536
537 std::set<uint8_t> m_emlsrLinks; //!< ID of the EMLSR links (empty if EMLSR mode is disabled)
538 std::optional<std::set<uint8_t>> m_nextEmlsrLinks; /**< ID of the links that will become the
539 EMLSR links when the pending
540 notification frame is acknowledged */
541 Time m_lastAdvPaddingDelay; //!< last advertised padding delay
542 Time m_lastAdvTransitionDelay; //!< last advertised transition delay
543 EventId m_transitionTimeoutEvent; /**< Timer started after the successful transmission of an
544 EML Operating Mode Notification frame */
545 bool m_resetCamState; //!< whether to reset the state of CAM when main PHY switches channel
546 bool m_inDeviceInterference; //!< whether in-device interference is such that a PHY cannot
547 //!< decode anything and cannot decrease the backoff counter
548 //!< when another PHY is transmitting
549 std::map<uint8_t, WifiPhyOperatingChannel>
550 m_mainPhyChannels; //!< link ID-indexed map of operating channels for the main PHY
551 std::map<uint8_t, WifiPhyOperatingChannel>
552 m_auxPhyChannels; //!< link ID-indexed map of operating channels for the aux PHYs
553};
554
555} // namespace ns3
556
557#endif /* EMLSR_MANAGER_H */
Test CCA busy notifications on EMLSR clients.
EmlsrManager is an abstract base class defining the API that EHT non-AP MLDs with EMLSR activated can...
void SendEmlOmn()
Send an EML Operating Mode Notification frame.
Time GetMediumSyncDuration() const
void ComputeOperatingChannels()
Compute the operating channels that the main PHY and the aux PHY(s) must switch to in order to operat...
void SetTransitionTimeout(Time timeout)
Set the Transition Timeout advertised by the associated AP with EMLSR activated.
void CancelMediumSyncDelayTimer(uint8_t linkId)
Cancel the MediumSyncDelay timer associated with the given link and take the appropriate actions.
virtual void NotifyMainPhySwitch(std::optional< uint8_t > currLinkId, uint8_t nextLinkId, Time duration)=0
Notify subclass that the main PHY is switching channel to operate on another link.
bool m_auxPhyTxCapable
whether Aux PHYs are capable of transmitting PPDUs
bool MediumSyncDelayNTxopsExceeded(uint8_t linkId)
Return whether no more TXOP attempt is allowed on the given link.
std::optional< Time > GetTransitionTimeout() const
void ChangeEmlsrMode()
This method is called to make an EMLSR mode change effective after the transition delay has elapsed o...
std::pair< bool, Time > GetDelayUntilAccessRequest(uint8_t linkId, AcIndex aci)
Notify that an UL TXOP is gained on the given link by the given AC.
virtual std::pair< bool, Time > DoGetDelayUntilAccessRequest(uint8_t linkId)=0
Subclasses have to provide an implementation for this method, that is called by the base class when t...
Ptr< EhtFrameExchangeManager > GetEhtFem(uint8_t linkId) const
void TxDropped(WifiMacDropReason reason, Ptr< const WifiMpdu > mpdu)
Notify that the given MPDU has been discarded for the given reason.
void NotifyUlTxopStart(uint8_t linkId)
Notify the start of an UL TXOP on the given link.
void TxOk(Ptr< const WifiMpdu > mpdu)
Notify the acknowledgment of the given MPDU.
void MediumSyncDelayTimerExpired(uint8_t linkId)
Take the appropriate actions when the MediumSyncDelay timer expires or is cancelled.
void NotifyTxopEnd(uint8_t linkId, bool ulTxopNotStarted=false, bool ongoingDlTxop=false)
Notify the end of a TXOP on the given link.
std::map< uint8_t, EventId > m_ulMainPhySwitch
link ID-indexed map of timers started when an aux PHY gains an UL TXOP and schedules a channel switch...
bool m_inDeviceInterference
whether in-device interference is such that a PHY cannot decode anything and cannot decrease the back...
void SwitchMainPhy(uint8_t linkId, bool noSwitchDelay, bool resetBackoff, bool requestAccess)
Switch channel on the Main PHY so that it operates on the given link.
bool GetCamStateReset() const
void SetEmlsrLinks(const std::set< uint8_t > &linkIds)
Take actions to enable EMLSR mode on the given set of links, if non-empty, or disable EMLSR mode,...
void SetMediumSyncOfdmEdThreshold(int8_t threshold)
Set the Medium Synchronization OFDM ED threshold (dBm) to use while the MediumSyncDelay timer is runn...
uint8_t m_mainPhyId
ID of main PHY (position in the vector of PHYs held by WifiNetDevice)
int8_t GetMediumSyncOfdmEdThreshold() const
void NotifyIcfReceived(uint8_t linkId)
Notify the reception of an initial Control frame on the given link.
std::map< uint8_t, MediumSyncDelayStatus > m_mediumSyncDelayStatus
the status of MediumSyncDelay timers (link ID-indexed)
virtual std::pair< bool, Time > GetDelayUnlessMainPhyTakesOverUlTxop(uint8_t linkId)=0
Subclasses have to provide an implementation for this method, that is called by the base class when t...
virtual void SwitchMainPhyIfTxopGainedByAuxPhy(uint8_t linkId, AcIndex aci)=0
Subclasses have to provide an implementation for this method, that is called by the base class when t...
void NotifyMgtFrameReceived(Ptr< const WifiMpdu > mpdu, uint8_t linkId)
Notify the reception of a management frame addressed to us.
virtual uint8_t GetLinkToSendEmlOmn()=0
std::map< uint8_t, WifiPhyOperatingChannel > m_auxPhyChannels
link ID-indexed map of operating channels for the aux PHYs
virtual void DoNotifyUlTxopStart(uint8_t linkId)=0
Notify the subclass of the start of an UL TXOP on the given link.
Ptr< StaWifiMac > m_staMac
the MAC of the managed non-AP MLD
virtual void DoNotifyMgtFrameReceived(Ptr< const WifiMpdu > mpdu, uint8_t linkId)=0
Notify the subclass of the reception of a management frame addressed to us.
Time m_emlsrPaddingDelay
EMLSR Padding delay.
bool GetInDeviceInterference() const
MHz_u m_auxPhyMaxWidth
max channel width supported by aux PHYs
void SetMediumSyncMaxNTxops(std::optional< uint8_t > nTxops)
Set the maximum number of TXOPs a non-AP STA is allowed to attempt to initiate while the MediumSyncDe...
Time m_emlsrTransitionDelay
EMLSR Transition delay.
void SetWifiMac(Ptr< StaWifiMac > mac)
Set the wifi MAC.
void DecrementMediumSyncDelayNTxops(uint8_t linkId)
Decrement the counter indicating the number of TXOP attempts left while the MediumSyncDelay timer is ...
bool GetAuxPhyTxCapable() const
const std::set< uint8_t > & GetEmlsrLinks() const
Time m_mediumSyncDuration
duration of the MediumSyncDelay timer
std::optional< Time > m_emlsrTransitionTimeout
Transition timeout advertised by APs with EMLSR activated.
void SwitchAuxPhy(Ptr< WifiPhy > auxPhy, uint8_t currLinkId, uint8_t nextLinkId)
Switch channel on the Aux PHY operating on the given current link so that it operates on the given ne...
std::map< Ptr< WifiPhy >, dBm_u > m_prevCcaEdThreshold
the CCA sensitivity threshold to restore once the MediumSyncDelay timer expires or the PHY moves to a...
void ResetMediumSyncDelayNTxops(uint8_t linkId)
Reset the counter indicating the number of TXOP attempts left while the MediumSyncDelay timer is runn...
std::optional< Time > GetElapsedMediumSyncDelayTimer(uint8_t linkId) const
Check whether the MediumSyncDelay timer is running for the STA operating on the given link.
virtual void DoNotifyTxopEnd(uint8_t linkId)=0
Notify the subclass of the end of a TXOP on the given link.
virtual void DoSetWifiMac(Ptr< StaWifiMac > mac)
Allow subclasses to take actions when the MAC is set.
void SetAuxPhyTxCapable(bool capable)
Set the member variable indicating whether Aux PHYs are capable of transmitting PPDUs.
std::optional< std::set< uint8_t > > m_nextEmlsrLinks
ID of the links that will become the EMLSR links when the pending notification frame is acknowledged.
void SetCcaEdThresholdOnLinkSwitch(Ptr< WifiPhy > phy, uint8_t linkId)
Set the CCA ED threshold (if needed) on the given PHY that is switching channel to operate on the giv...
virtual void NotifyEmlsrModeChanged()=0
Notify subclass that EMLSR mode changed.
void SetMainPhyId(uint8_t mainPhyId)
Set the ID of main PHY (position in the vector of PHYs held by WifiNetDevice).
const WifiPhyOperatingChannel & GetChannelForMainPhy(uint8_t linkId) const
~EmlsrManager() override
void ApplyMaxChannelWidthAndModClassOnAuxPhys()
Adjust the operating channel of all the aux PHYs to meet the constraint on the maximum channel width ...
void SetMediumSyncDuration(Time duration)
Set the duration of the MediumSyncDelay timer.
static constexpr bool RESET_BACKOFF
reset backoff on main PHY switch
Time m_lastAdvTransitionDelay
last advertised transition delay
static constexpr bool REQUEST_ACCESS
request channel access when PHY switch ends
static constexpr bool DONT_REQUEST_ACCESS
do not request channel access when PHY switch ends
void DoDispose() override
Destructor implementation.
void StartMediumSyncDelayTimer(uint8_t linkId)
Start the MediumSyncDelay timer and take the appropriate actions, if the timer is not already running...
int8_t m_msdOfdmEdThreshold
MediumSyncDelay OFDM ED threshold.
std::map< uint8_t, WifiPhyOperatingChannel > m_mainPhyChannels
link ID-indexed map of operating channels for the main PHY
std::optional< uint8_t > m_msdMaxNTxops
MediumSyncDelay max number of TXOPs.
virtual std::optional< uint8_t > ResendNotification(Ptr< const WifiMpdu > mpdu)=0
A previous EML Operating Mode Notification frame was dropped.
Ptr< StaWifiMac > GetStaMac() const
Time m_lastAdvPaddingDelay
last advertised padding delay
WifiModulationClass m_auxPhyMaxModClass
max modulation class supported by aux PHYs
uint8_t GetMainPhyId() const
std::optional< uint8_t > GetMediumSyncMaxNTxops() const
void SetCamStateReset(bool enable)
Set the member variable indicating whether the state of the CAM should be reset when the main PHY swi...
EventId m_transitionTimeoutEvent
Timer started after the successful transmission of an EML Operating Mode Notification frame.
virtual void DoNotifyIcfReceived(uint8_t linkId)=0
Notify the subclass of the reception of an initial Control frame on the given link.
void SetInDeviceInterference(bool enable)
Set the member variable indicating whether in-device interference is such that a PHY cannot decode an...
const WifiPhyOperatingChannel & GetChannelForAuxPhy(uint8_t linkId) const
bool m_resetCamState
whether to reset the state of CAM when main PHY switches channel
static TypeId GetTypeId()
Get the type ID.
std::set< uint8_t > m_emlsrLinks
ID of the EMLSR links (empty if EMLSR mode is disabled)
static constexpr bool DONT_RESET_BACKOFF
do not reset backoff on main PHY switch
MgtEmlOmn GetEmlOmn()
An identifier for simulation events.
Definition event-id.h:45
Implement the header for Action frames of type EML Operating Mode Notification.
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
a unique identifier for an interface.
Definition type-id.h:48
Class that keeps track of all information about the current PHY operating channel.
WifiMacDropReason
The reason why an MPDU was dropped.
Definition wifi-mac.h:70
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; 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.
ns3::Time timeout
Information about the status of the MediumSyncDelay timer associated with a link.
std::optional< uint8_t > msdNTxopsLeft
number of TXOP attempts left while the MediumSyncDelay timer is running
EventId timer
the MediumSyncDelay timer