wifi: Skip candidate AP if its channel width is not compatible with the non-AP STA

This commit is contained in:
Sébastien Deronne
2025-04-16 10:01:37 +02:00
parent 296de82cf3
commit a9965c13bf
3 changed files with 22 additions and 5 deletions

View File

@@ -601,6 +601,10 @@ It is possible to configure the behavior of the association manager to either ab
a problematic situation is detected (default) or to allow the association anyway, depending on the configured value
for the ``ns3::WifiMac::AllowAssociationWithDifferentChannelWidth`` attribute.
If the default association manager is used, it is also possible to skip candidate APs that are operating on a
larger channel width than the non-AP STA and which would result in the problematic situation described above.
This is done by setting the ``ns3::WifiMac::SkipCandidateAPsWithLargerChannelWidth`` attribute to true.
SpectrumWifiPhyHelper
=====================

View File

@@ -13,6 +13,7 @@
#include "wifi-net-device.h"
#include "wifi-phy.h"
#include "ns3/boolean.h"
#include "ns3/log.h"
#include "ns3/simulator.h"
#include "ns3/vht-configuration.h"
@@ -40,7 +41,16 @@ WifiDefaultAssocManager::GetTypeId()
"notified within this amount of time, we give up setting up that link.",
TimeValue(MilliSeconds(5)),
MakeTimeAccessor(&WifiDefaultAssocManager::m_channelSwitchTimeout),
MakeTimeChecker(Seconds(0)));
MakeTimeChecker(Seconds(0)))
.AddAttribute(
"SkipAssocIncompatibleChannelWidth",
"If set to true, it does not include APs with incompatible channel width with the "
"STA in the list of candidate APs. An incompatible channel width is one that the "
"STA cannot advertise to the AP, unless AP operates on a channel width that is "
"equal or lower than that channel width.",
BooleanValue(false),
MakeBooleanAccessor(&WifiDefaultAssocManager::m_skipAssocIncompatibleChannelWidth),
MakeBooleanChecker());
return tid;
}
@@ -290,7 +300,8 @@ WifiDefaultAssocManager::ChannelSwitchTimeout(uint8_t linkId)
bool
WifiDefaultAssocManager::CanBeInserted(const StaWifiMac::ApInfo& apInfo) const
{
return (m_waitBeaconEvent.IsPending() || m_probeRequestEvent.IsPending());
return ((m_waitBeaconEvent.IsPending() || m_probeRequestEvent.IsPending()) &&
(!m_skipAssocIncompatibleChannelWidth || IsChannelWidthCompatible(apInfo)));
}
bool

View File

@@ -57,9 +57,11 @@ class WifiDefaultAssocManager : public WifiAssocManager
*/
void ChannelSwitchTimeout(uint8_t linkId);
EventId m_waitBeaconEvent; ///< wait beacon event
EventId m_probeRequestEvent; ///< probe request event
Time m_channelSwitchTimeout; ///< maximum delay for channel switching
EventId m_waitBeaconEvent; ///< wait beacon event
EventId m_probeRequestEvent; ///< probe request event
Time m_channelSwitchTimeout; ///< maximum delay for channel switching
bool m_skipAssocIncompatibleChannelWidth; ///< flag whether to skip APs with incompatible
///< channel width
/** Channel switch info */
struct ChannelSwitchInfo