diff --git a/src/wifi/model/wifi-default-protection-manager.cc b/src/wifi/model/wifi-default-protection-manager.cc index 9d63535ea..5586eefac 100644 --- a/src/wifi/model/wifi-default-protection-manager.cc +++ b/src/wifi/model/wifi-default-protection-manager.cc @@ -21,10 +21,12 @@ #include "ap-wifi-mac.h" #include "frame-exchange-manager.h" +#include "sta-wifi-mac.h" #include "wifi-mpdu.h" #include "wifi-tx-parameters.h" #include "ns3/boolean.h" +#include "ns3/emlsr-manager.h" #include "ns3/erp-ofdm-phy.h" #include "ns3/log.h" @@ -188,8 +190,20 @@ WifiDefaultProtectionManager::GetPsduProtection(const WifiMacHeader& hdr, return std::make_unique(); } + // when an EMLSR client starts an UL TXOP on a link on which the main PHY is not operating, + // the aux PHY sends an RTS frame + bool emlsrNeedRts = false; + + if (auto staMac = DynamicCast(m_mac)) + { + auto emlsrManager = staMac->GetEmlsrManager(); + + emlsrNeedRts = emlsrManager && staMac->IsEmlsrLink(m_linkId) && + m_mac->GetLinkForPhy(emlsrManager->GetMainPhyId()) != m_linkId; + } + // check if RTS/CTS is needed - if (GetWifiRemoteStationManager()->NeedRts(hdr, size)) + if (emlsrNeedRts || GetWifiRemoteStationManager()->NeedRts(hdr, size)) { auto protection = std::make_unique(); protection->rtsTxVector = GetWifiRemoteStationManager()->GetRtsTxVector(hdr.GetAddr1());