View | Details | Raw Unified | Return to bug 2533
Collapse All | Expand All

(-)a/CHANGES.html (+5 lines)
 Lines 61-66    Link Here 
61
</ul>
61
</ul>
62
<h2>Changes to existing API:</h2>
62
<h2>Changes to existing API:</h2>
63
<ul>
63
<ul>
64
<li>The attributes <b>WifiPhy::TxAntennas</b> and <b>WifiPhy::RxAntennas</b>,
65
    and the related accessor methods, were replaced by <b>WifiPhy::MaxSupportedTxSpatialStreams</b>
66
    and <b>WifiPhy::MaxSupportedRxSpatialStreams</b>. A new attribute <b>WifiPhy::Antennas</b>
67
    was added to allow users to define the number of physical antennas on the device.
68
</li>
64
</ul>
69
</ul>
65
<h2>Changes to build system:</h2>
70
<h2>Changes to build system:</h2>
66
<ul>
71
<ul>
(-)a/examples/wireless/80211n-mimo.cc (-2 / +3 lines)
 Lines 132-139    Link Here 
132
          // Set guard interval
132
          // Set guard interval
133
          phy.Set ("ShortGuardEnabled", BooleanValue (shortGuardInterval));
133
          phy.Set ("ShortGuardEnabled", BooleanValue (shortGuardInterval));
134
          // Set MIMO capabilities
134
          // Set MIMO capabilities
135
          phy.Set ("TxAntennas", UintegerValue (nStreams));
135
          phy.Set ("Antennas", UintegerValue (nStreams));
136
          phy.Set ("RxAntennas", UintegerValue (nStreams));
136
          phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (nStreams));
137
          phy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (nStreams));
137
138
138
          WifiMacHelper mac;
139
          WifiMacHelper mac;
139
          WifiHelper wifi;
140
          WifiHelper wifi;
(-)a/examples/wireless/wifi-spectrum-saturation-example.cc (-16 / +24 lines)
 Lines 166-194    Link Here 
166
          else if (i > 31 && i <= 39)
166
          else if (i > 31 && i <= 39)
167
            {
167
            {
168
              phy.Set ("ShortGuardEnabled", BooleanValue (false));
168
              phy.Set ("ShortGuardEnabled", BooleanValue (false));
169
              phy.Set ("RxAntennas", UintegerValue (2));
169
              phy.Set ("Antennas", UintegerValue (2));
170
              phy.Set ("TxAntennas", UintegerValue (2));
170
              phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
171
              phy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
171
              channelWidth = 20;
172
              channelWidth = 20;
172
            }
173
            }
173
          else if (i > 39 && i <= 47)
174
          else if (i > 39 && i <= 47)
174
            {
175
            {
175
              phy.Set ("ShortGuardEnabled", BooleanValue (true));
176
              phy.Set ("ShortGuardEnabled", BooleanValue (true));
176
              phy.Set ("RxAntennas", UintegerValue (2));
177
              phy.Set ("Antennas", UintegerValue (2));
177
              phy.Set ("TxAntennas", UintegerValue (2));
178
              phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
179
              phy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
178
              channelWidth = 20;
180
              channelWidth = 20;
179
            }
181
            }
180
          else if (i > 47 && i <= 55)
182
          else if (i > 47 && i <= 55)
181
            {
183
            {
182
              phy.Set ("ShortGuardEnabled", BooleanValue (false));
184
              phy.Set ("ShortGuardEnabled", BooleanValue (false));
183
              phy.Set ("RxAntennas", UintegerValue (2));
185
              phy.Set ("Antennas", UintegerValue (2));
184
              phy.Set ("TxAntennas", UintegerValue (2));
186
              phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
187
              phy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
185
              channelWidth = 40;
188
              channelWidth = 40;
186
            }
189
            }
187
          else if (i > 55 && i <= 63)
190
          else if (i > 55 && i <= 63)
188
            {
191
            {
189
              phy.Set ("ShortGuardEnabled", BooleanValue (true));
192
              phy.Set ("ShortGuardEnabled", BooleanValue (true));
190
              phy.Set ("RxAntennas", UintegerValue (2));
193
              phy.Set ("Antennas", UintegerValue (2));
191
              phy.Set ("TxAntennas", UintegerValue (2));
194
              phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
195
              phy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
192
              channelWidth = 40;
196
              channelWidth = 40;
193
            }
197
            }
194
        }
198
        }
 Lines 236-264    Link Here 
236
          else if (i > 31 && i <= 39)
240
          else if (i > 31 && i <= 39)
237
            {
241
            {
238
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (false));
242
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (false));
239
              spectrumPhy.Set ("RxAntennas", UintegerValue (2));
243
              spectrumPhy.Set ("Antennas", UintegerValue (2));
240
              spectrumPhy.Set ("TxAntennas", UintegerValue (2));
244
              spectrumPhy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
245
              spectrumPhy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
241
              channelWidth = 20;
246
              channelWidth = 20;
242
            }
247
            }
243
          else if (i > 39 && i <= 47)
248
          else if (i > 39 && i <= 47)
244
            {
249
            {
245
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (true));
250
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (true));
246
              spectrumPhy.Set ("RxAntennas", UintegerValue (2));
251
              spectrumPhy.Set ("Antennas", UintegerValue (2));
247
              spectrumPhy.Set ("TxAntennas", UintegerValue (2));
252
              spectrumPhy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
253
              spectrumPhy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
248
              channelWidth = 20;
254
              channelWidth = 20;
249
            }
255
            }
250
          else if (i > 47 && i <= 55)
256
          else if (i > 47 && i <= 55)
251
            {
257
            {
252
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (false));
258
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (false));
253
              spectrumPhy.Set ("RxAntennas", UintegerValue (2));
259
              spectrumPhy.Set ("Antennas", UintegerValue (2));
254
              spectrumPhy.Set ("TxAntennas", UintegerValue (2));
260
              spectrumPhy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
261
              spectrumPhy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
255
              channelWidth = 40;
262
              channelWidth = 40;
256
            }
263
            }
257
          else if (i > 55 && i <= 63)
264
          else if (i > 55 && i <= 63)
258
            {
265
            {
259
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (true));
266
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (true));
260
              spectrumPhy.Set ("RxAntennas", UintegerValue (2));
267
              spectrumPhy.Set ("Antennas", UintegerValue (2));
261
              spectrumPhy.Set ("TxAntennas", UintegerValue (2));
268
              spectrumPhy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
269
              spectrumPhy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
262
              channelWidth = 40;
270
              channelWidth = 40;
263
            }
271
            }
264
        }
272
        }
(-)a/src/wifi/doc/source/wifi-design.rst (-3 / +1 lines)
 Lines 162-170    Link Here 
162
packets.  Moreover, interference from other technologies is not modeled.
162
packets.  Moreover, interference from other technologies is not modeled.
163
The following details pertain to the physical layer and channel models:
163
The following details pertain to the physical layer and channel models:
164
164
165
* 802.11n/ac MIMO currently uses the same 802.11n/ac SISO Yans and Nist error rate models
165
* 802.11ac MU-MIMO is not supported, and no more than 4 antennas can be configured
166
* 802.11ac MU-MIMO is not supported
167
* Antenna diversity is not supported
168
* 802.11n/ac beamforming is not supported
166
* 802.11n/ac beamforming is not supported
169
* PLCP preamble reception is not modeled
167
* PLCP preamble reception is not modeled
170
* PHY_RXSTART is not supported
168
* PHY_RXSTART is not supported
(-)a/src/wifi/doc/source/wifi-user.rst (-4 / +12 lines)
 Lines 154-164    Link Here 
154
154
155
 wifiPhyHelper.Set ("ShortGuardEnabled", BooleanValue(true));
155
 wifiPhyHelper.Set ("ShortGuardEnabled", BooleanValue(true));
156
156
157
In order to enable 802.11n/ac MIMO, the number of Rx antennas as well as the number of Tx antennas need to be configured.
157
In order to enable 802.11n/ac MIMO, the number of antennas as well as the number of supported spatial streams need to be configured.
158
For example, this code enables 2x2 MIMO::
158
For example, this code enables MIMO with 2 antennas and 2 spatial streams::
159
159
160
 wifiPhyHelper.Set ("TxAntennas", UintegerValue (2));
160
 wifiPhyHelper.Set ("Antennas", UintegerValue (2));
161
 wifiPhyHelper.Set ("RxAntennas", UintegerValue (2));
161
 wifiPhyHelper.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
162
 wifiPhyHelper.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
163
164
It is also possible to configure less streams than the number of antennas in order to benefit from diversity gain, and to define different MIMO capabilities for downlink and uplink.
165
For example, this code configures a node with 3 antennas that supports 2 spatial streams in downstream and 1 spatial stream in upstream::
166
167
 wifiPhyHelper.Set ("Antennas", UintegerValue (3));
168
 wifiPhyHelper.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
169
 wifiPhyHelper.Set ("MaxSupportedRxSpatialStreams", UintegerValue (1));
162
170
163
Furthermore, 802.11n provides an optional mode (GreenField mode) to reduce preamble durations and which is only compatible with 802.11n devices. This mode is enabled as follows::
171
Furthermore, 802.11n provides an optional mode (GreenField mode) to reduce preamble durations and which is only compatible with 802.11n devices. This mode is enabled as follows::
164
172
(-)a/src/wifi/examples/ideal-wifi-manager-example.cc (-5 / +7 lines)
 Lines 276-285    Link Here 
276
  Ptr<WifiNetDevice> wndServer = ndServer->GetObject<WifiNetDevice> ();
276
  Ptr<WifiNetDevice> wndServer = ndServer->GetObject<WifiNetDevice> ();
277
  Ptr<WifiPhy> wifiPhyPtrClient = wndClient->GetPhy ();
277
  Ptr<WifiPhy> wifiPhyPtrClient = wndClient->GetPhy ();
278
  Ptr<WifiPhy> wifiPhyPtrServer = wndServer->GetPhy ();
278
  Ptr<WifiPhy> wifiPhyPtrServer = wndServer->GetPhy ();
