wifi: Fix rate used to send Block Ack Request frames

This commit is contained in:
Sébastien Deronne
2018-12-15 18:26:36 +01:00
parent 834f6c6627
commit efc9d737e2
3 changed files with 35 additions and 4 deletions

View File

@@ -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");

View File

@@ -517,7 +517,14 @@ MacLow::StartTransmission (Ptr<const Packet> 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 ())
{

View File

@@ -653,7 +653,21 @@ WifiRemoteStationManager::GetRtsTxVector (Mac48Address address, const WifiMacHea
Ptr<const Packet> 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<WifiNetDevice> (m_wifiPhy->GetDevice ())));
v.SetNTx (1);
v.SetNss (1);
v.SetNess (0);
v.SetStbc (0);
return v;
}
if (!IsLowLatency ())
{
HighLatencyRtsTxVectorTag rtstag;