wifi: (fixes #2532) Remove potential inconsistencies between 802.11n MCS and NSS value reported in TXVECTOR

This commit is contained in:
Sébastien Deronne
2016-11-01 11:26:50 +01:00
parent 33bc706e2b
commit e1fd378394
4 changed files with 32 additions and 2 deletions

View File

@@ -31,6 +31,7 @@ Bugs fixed
- Bug 2511 - HT Greenfield is not working
- Bug 2521 - Include ipv6-option.h in wscript
- Bug 2529 - Missing trace when Block ACK timeout is triggered or when missing MPDUs are announced by a Block ACK response
- Bug 2532 - Inconsistencies between 802.11n MCS and NSS value reported in TXVECTOR
Known issues
------------

View File

@@ -398,8 +398,15 @@ SpectrumWifiPhy::StartRx (Ptr<SpectrumSignalParameters> rxParams)
NS_FATAL_ERROR ("Received Wi-Fi Spectrum Signal with no WifiPhyTag");
return;
}
WifiTxVector txVector = tag.GetWifiTxVector ();
if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT
&& (txVector.GetNss () != (1 + (txVector.GetMode ().GetMcsValue () / 8))))
{
NS_FATAL_ERROR ("MCS value does not match NSS value: MCS = " << (uint16_t)txVector.GetMode ().GetMcsValue () << ", NSS = " << (uint16_t)txVector.GetNss ());
}
if (txVector.GetNss () > GetNumberOfReceiveAntennas ())
{
/* failure. */

View File

@@ -547,7 +547,7 @@ StaWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
SetSlot (MicroSeconds (20));
}
}
if (m_qosSupported)
if (m_qosSupported)
{
EdcaParameterSet edcaParameters = beacon.GetEdcaParameterSet ();
//The value of the TXOP Limit field is specified as an unsigned integer, with the least significant octet transmitted first, in units of 32 μs.
@@ -556,6 +556,16 @@ StaWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin(), edcaParameters.GetViCWmax(), edcaParameters.GetViAifsn(), 32 * MicroSeconds (edcaParameters.GetViTXOPLimit()));
SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin(), edcaParameters.GetVoCWmax(), edcaParameters.GetVoAifsn(), 32 * MicroSeconds (edcaParameters.GetVoTXOPLimit()));
}
if (m_htSupported)
{
HtCapabilities htcapabilities = beacon.GetHtCapabilities ();
m_stationManager->AddStationHtCapabilities (hdr->GetAddr2 (), htcapabilities);
}
if (m_vhtSupported)
{
VhtCapabilities vhtcapabilities = beacon.GetVhtCapabilities ();
m_stationManager->AddStationVhtCapabilities (hdr->GetAddr2 (), vhtcapabilities);
}
m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
m_stationManager->SetShortSlotTimeEnabled (capabilities.IsShortSlotTime ());
}

View File

@@ -271,6 +271,13 @@ YansWifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerDb
WifiPhyTag tag;
packet->RemovePacketTag (tag);
WifiTxVector txVector = tag.GetWifiTxVector ();
if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT
&& (txVector.GetNss () != (1 + (txVector.GetMode ().GetMcsValue () / 8))))
{
NS_FATAL_ERROR ("MCS value does not match NSS value: MCS = " << (uint16_t)txVector.GetMode ().GetMcsValue () << ", NSS = " << (uint16_t)txVector.GetNss ());
}
if (txVector.GetNss () > GetNumberOfReceiveAntennas ())
{
/* failure. */
@@ -483,6 +490,11 @@ YansWifiPhy::SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, WifiPr
* - we are idle
*/
NS_ASSERT (!m_state->IsStateTx () && !m_state->IsStateSwitching ());
if (txVector.GetNss () > GetNumberOfTransmitAntennas ())
{
NS_FATAL_ERROR ("Less TX antennas than number of spatial streams!");
}
if (m_state->IsStateSleep ())
{