From 493bad6164642503ba3c1add284f844fca9afbf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Sat, 19 Oct 2024 12:58:54 +0200 Subject: [PATCH] wifi: Ideal RAA should not build SNR threshold for invalid combination --- .../model/rate-control/ideal-wifi-manager.cc | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/wifi/model/rate-control/ideal-wifi-manager.cc b/src/wifi/model/rate-control/ideal-wifi-manager.cc index bfcedd6a3d..81eb459c71 100644 --- a/src/wifi/model/rate-control/ideal-wifi-manager.cc +++ b/src/wifi/model/rate-control/ideal-wifi-manager.cc @@ -134,11 +134,21 @@ IdealWifiManager::BuildSnrThresholds() txVector.SetGuardInterval(guardInterval); // derive NSS from the MCS index nss = (mode.GetMcsValue() / 8) + 1; - NS_LOG_DEBUG("Adding mode = " << mode.GetUniqueName() << " channel width " << j - << " nss " << +nss << " GI " << guardInterval); txVector.SetNss(nss); txVector.SetMode(mode); - AddSnrThreshold(txVector, GetPhy()->CalculateSnr(txVector, m_ber)); + if (txVector.IsValid(GetPhy()->GetPhyBand())) + { + NS_LOG_DEBUG("Adding mode = " << mode.GetUniqueName() << " channel width " + << j << " nss " << +nss << " GI " + << guardInterval); + AddSnrThreshold(txVector, GetPhy()->CalculateSnr(txVector, m_ber)); + } + else + { + NS_LOG_DEBUG("Skipping mode = " << mode.GetUniqueName() << " channel width " + << j << " nss " << +nss << " GI " + << guardInterval); + } } else { @@ -156,12 +166,21 @@ IdealWifiManager::BuildSnrThresholds() { if (mode.IsAllowed(j, k)) { - NS_LOG_DEBUG("Adding mode = " << mode.GetUniqueName() - << " channel width " << j << " nss " << +k - << " GI " << guardInterval); txVector.SetNss(k); txVector.SetMode(mode); - AddSnrThreshold(txVector, GetPhy()->CalculateSnr(txVector, m_ber)); + if (txVector.IsValid(GetPhy()->GetPhyBand())) + { + NS_LOG_DEBUG("Adding mode = " << mode.GetUniqueName() + << " channel width " << j << " nss " + << +k << " GI " << guardInterval); + AddSnrThreshold(txVector, GetPhy()->CalculateSnr(txVector, m_ber)); + } + else + { + NS_LOG_DEBUG("Skipping mode = " << mode.GetUniqueName() + << " channel width " << j << " nss " + << +k << " GI " << guardInterval); + } } else {