279
  wifiPhyPtrClient->SetNumberOfTransmitAntennas (nss);
279
  wifiPhyPtrClient->SetNumberOfAntennas (nss);
280
  wifiPhyPtrClient->SetNumberOfReceiveAntennas (nss);
280
  wifiPhyPtrClient->SetMaxSupportedTxSpatialStreams (nss);
281
  wifiPhyPtrServer->SetNumberOfTransmitAntennas (nss);
281
  wifiPhyPtrClient->SetMaxSupportedRxSpatialStreams (nss);
282
  wifiPhyPtrServer->SetNumberOfReceiveAntennas (nss);
282
  wifiPhyPtrServer->SetNumberOfAntennas (nss);
283
  wifiPhyPtrServer->SetMaxSupportedTxSpatialStreams (nss);
284
  wifiPhyPtrServer->SetMaxSupportedRxSpatialStreams (nss);
283
  // Only set the channel width and guard interval for HT and VHT modes
285
  // Only set the channel width and guard interval for HT and VHT modes
284
  if (selectedStandard.m_name == "802.11n-5GHz" || 
286
  if (selectedStandard.m_name == "802.11n-5GHz" || 
285
      selectedStandard.m_name == "802.11n-2.4GHz" ||
287
      selectedStandard.m_name == "802.11n-2.4GHz" ||
 Lines 291-297    Link Here 
291
      wifiPhyPtrServer->SetGuardInterval (shortGuardInterval);
293
      wifiPhyPtrServer->SetGuardInterval (shortGuardInterval);
292
    }
294
    }
293
  NS_LOG_DEBUG ("Channel width " << wifiPhyPtrClient->GetChannelWidth () << " noiseDbm " << noiseDbm);
295
  NS_LOG_DEBUG ("Channel width " << wifiPhyPtrClient->GetChannelWidth () << " noiseDbm " << noiseDbm);
294
  NS_LOG_DEBUG ("NSS " << wifiPhyPtrClient->GetSupportedTxSpatialStreams ());
296
  NS_LOG_DEBUG ("NSS " << wifiPhyPtrClient->GetMaxSupportedTxSpatialStreams ());
295
297
296
  // Configure signal and noise, and schedule first iteration
298
  // Configure signal and noise, and schedule first iteration
297
  noiseDbm += 10 * log10 (selectedStandard.m_width * 1000000);
299
  noiseDbm += 10 * log10 (selectedStandard.m_width * 1000000);
(-)a/src/wifi/examples/minstrel-ht-wifi-manager-example.cc (-4 / +6 lines)
 Lines 272-279    Link Here 
272
  Ptr<WifiNetDevice> wndClient = ndClient->GetObject<WifiNetDevice> ();
272
  Ptr<WifiNetDevice> wndClient = ndClient->GetObject<WifiNetDevice> ();
273
  Ptr<WifiPhy> wifiPhyPtrClient = wndClient->GetPhy ();
273
  Ptr<WifiPhy> wifiPhyPtrClient = wndClient->GetPhy ();
274
  wifiPhyPtrClient->SetChannelWidth (selectedStandard.m_width);
274
  wifiPhyPtrClient->SetChannelWidth (selectedStandard.m_width);
275
  wifiPhyPtrClient->SetNumberOfTransmitAntennas (nss);
275
  wifiPhyPtrClient->SetNumberOfAntennas (nss);
276
  wifiPhyPtrClient->SetNumberOfReceiveAntennas (nss);
276
  wifiPhyPtrClient->SetMaxSupportedTxSpatialStreams (nss);
277
  wifiPhyPtrClient->SetMaxSupportedRxSpatialStreams (nss);
277
  noiseDbm += 10 * log10 (selectedStandard.m_width * 1000000);
278
  noiseDbm += 10 * log10 (selectedStandard.m_width * 1000000);
278
  NS_LOG_DEBUG ("Channel width " << wifiPhyPtrClient->GetChannelWidth () << " noiseDbm " << noiseDbm);
279
  NS_LOG_DEBUG ("Channel width " << wifiPhyPtrClient->GetChannelWidth () << " noiseDbm " << noiseDbm);
279
280
 Lines 284-291    Link Here 
284
  Ptr<WifiNetDevice> wndServer = ndServer->GetObject<WifiNetDevice> ();
285
  Ptr<WifiNetDevice> wndServer = ndServer->GetObject<WifiNetDevice> ();
285
  Ptr<WifiPhy> wifiPhyPtrServer = wndServer->GetPhy ();
286
  Ptr<WifiPhy> wifiPhyPtrServer = wndServer->GetPhy ();
286
  wifiPhyPtrServer->SetChannelWidth (selectedStandard.m_width);
287
  wifiPhyPtrServer->SetChannelWidth (selectedStandard.m_width);
287
  wifiPhyPtrServer->SetNumberOfTransmitAntennas (nss);
288
  wifiPhyPtrServer->SetNumberOfAntennas (nss);
288
  wifiPhyPtrServer->SetNumberOfReceiveAntennas (nss);
289
  wifiPhyPtrServer->SetMaxSupportedTxSpatialStreams (nss);
290
  wifiPhyPtrServer->SetMaxSupportedRxSpatialStreams (nss);
289
291
290
  double rssCurrent = (selectedStandard.m_snrHigh + noiseDbm);
292
  double rssCurrent = (selectedStandard.m_snrHigh + noiseDbm);
291
  rssLossModel->SetRss (rssCurrent);
293
  rssLossModel->SetRss (rssCurrent);
(-)a/src/wifi/model/aarf-wifi-manager.cc (-3 / +3 lines)
 Lines 238-244    Link Here 
238
      //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac
238
      //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac
239
      channelWidth = 20;
239
      channelWidth = 20;
240
    }
240
    }
241
  return WifiTxVector (GetSupported (station, station->m_rate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
241
  return WifiTxVector (GetSupported (station, station->m_rate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
242
}
242
}
243
243
244
WifiTxVector
244
WifiTxVector
 Lines 257-267    Link Here 
257
  WifiTxVector rtsTxVector;
257
  WifiTxVector rtsTxVector;
258
  if (GetUseNonErpProtection () == false)
258
  if (GetUseNonErpProtection () == false)
259
    {
259
    {
260
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
260
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
261
    }
261
    }
262
  else
262
  else
263
    {
263
    {
264
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
264
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
265
    }
265
    }
266
  return rtsTxVector;
266
  return rtsTxVector;
267
}
267
}
(-)a/src/wifi/model/aarfcd-wifi-manager.cc (-3 / +3 lines)
 Lines 310-316    Link Here 
310
      //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac
310
      //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac
311
      channelWidth = 20;
311
      channelWidth = 20;
312
    }
312
    }
313
  return WifiTxVector (GetSupported (station, station->m_rate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
313
  return WifiTxVector (GetSupported (station, station->m_rate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
314
}
314
}
315
315
316
WifiTxVector
316
WifiTxVector
 Lines 329-339    Link Here 
329
  WifiTxVector rtsTxVector;
329
  WifiTxVector rtsTxVector;
330
  if (GetUseNonErpProtection () == false)
330
  if (GetUseNonErpProtection () == false)
331
    {
331
    {
332
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
332
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
333
    }
333
    }
334
  else
334
  else
335
    {
335
    {
336
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
336
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
337
    }
337
    }
338
  return rtsTxVector;
338
  return rtsTxVector;
339
}
339
}
(-)a/src/wifi/model/amrr-wifi-manager.cc (-3 / +3 lines)
 Lines 341-347    Link Here 
341
      //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac
341
      //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac
342
      channelWidth = 20;
342
      channelWidth = 20;
343
    }
343
    }
344
  return WifiTxVector (GetSupported (station, rateIndex), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
344
  return WifiTxVector (GetSupported (station, rateIndex), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
345
}
345
}
346
346
347
WifiTxVector
347
WifiTxVector
 Lines 359-369    Link Here 
359
  WifiTxVector rtsTxVector;
359
  WifiTxVector rtsTxVector;
360
  if (GetUseNonErpProtection () == false)
360
  if (GetUseNonErpProtection () == false)
361
    {
361
    {
362
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
362
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
363
    }
363
    }
364
  else
364
  else
365
    {
365
    {
366
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
366
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
367
    }
367
    }
368
  return rtsTxVector;
368
  return rtsTxVector;
369
}
369
}
(-)a/src/wifi/model/aparf-wifi-manager.cc (-3 / +3 lines)
 Lines 329-335    Link Here 
329
      channelWidth = 20;
329
      channelWidth = 20;
330
    }
330
    }
331
  CheckInit (station);
331
  CheckInit (station);
332
  return WifiTxVector (GetSupported (station, station->m_rate), station->m_power, GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
332
  return WifiTxVector (GetSupported (station, station->m_rate), station->m_power, GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
333
}
333
}
334
334
335
WifiTxVector
335
WifiTxVector
 Lines 348-358    Link Here 
348
  WifiTxVector rtsTxVector;
348
  WifiTxVector rtsTxVector;
349
  if (GetUseNonErpProtection () == false)
349
  if (GetUseNonErpProtection () == false)
350
    {
350
    {
351
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
351
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
352
    }
352
    }
353
  else
353
  else
354
    {
354
    {
355
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
355
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
356
    }
356
    }
357
  return rtsTxVector;
357
  return rtsTxVector;
358
}
358
}
(-)a/src/wifi/model/arf-wifi-manager.cc (-3 / +3 lines)
 Lines 214-220    Link Here 
214
      //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac
214
      //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac
215
      channelWidth = 20;
215
      channelWidth = 20;
216
    }
216
    }
217
  return WifiTxVector (GetSupported (station, station->m_rate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, channelWidth, GetAggregation (station), false);
217
  return WifiTxVector (GetSupported (station, station->m_rate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
218
}
218
}
219
219
220
WifiTxVector
220
WifiTxVector
 Lines 233-243    Link Here 
233
  WifiTxVector rtsTxVector;
233
  WifiTxVector rtsTxVector;
234
  if (GetUseNonErpProtection () == false)
234
  if (GetUseNonErpProtection () == false)
235
    {
235
    {
236
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
236
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
237
    }
237
    }
238
  else
238
  else
239
    {
239
    {
240
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
240
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
241
    }
241
    }
242
  return rtsTxVector;
242
  return rtsTxVector;
243
}
243
}
(-)a/src/wifi/model/cara-wifi-manager.cc (-3 / +3 lines)
 Lines 188-194    Link Here 
