wifi: Fix sending Probe Requests on multiple links

This commit is contained in:
Stefano Avallone
2023-04-24 12:44:17 +02:00
committed by Stefano Avallone
parent f2dfc5999c
commit 1b29ec8fec
4 changed files with 21 additions and 14 deletions

View File

@@ -947,7 +947,7 @@ ApWifiMac::SendProbeResp(Mac48Address to, uint8_t linkId)
probe.Get<HtCapabilities>() = GetHtCapabilities(linkId);
probe.Get<HtOperation>() = GetHtOperation(linkId);
}
if (GetVhtSupported(SINGLE_LINK_OP_ID))
if (GetVhtSupported(linkId))
{
probe.Get<VhtCapabilities>() = GetVhtCapabilities(linkId);
probe.Get<VhtOperation>() = GetVhtOperation(linkId);

View File

@@ -241,38 +241,38 @@ StaWifiMac::GetCurrentChannel(uint8_t linkId) const
}
void
StaWifiMac::SendProbeRequest()
StaWifiMac::SendProbeRequest(uint8_t linkId)
{
NS_LOG_FUNCTION(this);
NS_LOG_FUNCTION(this << linkId);
WifiMacHeader hdr;
hdr.SetType(WIFI_MAC_MGT_PROBE_REQUEST);
hdr.SetAddr1(Mac48Address::GetBroadcast());
hdr.SetAddr2(GetAddress());
hdr.SetAddr2(GetFrameExchangeManager(linkId)->GetAddress());
hdr.SetAddr3(Mac48Address::GetBroadcast());
hdr.SetDsNotFrom();
hdr.SetDsNotTo();
Ptr<Packet> packet = Create<Packet>();
MgtProbeRequestHeader probe;
probe.Get<Ssid>() = GetSsid();
auto supportedRates = GetSupportedRates(SINGLE_LINK_OP_ID);
auto supportedRates = GetSupportedRates(linkId);
probe.Get<SupportedRates>() = supportedRates.rates;
probe.Get<ExtendedSupportedRatesIE>() = supportedRates.extendedRates;
if (GetHtSupported())
{
probe.Get<ExtendedCapabilities>() = GetExtendedCapabilities();
probe.Get<HtCapabilities>() = GetHtCapabilities(SINGLE_LINK_OP_ID);
probe.Get<HtCapabilities>() = GetHtCapabilities(linkId);
}
if (GetVhtSupported(SINGLE_LINK_OP_ID))
if (GetVhtSupported(linkId))
{
probe.Get<VhtCapabilities>() = GetVhtCapabilities(SINGLE_LINK_OP_ID);
probe.Get<VhtCapabilities>() = GetVhtCapabilities(linkId);
}
if (GetHeSupported())
{
probe.Get<HeCapabilities>() = GetHeCapabilities(SINGLE_LINK_OP_ID);
probe.Get<HeCapabilities>() = GetHeCapabilities(linkId);
}
if (GetEhtSupported())
{
probe.Get<EhtCapabilities>() = GetEhtCapabilities(SINGLE_LINK_OP_ID);
probe.Get<EhtCapabilities>() = GetEhtCapabilities(linkId);
}
packet->AddHeader(probe);

View File

@@ -185,10 +185,11 @@ class StaWifiMac : public WifiMac
void SetAssocManager(Ptr<WifiAssocManager> assocManager);
/**
* Forward a probe request packet to the DCF. The standard is not clear on the correct
* queue for management frames if QoS is supported. We always use the DCF.
* Enqueue a probe request packet for transmission on the given link.
*
* \param linkId the ID of the given link
*/
void SendProbeRequest();
void SendProbeRequest(uint8_t linkId);
/**
* This method is called after wait beacon timeout or wait probe request timeout has

View File

@@ -96,7 +96,13 @@ WifiDefaultAssocManager::DoStartScanning()
if (GetScanParams().type == WifiScanParams::ACTIVE)
{
Simulator::Schedule(GetScanParams().probeDelay, &StaWifiMac::SendProbeRequest, m_mac);
for (uint8_t linkId = 0; linkId < m_mac->GetNLinks(); linkId++)
{
Simulator::Schedule(GetScanParams().probeDelay,
&StaWifiMac::SendProbeRequest,
m_mac,
linkId);
}
m_probeRequestEvent =
Simulator::Schedule(GetScanParams().probeDelay + GetScanParams().maxChannelTime,
&WifiDefaultAssocManager::EndScanning,