wifi: Add SIG_B MCS field to TXVECTOR (based on patch from Xiaowen Wang)
This commit is contained in:
committed by
Sébastien Deronne
parent
e034753943
commit
ead8eaca91
@@ -98,6 +98,7 @@ HePpdu::SetPhyHeaders (const WifiTxVector& txVector, Time ppduDuration)
|
||||
if (txVector.IsDlMu ())
|
||||
{
|
||||
m_heSig.SetMuFlag (true);
|
||||
m_heSig.SetMcs (txVector.GetSigBMode ().GetMcsValue ());
|
||||
}
|
||||
else if (!txVector.IsUlMu ())
|
||||
{
|
||||
@@ -125,6 +126,10 @@ HePpdu::DoGetTxVector (void) const
|
||||
{
|
||||
txVector.SetHeMuUserInfo (muUserInfo.first, muUserInfo.second);
|
||||
}
|
||||
if (txVector.IsDlMu ())
|
||||
{
|
||||
txVector.SetSigBMode (HePhy::GetVhtMcs (m_heSig.GetMcs ()));
|
||||
}
|
||||
return txVector;
|
||||
}
|
||||
|
||||
|
||||
@@ -705,6 +705,11 @@ RrMultiUserScheduler::FinalizeTxVector (WifiTxVector& txVector)
|
||||
candidateIt++;
|
||||
}
|
||||
|
||||
auto hePhy = DynamicCast<HePhy> (m_apMac->GetWifiPhy ()->GetPhyEntity (WIFI_MOD_CLASS_HE));
|
||||
NS_ASSERT (hePhy);
|
||||
auto sigBMode = hePhy->GetSigBMode (txVector);
|
||||
txVector.SetSigBMode (sigBMode);
|
||||
|
||||
// remove candidates that will not be served
|
||||
m_candidates.erase (candidateIt, m_candidates.end ());
|
||||
}
|
||||
|
||||
@@ -89,7 +89,8 @@ WifiTxVector::WifiTxVector (const WifiTxVector& txVector)
|
||||
m_bssColor (txVector.m_bssColor),
|
||||
m_length (txVector.m_length),
|
||||
m_modeInitialized (txVector.m_modeInitialized),
|
||||
m_inactiveSubchannels (txVector.m_inactiveSubchannels)
|
||||
m_inactiveSubchannels (txVector.m_inactiveSubchannels),
|
||||
m_sigBMcs (txVector.m_sigBMcs)
|
||||
{
|
||||
m_muUserInfos.clear ();
|
||||
if (!txVector.m_muUserInfos.empty ()) //avoids crashing for loop
|
||||
@@ -334,6 +335,18 @@ WifiTxVector::GetLength (void) const
|
||||
return m_length;
|
||||
}
|
||||
|
||||
void
|
||||
WifiTxVector::SetSigBMode (const WifiMode& mode)
|
||||
{
|
||||
m_sigBMcs = mode;
|
||||
}
|
||||
|
||||
WifiMode
|
||||
WifiTxVector::GetSigBMode () const
|
||||
{
|
||||
return m_sigBMcs;
|
||||
}
|
||||
|
||||
bool
|
||||
WifiTxVector::IsValid (void) const
|
||||
{
|
||||
|
||||
@@ -406,6 +406,18 @@ public:
|
||||
*/
|
||||
const std::vector<bool>& GetInactiveSubchannels (void) const;
|
||||
|
||||
/**
|
||||
* Set the MCS used for SIG-B
|
||||
* \param mode MCS used for SIG-B
|
||||
*/
|
||||
void SetSigBMode (const WifiMode& mode);
|
||||
|
||||
/**
|
||||
* Get MCS used for SIG-B
|
||||
* \return MCS for SIG-B
|
||||
*/
|
||||
WifiMode GetSigBMode () const;
|
||||
|
||||
private:
|
||||
WifiMode m_mode; /**< The DATARATE parameter in Table 15-4.
|
||||
It is the value that will be passed
|
||||
@@ -432,7 +444,9 @@ private:
|
||||
indexed by station ID (STA-ID) corresponding
|
||||
to the 11 LSBs of the AID of the recipient STA
|
||||
This list shall be used only for HE MU */
|
||||
std::vector<bool> m_inactiveSubchannels;/**< Bitmap of inactive subchannels used for preamble puncturing */
|
||||
std::vector<bool> m_inactiveSubchannels; /**< Bitmap of inactive subchannels used for preamble puncturing */
|
||||
|
||||
WifiMode m_sigBMcs; //<! MCS_SIG_B per Table 27-1 IEEE 802.11ax-2021
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -443,7 +457,7 @@ private:
|
||||
*
|
||||
* \return ouput stream
|
||||
*/
|
||||
std::ostream & operator << (std::ostream & os,const WifiTxVector &v);
|
||||
std::ostream & operator << (std::ostream & os, const WifiTxVector &v);
|
||||
|
||||
} //namespace ns3
|
||||
|
||||
|
||||
@@ -243,12 +243,16 @@ TxDurationTest::CheckMuTxDuration (std::list<uint32_t> sizes, std::list<HeMuUser
|
||||
txVector.SetStbc (0);
|
||||
txVector.SetNess (0);
|
||||
std::list<uint16_t> staIds;
|
||||
|
||||
uint16_t staId = 1;
|
||||
for (const auto & userInfo : userInfos)
|
||||
{
|
||||
txVector.SetHeMuUserInfo (staId, userInfo);
|
||||
staIds.push_back (staId++);
|
||||
}
|
||||
|
||||
txVector.SetSigBMode (VhtPhy::GetVhtMcs0 ());
|
||||
|
||||
Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
|
||||
std::list<WifiPhyBand> testedBands {WIFI_PHY_BAND_5GHZ, WIFI_PHY_BAND_6GHZ, WIFI_PHY_BAND_2_4GHZ}; //Durations vary depending on frequency; test also 2.4 GHz (bug 1971)
|
||||
for (auto & testedBand : testedBands)
|
||||
@@ -621,6 +625,7 @@ HeSigBDurationTest::DoRun (void)
|
||||
userInfos.push_back ({{HeRu::RU_106_TONE, 1, true}, HePhy::GetHeMcs11 (), 1});
|
||||
userInfos.push_back ({{HeRu::RU_106_TONE, 2, true}, HePhy::GetHeMcs10 (), 4});
|
||||
WifiTxVector txVector = BuildTxVector (20, userInfos);
|
||||
txVector.SetSigBMode (VhtPhy::GetVhtMcs5 ());
|
||||
NS_TEST_EXPECT_MSG_EQ (hePhy->GetSigMode (WIFI_PPDU_FIELD_SIG_B, txVector), VhtPhy::GetVhtMcs5 (), "HE-SIG-B should be sent at MCS 5");
|
||||
std::pair<std::size_t, std::size_t> numUsersPerCc = txVector.GetNumRusPerHeSigBContentChannel ();
|
||||
NS_TEST_EXPECT_MSG_EQ (numUsersPerCc.first, 2, "Both users should be on HE-SIG-B content channel 1");
|
||||
@@ -633,6 +638,7 @@ HeSigBDurationTest::DoRun (void)
|
||||
userInfos.push_back ({{HeRu::RU_52_TONE, 7, true}, HePhy::GetHeMcs5 (), 3});
|
||||
userInfos.push_back ({{HeRu::RU_52_TONE, 8, true}, HePhy::GetHeMcs6 (), 2});
|
||||
txVector = BuildTxVector (40, userInfos);
|
||||
txVector.SetSigBMode (VhtPhy::GetVhtMcs4 ());
|
||||
NS_TEST_EXPECT_MSG_EQ (hePhy->GetSigMode (WIFI_PPDU_FIELD_SIG_B, txVector), VhtPhy::GetVhtMcs4 (), "HE-SIG-B should be sent at MCS 4");
|
||||
numUsersPerCc = txVector.GetNumRusPerHeSigBContentChannel ();
|
||||
NS_TEST_EXPECT_MSG_EQ (numUsersPerCc.first, 2, "Two users should be on HE-SIG-B content channel 1");
|
||||
@@ -642,6 +648,7 @@ HeSigBDurationTest::DoRun (void)
|
||||
//40 MHz band, odd number of users per HE-SIG-B content channel
|
||||
userInfos.push_back ({{HeRu::RU_26_TONE, 13, true}, HePhy::GetHeMcs3 (), 1});
|
||||
txVector = BuildTxVector (40, userInfos);
|
||||
txVector.SetSigBMode (VhtPhy::GetVhtMcs3 ());
|
||||
NS_TEST_EXPECT_MSG_EQ (hePhy->GetSigMode (WIFI_PPDU_FIELD_SIG_B, txVector), VhtPhy::GetVhtMcs3 (), "HE-SIG-B should be sent at MCS 3");
|
||||
numUsersPerCc = txVector.GetNumRusPerHeSigBContentChannel ();
|
||||
NS_TEST_EXPECT_MSG_EQ (numUsersPerCc.first, 2, "Two users should be on HE-SIG-B content channel 1");
|
||||
@@ -652,6 +659,7 @@ HeSigBDurationTest::DoRun (void)
|
||||
userInfos.push_back ({{HeRu::RU_242_TONE, 3, true}, HePhy::GetHeMcs1 (), 1});
|
||||
userInfos.push_back ({{HeRu::RU_242_TONE, 4, true}, HePhy::GetHeMcs4 (), 1});
|
||||
txVector = BuildTxVector (80, userInfos);
|
||||
txVector.SetSigBMode (VhtPhy::GetVhtMcs1 ());
|
||||
NS_TEST_EXPECT_MSG_EQ (hePhy->GetSigMode (WIFI_PPDU_FIELD_SIG_B, txVector), VhtPhy::GetVhtMcs1 (), "HE-SIG-B should be sent at MCS 1");
|
||||
numUsersPerCc = txVector.GetNumRusPerHeSigBContentChannel ();
|
||||
NS_TEST_EXPECT_MSG_EQ (numUsersPerCc.first, 3, "Three users should be on HE-SIG-B content channel 1");
|
||||
@@ -661,6 +669,7 @@ HeSigBDurationTest::DoRun (void)
|
||||
//160 MHz band
|
||||
userInfos.push_back ({{HeRu::RU_996_TONE, 1, false}, HePhy::GetHeMcs1 (), 1});
|
||||
txVector = BuildTxVector (160, userInfos);
|
||||
txVector.SetSigBMode (VhtPhy::GetVhtMcs1 ());
|
||||
NS_TEST_EXPECT_MSG_EQ (hePhy->GetSigMode (WIFI_PPDU_FIELD_SIG_B, txVector), VhtPhy::GetVhtMcs1 (), "HE-SIG-B should be sent at MCS 1");
|
||||
numUsersPerCc = txVector.GetNumRusPerHeSigBContentChannel ();
|
||||
NS_TEST_EXPECT_MSG_EQ (numUsersPerCc.first, 4, "Four users should be on HE-SIG-B content channel 1");
|
||||
@@ -911,6 +920,7 @@ PhyHeaderSectionsTest::DoRun (void)
|
||||
{ 2, { {HeRu::RU_106_TONE, 1, true}, HePhy::GetHeMcs9 (), 1 } } };
|
||||
sigAMode = HePhy::GetVhtMcs0 ();
|
||||
sigBMode = HePhy::GetVhtMcs4 (); //because of first user info map
|
||||
txVector.SetSigBMode (sigBMode);
|
||||
|
||||
// -> HE SU format
|
||||
txVector.SetPreambleType (WIFI_PREAMBLE_HE_SU);
|
||||
|
||||
@@ -308,6 +308,7 @@ TestMultiUserScheduler::ComputeWifiTxVector (void)
|
||||
m_txVector.SetHeMuUserInfo (sta.first,
|
||||
{{ruType, ruIndex++, primary80}, WifiMode ("HeMcs11"), 1});
|
||||
}
|
||||
m_txVector.SetSigBMode (VhtPhy::GetVhtMcs5 ());
|
||||
}
|
||||
|
||||
MultiUserScheduler::DlMuInfo
|
||||
|
||||
@@ -493,6 +493,8 @@ TestDlOfdmaPhyTransmission::SendMuPpdu (uint16_t rxStaId1, uint16_t rxStaId2)
|
||||
NS_ASSERT_MSG (false, "Unsupported channel width");
|
||||
}
|
||||
|
||||
txVector.SetSigBMode (VhtPhy::GetVhtMcs5 ());
|
||||
|
||||
HeRu::RuSpec ru1 (ruType, 1, true);
|
||||
txVector.SetRu (ru1, rxStaId1);
|
||||
txVector.SetMode (HePhy::GetHeMcs7 (), rxStaId1);
|
||||
@@ -1128,6 +1130,8 @@ TestDlOfdmaPhyPuncturing::SendMuPpdu (uint16_t rxStaId1, uint16_t rxStaId2, cons
|
||||
txVector.SetMode (HePhy::GetHeMcs9 (), rxStaId2);
|
||||
txVector.SetNss (1, rxStaId2);
|
||||
|
||||
txVector.SetSigBMode (VhtPhy::GetVhtMcs5 ());
|
||||
|
||||
Ptr<Packet> pkt1 = Create<Packet> (1000);
|
||||
WifiMacHeader hdr1;
|
||||
hdr1.SetType (WIFI_MAC_QOSDATA);
|
||||
@@ -1670,6 +1674,7 @@ TestUlOfdmaPpduUid::SendMuPpdu (void)
|
||||
txVector.SetRu (ru2, rxStaId2);
|
||||
txVector.SetMode (HePhy::GetHeMcs9 (), rxStaId2);
|
||||
txVector.SetNss (1, rxStaId2);
|
||||
txVector.SetSigBMode (VhtPhy::GetVhtMcs5 ());
|
||||
|
||||
Ptr<Packet> pkt1 = Create<Packet> (1000);
|
||||
WifiMacHeader hdr1;
|
||||
|
||||
@@ -724,6 +724,7 @@ WifiPrimaryChannelsTest::SendDlMuPpdu (uint8_t bss, uint16_t txChannelWidth, HeR
|
||||
hdr.SetAddr1 (staDev->GetMac ()->GetAddress ());
|
||||
psduMap[staId] = Create<const WifiPsdu> (Create<Packet> (1000), hdr);
|
||||
}
|
||||
txVector.SetSigBMode (VhtPhy::GetVhtMcs5 ());
|
||||
apDev->GetPhy ()->Send (psduMap, txVector);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user