188
      //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac
188
      //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac
189
      channelWidth = 20;
189
      channelWidth = 20;
190
    }
190
    }
191
  return WifiTxVector (GetSupported (station, station->m_rate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
191
  return WifiTxVector (GetSupported (station, station->m_rate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
192
}
192
}
193
193
194
WifiTxVector
194
WifiTxVector
 Lines 207-217    Link Here 
207
  WifiTxVector rtsTxVector;
207
  WifiTxVector rtsTxVector;
208
  if (GetUseNonErpProtection () == false)
208
  if (GetUseNonErpProtection () == false)
209
    {
209
    {
210
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
210
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
211
    }
211
    }
212
  else
212
  else
213
    {
213
    {
214
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
214
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
215
    }
215
    }
216
  return rtsTxVector;
216
  return rtsTxVector;
217
}
217
}
(-)a/src/wifi/model/constant-rate-wifi-manager.cc (-2 / +2 lines)
 Lines 117-130    Link Here 
117
ConstantRateWifiManager::DoGetDataTxVector (WifiRemoteStation *st)
117
ConstantRateWifiManager::DoGetDataTxVector (WifiRemoteStation *st)
118
{
118
{
119
  NS_LOG_FUNCTION (this << st);
119
  NS_LOG_FUNCTION (this << st);
120
  return WifiTxVector (m_dataMode, GetDefaultTxPowerLevel (), GetLongRetryCount (st), GetShortGuardInterval (st), Min(GetNumberOfTransmitAntennas (), GetNumberOfSupportedRxAntennas (st)), 0, GetChannelWidth (st), GetAggregation (st), false);
120
  return WifiTxVector (m_dataMode, GetDefaultTxPowerLevel (), GetLongRetryCount (st), GetShortGuardInterval (st), GetNumberOfAntennas (), Min(GetMaxNumberOfTransmitStreams (), GetNumberOfSupportedStreams (st)), 0, GetChannelWidth (st), GetAggregation (st), false);
121
}
121
}
122
122
123
WifiTxVector
123
WifiTxVector
124
ConstantRateWifiManager::DoGetRtsTxVector (WifiRemoteStation *st)
124
ConstantRateWifiManager::DoGetRtsTxVector (WifiRemoteStation *st)
125
{
125
{
126
  NS_LOG_FUNCTION (this << st);
126
  NS_LOG_FUNCTION (this << st);
127
  return WifiTxVector (m_ctlMode, GetDefaultTxPowerLevel (), GetShortRetryCount (st), GetShortGuardInterval (st), 1, 0, GetChannelWidth (st), GetAggregation (st), false);
127
  return WifiTxVector (m_ctlMode, GetDefaultTxPowerLevel (), GetShortRetryCount (st), GetShortGuardInterval (st), 1, 1, 0, GetChannelWidth (st), GetAggregation (st), false);
128
}
128
}
129
129
130
bool
130
bool
(-)a/src/wifi/model/ideal-wifi-manager.cc (-4 / +4 lines)
 Lines 133-139    Link Here 
133
            }
133
            }
134
          else
134
          else
135
            {
135
            {
136
              nss = GetPhy ()->GetSupportedTxSpatialStreams ();
136
              nss = GetPhy ()->GetMaxSupportedTxSpatialStreams ();
137
            }
137
            }
138
          NS_LOG_DEBUG ("Initialize, adding mode = " << mode.GetUniqueName () <<
138
          NS_LOG_DEBUG ("Initialize, adding mode = " << mode.GetUniqueName () <<
139
                        " channel width " << GetPhy ()->GetChannelWidth () <<
139
                        " channel width " << GetPhy ()->GetChannelWidth () <<
 Lines 295-301    Link Here 
295
                }
295
                }
296
              else
296
              else
297
                {
297
                {
298
                  nss = GetPhy ()->GetSupportedTxSpatialStreams ();
298
                  nss = GetPhy ()->GetMaxSupportedTxSpatialStreams ();
299
                }
299
                }
300
              txVector.SetNss (nss);
300
              txVector.SetNss (nss);
301
              if (WifiPhy::IsValidTxVector (txVector) == false)
301
              if (WifiPhy::IsValidTxVector (txVector) == false)
 Lines 370-376    Link Here 
370
      NS_LOG_DEBUG ("New datarate: " << maxMode.GetDataRate (channelWidth, GetPhy ()->GetGuardInterval (), nss));
370
      NS_LOG_DEBUG ("New datarate: " << maxMode.GetDataRate (channelWidth, GetPhy ()->GetGuardInterval (), nss));
371
      m_currentRate = maxMode.GetDataRate (channelWidth, GetPhy ()->GetGuardInterval (), nss);
371
      m_currentRate = maxMode.GetDataRate (channelWidth, GetPhy ()->GetGuardInterval (), nss);
372
    }
372
    }
373
  return WifiTxVector (maxMode, GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, nss, 0, channelWidth, GetAggregation (station), false);
373
  return WifiTxVector (maxMode, GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, GetNumberOfAntennas (), nss, 0, channelWidth, GetAggregation (station), false);
374
}
374
}
375
375
376
WifiTxVector
376
WifiTxVector
 Lines 402-408    Link Here 
402
          maxMode = mode;
402
          maxMode = mode;
403
        }
403
        }
404
    }
404
    }
405
  return WifiTxVector (maxMode, GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, nss, 0, GetChannelWidthForMode (maxMode), GetAggregation (station), false);
405
  return WifiTxVector (maxMode, GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, GetNumberOfAntennas (), nss, 0, GetChannelWidthForMode (maxMode), GetAggregation (station), false);
406
}
406
}
407
407
408
bool
408
bool
(-)a/src/wifi/model/interference-helper.cc (+14 lines)
 Lines 135-140    Link Here 
135
135
136
InterferenceHelper::InterferenceHelper ()
136
InterferenceHelper::InterferenceHelper ()
137
  : m_errorRateModel (0),
137
  : m_errorRateModel (0),
138
    m_numRxAntennas (1),
138
    m_firstPower (0.0),
139
    m_firstPower (0.0),
139
    m_rxing (false)
140
    m_rxing (false)
140
{
141
{
 Lines 195-200    Link Here 
195
  return m_errorRateModel;
196
  return m_errorRateModel;
196
}
197
}
197
198
199
void
200
InterferenceHelper::SetNumberOfReceiveAntennas (uint8_t rx)
201
{
202
  m_numRxAntennas = rx;
203
}
204
198
Time
205
Time
199
InterferenceHelper::GetEnergyDuration (double energyW)
206
InterferenceHelper::GetEnergyDuration (double energyW)
200
{
207
{
 Lines 283-288    Link Here 
283
    }
290
    }
284
  uint32_t rate = mode.GetPhyRate (txVector);
291
  uint32_t rate = mode.GetPhyRate (txVector);
285
  uint64_t nbits = (uint64_t)(rate * duration.GetSeconds ());
292
  uint64_t nbits = (uint64_t)(rate * duration.GetSeconds ());
293
  if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT || txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT)
294
    {
295
      nbits /= txVector.GetNss (); //divide effective number of bits by NSS to achieve same chunk error rate as SISO for AWGN
296
      double gain = (txVector.GetNTx () * m_numRxAntennas); //compute gain offered by MIMO, SIMO or MISO compared to SISO for AWGN
297
      NS_LOG_DEBUG ("TX=" << (uint32_t)txVector.GetNTx () << ", RX=" << (uint32_t)m_numRxAntennas << ", SNIR improvement=+" << 10.0 * std::log10 (gain) << "dB");
298
      snir *= gain;
299
    }
286
  double csr = m_errorRateModel->GetChunkSuccessRate (mode, txVector, snir, (uint32_t)nbits);
300
  double csr = m_errorRateModel->GetChunkSuccessRate (mode, txVector, snir, (uint32_t)nbits);
287
  return csr;
301
  return csr;
288
}
302
}
(-)a/src/wifi/model/interference-helper.h (+8 lines)
 Lines 157-162    Link Here 
157
   * \return Error rate model
157
   * \return Error rate model
158
   */
158
   */
159
  Ptr<ErrorRateModel> GetErrorRateModel (void) const;
159
  Ptr<ErrorRateModel> GetErrorRateModel (void) const;
160
  /**
161
   * Set the number of RX antennas in the receiver corresponding to this
162
   * interference helper.
163
   *
164
   * \param the number of RX antennas
165
   */
166
  void SetNumberOfReceiveAntennas (uint8_t rx);
160
167
161
  /**
168
  /**
162
   * \param energyW the minimum energy (W) requested
169
   * \param energyW the minimum energy (W) requested
 Lines 330-335    Link Here 
330
337
331
  double m_noiseFigure; /**< noise figure (linear) */
338
  double m_noiseFigure; /**< noise figure (linear) */
332
  Ptr<ErrorRateModel> m_errorRateModel;
339
  Ptr<ErrorRateModel> m_errorRateModel;
340
  uint8_t m_numRxAntennas; /**< the number of RX antennas in the corresponding receiver */
333
  /// Experimental: needed for energy duration calculation
341
  /// Experimental: needed for energy duration calculation
334
  NiChanges m_niChanges;
342
  NiChanges m_niChanges;
335
  double m_firstPower;
343
  double m_firstPower;
(-)a/src/wifi/model/minstrel-ht-wifi-manager.cc (-10 / +10 lines)
 Lines 244-250    Link Here 
244
                  // Check capabilities of the device
244
                  // Check capabilities of the device
