From e3e46e6691562c3e878d0169c19f3c3a6bf4e760 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Tue, 24 Jan 2023 23:47:29 +0100 Subject: [PATCH] wifi: Include EML Capabilities in mgt frames sent by MLDs --- src/wifi/model/ap-wifi-mac.cc | 19 +++++++++++++++++++ src/wifi/model/sta-wifi-mac.cc | 17 ++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index 92f302ed8..4a3af1362 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -35,6 +35,7 @@ #include "wifi-net-device.h" #include "wifi-phy.h" +#include "ns3/eht-configuration.h" #include "ns3/he-configuration.h" #include "ns3/ht-configuration.h" #include "ns3/log.h" @@ -667,6 +668,24 @@ ApWifiMac::GetMultiLinkElement(uint8_t linkId, WifiMacType frameType, const Mac4 mle.SetLinkIdInfo(linkId); mle.SetBssParamsChangeCount(0); + auto ehtConfiguration = GetEhtConfiguration(); + NS_ASSERT(ehtConfiguration); + + if (BooleanValue emlsrActivated; + ehtConfiguration->GetAttributeFailSafe("EmlsrActivated", emlsrActivated) && + emlsrActivated.Get()) + { + mle.SetEmlsrSupported(true); + // When the EMLSR Padding Delay subfield is included in a frame sent by an AP affiliated + // with an AP MLD, the EMLSR Padding Delay subfield is reserved. + // When the EMLSR Transition Delay subfield is included in a frame sent by an AP affiliated + // with an AP MLD, the EMLSR Transition Delay subfield is reserved. (Sec. 9.4.2.312.2.3 + // of 802.11be D2.3) + TimeValue time; + ehtConfiguration->GetAttribute("TransitionTimeout", time); + mle.SetTransitionTimeout(time.Get()); + } + // if the Multi-Link Element is being inserted in a (Re)Association Response frame // and the remote station is affiliated with an MLD, try multi-link setup if (auto staMldAddress = GetWifiRemoteStationManager(linkId)->GetMldAddress(to); diff --git a/src/wifi/model/sta-wifi-mac.cc b/src/wifi/model/sta-wifi-mac.cc index 46c20818b..030f491ac 100644 --- a/src/wifi/model/sta-wifi-mac.cc +++ b/src/wifi/model/sta-wifi-mac.cc @@ -30,6 +30,7 @@ #include "wifi-net-device.h" #include "wifi-phy.h" +#include "ns3/eht-configuration.h" #include "ns3/emlsr-manager.h" #include "ns3/he-configuration.h" #include "ns3/ht-configuration.h" @@ -373,8 +374,22 @@ StaWifiMac::GetMultiLinkElement(bool isReassoc, uint8_t linkId) const // and the EML Capabilities subfields, and shall not include the Link ID Info, the BSS // Parameters Change Count, and the Medium Synchronization Delay Information subfields // (Sec. 35.3.5.4 of 802.11be D2.0) - // TODO Add the MLD Capabilities and Operations and the EML Capabilities subfields + // TODO Add the MLD Capabilities and Operations subfield multiLinkElement.SetMldMacAddress(GetAddress()); + + if (m_emlsrManager) // EMLSR Manager is only installed if EMLSR is activated + { + multiLinkElement.SetEmlsrSupported(true); + TimeValue time; + m_emlsrManager->GetAttribute("EmlsrPaddingDelay", time); + multiLinkElement.SetEmlsrPaddingDelay(time.Get()); + m_emlsrManager->GetAttribute("EmlsrTransitionDelay", time); + multiLinkElement.SetEmlsrTransitionDelay(time.Get()); + // When the Transition Timeout subfield is included in a frame sent by a non-AP STA + // affiliated with a non-AP MLD, the Transition Timeout subfield is reserved + // (Section 9.4.2.312.2.3 of 802.11be D2.3) + } + // For each requested link in addition to the link on which the (Re)Association Request // frame is transmitted, the Link Info field of the Basic Multi-Link element carried // in the (Re)Association Request frame shall contain the corresponding Per-STA Profile