diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index d4fbfbf11..c710aaf0f 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -1816,9 +1816,9 @@ ApWifiMac::Receive(Ptr mpdu, uint8_t linkId) IsAssociated(hdr->GetAddr2())) { // received an EML Operating Mode Notification frame from an associated station - MgtEmlOperatingModeNotification frame; + MgtEmlOmn frame; pkt->RemoveHeader(frame); - ReceiveEmlNotification(frame, hdr->GetAddr2(), linkId); + ReceiveEmlOmn(frame, hdr->GetAddr2(), linkId); return; } break; @@ -2152,9 +2152,7 @@ ApWifiMac::ParseReportedStaInfo(const AssocReqRefVariant& assoc, Mac48Address fr } void -ApWifiMac::ReceiveEmlNotification(MgtEmlOperatingModeNotification& frame, - const Mac48Address& sender, - uint8_t linkId) +ApWifiMac::ReceiveEmlOmn(MgtEmlOmn& frame, const Mac48Address& sender, uint8_t linkId) { NS_LOG_FUNCTION(this << frame << sender << linkId); @@ -2288,7 +2286,7 @@ ApWifiMac::ReceiveEmlNotification(MgtEmlOperatingModeNotification& frame, frame.m_emlsrParamUpdate.reset(); auto ehtFem = StaticCast(GetFrameExchangeManager(linkId)); - ehtFem->SendEmlOperatingModeNotification(sender, frame); + ehtFem->SendEmlOmn(sender, frame); } void diff --git a/src/wifi/model/ap-wifi-mac.h b/src/wifi/model/ap-wifi-mac.h index 580748a2b..098cfa33b 100644 --- a/src/wifi/model/ap-wifi-mac.h +++ b/src/wifi/model/ap-wifi-mac.h @@ -48,7 +48,7 @@ class UniformRandomVariable; class MgtAssocRequestHeader; class MgtReassocRequestHeader; class MgtAssocResponseHeader; -class MgtEmlOperatingModeNotification; +class MgtEmlOmn; /// variant holding a reference to a (Re)Association Request using AssocReqRefVariant = std::variant, @@ -246,9 +246,7 @@ class ApWifiMac : public WifiMac * \param sender the MAC address of the sender of the frame * \param linkId the ID of the link over which the frame was received */ - void ReceiveEmlNotification(MgtEmlOperatingModeNotification& frame, - const Mac48Address& sender, - uint8_t linkId); + void ReceiveEmlOmn(MgtEmlOmn& frame, const Mac48Address& sender, uint8_t linkId); /** * The packet we sent was successfully received by the receiver diff --git a/src/wifi/model/eht/default-emlsr-manager.cc b/src/wifi/model/eht/default-emlsr-manager.cc index 16dff46ef..9a09bd14e 100644 --- a/src/wifi/model/eht/default-emlsr-manager.cc +++ b/src/wifi/model/eht/default-emlsr-manager.cc @@ -66,7 +66,7 @@ DefaultEmlsrManager::DoNotifyMgtFrameReceived(Ptr mpdu, uint8_t } uint8_t -DefaultEmlsrManager::GetLinkToSendEmlNotification() +DefaultEmlsrManager::GetLinkToSendEmlOmn() { NS_LOG_FUNCTION(this); auto linkId = GetStaMac()->GetLinkForPhy(m_mainPhyId); diff --git a/src/wifi/model/eht/default-emlsr-manager.h b/src/wifi/model/eht/default-emlsr-manager.h index 5ec1028b2..024ef1a75 100644 --- a/src/wifi/model/eht/default-emlsr-manager.h +++ b/src/wifi/model/eht/default-emlsr-manager.h @@ -45,7 +45,7 @@ class DefaultEmlsrManager : public EmlsrManager ~DefaultEmlsrManager() override; protected: - uint8_t GetLinkToSendEmlNotification() override; + uint8_t GetLinkToSendEmlOmn() override; std::optional ResendNotification(Ptr mpdu) override; private: diff --git a/src/wifi/model/eht/eht-frame-exchange-manager.cc b/src/wifi/model/eht/eht-frame-exchange-manager.cc index c86fe3c00..5c099a04f 100644 --- a/src/wifi/model/eht/eht-frame-exchange-manager.cc +++ b/src/wifi/model/eht/eht-frame-exchange-manager.cc @@ -261,9 +261,7 @@ EhtFrameExchangeManager::NotifySwitchingEmlsrLink(Ptr phy, uint8_t link } void -EhtFrameExchangeManager::SendEmlOperatingModeNotification( - const Mac48Address& dest, - const MgtEmlOperatingModeNotification& frame) +EhtFrameExchangeManager::SendEmlOmn(const Mac48Address& dest, const MgtEmlOmn& frame) { NS_LOG_FUNCTION(this << dest << frame); diff --git a/src/wifi/model/eht/eht-frame-exchange-manager.h b/src/wifi/model/eht/eht-frame-exchange-manager.h index 6f345a740..71ec7e6d7 100644 --- a/src/wifi/model/eht/eht-frame-exchange-manager.h +++ b/src/wifi/model/eht/eht-frame-exchange-manager.h @@ -52,8 +52,7 @@ class EhtFrameExchangeManager : public HeFrameExchangeManager * \param dest the MAC address of the receiver * \param frame the EML Operating Mode Notification frame to send */ - void SendEmlOperatingModeNotification(const Mac48Address& dest, - const MgtEmlOperatingModeNotification& frame); + void SendEmlOmn(const Mac48Address& dest, const MgtEmlOmn& frame); /** * Get the RSSI (in dBm) of the most recent packet received from the station having diff --git a/src/wifi/model/eht/emlsr-manager.cc b/src/wifi/model/eht/emlsr-manager.cc index 7aca82765..967a86c53 100644 --- a/src/wifi/model/eht/emlsr-manager.cc +++ b/src/wifi/model/eht/emlsr-manager.cc @@ -194,7 +194,7 @@ EmlsrManager::SetEmlsrLinks(const std::set& linkIds) if (GetStaMac() && GetStaMac()->IsAssociated() && GetTransitionTimeout() && m_nextEmlsrLinks) { // Request to enable EMLSR mode on the given links, provided that they have been setup - SendEmlOperatingModeNotification(); + SendEmlOmn(); } } @@ -216,7 +216,7 @@ EmlsrManager::NotifyMgtFrameReceived(Ptr mpdu, uint8_t linkId) { // a non-empty set of EMLSR links have been configured, hence enable EMLSR mode // on those links - SendEmlOperatingModeNotification(); + SendEmlOmn(); } } @@ -290,7 +290,7 @@ EmlsrManager::SwitchMainPhy(uint8_t linkId) } void -EmlsrManager::SendEmlOperatingModeNotification() +EmlsrManager::SendEmlOmn() { NS_LOG_FUNCTION(this); @@ -298,7 +298,7 @@ EmlsrManager::SendEmlOperatingModeNotification() "AP did not advertise a Transition Timeout, cannot send EML notification"); NS_ASSERT_MSG(m_nextEmlsrLinks, "Need to set EMLSR links before calling this method"); - MgtEmlOperatingModeNotification frame; + MgtEmlOmn frame; // Add the EMLSR Parameter Update field if needed if (m_lastAdvPaddingDelay != m_emlsrPaddingDelay || @@ -307,7 +307,7 @@ EmlsrManager::SendEmlOperatingModeNotification() m_lastAdvPaddingDelay = m_emlsrPaddingDelay; m_lastAdvTransitionDelay = m_emlsrTransitionDelay; frame.m_emlControl.emlsrParamUpdateCtrl = 1; - frame.m_emlsrParamUpdate = MgtEmlOperatingModeNotification::EmlsrParamUpdate{}; + frame.m_emlsrParamUpdate = MgtEmlOmn::EmlsrParamUpdate{}; frame.m_emlsrParamUpdate->paddingDelay = CommonInfoBasicMle::EncodeEmlsrPaddingDelay(m_lastAdvPaddingDelay); frame.m_emlsrParamUpdate->transitionDelay = @@ -344,8 +344,8 @@ EmlsrManager::SendEmlOperatingModeNotification() // non-AP STA affiliated with the non-AP MLD that operates on one of the EMLSR links is // in awake state. (Sec. 35.3.17 of 802.11be D3.0) - auto linkId = GetLinkToSendEmlNotification(); - GetEhtFem(linkId)->SendEmlOperatingModeNotification(m_staMac->GetBssid(linkId), frame); + auto linkId = GetLinkToSendEmlOmn(); + GetEhtFem(linkId)->SendEmlOmn(m_staMac->GetBssid(linkId), frame); } void @@ -403,10 +403,9 @@ EmlsrManager::TxDropped(WifiMacDropReason reason, Ptr mpdu) auto linkId = ResendNotification(mpdu); if (linkId) { - MgtEmlOperatingModeNotification frame; + MgtEmlOmn frame; pkt->RemoveHeader(frame); - GetEhtFem(*linkId)->SendEmlOperatingModeNotification(m_staMac->GetBssid(*linkId), - frame); + GetEhtFem(*linkId)->SendEmlOmn(m_staMac->GetBssid(*linkId), frame); } else { diff --git a/src/wifi/model/eht/emlsr-manager.h b/src/wifi/model/eht/emlsr-manager.h index 6e20c49f2..38794baab 100644 --- a/src/wifi/model/eht/emlsr-manager.h +++ b/src/wifi/model/eht/emlsr-manager.h @@ -146,7 +146,7 @@ class EmlsrManager : public Object /** * \return the ID of the link on which the EML Operating Mode Notification frame has to be sent */ - virtual uint8_t GetLinkToSendEmlNotification() = 0; + virtual uint8_t GetLinkToSendEmlOmn() = 0; /** * A previous EML Operating Mode Notification frame was dropped. Ask the subclass whether @@ -188,7 +188,7 @@ class EmlsrManager : public Object /** * Send an EML Operating Mode Notification frame. */ - void SendEmlOperatingModeNotification(); + void SendEmlOmn(); /** * Notify the subclass of the reception of a management frame addressed to us. diff --git a/src/wifi/model/mgt-headers.cc b/src/wifi/model/mgt-headers.cc index f317fd111..96dca5d1e 100644 --- a/src/wifi/model/mgt-headers.cc +++ b/src/wifi/model/mgt-headers.cc @@ -1731,26 +1731,26 @@ MgtDelBaHeader::SetParameterSet(uint16_t params) * EMLSR Operating Mode Notification ****************************************************/ -NS_OBJECT_ENSURE_REGISTERED(MgtEmlOperatingModeNotification); +NS_OBJECT_ENSURE_REGISTERED(MgtEmlOmn); TypeId -MgtEmlOperatingModeNotification::GetTypeId() +MgtEmlOmn::GetTypeId() { static TypeId tid = TypeId("ns3::MgtEmlOperatingModeNotification") .SetParent
() .SetGroupName("Wifi") - .AddConstructor(); + .AddConstructor(); return tid; } TypeId -MgtEmlOperatingModeNotification::GetInstanceTypeId() const +MgtEmlOmn::GetInstanceTypeId() const { return GetTypeId(); } void -MgtEmlOperatingModeNotification::Print(std::ostream& os) const +MgtEmlOmn::Print(std::ostream& os) const { os << "EMLSR Mode=" << +m_emlControl.emlsrMode << " EMLMR Mode=" << +m_emlControl.emlmrMode << " EMLSR Parameter Update Control=" << +m_emlControl.emlsrParamUpdateCtrl; @@ -1770,7 +1770,7 @@ MgtEmlOperatingModeNotification::Print(std::ostream& os) const } uint32_t -MgtEmlOperatingModeNotification::GetSerializedSize() const +MgtEmlOmn::GetSerializedSize() const { uint32_t size = 2; // Dialog Token (1) + first byte of EML Control if (m_emlControl.linkBitmap) @@ -1790,7 +1790,7 @@ MgtEmlOperatingModeNotification::GetSerializedSize() const } void -MgtEmlOperatingModeNotification::Serialize(Buffer::Iterator start) const +MgtEmlOmn::Serialize(Buffer::Iterator start) const { start.WriteU8(m_dialogToken); @@ -1825,7 +1825,7 @@ MgtEmlOperatingModeNotification::Serialize(Buffer::Iterator start) const } uint32_t -MgtEmlOperatingModeNotification::Deserialize(Buffer::Iterator start) +MgtEmlOmn::Deserialize(Buffer::Iterator start) { Buffer::Iterator i = start; @@ -1858,7 +1858,7 @@ MgtEmlOperatingModeNotification::Deserialize(Buffer::Iterator start) } void -MgtEmlOperatingModeNotification::SetLinkIdInBitmap(uint8_t linkId) +MgtEmlOmn::SetLinkIdInBitmap(uint8_t linkId) { NS_ABORT_MSG_IF(linkId > 15, "Link ID must not exceed 15"); if (!m_emlControl.linkBitmap) @@ -1869,7 +1869,7 @@ MgtEmlOperatingModeNotification::SetLinkIdInBitmap(uint8_t linkId) } std::list -MgtEmlOperatingModeNotification::GetLinkBitmap() const +MgtEmlOmn::GetLinkBitmap() const { std::list list; NS_ASSERT_MSG(m_emlControl.linkBitmap.has_value(), "No link bitmap"); diff --git a/src/wifi/model/mgt-headers.h b/src/wifi/model/mgt-headers.h index e22a5997b..4b6c08616 100644 --- a/src/wifi/model/mgt-headers.h +++ b/src/wifi/model/mgt-headers.h @@ -1109,10 +1109,10 @@ class MgtDelBaHeader : public Header * \ingroup wifi * Implement the header for Action frames of type EML Operating Mode Notification. */ -class MgtEmlOperatingModeNotification : public Header +class MgtEmlOmn : public Header { public: - MgtEmlOperatingModeNotification() = default; + MgtEmlOmn() = default; /** * Register this type. diff --git a/src/wifi/test/wifi-emlsr-test.cc b/src/wifi/test/wifi-emlsr-test.cc index 4e27be30e..84b7ca500 100644 --- a/src/wifi/test/wifi-emlsr-test.cc +++ b/src/wifi/test/wifi-emlsr-test.cc @@ -83,7 +83,7 @@ EmlOperatingModeNotificationTest::EmlOperatingModeNotificationTest() void EmlOperatingModeNotificationTest::DoRun() { - MgtEmlOperatingModeNotification frame; + MgtEmlOmn frame; // Both EMLSR Mode and EMLMR Mode subfields set to 0 (no link bitmap); TestHeaderSerialization(frame); @@ -104,7 +104,7 @@ EmlOperatingModeNotificationTest::DoRun() auto transition = MicroSeconds(128); frame.m_emlControl.emlsrParamUpdateCtrl = 1; - frame.m_emlsrParamUpdate = MgtEmlOperatingModeNotification::EmlsrParamUpdate{}; + frame.m_emlsrParamUpdate = MgtEmlOmn::EmlsrParamUpdate{}; frame.m_emlsrParamUpdate->paddingDelay = CommonInfoBasicMle::EncodeEmlsrPaddingDelay(padding); frame.m_emlsrParamUpdate->transitionDelay = CommonInfoBasicMle::EncodeEmlsrTransitionDelay(transition); @@ -542,7 +542,7 @@ EmlsrOperationsTestBase::SetSsid(uint16_t aid, Mac48Address /* addr */) * timeout expires and when an EML Notification response is received from the AP MLD (thus, * the correct EMLSR link set is stored after whichever of the two events occur first) */ -class EmlNotificationExchangeTest : public EmlsrOperationsTestBase +class EmlOmnExchangeTest : public EmlsrOperationsTestBase { public: /** @@ -551,9 +551,8 @@ class EmlNotificationExchangeTest : public EmlsrOperationsTestBase * \param linksToEnableEmlsrOn IDs of links on which EMLSR mode should be enabled * \param transitionTimeout the Transition Timeout advertised by the AP MLD */ - EmlNotificationExchangeTest(const std::set& linksToEnableEmlsrOn, - Time transitionTimeout); - ~EmlNotificationExchangeTest() override = default; + EmlOmnExchangeTest(const std::set& linksToEnableEmlsrOn, Time transitionTimeout); + ~EmlOmnExchangeTest() override = default; protected: void DoSetup() override; @@ -627,9 +626,8 @@ class EmlNotificationExchangeTest : public EmlsrOperationsTestBase std::list m_uidList; ///< list of UIDs of packets to corrupt }; -EmlNotificationExchangeTest::EmlNotificationExchangeTest( - const std::set& linksToEnableEmlsrOn, - Time transitionTimeout) +EmlOmnExchangeTest::EmlOmnExchangeTest(const std::set& linksToEnableEmlsrOn, + Time transitionTimeout) : EmlsrOperationsTestBase("Check EML Notification exchange"), m_checkEmlsrLinksCount(0), m_emlNotificationDroppedCount(0) @@ -642,7 +640,7 @@ EmlNotificationExchangeTest::EmlNotificationExchangeTest( } void -EmlNotificationExchangeTest::DoSetup() +EmlOmnExchangeTest::DoSetup() { EmlsrOperationsTestBase::DoSetup(); @@ -652,20 +650,18 @@ EmlNotificationExchangeTest::DoSetup() m_apMac->GetWifiPhy(linkId)->SetPostReceptionErrorModel(m_errorModel); } - m_staMacs[0]->TraceConnectWithoutContext( - "AckedMpdu", - MakeCallback(&EmlNotificationExchangeTest::TxOk, this)); - m_staMacs[0]->TraceConnectWithoutContext( - "DroppedMpdu", - MakeCallback(&EmlNotificationExchangeTest::TxDropped, this)); + m_staMacs[0]->TraceConnectWithoutContext("AckedMpdu", + MakeCallback(&EmlOmnExchangeTest::TxOk, this)); + m_staMacs[0]->TraceConnectWithoutContext("DroppedMpdu", + MakeCallback(&EmlOmnExchangeTest::TxDropped, this)); } void -EmlNotificationExchangeTest::Transmit(Ptr mac, - uint8_t phyId, - WifiConstPsduMap psduMap, - WifiTxVector txVector, - double txPowerW) +EmlOmnExchangeTest::Transmit(Ptr mac, + uint8_t phyId, + WifiConstPsduMap psduMap, + WifiTxVector txVector, + double txPowerW) { EmlsrOperationsTestBase::Transmit(mac, phyId, psduMap, txVector, txPowerW); auto linkId = m_txPsdus.back().linkId; @@ -706,9 +702,9 @@ EmlNotificationExchangeTest::Transmit(Ptr mac, } void -EmlNotificationExchangeTest::CheckEmlCapabilitiesInAssocReq(Ptr mpdu, - const WifiTxVector& txVector, - uint8_t linkId) +EmlOmnExchangeTest::CheckEmlCapabilitiesInAssocReq(Ptr mpdu, + const WifiTxVector& txVector, + uint8_t linkId) { MgtAssocRequestHeader frame; mpdu->GetPacket()->PeekHeader(frame); @@ -731,9 +727,9 @@ EmlNotificationExchangeTest::CheckEmlCapabilitiesInAssocReq(Ptr } void -EmlNotificationExchangeTest::CheckEmlCapabilitiesInAssocResp(Ptr mpdu, - const WifiTxVector& txVector, - uint8_t linkId) +EmlOmnExchangeTest::CheckEmlCapabilitiesInAssocResp(Ptr mpdu, + const WifiTxVector& txVector, + uint8_t linkId) { bool sentToEmlsrClient = (m_staMacs[0]->GetLinkIdByAddress(mpdu->GetHeader().GetAddr1()) == linkId); @@ -763,11 +759,11 @@ EmlNotificationExchangeTest::CheckEmlCapabilitiesInAssocResp(Ptr } void -EmlNotificationExchangeTest::CheckEmlNotification(Ptr psdu, - const WifiTxVector& txVector, - uint8_t linkId) +EmlOmnExchangeTest::CheckEmlNotification(Ptr psdu, + const WifiTxVector& txVector, + uint8_t linkId) { - MgtEmlOperatingModeNotification frame; + MgtEmlOmn frame; auto mpdu = *psdu->begin(); auto pkt = mpdu->GetPacket()->Copy(); WifiActionHeader::Remove(pkt); @@ -817,7 +813,7 @@ EmlNotificationExchangeTest::CheckEmlNotification(Ptr psdu, txVector, m_staMacs[0]->GetWifiPhy(linkId)->GetPhyBand()) + MicroSeconds(1); // to account for propagation delay - Simulator::Schedule(delay, &EmlNotificationExchangeTest::CheckEmlsrLinks, this); + Simulator::Schedule(delay, &EmlOmnExchangeTest::CheckEmlsrLinks, this); } NS_TEST_EXPECT_MSG_EQ(+m_mainPhyId, @@ -827,7 +823,7 @@ EmlNotificationExchangeTest::CheckEmlNotification(Ptr psdu, } void -EmlNotificationExchangeTest::TxOk(Ptr mpdu) +EmlOmnExchangeTest::TxOk(Ptr mpdu) { const auto& hdr = mpdu->GetHeader(); @@ -841,14 +837,14 @@ EmlNotificationExchangeTest::TxOk(Ptr mpdu) // the EML Operating Mode Notification frame that the non-AP MLD sent has been // acknowledged; after the transition timeout, the EMLSR links have been set Simulator::Schedule(m_transitionTimeout + NanoSeconds(1), - &EmlNotificationExchangeTest::CheckEmlsrLinks, + &EmlOmnExchangeTest::CheckEmlsrLinks, this); } } } void -EmlNotificationExchangeTest::TxDropped(WifiMacDropReason reason, Ptr mpdu) +EmlOmnExchangeTest::TxDropped(WifiMacDropReason reason, Ptr mpdu) { const auto& hdr = mpdu->GetHeader(); @@ -867,7 +863,7 @@ EmlNotificationExchangeTest::TxDropped(WifiMacDropReason reason, Ptr mpdu, auto pkt = mpdu->GetPacket()->Copy(); const auto& hdr = mpdu->GetHeader(); WifiActionHeader::Remove(pkt); - MgtEmlOperatingModeNotification frame; + MgtEmlOmn frame; pkt->RemoveHeader(frame); std::optional staId; @@ -2974,10 +2970,10 @@ WifiEmlsrTestSuite::WifiEmlsrTestSuite() : TestSuite("wifi-emlsr", UNIT) { AddTestCase(new EmlOperatingModeNotificationTest(), TestCase::QUICK); - AddTestCase(new EmlNotificationExchangeTest({1, 2}, MicroSeconds(0)), TestCase::QUICK); - AddTestCase(new EmlNotificationExchangeTest({1, 2}, MicroSeconds(2048)), TestCase::QUICK); - AddTestCase(new EmlNotificationExchangeTest({0, 1, 2, 3}, MicroSeconds(0)), TestCase::QUICK); - AddTestCase(new EmlNotificationExchangeTest({0, 1, 2, 3}, MicroSeconds(2048)), TestCase::QUICK); + AddTestCase(new EmlOmnExchangeTest({1, 2}, MicroSeconds(0)), TestCase::QUICK); + AddTestCase(new EmlOmnExchangeTest({1, 2}, MicroSeconds(2048)), TestCase::QUICK); + AddTestCase(new EmlOmnExchangeTest({0, 1, 2, 3}, MicroSeconds(0)), TestCase::QUICK); + AddTestCase(new EmlOmnExchangeTest({0, 1, 2, 3}, MicroSeconds(2048)), TestCase::QUICK); for (const auto& emlsrLinks : {std::set{0, 1, 2}, std::set{1, 2}, std::set{0, 1}}) {