245
                  if (!(!GetPhy ()->GetGuardInterval () && m_minstrelGroups[groupId].sgi)                   ///Is SGI supported by the transmitter?
245
                  if (!(!GetPhy ()->GetGuardInterval () && m_minstrelGroups[groupId].sgi)                   ///Is SGI supported by the transmitter?
246
                      && (GetPhy ()->GetChannelWidth () >= m_minstrelGroups[groupId].chWidth)               ///Is channel width supported by the transmitter?
246
                      && (GetPhy ()->GetChannelWidth () >= m_minstrelGroups[groupId].chWidth)               ///Is channel width supported by the transmitter?
247
                      && (GetPhy ()->GetNumberOfTransmitAntennas () >= m_minstrelGroups[groupId].streams))  ///Are streams supported by the transmitter?
247
                      && (GetPhy ()->GetMaxSupportedTxSpatialStreams () >= m_minstrelGroups[groupId].streams))  ///Are streams supported by the transmitter?
248
                    {
248
                    {
249
                      m_minstrelGroups[groupId].isSupported = true;
249
                      m_minstrelGroups[groupId].isSupported = true;
250
250
 Lines 283-289    Link Here 
283
                      // Check capabilities of the device
283
                      // Check capabilities of the device
284
                      if (!(!GetPhy ()->GetGuardInterval () && m_minstrelGroups[groupId].sgi)                   ///Is SGI supported by the transmitter?
284
                      if (!(!GetPhy ()->GetGuardInterval () && m_minstrelGroups[groupId].sgi)                   ///Is SGI supported by the transmitter?
285
                          && (GetPhy ()->GetChannelWidth () >= m_minstrelGroups[groupId].chWidth)               ///Is channel width supported by the transmitter?
285
                          && (GetPhy ()->GetChannelWidth () >= m_minstrelGroups[groupId].chWidth)               ///Is channel width supported by the transmitter?
286
                          && (GetPhy ()->GetNumberOfTransmitAntennas () >= m_minstrelGroups[groupId].streams))  ///Are streams supported by the transmitter?
286
                          && (GetPhy ()->GetMaxSupportedTxSpatialStreams () >= m_minstrelGroups[groupId].streams))  ///Are streams supported by the transmitter?
287
                        {
287
                        {
288
                          m_minstrelGroups[groupId].isSupported = true;
288
                          m_minstrelGroups[groupId].isSupported = true;
289
289
 Lines 921-930    Link Here 
921
      McsGroup group = m_minstrelGroups[groupId];
921
      McsGroup group = m_minstrelGroups[groupId];
922
922
923
      // Check consistency of rate selected.
923
      // Check consistency of rate selected.
924
      if ((group.sgi && !GetShortGuardInterval (station)) || group.chWidth > GetChannelWidth (station)  ||  (uint32_t) group.streams > GetNumberOfSupportedRxAntennas (station))
924
      if ((group.sgi && !GetShortGuardInterval (station)) || group.chWidth > GetChannelWidth (station)  ||  (uint32_t) group.streams > GetNumberOfSupportedStreams (station))
925
        {
925
        {
926
          NS_ASSERT_MSG (false,"Inconsistent group selected. Group: (" << (uint32_t)group.streams << "," << (uint32_t)group.sgi << "," << group.chWidth << ")" <<
926
          NS_ASSERT_MSG (false,"Inconsistent group selected. Group: (" << (uint32_t)group.streams << "," << (uint32_t)group.sgi << "," << group.chWidth << ")" <<
927
                         " Station capabilities: (" << GetNumberOfSupportedRxAntennas (station) << "," << GetShortGuardInterval (station) << "," << GetChannelWidth (station) << ")");
927
                         " Station capabilities: (" << GetNumberOfSupportedStreams (station) << "," << GetShortGuardInterval (station) << "," << GetChannelWidth (station) << ")");
928
        }
928
        }
929
929
930
      uint64_t dataRate = GetMcsSupported (station, mcsIndex).GetDataRate (group.chWidth, group.sgi, group.streams);
930
      uint64_t dataRate = GetMcsSupported (station, mcsIndex).GetDataRate (group.chWidth, group.sgi, group.streams);
 Lines 934-940    Link Here 
934
        }
934
        }
935
935
936
      return WifiTxVector (GetMcsSupported (station, mcsIndex), GetDefaultTxPowerLevel (), GetLongRetryCount (station),
936
      return WifiTxVector (GetMcsSupported (station, mcsIndex), GetDefaultTxPowerLevel (), GetLongRetryCount (station),
937
                           group.sgi, group.streams, GetNess (station), group.chWidth, GetAggregation (station) && !station->m_isSampling, GetStbc (station));
937
                           group.sgi, GetNumberOfAntennas (), group.streams, GetNess (station), group.chWidth, GetAggregation (station) && !station->m_isSampling, GetStbc (station));
938
    }
938
    }
939
}
939
}
940
940
 Lines 1010-1016    Link Here 
1010
      NS_ASSERT (rateFound);
1010
      NS_ASSERT (rateFound);
1011
1011
1012
      return WifiTxVector (rtsRate, GetDefaultTxPowerLevel (), GetShortRetryCount (station),
1012
      return WifiTxVector (rtsRate, GetDefaultTxPowerLevel (), GetShortRetryCount (station),
1013
                           false, 1, 0, GetChannelWidth (station), GetAggregation (station), false);
1013
                           false, 1, 1, 0, GetChannelWidth (station), GetAggregation (station), false);
1014
    }
1014
    }
1015
}
1015
}
1016
1016
 Lines 1521-1531    Link Here 
1521
      if (m_minstrelGroups[groupId].isSupported)
1521
      if (m_minstrelGroups[groupId].isSupported)
1522
        {
1522
        {
1523
          station->m_groupsTable[groupId].m_supported = false;
1523
          station->m_groupsTable[groupId].m_supported = false;
1524
          if (!(!GetVhtSupported (station) && m_minstrelGroups[groupId].isVht)                  ///Is VHT supported by the receiver?
1524
          if (!(!GetVhtSupported (station) && m_minstrelGroups[groupId].isVht)                    ///Is VHT supported by the receiver?
1525
              && (m_minstrelGroups[groupId].isVht || !GetVhtSupported (station) || !m_useVhtOnly) ///If it is an HT MCS, check if VHT only is disabled
1525
              && (m_minstrelGroups[groupId].isVht || !GetVhtSupported (station) || !m_useVhtOnly) ///If it is an HT MCS, check if VHT only is disabled
1526
              && !(!GetShortGuardInterval (station) && m_minstrelGroups[groupId].sgi)           ///Is SGI supported by the receiver?
1526
              && !(!GetShortGuardInterval (station) && m_minstrelGroups[groupId].sgi)             ///Is SGI supported by the receiver?
1527
              && (GetChannelWidth (station) >= m_minstrelGroups[groupId].chWidth)               ///Is channel width supported by the receiver?
1527
              && (GetChannelWidth (station) >= m_minstrelGroups[groupId].chWidth)                 ///Is channel width supported by the receiver?
1528
              && (GetNumberOfSupportedRxAntennas (station) >= m_minstrelGroups[groupId].streams)) ///Are streams supported by the receiver?
1528
              && (GetNumberOfSupportedStreams (station) >= m_minstrelGroups[groupId].streams))    ///Are streams supported by the receiver?
1529
            {
1529
            {
1530
              NS_LOG_DEBUG ("Group " << groupId << ": (" << (uint32_t)m_minstrelGroups[groupId].streams <<
1530
              NS_LOG_DEBUG ("Group " << groupId << ": (" << (uint32_t)m_minstrelGroups[groupId].streams <<
1531
                            "," << (uint32_t)m_minstrelGroups[groupId].sgi << "," << m_minstrelGroups[groupId].chWidth << ")");
1531
                            "," << (uint32_t)m_minstrelGroups[groupId].sgi << "," << m_minstrelGroups[groupId].chWidth << ")");
(-)a/src/wifi/model/minstrel-wifi-manager.cc (-3 / +3 lines)
 Lines 361-367    Link Here 
361
      //start the rate at half way
361
      //start the rate at half way
362
      station->m_txrate = station->m_nModes / 2;
362
      station->m_txrate = station->m_nModes / 2;
363
    }
363
    }
364
  return WifiTxVector (GetSupported (station, station->m_txrate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
364
  return WifiTxVector (GetSupported (station, station->m_txrate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
365
}
365
}
366
366
367
WifiTxVector
367
WifiTxVector
 Lines 378-388    Link Here 
378
  WifiTxVector rtsTxVector;
378
  WifiTxVector rtsTxVector;
379
  if (GetUseNonErpProtection () == false)
379
  if (GetUseNonErpProtection () == false)
380
    {
380
    {
381
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
381
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
382
    }
382
    }
383
  else
383
  else
384
    {
384
    {
385
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
385
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
386
    }
386
    }
387
  return rtsTxVector;
387
  return rtsTxVector;
388
}
388
}
(-)a/src/wifi/model/onoe-wifi-manager.cc (-3 / +3 lines)
 Lines 283-289    Link Here 
283
      //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac
283
      //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac
284
      channelWidth = 20;
284
      channelWidth = 20;
285
    }
285
    }
286
  return WifiTxVector (GetSupported (station, rateIndex), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
286
  return WifiTxVector (GetSupported (station, rateIndex), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
287
}
287
}
288
288
289
WifiTxVector
289
WifiTxVector
 Lines 300-310    Link Here 
300
  WifiTxVector rtsTxVector;
300
  WifiTxVector rtsTxVector;
301
  if (GetUseNonErpProtection () == false)
301
  if (GetUseNonErpProtection () == false)
302
    {
302
    {
303
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
303
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
304
    }
304
    }
305
  else
305
  else
306
    {
306
    {
307
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
307
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
308
    }
308
    }
309
  return rtsTxVector;
309
  return rtsTxVector;
310
}
310
}
(-)a/src/wifi/model/parf-wifi-manager.cc (-3 / +3 lines)
 Lines 301-307    Link Here 
301
      channelWidth = 20;
301
      channelWidth = 20;
302
    }
302
    }
303
  CheckInit (station);
303
  CheckInit (station);
