diff --git a/examples/wireless/80211n-mimo.cc b/examples/wireless/80211n-mimo.cc index 0c6e0b76f..697d9a6b2 100644 --- a/examples/wireless/80211n-mimo.cc +++ b/examples/wireless/80211n-mimo.cc @@ -159,8 +159,18 @@ int main (int argc, char *argv[]) return 0; } - wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager","DataMode", StringValue (modes[i]), - "ControlMode", StringValue (modes[i])); + StringValue ctrlRate; + if (frequency == 2.4) + { + ctrlRate = StringValue ("ErpOfdmRate24Mbps"); + } + else + { + ctrlRate = StringValue ("OfdmRate24Mbps"); + } + wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", + "DataMode", StringValue (modes[i]), + "ControlMode", ctrlRate); Ssid ssid = Ssid ("ns3-80211n"); diff --git a/src/wifi/model/mac-low.cc b/src/wifi/model/mac-low.cc index 125248cd8..a74a3079e 100644 --- a/src/wifi/model/mac-low.cc +++ b/src/wifi/model/mac-low.cc @@ -517,7 +517,14 @@ MacLow::StartTransmission (Ptr packet, CancelAllEvents (); m_currentTxop = txop; m_txParams = params; - m_currentTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr); + if (m_currentHdr.IsCtl ()) + { + m_currentTxVector = GetRtsTxVector (m_currentPacket, &m_currentHdr); + } + else + { + m_currentTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr); + } if (NeedRts () && !IsCfPeriod ()) { diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index 5f687ff3e..10d101546 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -653,7 +653,21 @@ WifiRemoteStationManager::GetRtsTxVector (Mac48Address address, const WifiMacHea Ptr packet) { NS_LOG_FUNCTION (this << address << *header << packet); - NS_ASSERT (!address.IsGroup ()); + if (address.IsGroup ()) + { + WifiMode mode = GetNonUnicastMode (); + WifiTxVector v; + v.SetMode (mode); + v.SetPreambleType (GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (address))); + v.SetTxPowerLevel (m_defaultTxPowerLevel); + v.SetChannelWidth (GetChannelWidthForTransmission (mode, m_wifiPhy->GetChannelWidth ())); + v.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mode, DynamicCast (m_wifiPhy->GetDevice ()))); + v.SetNTx (1); + v.SetNss (1); + v.SetNess (0); + v.SetStbc (0); + return v; + } if (!IsLowLatency ()) { HighLatencyRtsTxVectorTag rtstag;