A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
emlsr-manager.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Universita' degli Studi di Napoli Federico II
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Stefano Avallone <stavallo@unina.it>
18 */
19
20#include "emlsr-manager.h"
21
22#include "eht-configuration.h"
24
25#include "ns3/abort.h"
26#include "ns3/assert.h"
27#include "ns3/attribute-container.h"
28#include "ns3/log.h"
29#include "ns3/wifi-mpdu.h"
30#include "ns3/wifi-net-device.h"
31#include "ns3/wifi-phy-state-helper.h"
32
33namespace ns3
34{
35
36NS_LOG_COMPONENT_DEFINE("EmlsrManager");
37
38NS_OBJECT_ENSURE_REGISTERED(EmlsrManager);
39
40TypeId
42{
43 static TypeId tid =
44 TypeId("ns3::EmlsrManager")
46 .SetGroupName("Wifi")
47 .AddAttribute("EmlsrPaddingDelay",
48 "The EMLSR Paddind Delay (not used by AP MLDs). "
49 "Possible values are 0 us, 32 us, 64 us, 128 us or 256 us.",
53 .AddAttribute("EmlsrTransitionDelay",
54 "The EMLSR Transition Delay (not used by AP MLDs). "
55 "Possible values are 0 us, 16 us, 32 us, 64 us, 128 us or 256 us.",
59 .AddAttribute(
60 "MainPhyId",
61 "The ID of the main PHY (position in the vector of PHYs held by "
62 "WifiNetDevice). This attribute cannot be set after initialization.",
65 MakeUintegerChecker<uint8_t>())
66 .AddAttribute("AuxPhyChannelWidth",
67 "The maximum channel width (MHz) supported by Aux PHYs",
68 UintegerValue(20),
70 MakeUintegerChecker<uint16_t>(20, 160))
71 .AddAttribute(
72 "EmlsrLinkSet",
73 "IDs of the links on which EMLSR mode will be enabled. An empty set "
74 "indicates to disable EMLSR.",
76 MakeAttributeContainerAccessor<UintegerValue>(&EmlsrManager::SetEmlsrLinks),
77 MakeAttributeContainerChecker<UintegerValue>(MakeUintegerChecker<uint8_t>()))
78 .AddAttribute("ResetCamState",
79 "Whether to reset the state of the ChannelAccessManager associated with "
80 "the link on which the main PHY has just switched to.",
81 BooleanValue(false),
85 return tid;
86}
87
89{
90 NS_LOG_FUNCTION(this);
91}
92
94{
96}
97
98void
100{
101 NS_LOG_FUNCTION(this);
105 m_staMac = nullptr;
108}
109
110void
112{
113 NS_LOG_FUNCTION(this << mac);
114 NS_ASSERT(mac);
115 m_staMac = mac;
116
117 NS_ABORT_MSG_IF(!m_staMac->GetEhtConfiguration(), "EmlsrManager requires EHT support");
118 NS_ABORT_MSG_IF(m_staMac->GetNLinks() <= 1, "EmlsrManager can only be installed on MLDs");
120 "EmlsrManager can only be installed on non-AP MLDs");
121
125}
126
127void
129{
130 NS_LOG_FUNCTION(this << mainPhyId);
131 NS_ABORT_MSG_IF(IsInitialized(), "Cannot be called once this object has been initialized");
132 m_mainPhyId = mainPhyId;
133}
134
135uint8_t
137{
138 return m_mainPhyId;
139}
140
141void
143{
144 m_resetCamState = enable;
145}
146
147bool
149{
150 return m_resetCamState;
151}
152
153const std::set<uint8_t>&
155{
156 return m_emlsrLinks;
157}
158
161{
162 return m_staMac;
163}
164
166EmlsrManager::GetEhtFem(uint8_t linkId) const
167{
168 return StaticCast<EhtFrameExchangeManager>(m_staMac->GetFrameExchangeManager(linkId));
169}
170
171void
173{
176}
177
178std::optional<Time>
180{
182}
183
184void
185EmlsrManager::SetEmlsrLinks(const std::set<uint8_t>& linkIds)
186{
187 NS_LOG_FUNCTION(this);
188 NS_ABORT_MSG_IF(linkIds.size() == 1, "Cannot enable EMLSR mode on a single link");
189
190 if (linkIds != m_emlsrLinks)
191 {
192 m_nextEmlsrLinks = linkIds;
193 }
194
195 if (GetStaMac() && GetStaMac()->IsAssociated() && GetTransitionTimeout() && m_nextEmlsrLinks)
196 {
197 // Request to enable EMLSR mode on the given links, provided that they have been setup
198 SendEmlOmn();
199 }
200}
201
202void
204{
205 NS_LOG_FUNCTION(this << *mpdu << linkId);
206
207 const auto& hdr = mpdu->GetHeader();
208
209 DoNotifyMgtFrameReceived(mpdu, linkId);
210
211 if (hdr.IsAssocResp() && GetStaMac()->IsAssociated() && GetTransitionTimeout())
212 {
213 // we just completed ML setup with an AP MLD that supports EMLSR
215
216 if (m_nextEmlsrLinks && !m_nextEmlsrLinks->empty())
217 {
218 // a non-empty set of EMLSR links have been configured, hence enable EMLSR mode
219 // on those links
220 SendEmlOmn();
221 }
222 }
223
224 if (hdr.IsAction() && hdr.GetAddr2() == m_staMac->GetBssid(linkId))
225 {
226 // this is an action frame sent by an AP of the AP MLD we are associated with
227 auto [category, action] = WifiActionHeader::Peek(mpdu->GetPacket());
228 if (category == WifiActionHeader::PROTECTED_EHT &&
229 action.protectedEhtAction ==
231 {
233 {
234 // no need to wait until the expiration of the transition timeout
237 }
238 }
239 }
240}
241
242void
244{
245 NS_LOG_FUNCTION(this << linkId);
246
248
249 // block transmissions and suspend medium access on all other EMLSR links
250 for (auto id : m_staMac->GetLinkIds())
251 {
252 if (id != linkId && m_staMac->IsEmlsrLink(id))
253 {
256 }
257 }
258
259 auto mainPhy = m_staMac->GetDevice()->GetPhy(m_mainPhyId);
260 auto auxPhy = m_staMac->GetWifiPhy(linkId);
261
262 if (m_staMac->GetWifiPhy(linkId) == mainPhy)
263 {
264 // nothing to do, we received an ICF from the main PHY
265 return;
266 }
267
268 SwitchMainPhy(linkId, true); // channel switch should occur instantaneously
269
270 // aux PHY received the ICF but main PHY will send the response
271 auto uid = auxPhy->GetPreviouslyRxPpduUid();
272 mainPhy->SetPreviouslyRxPpduUid(uid);
273}
274
275void
277{
278 NS_LOG_FUNCTION(this << linkId);
279
280 if (!m_staMac->IsEmlsrLink(linkId))
281 {
282 NS_LOG_DEBUG("EMLSR is not enabled on link " << +linkId);
283 return;
284 }
285
286 // block transmissions and suspend medium access on all other EMLSR links
287 for (auto id : m_staMac->GetLinkIds())
288 {
289 if (id != linkId && m_staMac->IsEmlsrLink(id))
290 {
293 }
294 }
295
296 // if this TXOP is being started by an aux PHY, wait until the end of RTS transmission and
297 // then have the main PHY (instantaneously) take over the TXOP on this link. We may start the
298 // channel switch now and use the channel switch delay configured for the main PHY, but then
299 // we would have no guarantees that the channel switch is completed in RTS TX time plus SIFS.
300 if (m_staMac->GetLinkForPhy(m_mainPhyId) != linkId)
301 {
302 auto stateHelper = m_staMac->GetWifiPhy(linkId)->GetState();
303 NS_ASSERT(stateHelper);
304 NS_ASSERT_MSG(stateHelper->GetState() == TX,
305 "Expecting the aux PHY to be transmitting (an RTS frame)");
306 Simulator::Schedule(stateHelper->GetDelayUntilIdle(),
308 this,
309 linkId,
310 true); // channel switch should occur instantaneously
311 }
312}
313
314void
316{
317 NS_LOG_FUNCTION(this << linkId);
318
319 if (!m_staMac->IsEmlsrLink(linkId))
320 {
321 NS_LOG_DEBUG("EMLSR is not enabled on link " << +linkId);
322 return;
323 }
324
325 // unblock transmissions and resume medium access on other EMLSR links
326 for (auto id : m_staMac->GetLinkIds())
327 {
328 if (id != linkId && m_staMac->IsEmlsrLink(id))
329 {
332 }
333 }
334}
335
336void
337EmlsrManager::SwitchMainPhy(uint8_t linkId, bool noSwitchDelay)
338{
339 NS_LOG_FUNCTION(this << linkId << noSwitchDelay);
340
341 auto mainPhy = m_staMac->GetDevice()->GetPhy(m_mainPhyId);
342
343 NS_ASSERT_MSG(mainPhy != m_staMac->GetWifiPhy(linkId),
344 "Main PHY is already operating on link " << +linkId);
345
346 // find the link on which the main PHY is operating
347 auto currMainPhyLinkId = m_staMac->GetLinkForPhy(mainPhy);
348 NS_ASSERT_MSG(currMainPhyLinkId, "Current link ID for main PHY not found");
349
350 auto newMainPhyChannel = GetChannelForMainPhy(linkId);
351
352 NS_LOG_DEBUG("Main PHY (" << mainPhy << ") is about to switch to " << newMainPhyChannel
353 << " to operate on link " << +linkId);
354
355 // notify the channel access manager of the upcoming channel switch(es)
356 m_staMac->GetChannelAccessManager(*currMainPhyLinkId)
357 ->NotifySwitchingEmlsrLink(mainPhy, newMainPhyChannel, linkId);
358
359 // this assert also ensures that the actual channel switch is not delayed
360 NS_ASSERT_MSG(!mainPhy->GetState()->IsStateTx(),
361 "We should not ask the main PHY to switch channel while transmitting");
362
363 // request the main PHY to switch channel
365 auto delay = mainPhy->GetChannelSwitchDelay();
366 NS_ASSERT_MSG(noSwitchDelay || delay <= m_lastAdvTransitionDelay,
367 "Transition delay (" << m_lastAdvTransitionDelay.As(Time::US)
368 << ") should exceed the channel switch delay ("
369 << delay.As(Time::US) << ")");
370 if (noSwitchDelay)
371 {
372 mainPhy->SetAttribute("ChannelSwitchDelay", TimeValue(Seconds(0)));
373 }
374 mainPhy->SetOperatingChannel(newMainPhyChannel);
375 // restore previous channel switch delay
376 if (noSwitchDelay)
377 {
378 mainPhy->SetAttribute("ChannelSwitchDelay", TimeValue(delay));
379 }
380 });
381
382 NotifyMainPhySwitch(*currMainPhyLinkId, linkId);
383}
384
387{
388 MgtEmlOmn frame;
389
390 // Add the EMLSR Parameter Update field if needed
393 {
398 frame.m_emlsrParamUpdate->paddingDelay =
400 frame.m_emlsrParamUpdate->transitionDelay =
402 }
403
404 // We must verify that the links included in the given EMLSR link set (if any) have been setup.
405 auto setupLinkIds = m_staMac->GetSetupLinkIds();
406
407 for (auto emlsrLinkIt = m_nextEmlsrLinks->begin(); emlsrLinkIt != m_nextEmlsrLinks->end();)
408 {
409 if (auto setupLinkIt = setupLinkIds.find(*emlsrLinkIt); setupLinkIt != setupLinkIds.cend())
410 {
411 setupLinkIds.erase(setupLinkIt);
412 frame.SetLinkIdInBitmap(*emlsrLinkIt);
413 emlsrLinkIt++;
414 }
415 else
416 {
417 NS_LOG_DEBUG("Link ID " << +(*emlsrLinkIt) << " has not been setup");
418 emlsrLinkIt = m_nextEmlsrLinks->erase(emlsrLinkIt);
419 }
420 }
421
422 // EMLSR Mode is enabled if and only if the set of EMLSR links is not empty
423 frame.m_emlControl.emlsrMode = m_nextEmlsrLinks->empty() ? 0 : 1;
424
425 return frame;
426}
427
428void
430{
431 NS_LOG_FUNCTION(this);
432
434 "AP did not advertise a Transition Timeout, cannot send EML notification");
435 NS_ASSERT_MSG(m_nextEmlsrLinks, "Need to set EMLSR links before calling this method");
436
437 // TODO if this is a single radio non-AP MLD and not all setup links are in the EMLSR link
438 // set, we have to put setup links that are not included in the given EMLSR link set (i.e.,
439 // those remaining in setupLinkIds, if m_nextEmlsrLinks is not empty) in the sleep mode:
440 // For the EMLSR mode enabled in a single radio non-AP MLD, the STA(s) affiliated with
441 // the non-AP MLD that operates on the enabled link(s) that corresponds to the bit
442 // position(s) of the EMLSR Link Bitmap subfield set to 0 shall be in doze state if a
443 // non-AP STA affiliated with the non-AP MLD that operates on one of the EMLSR links is
444 // in awake state. (Sec. 35.3.17 of 802.11be D3.0)
445
446 auto frame = GetEmlOmn();
447 auto linkId = GetLinkToSendEmlOmn();
448 GetEhtFem(linkId)->SendEmlOmn(m_staMac->GetBssid(linkId), frame);
449}
450
451void
453{
454 NS_LOG_FUNCTION(this << *mpdu);
455
456 const auto& hdr = mpdu->GetHeader();
457
458 if (hdr.IsAssocReq())
459 {
460 // store padding delay and transition delay advertised in AssocReq
461 MgtAssocRequestHeader assocReq;
462 mpdu->GetPacket()->PeekHeader(assocReq);
463 auto& mle = assocReq.Get<MultiLinkElement>();
464 NS_ASSERT_MSG(mle, "AssocReq should contain a Multi-Link Element");
465 m_lastAdvPaddingDelay = mle->GetEmlsrPaddingDelay();
466 m_lastAdvTransitionDelay = mle->GetEmlsrTransitionDelay();
467 }
468
469 if (hdr.IsMgt() && hdr.IsAction())
470 {
471 if (auto [category, action] = WifiActionHeader::Peek(mpdu->GetPacket());
473 action.protectedEhtAction ==
475 {
476 // the EML Operating Mode Notification frame that we sent has been acknowledged.
477 // Start the transition timeout to wait until the request can be made effective
478 NS_ASSERT_MSG(m_emlsrTransitionTimeout, "No transition timeout received from AP");
481 this);
482 }
483 }
484}
485
486void
488{
489 NS_LOG_FUNCTION(this << reason << *mpdu);
490
491 const auto& hdr = mpdu->GetHeader();
492
493 if (hdr.IsMgt() && hdr.IsAction())
494 {
495 auto pkt = mpdu->GetPacket()->Copy();
496 if (auto [category, action] = WifiActionHeader::Remove(pkt);
498 action.protectedEhtAction ==
500 {
501 // the EML Operating Mode Notification frame has been dropped. Ask the subclass
502 // whether the frame needs to be resent
503 auto linkId = ResendNotification(mpdu);
504 if (linkId)
505 {
506 MgtEmlOmn frame;
507 pkt->RemoveHeader(frame);
508 GetEhtFem(*linkId)->SendEmlOmn(m_staMac->GetBssid(*linkId), frame);
509 }
510 else
511 {
512 m_nextEmlsrLinks.reset();
513 }
514 }
515 }
516}
517
518void
520{
521 NS_LOG_FUNCTION(this);
522
523 // After the successful transmission of the EML Operating Mode Notification frame by the
524 // non-AP STA affiliated with the non-AP MLD, the non-AP MLD shall operate in the EMLSR mode
525 // and the other non-AP STAs operating on the corresponding EMLSR links shall transition to
526 // active mode after the transition delay indicated in the Transition Timeout subfield in the
527 // EML Capabilities subfield of the Basic Multi-Link element or immediately after receiving an
528 // EML Operating Mode Notification frame from one of the APs operating on the EMLSR links and
529 // affiliated with the AP MLD. (Sec. 35.3.17 of 802.11be D3.0)
530 NS_ASSERT_MSG(m_nextEmlsrLinks, "No set of EMLSR links stored");
532 m_nextEmlsrLinks.reset();
533
534 // Make other non-AP STAs operating on the corresponding EMLSR links transition to
535 // active mode or passive mode (depending on whether EMLSR mode has been enabled or disabled)
537 // Enforce the limit on the max channel width supported by aux PHYs
539
541}
542
543void
545{
546 NS_LOG_FUNCTION(this);
547 auto currMainPhyLinkId = m_staMac->GetLinkForPhy(m_mainPhyId);
548 NS_ASSERT(currMainPhyLinkId);
549
550 for (const auto linkId : m_staMac->GetLinkIds())
551 {
552 auto auxPhy = m_staMac->GetWifiPhy(linkId);
553 auto channel = GetChannelForAuxPhy(linkId);
554
555 if (linkId == currMainPhyLinkId || !m_staMac->IsEmlsrLink(linkId) ||
556 auxPhy->GetOperatingChannel() == channel)
557 {
558 continue;
559 }
560
561 NS_LOG_DEBUG("Aux PHY (" << auxPhy << ") is about to switch to " << channel
562 << " to operate on link " << +linkId);
563 // We cannot simply set the new channel, because otherwise the MAC will disable
564 // the setup link. We need to inform the MAC (via the Channel Access Manager) that
565 // this channel switch must not have such a consequence. We already have a method
566 // for doing so, i.e., inform the MAC that the PHY is switching channel to operate
567 // on the "same" link.
569 channel,
570 linkId);
571
573 Simulator::ScheduleNow(fp, auxPhy, channel);
574 }
575}
576
577void
579{
580 NS_LOG_FUNCTION(this);
581
582 m_mainPhyChannels.clear();
583 m_auxPhyChannels.clear();
584
585 auto linkIds = m_staMac->GetSetupLinkIds();
586
587 for (auto linkId : linkIds)
588 {
589 const auto& channel = m_staMac->GetWifiPhy(linkId)->GetOperatingChannel();
590 m_mainPhyChannels.emplace(linkId, channel);
591
592 auto mainPhyChWidth = channel.GetWidth();
593 if (m_auxPhyMaxWidth >= mainPhyChWidth)
594 {
595 // same channel can be used by aux PHYs
596 m_auxPhyChannels.emplace(linkId, channel);
597 continue;
598 }
599 // aux PHYs will operate on a primary subchannel
600 auto freq = channel.GetPrimaryChannelCenterFrequency(m_auxPhyMaxWidth);
602 freq,
605 channel.GetPhyBand());
607 "Primary" << m_auxPhyMaxWidth << " channel not found");
608 m_auxPhyChannels.emplace(linkId, chIt);
609 // find the P20 index for the channel used by the aux PHYs
610 auto p20Index = channel.GetPrimaryChannelIndex(20);
611 while (mainPhyChWidth > m_auxPhyMaxWidth)
612 {
613 mainPhyChWidth /= 2;
614 p20Index /= 2;
615 }
616 m_auxPhyChannels[linkId].SetPrimary20Index(p20Index);
617 }
618}
619
622{
623 auto it = m_mainPhyChannels.find(linkId);
625 "Channel for main PHY on link ID " << +linkId << " not found");
626 return it->second;
627}
628
631{
632 auto it = m_auxPhyChannels.find(linkId);
634 "Channel for aux PHY on link ID " << +linkId << " not found");
635 return it->second;
636}
637
638} // namespace ns3
A container for one type of attribute.
AttributeValue implementation for Boolean.
Definition: boolean.h:37
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 NotifyStopUsingOtherEmlsrLink()
Notify that another EMLSR link is no longer being used, hence medium access can be resumed.
void NotifyStartUsingOtherEmlsrLink()
Notify that another EMLSR link is being used, hence medium access should be disabled.
void SendEmlOmn()
Send an EML Operating Mode Notification frame.
void ComputeOperatingChannels()
Compute the operating channels that the main PHY and the aux PHY(s) must switch to in order to operat...
void ApplyMaxChannelWidthOnAuxPhys()
Adjust the operating channel of all the aux PHYs to meet the constraint on the maximum channel width ...
void SetTransitionTimeout(Time timeout)
Set the Transition Timeout advertised by the associated AP with EMLSR activated.
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...
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.
virtual void NotifyMainPhySwitch(uint8_t currLinkId, uint8_t nextLinkId)=0
Notify subclass that the main PHY is switching channel to operate on another 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,...
uint8_t m_mainPhyId
ID of main PHY (position in the vector of PHYs held by WifiNetDevice)
void NotifyIcfReceived(uint8_t linkId)
Notify the reception of an initial Control frame on the given link.
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
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.
void NotifyTxopEnd(uint8_t linkId)
Notify the end of a TXOP on the given link.
Time m_emlsrTransitionDelay
EMLSR Transition delay.
void SetWifiMac(Ptr< StaWifiMac > mac)
Set the wifi MAC.
const std::set< uint8_t > & GetEmlsrLinks() const
std::optional< Time > m_emlsrTransitionTimeout
Transition timeout advertised by APs with EMLSR activated.
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.
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 SwitchMainPhy(uint8_t linkId, bool noSwitchDelay)
Switch channel on the Main PHY so that it operates on the given link.
Time m_lastAdvTransitionDelay
last advertised transition delay
void DoDispose() override
Destructor implementation.
std::map< uint8_t, WifiPhyOperatingChannel > m_mainPhyChannels
link ID-indexed map of operating channels for the main PHY
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
uint8_t GetMainPhyId() 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.
uint16_t m_auxPhyMaxWidth
max channel width (MHz) supported by aux PHYs
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)
MgtEmlOmn GetEmlOmn()
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition: event-id.cc:55
EventImpl * PeekEventImpl() const
Definition: event-id.cc:83
bool IsRunning() const
This method is syntactic sugar for !IsExpired().
Definition: event-id.cc:76
void Invoke()
Called by the simulation engine to notify the event that it is time to execute.
Definition: event-impl.cc:47
Implement the header for management frames of type association request.
Definition: mgt-headers.h:161
Implement the header for Action frames of type EML Operating Mode Notification.
Definition: mgt-headers.h:1113
void SetLinkIdInBitmap(uint8_t linkId)
Set the bit position in the link bitmap corresponding to the given link.
EmlControl m_emlControl
EML Control field.
Definition: mgt-headers.h:1163
std::optional< EmlsrParamUpdate > m_emlsrParamUpdate
EMLSR Parameter Update field.
Definition: mgt-headers.h:1164
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Definition: object-base.cc:315
bool TraceDisconnectWithoutContext(std::string name, const CallbackBase &cb)
Disconnect from a TraceSource a Callback previously connected without a context.
Definition: object-base.cc:343
A base class which provides memory management and object aggregation.
Definition: object.h:89
virtual void DoDispose()
Destructor implementation.
Definition: object.cc:352
bool IsInitialized() const
Check if the object has been initialized.
Definition: object.cc:212
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:558
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
Definition: simulator.h:592
std::set< uint8_t > GetSetupLinkIds() const
Get the IDs of the setup links (if any).
void UnblockTxOnLink(uint8_t linkId, WifiQueueBlockedReason reason)
Unblock transmissions on the given link for the given reason.
void BlockTxOnLink(uint8_t linkId, WifiQueueBlockedReason reason)
Block transmissions on the given link for the given reason.
void NotifyEmlsrModeChanged(const std::set< uint8_t > &linkIds)
Notify the MAC that EMLSR mode has changed on the given set of links.
bool IsEmlsrLink(uint8_t linkId) const
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Definition: time.cc:415
@ US
microsecond
Definition: nstime.h:118
AttributeValue implementation for Time.
Definition: nstime.h:1412
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:930
Hold an unsigned integer type.
Definition: uinteger.h:45
static std::pair< CategoryValue, ActionValue > Peek(Ptr< const Packet > pkt)
Peek an Action header from the given packet.
static std::pair< CategoryValue, ActionValue > Remove(Ptr< Packet > pkt)
Remove an Action header from the given packet.
@ PROTECTED_EHT_EML_OPERATING_MODE_NOTIFICATION
Definition: mgt-headers.h:714
Ptr< FrameExchangeManager > GetFrameExchangeManager(uint8_t linkId=SINGLE_LINK_OP_ID) const
Get the Frame Exchange Manager associated with the given link.
Definition: wifi-mac.cc:866
Mac48Address GetBssid(uint8_t linkId) const
Definition: wifi-mac.cc:478
TypeOfStation GetTypeOfStation() const
Return the type of station.
Definition: wifi-mac.cc:427
uint8_t GetNLinks() const
Get the number of links (can be greater than 1 for 11be devices only).
Definition: wifi-mac.cc:935
Ptr< WifiPhy > GetWifiPhy(uint8_t linkId=SINGLE_LINK_OP_ID) const
Definition: wifi-mac.cc:1173
Ptr< EhtConfiguration > GetEhtConfiguration() const
Definition: wifi-mac.cc:1757
Ptr< WifiNetDevice > GetDevice() const
Return the device this PHY is associated with.
Definition: wifi-mac.cc:439
std::optional< uint8_t > GetLinkForPhy(Ptr< const WifiPhy > phy) const
Get the ID of the link (if any) on which the given PHY is operating.
Definition: wifi-mac.cc:976
const std::set< uint8_t > & GetLinkIds() const
Definition: wifi-mac.cc:941
Ptr< ChannelAccessManager > GetChannelAccessManager(uint8_t linkId=SINGLE_LINK_OP_ID) const
Get the Channel Access Manager associated with the given link.
Definition: wifi-mac.cc:872
Ptr< WifiPhy > GetPhy() const
802.11 PHY layer model
Definition: wifi-phy.h:53
Ptr< WifiPhyStateHelper > GetState() const
Return the WifiPhyStateHelper of this PHY.
Definition: wifi-phy.cc:445
void SetOperatingChannel(const ChannelTuple &channelTuple)
If the standard for this object has not been set yet, store the given channel settings.
Definition: wifi-phy.cc:1082
const WifiPhyOperatingChannel & GetOperatingChannel() const
Get a const reference to the operating channel.
Definition: wifi-phy.cc:1017
Class that keeps track of all information about the current PHY operating channel.
static const std::set< FrequencyChannelInfo > m_frequencyChannels
Available frequency channels.
static ConstIterator FindFirst(uint8_t number, uint16_t frequency, uint16_t width, WifiStandard standard, WifiPhyBand band, ConstIterator start=m_frequencyChannels.begin())
Find the first channel matching the specified parameters.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:66
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:86
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Definition: boolean.h:86
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition: boolean.cc:124
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition: nstime.h:1433
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Definition: nstime.h:1413
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition: uinteger.h:46
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:268
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1349
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1325
WifiMacDropReason
The reason why an MPDU was dropped.
Definition: wifi-mac.h:77
@ STA
Definition: wifi-mac.h:65
@ WIFI_STANDARD_UNSPECIFIED
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:704
ns3::Time timeout
static uint8_t EncodeEmlsrTransitionDelay(Time delay)
static uint8_t EncodeEmlsrPaddingDelay(Time delay)
uint8_t emlsrMode
EMLSR Mode.
Definition: mgt-headers.h:1133
uint8_t emlsrParamUpdateCtrl
EMLSR Parameter Update Control.
Definition: mgt-headers.h:1135
EMLSR Parameter Update field.
Definition: mgt-headers.h:1146
@ TX
The PHY layer is sending a packet.