304
  return WifiTxVector (GetSupported (station, station->m_currentRate), station->m_currentPower, GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
304
  return WifiTxVector (GetSupported (station, station->m_currentRate), station->m_currentPower, GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
305
}
305
}
306
306
307
WifiTxVector
307
WifiTxVector
 Lines 320-330    Link Here 
320
  WifiTxVector rtsTxVector;
320
  WifiTxVector rtsTxVector;
321
  if (GetUseNonErpProtection () == false)
321
  if (GetUseNonErpProtection () == false)
322
    {
322
    {
323
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
323
      rtsTxVector = WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
324
    }
324
    }
325
  else
325
  else
326
    {
326
    {
327
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
327
      rtsTxVector = WifiTxVector (GetNonErpSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
328
    }
328
    }
329
  return rtsTxVector;
329
  return rtsTxVector;
330
}
330
}
(-)a/src/wifi/model/regular-wifi-mac.cc (-3 / +3 lines)
 Lines 175-181    Link Here 
175
        }
175
        }
176
      capabilities.SetRxHighestSupportedDataRate (maxSupportedRate / 1e6); //in Mbit/s
176
      capabilities.SetRxHighestSupportedDataRate (maxSupportedRate / 1e6); //in Mbit/s
177
      capabilities.SetTxMcsSetDefined (m_phy->GetNMcs () > 0);
177
      capabilities.SetTxMcsSetDefined (m_phy->GetNMcs () > 0);
178
      capabilities.SetTxMaxNSpatialStreams (m_phy->GetSupportedTxSpatialStreams ());
178
      capabilities.SetTxMaxNSpatialStreams (m_phy->GetMaxSupportedTxSpatialStreams ());
179
    }
179
    }
180
  return capabilities;
180
  return capabilities;
181
}
181
}
 Lines 211-221    Link Here 
211
            }
211
            }
212
        }
212
        }
213
      // Support same MaxMCS for each spatial stream
213
      // Support same MaxMCS for each spatial stream
214
      for (uint8_t nss = 1; nss <= m_phy->GetSupportedRxSpatialStreams (); nss++)
214
      for (uint8_t nss = 1; nss <= m_phy->GetMaxSupportedRxSpatialStreams (); nss++)
215
        {
215
        {
216
          capabilities.SetRxMcsMap (maxMcs, nss);
216
          capabilities.SetRxMcsMap (maxMcs, nss);
217
        }
217
        }
218
      for (uint8_t nss = 1; nss <= m_phy->GetSupportedTxSpatialStreams (); nss++)
218
      for (uint8_t nss = 1; nss <= m_phy->GetMaxSupportedTxSpatialStreams (); nss++)
219
        {
219
        {
220
          capabilities.SetTxMcsMap (maxMcs, nss);
220
          capabilities.SetTxMcsMap (maxMcs, nss);
221
        }
221
        }
(-)a/src/wifi/model/rraa-wifi-manager.cc (-3 / +3 lines)
 Lines 295-301    Link Here 
295
    {
295
    {
296
      ResetCountersBasic (station);
296
      ResetCountersBasic (station);
297
    }
297
    }
298
  return WifiTxVector (GetSupported (station, station->m_rate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false);
298
  return WifiTxVector (GetSupported (station, station->m_rate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
299
}
299
}
300
300
301
WifiTxVector
301
WifiTxVector
 Lines 311-321    Link Here 
311
  WifiTxVector rtsTxVector;
311
  WifiTxVector rtsTxVector;
312
  if (GetUseNonErpProtection () == false)
312
  if (GetUseNonErpProtection () == false)
313
    {
313
    {
314
      rtsTxVector = WifiTxVector (GetSupported (st, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (st), false, 1, 0, channelWidth, GetAggregation (station), false);
314
      rtsTxVector = WifiTxVector (GetSupported (st, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (st), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
315
    }
315
    }
316
  else
316
  else
317
    {
317
    {
318
      rtsTxVector = WifiTxVector (GetNonErpSupported (st, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (st), false, 1, 0, channelWidth, GetAggregation (station), false);
318
      rtsTxVector = WifiTxVector (GetNonErpSupported (st, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (st), false, 1, 1, 0, channelWidth, GetAggregation (station), false);
319
    }
319
    }
320
  return rtsTxVector;
320
  return rtsTxVector;
321
}
321
}
(-)a/src/wifi/model/spectrum-wifi-phy.cc (-6 / +7 lines)
 Lines 407-419    Link Here 
407
      NS_FATAL_ERROR ("MCS value does not match NSS value: MCS = " << (uint16_t)txVector.GetMode ().GetMcsValue () << ", NSS = " << (uint16_t)txVector.GetNss ());
407
      NS_FATAL_ERROR ("MCS value does not match NSS value: MCS = " << (uint16_t)txVector.GetMode ().GetMcsValue () << ", NSS = " << (uint16_t)txVector.GetNss ());
408
    }
408
    }
409
409
410
  if (txVector.GetNss () > GetNumberOfReceiveAntennas ())
410
  if (txVector.GetNss () > GetMaxSupportedRxSpatialStreams ())
411
    {
411
    {
412
      /* failure. */
412
      NS_FATAL_ERROR ("Reception ends in failure because of an unsupported number of spatial streams");
413
      NotifyRxDrop (packet);
414
      NS_LOG_INFO ("Reception ends in failure because less RX antennas than number of spatial streams");
415
      SwitchMaybeToCcaBusy ();
416
      return;
417
    }
413
    }
418
414
419
  enum WifiPreamble preamble = tag.GetWifiPreamble ();
415
  enum WifiPreamble preamble = tag.GetWifiPreamble ();
 Lines 676-681    Link Here 
676
   *  - we are idle
672
   *  - we are idle
677
   */
673
   */
678
  NS_ASSERT (!m_state->IsStateTx () && !m_state->IsStateSwitching ());
674
  NS_ASSERT (!m_state->IsStateTx () && !m_state->IsStateSwitching ());
675
  
676
  if (txVector.GetNss () > GetMaxSupportedTxSpatialStreams ())
677
    {
678
      NS_FATAL_ERROR ("Unsupported number of spatial streams!");
679
    }
679
680
680
  if (m_state->IsStateSleep ())
681
  if (m_state->IsStateSleep ())
681
    {
682
    {
(-)a/src/wifi/model/wifi-phy-tag.cc (-1 / +3 lines)
 Lines 39-45    Link Here 
39
uint32_t
39
uint32_t
40
WifiPhyTag::GetSerializedSize (void) const
40
WifiPhyTag::GetSerializedSize (void) const
41
{
41
{
42
  return (4 + (6 * 1) + 4 + 2);
42
  return (4 + (7 * 1) + 4 + 2);
43
}
43
}
44
44
45
void
45
void
 Lines 49-54    Link Here 
49
  i.WriteU8 (m_wifiTxVector.GetTxPowerLevel ());
49
  i.WriteU8 (m_wifiTxVector.GetTxPowerLevel ());
50
  i.WriteU8 (m_wifiTxVector.GetRetries ());
50
  i.WriteU8 (m_wifiTxVector.GetRetries ());
51
  i.WriteU8 (m_wifiTxVector.IsShortGuardInterval ());
51
  i.WriteU8 (m_wifiTxVector.IsShortGuardInterval ());
52
  i.WriteU8 (m_wifiTxVector.GetNTx ());
52
  i.WriteU8 (m_wifiTxVector.GetNss ());
53
  i.WriteU8 (m_wifiTxVector.GetNss ());
53
  i.WriteU8 (m_wifiTxVector.GetNess ());
54
  i.WriteU8 (m_wifiTxVector.GetNess ());
54
  i.WriteU8 (m_wifiTxVector.IsStbc ());
55
  i.WriteU8 (m_wifiTxVector.IsStbc ());
 Lines 63-68    Link Here 
63
  m_wifiTxVector.SetTxPowerLevel (i.ReadU8 ());
64
  m_wifiTxVector.SetTxPowerLevel (i.ReadU8 ());
64
  m_wifiTxVector.SetRetries (i.ReadU8 ());
65
  m_wifiTxVector.SetRetries (i.ReadU8 ());
65
  m_wifiTxVector.SetShortGuardInterval (i.ReadU8 ());
66
  m_wifiTxVector.SetShortGuardInterval (i.ReadU8 ());
67
  m_wifiTxVector.SetNTx (i.ReadU8 ());
66
  m_wifiTxVector.SetNss (i.ReadU8 ());
68
  m_wifiTxVector.SetNss (i.ReadU8 ());
67
  m_wifiTxVector.SetNess (i.ReadU8 ());
69
  m_wifiTxVector.SetNess (i.ReadU8 ());
68
  m_wifiTxVector.SetStbc (i.ReadU8 ());
70
  m_wifiTxVector.SetStbc (i.ReadU8 ());
(-)a/src/wifi/model/wifi-phy.cc (-29 / +59 lines)
 Lines 248-262    Link Here 
248
    .AddAttribute ("TxAntennas",
248
    .AddAttribute ("TxAntennas",
249
                   "The number of supported Tx antennas.",
249
                   "The number of supported Tx antennas.",
250
                   UintegerValue (1),
250
                   UintegerValue (1),
251
                   MakeUintegerAccessor (&WifiPhy::GetNumberOfTransmitAntennas,
251
                   MakeUintegerAccessor (&WifiPhy::m_numberOfTransmitters),
252
                                         &WifiPhy::SetNumberOfTransmitAntennas),
252
                   MakeUintegerChecker<uint32_t> (),
253
                   MakeUintegerChecker<uint32_t> ())
253
                   TypeId::DEPRECATED,
254
                   "Not used anymore.")
254
    .AddAttribute ("RxAntennas",
255
    .AddAttribute ("RxAntennas",
255
                   "The number of supported Rx antennas.",
256
                   "The number of supported Rx antennas.",
256
                   UintegerValue (1),
257
                   UintegerValue (1),
257
                   MakeUintegerAccessor (&WifiPhy::GetNumberOfReceiveAntennas,
258
                   MakeUintegerAccessor (&WifiPhy::m_numberOfReceivers),
258
                                         &WifiPhy::SetNumberOfReceiveAntennas),
259
                   MakeUintegerChecker<uint32_t> (),
260
                   TypeId::DEPRECATED,
261
                   "Not used anymore.")
262
    .AddAttribute ("Antennas",
263
                   "The number of antennas on the device.",
264
                   UintegerValue (1),
265
                   MakeUintegerAccessor (&WifiPhy::GetNumberOfAntennas,
266
                                         &WifiPhy::SetNumberOfAntennas),
259
                   MakeUintegerChecker<uint32_t> ())
267
                   MakeUintegerChecker<uint32_t> ())
268
    .AddAttribute ("MaxSupportedTxSpatialStreams",
269
                   "The maximum number of supported TX spatial streams."
270
                   "This parameter is only valuable for 802.11n/ac STAs and APs.",
271
                   UintegerValue (1),
272
                   MakeUintegerAccessor (&WifiPhy::GetMaxSupportedTxSpatialStreams,
273
                                         &WifiPhy::SetMaxSupportedTxSpatialStreams),
274
                   MakeUintegerChecker<uint8_t> ())
275
    .AddAttribute ("MaxSupportedRxSpatialStreams",
276
                   "The maximum number of supported RX spatial streams."
277
                   "This parameter is only valuable for 802.11n/ac STAs and APs.",
278
                   UintegerValue (1),
279
                   MakeUintegerAccessor (&WifiPhy::GetMaxSupportedRxSpatialStreams,
280
                                         &WifiPhy::SetMaxSupportedRxSpatialStreams),
281
                   MakeUintegerChecker<uint8_t> ())
260
    .AddAttribute ("ShortGuardEnabled",
282
    .AddAttribute ("ShortGuardEnabled",
261
                   "Whether or not short guard interval is enabled."
283
                   "Whether or not short guard interval is enabled."
262
                   "This parameter is only valuable for 802.11n/ac STAs and APs.",
284
                   "This parameter is only valuable for 802.11n/ac STAs and APs.",
 Lines 358-363    Link Here 
358
    m_totalAmpduNumSymbols (0)
380
    m_totalAmpduNumSymbols (0)
359
{
381
{
360
  NS_LOG_FUNCTION (this);
382
  NS_LOG_FUNCTION (this);
383
  NS_UNUSED (m_numberOfTransmitters);
384
  NS_UNUSED (m_numberOfReceivers);
361
  m_random = CreateObject<UniformRandomVariable> ();
385
  m_random = CreateObject<UniformRandomVariable> ();
362
  m_state = CreateObject<WifiPhyStateHelper> ();
386
  m_state = CreateObject<WifiPhyStateHelper> ();
363
}
387
}
 Lines 456-461    Link Here 
456
{
480
{
457
  NS_LOG_FUNCTION (this << noiseFigureDb);
481
  NS_LOG_FUNCTION (this << noiseFigureDb);
458
  m_interference.SetNoiseFigure (DbToRatio (noiseFigureDb));
482
  m_interference.SetNoiseFigure (DbToRatio (noiseFigureDb));
483
  m_interference.SetNumberOfReceiveAntennas (GetNumberOfAntennas ());
459
}
484
}
460
485
461
double
486
double
 Lines 629-634    Link Here 
629
WifiPhy::SetErrorRateModel (Ptr<ErrorRateModel> rate)
654
WifiPhy::SetErrorRateModel (Ptr<ErrorRateModel> rate)
630
{
655
{
631
  m_interference.SetErrorRateModel (rate);
656
  m_interference.SetErrorRateModel (rate);
657
  m_interference.SetNumberOfReceiveAntennas (GetNumberOfAntennas ());
632
}
658
}
633
659
634
Ptr<ErrorRateModel>
660
Ptr<ErrorRateModel>
 Lines 853-859    Link Here 
853
      m_deviceMcsSet.push_back (WifiPhy::GetHtMcs5 ());
879
      m_deviceMcsSet.push_back (WifiPhy::GetHtMcs5 ());
854
      m_deviceMcsSet.push_back (WifiPhy::GetHtMcs6 ());
880
      m_deviceMcsSet.push_back (WifiPhy::GetHtMcs6 ());
855
      m_deviceMcsSet.push_back (WifiPhy::GetHtMcs7 ());
881
      m_deviceMcsSet.push_back (WifiPhy::GetHtMcs7 ());
856
      if (GetSupportedTxSpatialStreams () > 1)
882
      if (GetMaxSupportedTxSpatialStreams () > 1)
857
        {
883
        {
858
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs8 ());
884
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs8 ());
859
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs9 ());
885
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs9 ());
 Lines 864-870    Link Here 
864
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs14 ());
890
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs14 ());
865
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs15 ());
891
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs15 ());
866
        }
892
        }
867
      if (GetSupportedTxSpatialStreams () > 2)
893
      if (GetMaxSupportedTxSpatialStreams () > 2)
868
        {
894
        {
869
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs16 ());
895
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs16 ());
870
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs17 ());
896
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs17 ());
 Lines 875-881    Link Here 
875
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs22 ());
901
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs22 ());
876
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs23 ());
902
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs23 ());
877
        }
903
        }
878
      if (GetSupportedTxSpatialStreams () > 3)
904
      if (GetMaxSupportedTxSpatialStreams () > 3)
879
        {
905
        {
880
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs24 ());
906
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs24 ());
881
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs25 ());
907
          m_deviceMcsSet.push_back (WifiPhy::GetHtMcs25 ());
 Lines 1160-1199    Link Here 
1160
}
1186
}
1161
1187
1162
void
1188
void
1163
WifiPhy::SetNumberOfTransmitAntennas (uint32_t tx)
1189
WifiPhy::SetNumberOfAntennas (uint8_t antennas)
1164
{
1190
{
1165
  m_numberOfTransmitters = tx;
1191
  NS_ASSERT_MSG (antennas > 0 && antennas <= 4, "unsupported number of antennas");
1166
  ConfigureHtDeviceMcsSet ();
1192
  m_numberOfAntennas = antennas;
1193
  m_interference.SetNumberOfReceiveAntennas (antennas);
1194
}
1195
1196
uint8_t
1197
WifiPhy::GetNumberOfAntennas (void) const
1198
{
1199
  return m_numberOfAntennas;
1167
}
1200
}
1168
1201
1169
void
1202
void
1170
WifiPhy::SetNumberOfReceiveAntennas (uint32_t rx)
1203
WifiPhy::SetMaxSupportedTxSpatialStreams (uint8_t streams)
1171
{
1204
{
1172
  m_numberOfReceivers = rx;
1205
  NS_ASSERT (streams <= GetNumberOfAntennas ());
1173
}
1206
  m_txSpatialStreams = streams;
1174
1207
  ConfigureHtDeviceMcsSet ();
1175
uint32_t
1176
WifiPhy::GetNumberOfTransmitAntennas (void) const
1177
{
1178
  return m_numberOfTransmitters;
1179
}
1180
1181
uint32_t
1182
WifiPhy::GetNumberOfReceiveAntennas (void) const
1183
{
1184
  return m_numberOfReceivers;
1185
}
1208
}
1186
1209
1187
uint8_t 
1210
uint8_t 
1188
WifiPhy::GetSupportedRxSpatialStreams (void) const
1211
WifiPhy::GetMaxSupportedTxSpatialStreams (void) const
1189
{
1212
{
1190
  return (static_cast<uint8_t> (GetNumberOfReceiveAntennas ()));
1213
  return m_txSpatialStreams;
1214
}
1215
1216
void
1217
WifiPhy::SetMaxSupportedRxSpatialStreams (uint8_t streams)
1218
{
1219
  NS_ASSERT (streams <= GetNumberOfAntennas ());
1220
  m_rxSpatialStreams = streams;
1191
}
1221
}
1192
1222
1193
uint8_t 
1223
uint8_t 
1194
WifiPhy::GetSupportedTxSpatialStreams (void) const
1224
WifiPhy::GetMaxSupportedRxSpatialStreams (void) const
1195
{
1225
{
1196
  return (static_cast<uint8_t> (GetNumberOfTransmitAntennas ()));
1226
  return m_rxSpatialStreams;
1197
}
1227
}
1198
1228
1199
uint32_t
1229
uint32_t
(-)a/src/wifi/model/wifi-phy.h (-23 / +27 lines)
 Lines 1398-1418    Link Here 
1398
   */
1398
   */
1399
  virtual uint32_t GetFrequency (void) const;
1399
  virtual uint32_t GetFrequency (void) const;
1400
  /**
1400
  /**
1401
   * \param tx the number of transmitters on this node.
1401
   * \param antennas the number of antennas on this node.
1402
   */
1403
  virtual void SetNumberOfTransmitAntennas (uint32_t tx);
1404
  /**
1405
   * \return the number of transmit antenna on this device
1406
   */
1402
   */
1407
  virtual uint32_t GetNumberOfTransmitAntennas (void) const;
1403
  virtual void SetNumberOfAntennas (uint8_t antennas);
1408
  /**
1404
  /**
1409
  * \param rx the number of receivers on this node.
1405
   * \return the number of antennas on this device
1410
  */
1406
   */
1411
  virtual void SetNumberOfReceiveAntennas (uint32_t rx);
1407
  virtual uint8_t GetNumberOfAntennas (void) const;
1412
  /**
1408
  /**
1413
   * \return the number of receivers on this node.
1409
   * \param streams the maximum number of supported TX spatial streams.
1414
   */
1410
   */
1415
  virtual uint32_t GetNumberOfReceiveAntennas (void) const;
1411
  virtual void SetMaxSupportedTxSpatialStreams (uint8_t streams);
1412
  /**
1413
   * \return the maximum number of supported TX spatial streams
1414
   */
1415
  virtual uint8_t GetMaxSupportedTxSpatialStreams (void) const;
1416
  /**
1417
   * \param streams the maximum number of supported RX spatial streams.
1418
   */
1419
  virtual void SetMaxSupportedRxSpatialStreams (uint8_t streams);
1420
  /**
1421
   * \return the maximum number of supported RX spatial streams
1422
   */
1423
  virtual uint8_t GetMaxSupportedRxSpatialStreams (void) const;
1416
1424
1417
  /**
1425
  /**
1418
   * Enable or disable short/long guard interval.
1426
   * Enable or disable short/long guard interval.
 Lines 1504-1517    Link Here 
1504
   */
1512
   */
1505
  virtual std::vector<uint32_t> GetSupportedChannelWidthSet (void) const;
1513
  virtual std::vector<uint32_t> GetSupportedChannelWidthSet (void) const;
1506
  /**
1514
  /**
1507
   * \return the maximum number of supported Rx spatial streams
1508
   */
1509
  virtual uint8_t GetSupportedRxSpatialStreams (void) const;
1510
  /**
1511
   * \return the maximum number of supported Tx spatial streams
1512
   */
1513
  virtual uint8_t GetSupportedTxSpatialStreams (void) const;
1514
  /**
1515
   * Convert from dBm to Watts.
1515
   * Convert from dBm to Watts.
1516
   *
1516
   *
1517
   * \param dbm the power in dBm
1517
   * \param dbm the power in dBm
 Lines 1825-1839    Link Here 
1825
  bool     m_guardInterval;         //!< Flag if short guard interval is used
1825
  bool     m_guardInterval;         //!< Flag if short guard interval is used
1826
  bool     m_shortPreamble;         //!< Flag if short PLCP preamble is supported
1826
  bool     m_shortPreamble;         //!< Flag if short PLCP preamble is supported
1827
1827
1828
  uint32_t m_numberOfTransmitters;     //!< Number of transmitters
1828
  uint32_t m_numberOfTransmitters; //!< Number of transmitters (DEPRECATED)
1829
  uint32_t m_numberOfReceivers;        //!< Number of receivers
1829
  uint32_t m_numberOfReceivers;    //!< Number of receivers (DEPRECATED)
1830
1831
  uint32_t m_numberOfAntennas;  //!< Number of transmitters
1832
  uint32_t m_txSpatialStreams;  //!< Number of supported TX spatial streams
1833
  uint32_t m_rxSpatialStreams;  //!< Number of supported RX spatial streams
1830
1834
1831
  typedef std::map<ChannelNumberStandardPair,FrequencyWidthPair> ChannelToFrequencyWidthMap;
1835
  typedef std::map<ChannelNumberStandardPair,FrequencyWidthPair> ChannelToFrequencyWidthMap;
1832
  static ChannelToFrequencyWidthMap m_channelToFrequencyWidth;
1836
  static ChannelToFrequencyWidthMap m_channelToFrequencyWidth;
1833
1837
1834
  std::vector<uint32_t> m_supportedChannelWidthSet; //!< Supported channel width
1838
  std::vector<uint32_t> m_supportedChannelWidthSet; //!< Supported channel width
1835
  uint16_t             m_channelNumber;  //!< Operating channel number
1839
  uint16_t              m_channelNumber;            //!< Operating channel number
1836
  uint16_t             m_initialChannelNumber;  //!< Initial channel number
1840
  uint16_t              m_initialChannelNumber;     //!< Initial channel number
1837
1841
1838
  Time m_channelSwitchDelay;     //!< Time required to switch between channel
1842
  Time m_channelSwitchDelay;     //!< Time required to switch between channel
1839
  uint32_t m_totalAmpduSize;     //!< Total size of the previously transmitted MPDUs in an A-MPDU, used for the computation of the number of symbols needed for the last MPDU in the A-MPDU
1843
  uint32_t m_totalAmpduSize;     //!< Total size of the previously transmitted MPDUs in an A-MPDU, used for the computation of the number of symbols needed for the last MPDU in the A-MPDU
(-)a/src/wifi/model/wifi-remote-station-manager.cc (-10 / +17 lines)
 Lines 766-775    Link Here 
766
  return WifiTxVector (GetDefaultMode (),
766
  return WifiTxVector (GetDefaultMode (),
767
                       GetDefaultTxPowerLevel (),
767
                       GetDefaultTxPowerLevel (),
768
                       0,
768
                       0,
769
                       m_wifiPhy->GetChannelWidth (),
770
                       m_wifiPhy->GetGuardInterval (),
769
                       m_wifiPhy->GetGuardInterval (),
771
                       GetNumberOfTransmitAntennas (),
770
                       GetNumberOfAntennas (),
772
                       GetNumberOfTransmitAntennas (),
771
                       GetMaxNumberOfTransmitStreams (),
772
                       0,
773
                       m_wifiPhy->GetChannelWidth (),
773
                       false,
774
                       false,
774
                       false);
775
                       false);
775
}
776
}
 Lines 1467-1473    Link Here 
1467
  state->m_channelWidth = m_wifiPhy->GetChannelWidth ();
1468
  state->m_channelWidth = m_wifiPhy->GetChannelWidth ();
1468
  state->m_shortGuardInterval = m_wifiPhy->GetGuardInterval ();
1469
  state->m_shortGuardInterval = m_wifiPhy->GetGuardInterval ();
1469
  state->m_greenfield = m_wifiPhy->GetGreenfield ();
1470
  state->m_greenfield = m_wifiPhy->GetGreenfield ();
1470
  state->m_rx = 1;
1471
  state->m_streams = 1;
1471
  state->m_ness = 0;
1472
  state->m_ness = 0;
1472
  state->m_aggregation = false;
1473
  state->m_aggregation = false;
1473
  state->m_stbc = false;
1474
  state->m_stbc = false;
 Lines 1534-1540    Link Here 
1534
    }
1535
    }
1535
  state->m_htSupported = true;
1536
  state->m_htSupported = true;
1536
  state->m_greenfield = htCapabilities.GetGreenfield ();
1537
  state->m_greenfield = htCapabilities.GetGreenfield ();
1537
  state->m_rx = htCapabilities.GetRxHighestSupportedAntennas ();
1538
  state->m_streams = htCapabilities.GetRxHighestSupportedAntennas ();
1538
}
1539
}
1539
1540
1540
void
1541
void
 Lines 1813-1821    Link Here 
1813
}
1814
}
1814
1815
1815
uint8_t
1816
uint8_t
1816
WifiRemoteStationManager::GetNumberOfSupportedRxAntennas (const WifiRemoteStation *station) const
1817
WifiRemoteStationManager::GetNumberOfSupportedStreams (const WifiRemoteStation *station) const
1817
{
1818
{
1818
  return station->m_state->m_rx;
1819
  return station->m_state->m_streams;
1819
}
1820
}
1820
1821
1821
uint32_t
1822
uint32_t
 Lines 1893-1902    Link Here 
1893
  m_defaultTxPowerLevel = txPower;
1894
  m_defaultTxPowerLevel = txPower;
1894
}
1895
}
1895
1896
1896
uint32_t
1897
uint8_t
1897
WifiRemoteStationManager::GetNumberOfTransmitAntennas (void)
1898
WifiRemoteStationManager::GetNumberOfAntennas (void)
1898
{
1899
{
1899
  return m_wifiPhy->GetNumberOfTransmitAntennas ();
1900
  return m_wifiPhy->GetNumberOfAntennas ();
1901
}
1902
1903
uint8_t
1904
WifiRemoteStationManager::GetMaxNumberOfTransmitStreams (void)
1905
{
1906
  return m_wifiPhy->GetMaxSupportedTxSpatialStreams ();
1900
}
1907
}
1901
1908
1902
WifiRemoteStationInfo::WifiRemoteStationInfo ()
1909
WifiRemoteStationInfo::WifiRemoteStationInfo ()
(-)a/src/wifi/model/wifi-remote-station-manager.h (-6 / +10 lines)
 Lines 730-738    Link Here 
730
   */
730
   */
731
  void SetDefaultTxPowerLevel (uint8_t txPower);
731
  void SetDefaultTxPowerLevel (uint8_t txPower);
732
  /**
732
  /**
733
   * \return the number of transmit antennas supported by the phy layer
733
   * \return the number of antennas supported by the phy layer
734
   */
734
   */
735
  uint32_t GetNumberOfTransmitAntennas (void);
735
  uint8_t GetNumberOfAntennas (void);
736
  /**
737
   * \return the maximum number of spatial streams supported by the phy layer
738
   */
739
  uint8_t GetMaxNumberOfTransmitStreams (void);
736
740
737
  /**
741
  /**
738
   * TracedCallback signature for power change events.
742
   * TracedCallback signature for power change events.
 Lines 870-882    Link Here 
870
  bool GetGreenfield (const WifiRemoteStation *station) const;
874
  bool GetGreenfield (const WifiRemoteStation *station) const;
871
875
872
  /**
876
  /**
873
   * Return the number of receive antennas the station has.
877
   * Return the number of supported streams the station has.
874
   *
878
   *
875
   * \param station the station being queried
879
   * \param station the station being queried
876
   *
880
   *
877
   * \return the number of receive antennas the station has
881
   * \return the number of supported streams the station has
878
   */
882
   */
879
  uint8_t GetNumberOfSupportedRxAntennas (const WifiRemoteStation *station) const;
883
  uint8_t GetNumberOfSupportedStreams (const WifiRemoteStation *station) const;
880
  /**
884
  /**
881
   * \returns the number of Ness the station has.
885
   * \returns the number of Ness the station has.
882
   *
886
   *
 Lines 1287-1293    Link Here 
1287
1291
1288
  uint32_t m_channelWidth;    //!< Channel width (in MHz) supported by the remote station
1292
  uint32_t m_channelWidth;    //!< Channel width (in MHz) supported by the remote station
1289
  bool m_shortGuardInterval;  //!< Flag if short guard interval is supported by the remote station
1293
  bool m_shortGuardInterval;  //!< Flag if short guard interval is supported by the remote station
1290
  uint8_t m_rx;               //!< Number of supported RX streams by the remote station
1294
  uint8_t m_streams;          //!< Number of supported streams by the remote station
1291
  uint32_t m_ness;            //!< Number of streams in beamforming of the remote station
1295
  uint32_t m_ness;            //!< Number of streams in beamforming of the remote station
1292
  bool m_stbc;                //!< Flag if STBC is supported by the remote station
1296
  bool m_stbc;                //!< Flag if STBC is supported by the remote station
1293
  bool m_aggregation;         //!< Flag if MPDU aggregation is used by the remote station
1297
  bool m_aggregation;         //!< Flag if MPDU aggregation is used by the remote station
(-)a/src/wifi/model/wifi-tx-vector.cc (-3 / +20 lines)
 Lines 28-33    Link Here 
28
  : m_retries (0),
28
  : m_retries (0),
29
    m_channelWidth (20),
29
    m_channelWidth (20),
30
    m_shortGuardInterval (false),
30
    m_shortGuardInterval (false),
31
    m_nTx (1),
31
    m_nss (1),
32
    m_nss (1),
32
    m_ness (0),
33
    m_ness (0),
33
    m_aggregation (false),
34
    m_aggregation (false),
 Lines 37-50    Link Here 
37
{
38
{
38
}
39
}
39
40
40
WifiTxVector::WifiTxVector (WifiMode mode, uint8_t powerLevel, uint8_t retries,
41
WifiTxVector::WifiTxVector (WifiMode mode, uint8_t powerLevel,
41
                            bool shortGuardInterval, uint8_t nss, uint8_t ness,
42
                            uint8_t retries, bool shortGuardInterval,
42
                            uint32_t channelWidth, bool aggregation, bool stbc)
43
                            uint8_t nTx, uint8_t nss,
44
                            uint8_t ness, uint32_t channelWidth,
45
                            bool aggregation, bool stbc)
43
  : m_mode (mode),
46
  : m_mode (mode),
44
    m_txPowerLevel (powerLevel),
47
    m_txPowerLevel (powerLevel),
45
    m_retries (retries),
48
    m_retries (retries),
46
    m_channelWidth (channelWidth),
49
    m_channelWidth (channelWidth),
47
    m_shortGuardInterval (shortGuardInterval),
50
    m_shortGuardInterval (shortGuardInterval),
51
    m_nTx (nTx),
48
    m_nss (nss),
52
    m_nss (nss),
49
    m_ness (ness),
53
    m_ness (ness),
50
    m_aggregation (aggregation),
54
    m_aggregation (aggregation),
 Lines 93-98    Link Here 
93
}
97
}
94
98
95
uint8_t
99
uint8_t
100
WifiTxVector::GetNTx (void) const
101
{
102
  return m_nTx;
103
}
104
105
uint8_t
96
WifiTxVector::GetNss (void) const
106
WifiTxVector::GetNss (void) const
97
{
107
{
98
  return m_nss;
108
  return m_nss;
 Lines 149-154    Link Here 
149
}
159
}
150
160
151
void
161
void
162
WifiTxVector::SetNTx (uint8_t nTx)
163
{
164
  m_nTx = nTx;
165
}
166
167
void
152
WifiTxVector::SetNss (uint8_t nss)
168
WifiTxVector::SetNss (uint8_t nss)
153
{
169
{
154
  m_nss = nss;
170
  m_nss = nss;
 Lines 179-184    Link Here 
179
    " retries: " << (uint32_t)v.GetRetries () <<
195
    " retries: " << (uint32_t)v.GetRetries () <<
180
    " channel width: " << v.GetChannelWidth () <<
196
    " channel width: " << v.GetChannelWidth () <<
181
    " Short GI: " << v.IsShortGuardInterval () <<
197
    " Short GI: " << v.IsShortGuardInterval () <<
198
    " NTx: " << (uint32_t)v.GetNTx () <<
182
    " Nss: " << (uint32_t)v.GetNss () <<
199
    " Nss: " << (uint32_t)v.GetNss () <<
183
    " Ness: " << (uint32_t)v.GetNess () <<
200
    " Ness: " << (uint32_t)v.GetNess () <<
184
    " MPDU aggregation: " << v.IsAggregation () <<
201
    " MPDU aggregation: " << v.IsAggregation () <<
(-)a/src/wifi/model/wifi-tx-vector.h (-2 / +15 lines)
 Lines 69-74    Link Here 
69
   * \param powerLevel transmission power level
69
   * \param powerLevel transmission power level
70
   * \param retries retries
70
   * \param retries retries
71
   * \param shortGuardInterval enable or disable short guard interval
71
   * \param shortGuardInterval enable or disable short guard interval
72
   * \param nTx the number of TX antennas
72
   * \param nss the number of spatial STBC streams (NSS)
73
   * \param nss the number of spatial STBC streams (NSS)
73
   * \param ness the number of extension spatial streams (NESS)
74
   * \param ness the number of extension spatial streams (NESS)
74
   * \param channelWidth the channel width in MHz
75
   * \param channelWidth the channel width in MHz
 Lines 79-84    Link Here 
79
                uint8_t powerLevel,
80
                uint8_t powerLevel,
80
                uint8_t retries,
81
                uint8_t retries,
81
                bool shortGuardInterval,
82
                bool shortGuardInterval,
83
                uint8_t nTx,
82
                uint8_t nss,
84
                uint8_t nss,
83
                uint8_t ness,
85
                uint8_t ness,
84
                uint32_t channelWidth,
86
                uint32_t channelWidth,
 Lines 135-140    Link Here 
135
  */
137
  */
136
  void SetShortGuardInterval (bool guardinterval);
138
  void SetShortGuardInterval (bool guardinterval);
137
  /**
139
  /**
140
   * \returns the number of TX antennas
141
   */
142
  uint8_t GetNTx (void) const;
143
  /**
144
   * Sets the number of TX antennas
145
   *
146
   * \param nTx
147
   */
148
  void SetNTx (uint8_t nTx);
149
  /**
138
   * \returns the number of Nss
150
   * \returns the number of Nss
139
   */
151
   */
140
  uint8_t GetNss (void) const;
152
  uint8_t GetNss (void) const;
 Lines 192-199    Link Here 
192
                                 for Click radiotap information */
204
                                 for Click radiotap information */
193
  uint32_t m_channelWidth;       /**< channel width in MHz */
205
  uint32_t m_channelWidth;       /**< channel width in MHz */
194
  bool     m_shortGuardInterval; /**< true if short GI is going to be used */
206
  bool     m_shortGuardInterval; /**< true if short GI is going to be used */
195
  uint8_t  m_nss;                /**< number of streams */
207
  uint8_t  m_nTx;                /**< number of TX antennas */
196
  uint8_t  m_ness;               /**< number of streams in beamforming */
208
  uint8_t  m_nss;                /**< number of spatial streams */
209
  uint8_t  m_ness;               /**< number of spatial streams in beamforming */
197
  bool     m_aggregation;        /** Flag whether the PSDU contains A-MPDU. */
210
  bool     m_aggregation;        /** Flag whether the PSDU contains A-MPDU. */
198
  bool     m_stbc;               /**< STBC used or not */
211
  bool     m_stbc;               /**< STBC used or not */
199
212
(-)a/src/wifi/model/yans-wifi-phy.cc (-8 / +4 lines)
 Lines 278-290    Link Here 
278
      NS_FATAL_ERROR ("MCS value does not match NSS value: MCS = " << (uint16_t)txVector.GetMode ().GetMcsValue () << ", NSS = " << (uint16_t)txVector.GetNss ());
278
      NS_FATAL_ERROR ("MCS value does not match NSS value: MCS = " << (uint16_t)txVector.GetMode ().GetMcsValue () << ", NSS = " << (uint16_t)txVector.GetNss ());
279
    }
279
    }
280
  
280
  
281
  if (txVector.GetNss () > GetNumberOfReceiveAntennas ())
281
  if (txVector.GetNss () > GetMaxSupportedRxSpatialStreams ())
282
    {
282
    {
283
      /* failure. */
283
      NS_FATAL_ERROR ("Reception ends in failure because of an unsupported number of spatial streams");
284
      NotifyRxDrop (packet);
285
      NS_LOG_INFO ("Reception ends in failure because less RX antennas than number of spatial streams");
286
      SwitchMaybeToCcaBusy ();
287
      return;
288
    }
284
    }
289
285
290
  enum WifiPreamble preamble = tag.GetWifiPreamble ();
286
  enum WifiPreamble preamble = tag.GetWifiPreamble ();
 Lines 491-499    Link Here 
491
   */
487
   */
492
  NS_ASSERT (!m_state->IsStateTx () && !m_state->IsStateSwitching ());
488
  NS_ASSERT (!m_state->IsStateTx () && !m_state->IsStateSwitching ());
493
  
489
  
494
  if (txVector.GetNss () > GetNumberOfTransmitAntennas ())
490
  if (txVector.GetNss () > GetMaxSupportedTxSpatialStreams ())
495
    {
491
    {
496
      NS_FATAL_ERROR ("Less TX antennas than number of spatial streams!");
492
      NS_FATAL_ERROR ("Unsupported number of spatial streams!");
497
    }
493
    }
498
494
499
  if (m_state->IsStateSleep ())
495
  if (m_state->IsStateSleep ())
(-)a/src/wifi/test/spectrum-wifi-phy-test.cc (-1 / +1 lines)
 Lines 73-79    Link Here 
73
  WifiPreamble preamble;
73
  WifiPreamble preamble;
74
  preamble = WIFI_PREAMBLE_LONG;
74
  preamble = WIFI_PREAMBLE_LONG;
75
  WifiMode mode = WifiPhy::GetOfdmRate6Mbps ();
75
  WifiMode mode = WifiPhy::GetOfdmRate6Mbps ();
76
  WifiTxVector txVector = WifiTxVector (mode, 0, 0, false, 1, 0, 20000000, false, false);
76
  WifiTxVector txVector = WifiTxVector (mode, 0, 0, false, 1, 1, 0, 20000000, false, false);
77
  enum mpduType mpdutype = NORMAL_MPDU;
77
  enum mpduType mpdutype = NORMAL_MPDU;
78
78
79
  Ptr<Packet> pkt = Create<Packet> (1000);
79
  Ptr<Packet> pkt = Create<Packet> (1000);

Return to bug 2533