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

(-)a/src/wifi/model/aarf-wifi-manager.cc (-2 / +2 lines)
 Lines 267-273    Link Here 
267
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
267
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
268
      m_currentRate = mode.GetDataRate (channelWidth);
268
      m_currentRate = mode.GetDataRate (channelWidth);
269
    }
269
    }
270
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
270
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
271
}
271
}
272
272
273
WifiTxVector
273
WifiTxVector
 Lines 293-299    Link Here 
293
    {
293
    {
294
      mode = GetNonErpSupported (station, 0);
294
      mode = GetNonErpSupported (station, 0);
295
    }
295
    }
296
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
296
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
297
  return rtsTxVector;
297
  return rtsTxVector;
298
}
298
}
299
299
(-)a/src/wifi/model/aarfcd-wifi-manager.cc (-2 / +2 lines)
 Lines 335-341    Link Here 
335
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
335
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
336
      m_currentRate = mode.GetDataRate (channelWidth);
336
      m_currentRate = mode.GetDataRate (channelWidth);
337
    }
337
    }
338
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
338
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
339
}
339
}
340
340
341
WifiTxVector
341
WifiTxVector
 Lines 361-367    Link Here 
361
    {
361
    {
362
      mode = GetNonErpSupported (station, 0);
362
      mode = GetNonErpSupported (station, 0);
363
    }
363
    }
364
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
364
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
365
  return rtsTxVector;
365
  return rtsTxVector;
366
}
366
}
367
367
(-)a/src/wifi/model/amrr-wifi-manager.cc (-2 / +2 lines)
 Lines 375-381    Link Here 
375
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
375
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
376
      m_currentRate = mode.GetDataRate (channelWidth);
376
      m_currentRate = mode.GetDataRate (channelWidth);
377
    }
377
    }
378
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
378
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
379
}
379
}
380
380
381
WifiTxVector
381
WifiTxVector
 Lines 400-406    Link Here 
400
    {
400
    {
401
      mode = GetNonErpSupported (station, 0);
401
      mode = GetNonErpSupported (station, 0);
402
    }
402
    }
403
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
403
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
404
  return rtsTxVector;
404
  return rtsTxVector;
405
}
405
}
406
406
(-)a/src/wifi/model/aparf-wifi-manager.cc (-2 / +2 lines)
 Lines 362-368    Link Here 
362
      m_rateChange (prevRate, rate, station->m_state->m_address);
362
      m_rateChange (prevRate, rate, station->m_state->m_address);
363
      station->m_prevRateIndex = station->m_rateIndex;
363
      station->m_prevRateIndex = station->m_rateIndex;
364
    }
364
    }
365
  return WifiTxVector (mode, station->m_powerLevel, GetPreambleForTransmission (mode, GetAddress (st)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
365
  return WifiTxVector (mode, station->m_powerLevel, GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (st))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
366
}
366
}
367
367
368
WifiTxVector
368
WifiTxVector
 Lines 388-394    Link Here 
388
    {
388
    {
389
      mode = GetNonErpSupported (station, 0);
389
      mode = GetNonErpSupported (station, 0);
390
    }
390
    }
391
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (st)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
391
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (st))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
392
  return rtsTxVector;
392
  return rtsTxVector;
393
}
393
}
394
394
(-)a/src/wifi/model/arf-wifi-manager.cc (-2 / +2 lines)
 Lines 244-250    Link Here 
244
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
244
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
245
      m_currentRate = mode.GetDataRate (channelWidth);
245
      m_currentRate = mode.GetDataRate (channelWidth);
246
    }
246
    }
247
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
247
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
248
}
248
}
249
249
250
WifiTxVector
250
WifiTxVector
 Lines 270-276    Link Here 
270
    {
270
    {
271
      mode = GetNonErpSupported (station, 0);
271
      mode = GetNonErpSupported (station, 0);
272
    }
272
    }
273
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
273
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
274
  return rtsTxVector;
274
  return rtsTxVector;
275
}
275
}
276
276
(-)a/src/wifi/model/cara-wifi-manager.cc (-2 / +2 lines)
 Lines 213-219    Link Here 
213
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
213
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
214
      m_currentRate = mode.GetDataRate (channelWidth);
214
      m_currentRate = mode.GetDataRate (channelWidth);
215
    }
215
    }
216
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
216
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
217
}
217
}
218
218
219
WifiTxVector
219
WifiTxVector
 Lines 239-245    Link Here 
239
    {
239
    {
240
      mode = GetNonErpSupported (station, 0);
240
      mode = GetNonErpSupported (station, 0);
241
    }
241
    }
242
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
242
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
243
  return rtsTxVector;
243
  return rtsTxVector;
244
}
244
}
245
245
(-)a/src/wifi/model/constant-rate-wifi-manager.cc (-2 / +2 lines)
 Lines 118-131    Link Here 
118
ConstantRateWifiManager::DoGetDataTxVector (WifiRemoteStation *st)
118
ConstantRateWifiManager::DoGetDataTxVector (WifiRemoteStation *st)
119
{
119
{
120
  NS_LOG_FUNCTION (this << st);
120
  NS_LOG_FUNCTION (this << st);
121
  return WifiTxVector (m_dataMode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (m_dataMode, GetAddress (st)), ConvertGuardIntervalToNanoSeconds (m_dataMode, GetShortGuardIntervalSupported (st), NanoSeconds (GetGuardInterval (st))), GetNumberOfAntennas (), Min (GetMaxNumberOfTransmitStreams (), GetNumberOfSupportedStreams (st)), 0, GetChannelWidthForTransmission (m_dataMode, GetChannelWidth (st)), GetAggregation (st), false);
121
  return WifiTxVector (m_dataMode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (m_dataMode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (st))), ConvertGuardIntervalToNanoSeconds (m_dataMode, GetShortGuardIntervalSupported (st), NanoSeconds (GetGuardInterval (st))), GetNumberOfAntennas (), Min (GetMaxNumberOfTransmitStreams (), GetNumberOfSupportedStreams (st)), 0, GetChannelWidthForTransmission (m_dataMode, GetChannelWidth (st)), GetAggregation (st), false);
122
}
122
}
123
123
124
WifiTxVector
124
WifiTxVector
125
ConstantRateWifiManager::DoGetRtsTxVector (WifiRemoteStation *st)
125
ConstantRateWifiManager::DoGetRtsTxVector (WifiRemoteStation *st)
126
{
126
{
127
  NS_LOG_FUNCTION (this << st);
127
  NS_LOG_FUNCTION (this << st);
128
  return WifiTxVector (m_ctlMode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (m_ctlMode, GetAddress (st)), ConvertGuardIntervalToNanoSeconds (m_ctlMode, GetShortGuardIntervalSupported (st), NanoSeconds (GetGuardInterval (st))), 1, 1, 0, GetChannelWidthForTransmission (m_ctlMode, GetChannelWidth (st)), GetAggregation (st), false);
128
  return WifiTxVector (m_ctlMode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (m_ctlMode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (st))), ConvertGuardIntervalToNanoSeconds (m_ctlMode, GetShortGuardIntervalSupported (st), NanoSeconds (GetGuardInterval (st))), 1, 1, 0, GetChannelWidthForTransmission (m_ctlMode, GetChannelWidth (st)), GetAggregation (st), false);
129
}
129
}
130
130
131
bool
131
bool
(-)a/src/wifi/model/ideal-wifi-manager.cc (-2 / +2 lines)
 Lines 503-509    Link Here 
503
      NS_LOG_DEBUG ("New datarate: " << maxMode.GetDataRate (channelWidth, guardInterval, selectedNss));
503
      NS_LOG_DEBUG ("New datarate: " << maxMode.GetDataRate (channelWidth, guardInterval, selectedNss));
504
      m_currentRate = maxMode.GetDataRate (channelWidth, guardInterval, selectedNss);
504
      m_currentRate = maxMode.GetDataRate (channelWidth, guardInterval, selectedNss);
505
    }
505
    }
506
  return WifiTxVector (maxMode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (maxMode, GetAddress (station)), guardInterval, GetNumberOfAntennas (), selectedNss, 0, GetChannelWidthForTransmission (maxMode, channelWidth), GetAggregation (station), false);
506
  return WifiTxVector (maxMode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (maxMode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), guardInterval, GetNumberOfAntennas (), selectedNss, 0, GetChannelWidthForTransmission (maxMode, channelWidth), GetAggregation (station), false);
507
}
507
}
508
508
509
WifiTxVector
509
WifiTxVector
 Lines 534-540    Link Here 
534
          maxMode = mode;
534
          maxMode = mode;
535
        }
535
        }
536
    }
536
    }
537
  return WifiTxVector (maxMode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (maxMode, GetAddress (station)), 800, GetNumberOfAntennas (), nss, 0, GetChannelWidthForMode (maxMode), GetAggregation (station), false);
537
  return WifiTxVector (maxMode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (maxMode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, GetNumberOfAntennas (), nss, 0, GetChannelWidthForMode (maxMode), GetAggregation (station), false);
538
}
538
}
539
539
540
bool
540
bool
(-)a/src/wifi/model/minstrel-ht-wifi-manager.cc (-2 / +2 lines)
 Lines 874-880    Link Here 
874
          NS_LOG_DEBUG ("New datarate: " << dataRate);
874
          NS_LOG_DEBUG ("New datarate: " << dataRate);
875
          m_currentRate = dataRate;
875
          m_currentRate = dataRate;
876
        }
876
        }
877
      return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), group.sgi ? 400 : 800, GetNumberOfAntennas (), group.streams, GetNess (station), GetChannelWidthForTransmission (mode, group.chWidth), GetAggregation (station) && !station->m_isSampling, false);
877
      return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), group.sgi ? 400 : 800, GetNumberOfAntennas (), group.streams, GetNess (station), GetChannelWidthForTransmission (mode, group.chWidth), GetAggregation (station) && !station->m_isSampling, false);
878
    }
878
    }
879
}
879
}
880
880
 Lines 949-955    Link Here 
949
949
950
      NS_ASSERT (rateFound);
950
      NS_ASSERT (rateFound);
951
951
952
      return WifiTxVector (rtsRate, GetDefaultTxPowerLevel (), GetPreambleForTransmission (rtsRate, GetAddress (station)),
952
      return WifiTxVector (rtsRate, GetDefaultTxPowerLevel (), GetPreambleForTransmission (rtsRate.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))),
953
                           800, 1, 1, 0, GetChannelWidthForTransmission (rtsRate, GetChannelWidth (station)), GetAggregation (station), false);
953
                           800, 1, 1, 0, GetChannelWidthForTransmission (rtsRate, GetChannelWidth (station)), GetAggregation (station), false);
954
    }
954
    }
955
}
955
}
(-)a/src/wifi/model/minstrel-wifi-manager.cc (-2 / +2 lines)
 Lines 385-391    Link Here 
385
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
385
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
386
      m_currentRate = mode.GetDataRate (channelWidth);
386
      m_currentRate = mode.GetDataRate (channelWidth);
387
    }
387
    }
388
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
388
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
389
}
389
}
390
390
391
WifiTxVector
391
WifiTxVector
 Lines 409-415    Link Here 
409
    {
409
    {
410
      mode = GetNonErpSupported (station, 0);
410
      mode = GetNonErpSupported (station, 0);
411
    }
411
    }
412
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
412
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
413
  return rtsTxVector;
413
  return rtsTxVector;
414
}
414
}
415
415
(-)a/src/wifi/model/onoe-wifi-manager.cc (-2 / +2 lines)
 Lines 327-333    Link Here 
327
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
327
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
328
      m_currentRate = mode.GetDataRate (channelWidth);
328
      m_currentRate = mode.GetDataRate (channelWidth);
329
    }
329
    }
330
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (st)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
330
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (st))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
331
}
331
}
332
332
333
WifiTxVector
333
WifiTxVector
 Lines 352-358    Link Here 
352
    {
352
    {
353
      mode = GetNonErpSupported (station, 0);
353
      mode = GetNonErpSupported (station, 0);
354
    }
354
    }
355
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (st)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
355
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (st))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
356
  return rtsTxVector;
356
  return rtsTxVector;
357
}
357
}
358
358
(-)a/src/wifi/model/parf-wifi-manager.cc (-2 / +2 lines)
 Lines 334-340    Link Here 
334
      m_rateChange (prevRate, rate, station->m_state->m_address);
334
      m_rateChange (prevRate, rate, station->m_state->m_address);
335
      station->m_prevRateIndex = station->m_rateIndex;
335
      station->m_prevRateIndex = station->m_rateIndex;
336
    }
336
    }
337
  return WifiTxVector (mode, station->m_powerLevel, GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
337
  return WifiTxVector (mode, station->m_powerLevel, GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
338
}
338
}
339
339
340
WifiTxVector
340
WifiTxVector
 Lines 360-366    Link Here 
360
    {
360
    {
361
      mode = GetNonErpSupported (station, 0);
361
      mode = GetNonErpSupported (station, 0);
362
    }
362
    }
363
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
363
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
364
  return rtsTxVector;
364
  return rtsTxVector;
365
}
365
}
366
366
(-)a/src/wifi/model/rraa-wifi-manager.cc (-2 / +2 lines)
 Lines 364-370    Link Here 
364
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
364
      NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth));
365
      m_currentRate = mode.GetDataRate (channelWidth);
365
      m_currentRate = mode.GetDataRate (channelWidth);
366
    }
366
    }
367
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
367
  return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
368
}
368
}
369
369
370
WifiTxVector
370
WifiTxVector
 Lines 388-394    Link Here 
388
    {
388
    {
389
      mode = GetNonErpSupported (station, 0);
389
      mode = GetNonErpSupported (station, 0);
390
    }
390
    }
391
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
391
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
392
  return rtsTxVector;
392
  return rtsTxVector;
393
}
393
}
394
394
(-)a/src/wifi/model/rrpaa-wifi-manager.cc (-2 / +2 lines)
 Lines 415-421    Link Here 
415
      m_powerChange (prevPower, power, station->m_state->m_address);
415
      m_powerChange (prevPower, power, station->m_state->m_address);
416
      station->m_prevPowerLevel = station->m_powerLevel;
416
      station->m_prevPowerLevel = station->m_powerLevel;
417
    }
417
    }
418
  return WifiTxVector (mode, station->m_powerLevel, GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
418
  return WifiTxVector (mode, station->m_powerLevel, GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
419
}
419
}
420
WifiTxVector
420
WifiTxVector
421
RrpaaWifiManager::DoGetRtsTxVector (WifiRemoteStation *st)
421
RrpaaWifiManager::DoGetRtsTxVector (WifiRemoteStation *st)
 Lines 438-444    Link Here 
438
    {
438
    {
439
      mode = GetNonErpSupported (station, 0);
439
      mode = GetNonErpSupported (station, 0);
440
    }
440
    }
441
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode, GetAddress (st)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
441
  rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), 800, 1, 1, 0, channelWidth, GetAggregation (station), false);
442
  return rtsTxVector;
442
  return rtsTxVector;
443
}
443
}
444
444
(-)b514e7e38d23 (+197 lines)
Added Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2005,2006,2007 INRIA
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License version 2 as
7
 * published by the Free Software Foundation;
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 *
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 */
20
21
#include "tx-vector-tag.h"
22
23
/***************************************************************
24
 *           Packet Mode Tagger
25
 ***************************************************************/
26
27
namespace ns3 {
28
29
HighLatencyDataTxVectorTag::HighLatencyDataTxVectorTag ()
30
{
31
}
32
33
HighLatencyDataTxVectorTag::HighLatencyDataTxVectorTag (WifiTxVector dataTxVector)
34
  : m_dataTxVector (dataTxVector)
35
{
36
}
37
38
WifiTxVector
39
HighLatencyDataTxVectorTag::GetDataTxVector (void) const
40
{
41
  return m_dataTxVector;
42
}
43
44
TypeId
45
HighLatencyDataTxVectorTag::GetTypeId (void)
46
{
47
  static TypeId tid = TypeId ("ns3::HighLatencyDataTxVectorTag")
48
    .SetParent<Tag> ()
49
    .SetGroupName ("Wifi")
50
    .AddConstructor<HighLatencyDataTxVectorTag> ()
51
  ;
52
  return tid;
53
}
54
55
TypeId
56
HighLatencyDataTxVectorTag::GetInstanceTypeId (void) const
57
{
58
  return GetTypeId ();
59
}
60
61
uint32_t
62
HighLatencyDataTxVectorTag::GetSerializedSize (void) const
63
{
64
  return sizeof (WifiTxVector);
65
}
66
67
void
68
HighLatencyDataTxVectorTag::Serialize (TagBuffer i) const
69
{
70
  i.Write ((uint8_t *)&m_dataTxVector, sizeof (WifiTxVector));
71
}
72
73
void
74
HighLatencyDataTxVectorTag::Deserialize (TagBuffer i)
75
{
76
  i.Read ((uint8_t *)&m_dataTxVector, sizeof (WifiTxVector));
77
}
78
79
void
80
HighLatencyDataTxVectorTag::Print (std::ostream &os) const
81
{
82
  os << "Data=" << m_dataTxVector;
83
}
84
85
HighLatencyRtsTxVectorTag::HighLatencyRtsTxVectorTag ()
86
{
87
}
88
89
HighLatencyRtsTxVectorTag::HighLatencyRtsTxVectorTag (WifiTxVector rtsTxVector)
90
  : m_rtsTxVector (rtsTxVector)
91
{
92
}
93
94
WifiTxVector
95
HighLatencyRtsTxVectorTag::GetRtsTxVector (void) const
96
{
97
  return m_rtsTxVector;
98
}
99
100
TypeId
101
HighLatencyRtsTxVectorTag::GetTypeId (void)
102
{
103
  static TypeId tid = TypeId ("ns3::HighLatencyRtsTxVectorTag")
104
    .SetParent<Tag> ()
105
    .SetGroupName ("Wifi")
106
    .AddConstructor<HighLatencyRtsTxVectorTag> ()
107
  ;
108
  return tid;
109
}
110
111
TypeId
112
HighLatencyRtsTxVectorTag::GetInstanceTypeId (void) const
113
{
114
  return GetTypeId ();
115
}
116
117
uint32_t
118
HighLatencyRtsTxVectorTag::GetSerializedSize (void) const
119
{
120
  return sizeof (WifiTxVector);
121
}
122
123
void
124
HighLatencyRtsTxVectorTag::Serialize (TagBuffer i) const
125
{
126
  i.Write ((uint8_t *)&m_rtsTxVector, sizeof (WifiTxVector));
127
}
128
129
void
130
HighLatencyRtsTxVectorTag::Deserialize (TagBuffer i)
131
{
132
  i.Read ((uint8_t *)&m_rtsTxVector, sizeof (WifiTxVector));
133
}
134
135
void
136
HighLatencyRtsTxVectorTag::Print (std::ostream &os) const
137
{
138
  os << "Rts=" << m_rtsTxVector;
139
}
140
141
HighLatencyCtsToSelfTxVectorTag::HighLatencyCtsToSelfTxVectorTag ()
142
{
143
}
144
145
HighLatencyCtsToSelfTxVectorTag::HighLatencyCtsToSelfTxVectorTag (WifiTxVector ctsToSelfTxVector)
146
  : m_ctsToSelfTxVector (ctsToSelfTxVector)
147
{
148
}
149
150
WifiTxVector
151
HighLatencyCtsToSelfTxVectorTag::GetCtsToSelfTxVector (void) const
152
{
153
  return m_ctsToSelfTxVector;
154
}
155
156
TypeId
157
HighLatencyCtsToSelfTxVectorTag::GetTypeId (void)
158
{
159
  static TypeId tid = TypeId ("ns3::HighLatencyCtsToSelfTxVectorTag")
160
    .SetParent<Tag> ()
161
    .SetGroupName ("Wifi")
162
    .AddConstructor<HighLatencyCtsToSelfTxVectorTag> ()
163
  ;
164
  return tid;
165
}
166
167
TypeId
168
HighLatencyCtsToSelfTxVectorTag::GetInstanceTypeId (void) const
169
{
170
  return GetTypeId ();
171
}
172
173
uint32_t
174
HighLatencyCtsToSelfTxVectorTag::GetSerializedSize (void) const
175
{
176
  return sizeof (WifiTxVector);
177
}
178
179
void
180
HighLatencyCtsToSelfTxVectorTag::Serialize (TagBuffer i) const
181
{
182
  i.Write ((uint8_t *)&m_ctsToSelfTxVector, sizeof (WifiTxVector));
183
}
184
185
void
186
HighLatencyCtsToSelfTxVectorTag::Deserialize (TagBuffer i)
187
{
188
  i.Read ((uint8_t *)&m_ctsToSelfTxVector, sizeof (WifiTxVector));
189
}
190
191
void
192
HighLatencyCtsToSelfTxVectorTag::Print (std::ostream &os) const
193
{
194
  os << "Cts To Self=" << m_ctsToSelfTxVector;
195
}
196
197
} //namespace ns3
(-)b514e7e38d23 (+135 lines)
Added Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2005,2006,2007 INRIA
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License version 2 as
7
 * published by the Free Software Foundation;
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 *
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 */
20
21
#ifndef TX_VECTOR_TAG_H
22
#define TX_VECTOR_TAG_H
23
24
#include "ns3/tag.h"
25
#include "wifi-tx-vector.h"
26
27
/***************************************************************
28
 *           Packet Mode Tagger
29
 ***************************************************************/
30
31
namespace ns3 {
32
33
/**
34
 * HighLatencyDataTxVectorTag class
35
 */
36
class HighLatencyDataTxVectorTag : public Tag
37
{
38
public:
39
  HighLatencyDataTxVectorTag ();
40
  /**
41
   * Constructor
42
   *
43
   * \param dataTxVector TXVECTOR for data frames
44
   */
45
  HighLatencyDataTxVectorTag (WifiTxVector dataTxVector);
46
  /**
47
   * \returns the transmission mode to use to send this packet
48
   */
49
  WifiTxVector GetDataTxVector (void) const;
50
51
  /**
52
   * \brief Get the type ID.
53
   * \return the object TypeId
54
   */
55
  static TypeId GetTypeId (void);
56
  virtual TypeId GetInstanceTypeId (void) const;
57
  virtual uint32_t GetSerializedSize (void) const;
58
  virtual void Serialize (TagBuffer i) const;
59
  virtual void Deserialize (TagBuffer i);
60
  virtual void Print (std::ostream &os) const;
61
62
private:
63
  WifiTxVector m_dataTxVector; ///< TXVECTOR for data frames
64
};
65
66
/**
67
 * HighLatencyRtsTxVectorTag class
68
 */
69
class HighLatencyRtsTxVectorTag : public Tag
70
{
71
public:
72
  HighLatencyRtsTxVectorTag ();
73
  /**
74
   * Constructor
75
   *
76
   * \param rtsTxVector TXVECTOR for RTS frames
77
   */
78
  HighLatencyRtsTxVectorTag (WifiTxVector rtsTxVector);
79
  /**
80
   * \returns the transmission mode to use to send the RTS prior to the
81
   *          transmission of the data packet itself.
82
   */
83
  WifiTxVector GetRtsTxVector (void) const;
84
85
  /**
86
   * \brief Get the type ID.
87
   * \return the object TypeId
88
   */
89
  static TypeId GetTypeId (void);
90
  virtual TypeId GetInstanceTypeId (void) const;
91
  virtual uint32_t GetSerializedSize (void) const;
92
  virtual void Serialize (TagBuffer i) const;
93
  virtual void Deserialize (TagBuffer i);
94
  virtual void Print (std::ostream &os) const;
95
96
private:
97
  WifiTxVector m_rtsTxVector; ///< TXVECTOR for data frames
98
};
99
100
/**
101
 * HighLatencyCtsToSelfTxVectorTag class
102
 */
103
class HighLatencyCtsToSelfTxVectorTag : public Tag
104
{
105
public:
106
  HighLatencyCtsToSelfTxVectorTag ();
107
  /**
108
   * Constructor
109
   *
110
   * \param ctsToSelfTxVector TXVECTOR for CTS-to-self frames
111
   */
112
  HighLatencyCtsToSelfTxVectorTag (WifiTxVector ctsToSelfTxVector);
113
  /**
114
   * \returns the transmission mode to use for the CTS-to-self.
115
   */
116
  WifiTxVector GetCtsToSelfTxVector (void) const;
117
118
  /**
119
   * \brief Get the type ID.
120
   * \return the object TypeId
121
   */
122
  static TypeId GetTypeId (void);
123
  virtual TypeId GetInstanceTypeId (void) const;
124
  virtual uint32_t GetSerializedSize (void) const;
125
  virtual void Serialize (TagBuffer i) const;
126
  virtual void Deserialize (TagBuffer i);
127
  virtual void Print (std::ostream &os) const;
128
129
private:
130
  WifiTxVector m_ctsToSelfTxVector; ///< TXVECTOR for CTS-to-self frames
131
};
132
133
} //namespace ns3
134
135
#endif /* TX_VECTOR_TAG_H */
(-)b514e7e38d23 (+65 lines)
Added Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2005,2006,2007 INRIA
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License version 2 as
7
 * published by the Free Software Foundation;
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 *
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 */
20
21
#include "ns3/simulator.h"
22
#include "wifi-remote-station-info.h"
23
24
namespace ns3 {
25
26
WifiRemoteStationInfo::WifiRemoteStationInfo ()
27
  : m_memoryTime (Seconds (1.0)),
28
    m_lastUpdate (Seconds (0.0)),
29
    m_failAvg (0.0)
30
{
31
}
32
33
WifiRemoteStationInfo::~WifiRemoteStationInfo ()
34
{
35
}
36
37
double
38
WifiRemoteStationInfo::CalculateAveragingCoefficient ()
39
{
40
  double retval = std::exp (static_cast<double> (m_lastUpdate.GetMicroSeconds () - Simulator::Now ().GetMicroSeconds ()) / m_memoryTime.GetMicroSeconds ());
41
  m_lastUpdate = Simulator::Now ();
42
  return retval;
43
}
44
45
void
46
WifiRemoteStationInfo::NotifyTxSuccess (uint32_t retryCounter)
47
{
48
  double coefficient = CalculateAveragingCoefficient ();
49
  m_failAvg = static_cast<double> (retryCounter) / (1 + retryCounter) * (1 - coefficient) + coefficient * m_failAvg;
50
}
51
52
void
53
WifiRemoteStationInfo::NotifyTxFailed ()
54
{
55
  double coefficient = CalculateAveragingCoefficient ();
56
  m_failAvg = (1 - coefficient) + coefficient * m_failAvg;
57
}
58
59
double
60
WifiRemoteStationInfo::GetFrameErrorRate () const
61
{
62
  return m_failAvg;
63
}
64
65
} //namespace ns3
(-)b514e7e38d23 (+74 lines)
Added Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2005,2006,2007 INRIA
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License version 2 as
7
 * published by the Free Software Foundation;
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 *
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 */
20
21
#ifndef WIFI_REMOTE_STATION_INFO_H
22
#define WIFI_REMOTE_STATION_INFO_H
23
24
#include "ns3/nstime.h"
25
#include "ns3/uinteger.h"
26
27
namespace ns3 {
28
29
/**
30
 * \brief Tid independent remote station statistics
31
 *
32
 * Structure is similar to struct sta_info in Linux kernel (see
33
 * net/mac80211/sta_info.h)
34
 */
35
class WifiRemoteStationInfo
36
{
37
public:
38
  WifiRemoteStationInfo ();
39
  virtual ~WifiRemoteStationInfo ();
40
41
  /**
42
   * \brief Updates average frame error rate when data or RTS was transmitted successfully.
43
   *
44
   * \param retryCounter is slrc or ssrc value at the moment of success transmission.
45
   */
46
  void NotifyTxSuccess (uint32_t retryCounter);
47
  /// Updates average frame error rate when final data or RTS has failed.
48
  void NotifyTxFailed ();
49
  /**
50
   * Return frame error rate (probability that frame is corrupted due to transmission error).
51
   * \returns the frame error rate
52
   */
53
  double GetFrameErrorRate () const;
54
private:
55
  /**
56
   * \brief Calculate averaging coefficient for frame error rate. Depends on time of the last update.
57
   *
58
   * \attention Calling this method twice gives different results,
59
   * because it resets time of last update.
60
   *
61
   * \return average coefficient for frame error rate
62
   */
63
  double CalculateAveragingCoefficient ();
64
  /// averaging coefficient depends on the memory time
65
  Time m_memoryTime;
66
  /// when last update has occurred
67
  Time m_lastUpdate;
68
  /// moving percentage of failed frames
69
  double m_failAvg;
70
};
71
72
} //namespace ns3
73
74
#endif /* WIFI_REMOTE_STATION_INFO_H */
(-)a/src/wifi/model/wifi-remote-station-manager.cc (-395 / +11 lines)
 Lines 36-318    Link Here 
36
#include "vht-configuration.h"
36
#include "vht-configuration.h"
37
#include "he-configuration.h"
37
#include "he-configuration.h"
38
#include "wifi-net-device.h"
38
#include "wifi-net-device.h"
39
#include "tx-vector-tag.h"
39
40
40
namespace ns3 {
41
namespace ns3 {
41
42
42
NS_LOG_COMPONENT_DEFINE ("WifiRemoteStationManager");
43
NS_LOG_COMPONENT_DEFINE ("WifiRemoteStationManager");
43
44
44
/**
45
 * HighLatencyDataTxVectorTag class
46
 */
47
class HighLatencyDataTxVectorTag : public Tag
48
{
49
public:
50
  HighLatencyDataTxVectorTag ();
51
  /**
52
   * Constructor
53
   *
54
   * \param dataTxVector TXVECTOR for data frames
55
   */
56
  HighLatencyDataTxVectorTag (WifiTxVector dataTxVector);
57
  /**
58
   * \returns the transmission mode to use to send this packet
59
   */
60
  WifiTxVector GetDataTxVector (void) const;
61
62
  /**
63
   * \brief Get the type ID.
64
   * \return the object TypeId
65
   */
66
  static TypeId GetTypeId (void);
67
  virtual TypeId GetInstanceTypeId (void) const;
68
  virtual uint32_t GetSerializedSize (void) const;
69
  virtual void Serialize (TagBuffer i) const;
70
  virtual void Deserialize (TagBuffer i);
71
  virtual void Print (std::ostream &os) const;
72
73
private:
74
  WifiTxVector m_dataTxVector; ///< TXVECTOR for data frames
75
};
76
77
HighLatencyDataTxVectorTag::HighLatencyDataTxVectorTag ()
78
{
79
}
80
81
HighLatencyDataTxVectorTag::HighLatencyDataTxVectorTag (WifiTxVector dataTxVector)
82
  : m_dataTxVector (dataTxVector)
83
{
84
}
85
86
WifiTxVector
87
HighLatencyDataTxVectorTag::GetDataTxVector (void) const
88
{
89
  return m_dataTxVector;
90
}
91
92
TypeId
93
HighLatencyDataTxVectorTag::GetTypeId (void)
94
{
95
  static TypeId tid = TypeId ("ns3::HighLatencyDataTxVectorTag")
96
    .SetParent<Tag> ()
97
    .SetGroupName ("Wifi")
98
    .AddConstructor<HighLatencyDataTxVectorTag> ()
99
  ;
100
  return tid;
101
}
102
103
TypeId
104
HighLatencyDataTxVectorTag::GetInstanceTypeId (void) const
105
{
106
  return GetTypeId ();
107
}
108
109
uint32_t
110
HighLatencyDataTxVectorTag::GetSerializedSize (void) const
111
{
112
  return sizeof (WifiTxVector);
113
}
114
115
void
116
HighLatencyDataTxVectorTag::Serialize (TagBuffer i) const
117
{
118
  i.Write ((uint8_t *)&m_dataTxVector, sizeof (WifiTxVector));
119
}
120
121
void
122
HighLatencyDataTxVectorTag::Deserialize (TagBuffer i)
123
{
124
  i.Read ((uint8_t *)&m_dataTxVector, sizeof (WifiTxVector));
125
}
126
127
void
128
HighLatencyDataTxVectorTag::Print (std::ostream &os) const
129
{
130
  os << "Data=" << m_dataTxVector;
131
}
132
133
/**
134
 * HighLatencyRtsTxVectorTag class
135
 */
136
class HighLatencyRtsTxVectorTag : public Tag
137
{
138
public:
139
  HighLatencyRtsTxVectorTag ();
140
  /**
141
   * Constructor
142
   *
143
   * \param rtsTxVector TXVECTOR for RTS frames
144
   */
145
  HighLatencyRtsTxVectorTag (WifiTxVector rtsTxVector);
146
  /**
147
   * \returns the transmission mode to use to send the RTS prior to the
148
   *          transmission of the data packet itself.
149
   */
150
  WifiTxVector GetRtsTxVector (void) const;
151
152
  /**
153
   * \brief Get the type ID.
154
   * \return the object TypeId
155
   */
156
  static TypeId GetTypeId (void);
157
  virtual TypeId GetInstanceTypeId (void) const;
158
  virtual uint32_t GetSerializedSize (void) const;
159
  virtual void Serialize (TagBuffer i) const;
160
  virtual void Deserialize (TagBuffer i);
161
  virtual void Print (std::ostream &os) const;
162
163
private:
164
  WifiTxVector m_rtsTxVector; ///< TXVECTOR for data frames
165
};
166
167
HighLatencyRtsTxVectorTag::HighLatencyRtsTxVectorTag ()
168
{
169
}
170
171
HighLatencyRtsTxVectorTag::HighLatencyRtsTxVectorTag (WifiTxVector rtsTxVector)
172
  : m_rtsTxVector (rtsTxVector)
173
{
174
}
175
176
WifiTxVector
177
HighLatencyRtsTxVectorTag::GetRtsTxVector (void) const
178
{
179
  return m_rtsTxVector;
180
}
181
182
TypeId
183
HighLatencyRtsTxVectorTag::GetTypeId (void)
184
{
185
  static TypeId tid = TypeId ("ns3::HighLatencyRtsTxVectorTag")
186
    .SetParent<Tag> ()
187
    .SetGroupName ("Wifi")
188
    .AddConstructor<HighLatencyRtsTxVectorTag> ()
189
  ;
190
  return tid;
191
}
192
193
TypeId
194
HighLatencyRtsTxVectorTag::GetInstanceTypeId (void) const
195
{
196
  return GetTypeId ();
197
}
198
199
uint32_t
200
HighLatencyRtsTxVectorTag::GetSerializedSize (void) const
201
{
202
  return sizeof (WifiTxVector);
203
}
204
205
void
206
HighLatencyRtsTxVectorTag::Serialize (TagBuffer i) const
207
{
208
  i.Write ((uint8_t *)&m_rtsTxVector, sizeof (WifiTxVector));
209
}
210
211
void
212
HighLatencyRtsTxVectorTag::Deserialize (TagBuffer i)
213
{
214
  i.Read ((uint8_t *)&m_rtsTxVector, sizeof (WifiTxVector));
215
}
216
217
void
218
HighLatencyRtsTxVectorTag::Print (std::ostream &os) const
219
{
220
  os << "Rts=" << m_rtsTxVector;
221
}
222
223
/**
224
 * HighLatencyCtsToSelfTxVectorTag class
225
 */
226
class HighLatencyCtsToSelfTxVectorTag : public Tag
227
{
228
public:
229
  HighLatencyCtsToSelfTxVectorTag ();
230
  /**
231
   * Constructor
232
   *
233
   * \param ctsToSelfTxVector TXVECTOR for CTS-to-self frames
234
   */
235
  HighLatencyCtsToSelfTxVectorTag (WifiTxVector ctsToSelfTxVector);
236
  /**
237
   * \returns the transmission mode to use for the CTS-to-self.
238
   */
239
  WifiTxVector GetCtsToSelfTxVector (void) const;
240
241
  /**
242
   * \brief Get the type ID.
243
   * \return the object TypeId
244
   */
245
  static TypeId GetTypeId (void);
246
  virtual TypeId GetInstanceTypeId (void) const;
247
  virtual uint32_t GetSerializedSize (void) const;
248
  virtual void Serialize (TagBuffer i) const;
249
  virtual void Deserialize (TagBuffer i);
250
  virtual void Print (std::ostream &os) const;
251
252
private:
253
  WifiTxVector m_ctsToSelfTxVector; ///< TXVECTOR for CTS-to-self frames
254
};
255
256
HighLatencyCtsToSelfTxVectorTag::HighLatencyCtsToSelfTxVectorTag ()
257
{
258
}
259
260
HighLatencyCtsToSelfTxVectorTag::HighLatencyCtsToSelfTxVectorTag (WifiTxVector ctsToSelfTxVector)
261
  : m_ctsToSelfTxVector (ctsToSelfTxVector)
262
{
263
}
264
265
WifiTxVector
266
HighLatencyCtsToSelfTxVectorTag::GetCtsToSelfTxVector (void) const
267
{
268
  return m_ctsToSelfTxVector;
269
}
270
271
TypeId
272
HighLatencyCtsToSelfTxVectorTag::GetTypeId (void)
273
{
274
  static TypeId tid = TypeId ("ns3::HighLatencyCtsToSelfTxVectorTag")
275
    .SetParent<Tag> ()
276
    .SetGroupName ("Wifi")
277
    .AddConstructor<HighLatencyCtsToSelfTxVectorTag> ()
278
  ;
279
  return tid;
280
}
281
282
TypeId
283
HighLatencyCtsToSelfTxVectorTag::GetInstanceTypeId (void) const
284
{
285
  return GetTypeId ();
286
}
287
288
uint32_t
289
HighLatencyCtsToSelfTxVectorTag::GetSerializedSize (void) const
290
{
291
  return sizeof (WifiTxVector);
292
}
293
294
void
295
HighLatencyCtsToSelfTxVectorTag::Serialize (TagBuffer i) const
296
{
297
  i.Write ((uint8_t *)&m_ctsToSelfTxVector, sizeof (WifiTxVector));
298
}
299
300
void
301
HighLatencyCtsToSelfTxVectorTag::Deserialize (TagBuffer i)
302
{
303
  i.Read ((uint8_t *)&m_ctsToSelfTxVector, sizeof (WifiTxVector));
304
}
305
306
void
307
HighLatencyCtsToSelfTxVectorTag::Print (std::ostream &os) const
308
{
309
  os << "Cts To Self=" << m_ctsToSelfTxVector;
310
}
311
312
} //namespace ns3
313
314
namespace ns3 {
315
316
NS_OBJECT_ENSURE_REGISTERED (WifiRemoteStationManager);
45
NS_OBJECT_ENSURE_REGISTERED (WifiRemoteStationManager);
317
46
318
TypeId
47
TypeId
 Lines 815-841    Link Here 
815
  packet->AddPacketTag (ctstoselftag);
544
  packet->AddPacketTag (ctstoselftag);
816
}
545
}
817
546
818
uint16_t
819
WifiRemoteStationManager::GetChannelWidthForTransmission (WifiMode mode, uint16_t maxSupportedChannelWidth)
820
{
821
  NS_LOG_FUNCTION (mode << maxSupportedChannelWidth);
822
  WifiModulationClass modulationClass = mode.GetModulationClass ();
823
  if (maxSupportedChannelWidth > 20
824
      && (modulationClass == WifiModulationClass::WIFI_MOD_CLASS_OFDM // all non-HT OFDM control and management frames
825
          || modulationClass == WifiModulationClass::WIFI_MOD_CLASS_ERP_OFDM)) // special case of beacons at 2.4 GHz
826
    {
827
      NS_LOG_LOGIC ("Channel width reduced to 20 MHz");
828
      return 20;
829
    }
830
  //at 2.4 GHz basic rate can be non-ERP DSSS
831
  if (modulationClass == WifiModulationClass::WIFI_MOD_CLASS_DSSS
832
      || modulationClass == WifiModulationClass::WIFI_MOD_CLASS_HR_DSSS)
833
    {
834
      return 22;
835
    }
836
  return maxSupportedChannelWidth;
837
}
838
839
WifiTxVector
547
WifiTxVector
840
WifiRemoteStationManager::GetDataTxVector (Mac48Address address, const WifiMacHeader *header, Ptr<const Packet> packet)
548
WifiRemoteStationManager::GetDataTxVector (Mac48Address address, const WifiMacHeader *header, Ptr<const Packet> packet)
841
{
549
{
 Lines 845-851    Link Here 
845
      WifiMode mode = GetNonUnicastMode ();
553
      WifiMode mode = GetNonUnicastMode ();
846
      WifiTxVector v;
554
      WifiTxVector v;
847
      v.SetMode (mode);
555
      v.SetMode (mode);
848
      v.SetPreambleType (GetPreambleForTransmission (mode, address));
556
      v.SetPreambleType (GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (address)));
849
      v.SetTxPowerLevel (m_defaultTxPowerLevel);
557
      v.SetTxPowerLevel (m_defaultTxPowerLevel);
850
      v.SetChannelWidth (GetChannelWidthForTransmission (mode, m_wifiPhy->GetChannelWidth ()));
558
      v.SetChannelWidth (GetChannelWidthForTransmission (mode, m_wifiPhy->GetChannelWidth ()));
851
      v.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
559
      v.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
 Lines 876-882    Link Here 
876
          mgtMode = GetDefaultMode ();
584
          mgtMode = GetDefaultMode ();
877
        }
585
        }
878
      txVector.SetMode (mgtMode);
586
      txVector.SetMode (mgtMode);
879
      txVector.SetPreambleType (GetPreambleForTransmission (mgtMode, address));
587
      txVector.SetPreambleType (GetPreambleForTransmission (mgtMode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (address)));
880
      txVector.SetChannelWidth (GetChannelWidthForTransmission (mgtMode, m_wifiPhy->GetChannelWidth ()));
588
      txVector.SetChannelWidth (GetChannelWidthForTransmission (mgtMode, m_wifiPhy->GetChannelWidth ()));
881
      txVector.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mgtMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
589
      txVector.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mgtMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
882
    }
590
    }
 Lines 1347-1375    Link Here 
1347
  return isLast;
1055
  return isLast;
1348
}
1056
}
1349
1057
1350
bool
1351
WifiRemoteStationManager::IsAllowedControlAnswerModulationClass (WifiModulationClass modClassReq, WifiModulationClass modClassAnswer) const
1352
{
1353
  switch (modClassReq)
1354
    {
1355
    case WIFI_MOD_CLASS_DSSS:
1356
      return (modClassAnswer == WIFI_MOD_CLASS_DSSS);
1357
    case WIFI_MOD_CLASS_HR_DSSS:
1358
      return (modClassAnswer == WIFI_MOD_CLASS_DSSS || modClassAnswer == WIFI_MOD_CLASS_HR_DSSS);
1359
    case WIFI_MOD_CLASS_ERP_OFDM:
1360
      return (modClassAnswer == WIFI_MOD_CLASS_DSSS || modClassAnswer == WIFI_MOD_CLASS_HR_DSSS || modClassAnswer == WIFI_MOD_CLASS_ERP_OFDM);
1361
    case WIFI_MOD_CLASS_OFDM:
1362
      return (modClassAnswer == WIFI_MOD_CLASS_OFDM);
1363
    case WIFI_MOD_CLASS_HT:
1364
    case WIFI_MOD_CLASS_VHT:
1365
    case WIFI_MOD_CLASS_HE:
1366
      return true;
1367
    default:
1368
      NS_FATAL_ERROR ("Modulation class not defined");
1369
      return false;
1370
    }
1371
}
1372
1373
WifiMode
1058
WifiMode
1374
WifiRemoteStationManager::GetControlAnswerMode (WifiMode reqMode)
1059
WifiRemoteStationManager::GetControlAnswerMode (WifiMode reqMode)
1375
{
1060
{
 Lines 1518-1524    Link Here 
1518
  WifiMode ctsMode = GetControlAnswerMode (rtsMode);
1203
  WifiMode ctsMode = GetControlAnswerMode (rtsMode);
1519
  WifiTxVector v;
1204
  WifiTxVector v;
1520
  v.SetMode (ctsMode);
1205
  v.SetMode (ctsMode);
1521
  v.SetPreambleType (GetPreambleForTransmission (ctsMode, address));
1206
  v.SetPreambleType (GetPreambleForTransmission (ctsMode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (address)));
1522
  v.SetTxPowerLevel (DoGetCtsTxPowerLevel (address, ctsMode));
1207
  v.SetTxPowerLevel (DoGetCtsTxPowerLevel (address, ctsMode));
1523
  v.SetChannelWidth (GetChannelWidthForTransmission (ctsMode, DoGetCtsTxChannelWidth (address, ctsMode)));
1208
  v.SetChannelWidth (GetChannelWidthForTransmission (ctsMode, DoGetCtsTxChannelWidth (address, ctsMode)));
1524
  v.SetGuardInterval (DoGetCtsTxGuardInterval (address, ctsMode));
1209
  v.SetGuardInterval (DoGetCtsTxGuardInterval (address, ctsMode));
 Lines 1535-1541    Link Here 
1535
  WifiMode ackMode = GetControlAnswerMode (dataMode);
1220
  WifiMode ackMode = GetControlAnswerMode (dataMode);
1536
  WifiTxVector v;
1221
  WifiTxVector v;
1537
  v.SetMode (ackMode);
1222
  v.SetMode (ackMode);
1538
  v.SetPreambleType (GetPreambleForTransmission (ackMode, address));
1223
  v.SetPreambleType (GetPreambleForTransmission (ackMode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (address)));
1539
  v.SetTxPowerLevel (DoGetAckTxPowerLevel (address, ackMode));
1224
  v.SetTxPowerLevel (DoGetAckTxPowerLevel (address, ackMode));
1540
  v.SetChannelWidth (GetChannelWidthForTransmission (ackMode, DoGetAckTxChannelWidth (address, ackMode)));
1225
  v.SetChannelWidth (GetChannelWidthForTransmission (ackMode, DoGetAckTxChannelWidth (address, ackMode)));
1541
  v.SetGuardInterval (DoGetAckTxGuardInterval (address, ackMode));
1226
  v.SetGuardInterval (DoGetAckTxGuardInterval (address, ackMode));
 Lines 1552-1558    Link Here 
1552
  WifiMode blockAckMode = GetControlAnswerMode (blockAckReqMode);
1237
  WifiMode blockAckMode = GetControlAnswerMode (blockAckReqMode);
1553
  WifiTxVector v;
1238
  WifiTxVector v;
1554
  v.SetMode (blockAckMode);
1239
  v.SetMode (blockAckMode);
1555
  v.SetPreambleType (GetPreambleForTransmission (blockAckMode, address));
1240
  v.SetPreambleType (GetPreambleForTransmission (blockAckMode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (address)));
1556
  v.SetTxPowerLevel (DoGetBlockAckTxPowerLevel (address, blockAckMode));
1241
  v.SetTxPowerLevel (DoGetBlockAckTxPowerLevel (address, blockAckMode));
1557
  v.SetChannelWidth (GetChannelWidthForTransmission (blockAckMode, DoGetBlockAckTxChannelWidth (address, blockAckMode)));
1242
  v.SetChannelWidth (GetChannelWidthForTransmission (blockAckMode, DoGetBlockAckTxChannelWidth (address, blockAckMode)));
1558
  v.SetGuardInterval (DoGetBlockAckTxGuardInterval (address, blockAckMode));
1243
  v.SetGuardInterval (DoGetBlockAckTxGuardInterval (address, blockAckMode));
 Lines 2256-2345    Link Here 
2256
}
1941
}
2257
1942
2258
uint8_t
1943
uint8_t
2259
WifiRemoteStationManager::GetNumberOfAntennas (void)
1944
WifiRemoteStationManager::GetNumberOfAntennas (void) const
2260
{
1945
{
2261
  return m_wifiPhy->GetNumberOfAntennas ();
1946
  return m_wifiPhy->GetNumberOfAntennas ();
2262
}
1947
}
2263
1948
2264
uint8_t
1949
uint8_t
2265
WifiRemoteStationManager::GetMaxNumberOfTransmitStreams (void)
1950
WifiRemoteStationManager::GetMaxNumberOfTransmitStreams (void) const
2266
{
1951
{
2267
  return m_wifiPhy->GetMaxSupportedTxSpatialStreams ();
1952
  return m_wifiPhy->GetMaxSupportedTxSpatialStreams ();
2268
}
1953
}
2269
1954
2270
WifiPreamble
1955
bool
2271
WifiRemoteStationManager::GetPreambleForTransmission (WifiMode mode, Mac48Address dest)
1956
WifiRemoteStationManager::UseGreenfieldForDestination (Mac48Address dest) const
2272
{
2273
  NS_LOG_FUNCTION (this << mode << dest);
2274
  WifiPreamble preamble;
2275
  if (mode.GetModulationClass () == WIFI_MOD_CLASS_HE)
2276
    {
2277
      preamble = WIFI_PREAMBLE_HE_SU;
2278
    }
2279
  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
2280
    {
2281
      preamble = WIFI_PREAMBLE_VHT;
2282
    }
2283
  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT && GetGreenfieldSupported () && GetGreenfieldSupported (dest) && !GetUseGreenfieldProtection ())
2284
    {
2285
      //If protection for greenfield is used we go for HT_MF preamble which is the default protection for GF format defined in the standard.
2286
      preamble = WIFI_PREAMBLE_HT_GF;
2287
    }
2288
  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
2289
    {
2290
      preamble = WIFI_PREAMBLE_HT_MF;
2291
    }
2292
  else if (GetShortPreambleEnabled ())
2293
    {
2294
      preamble = WIFI_PREAMBLE_SHORT;
2295
    }
2296
  else
2297
    {
2298
      preamble = WIFI_PREAMBLE_LONG;
2299
    }
2300
  NS_LOG_DEBUG ("selected preamble=" << preamble);
2301
  return preamble;
2302
}
2303
2304
WifiRemoteStation::~WifiRemoteStation ()
2305
{
1957
{
2306
  NS_LOG_FUNCTION (this);
1958
  return (GetGreenfieldSupported () && GetGreenfieldSupported (dest) && !GetUseGreenfieldProtection ());
2307
}
2308
2309
WifiRemoteStationInfo::WifiRemoteStationInfo ()
2310
  : m_memoryTime (Seconds (1.0)),
2311
    m_lastUpdate (Seconds (0.0)),
2312
    m_failAvg (0.0)
2313
{
2314
  NS_LOG_FUNCTION (this);
2315
}
2316
2317
double
2318
WifiRemoteStationInfo::CalculateAveragingCoefficient ()
2319
{
2320
  double retval = std::exp (static_cast<double> (m_lastUpdate.GetMicroSeconds () - Simulator::Now ().GetMicroSeconds ()) / m_memoryTime.GetMicroSeconds ());
2321
  m_lastUpdate = Simulator::Now ();
2322
  return retval;
2323
}
2324
2325
void
2326
WifiRemoteStationInfo::NotifyTxSuccess (uint32_t retryCounter)
2327
{
2328
  double coefficient = CalculateAveragingCoefficient ();
2329
  m_failAvg = static_cast<double> (retryCounter) / (1 + retryCounter) * (1 - coefficient) + coefficient * m_failAvg;
2330
}
2331
2332
void
2333
WifiRemoteStationInfo::NotifyTxFailed ()
2334
{
2335
  double coefficient = CalculateAveragingCoefficient ();
2336
  m_failAvg = (1 - coefficient) + coefficient * m_failAvg;
2337
}
2338
2339
double
2340
WifiRemoteStationInfo::GetFrameErrorRate () const
2341
{
2342
  return m_failAvg;
2343
}
1959
}
2344
1960
2345
} //namespace ns3
1961
} //namespace ns3
(-)a/src/wifi/model/wifi-remote-station-manager.h (-141 / +76 lines)
 Lines 23-39    Link Here 
23
23
24
#include "ns3/traced-callback.h"
24
#include "ns3/traced-callback.h"
25
#include "ns3/object.h"
25
#include "ns3/object.h"
26
#include "ns3/nstime.h"
27
#include "ns3/data-rate.h"
26
#include "ns3/data-rate.h"
28
#include "ns3/mac48-address.h"
27
#include "ns3/mac48-address.h"
29
#include "wifi-mode.h"
28
#include "wifi-mode.h"
30
#include "wifi-preamble.h"
29
#include "wifi-utils.h"
30
#include "wifi-remote-station-info.h"
31
31
32
namespace ns3 {
32
namespace ns3 {
33
33
34
struct WifiRemoteStation;
35
struct WifiRemoteStationState;
36
37
class WifiPhy;
34
class WifiPhy;
38
class WifiMac;
35
class WifiMac;
39
class WifiMacHeader;
36
class WifiMacHeader;
 Lines 43-87    Link Here 
43
class HeCapabilities;
40
class HeCapabilities;
44
class WifiTxVector;
41
class WifiTxVector;
45
42
43
struct WifiRemoteStationState;
44
46
/**
45
/**
47
 * \brief Tid independent remote station statistics
46
 * \brief hold per-remote-station state.
48
 *
47
 *
49
 * Structure is similar to struct sta_info in Linux kernel (see
48
 * The state in this class is used to keep track
50
 * net/mac80211/sta_info.h)
49
 * of association status if we are in an infrastructure
50
 * network and to perform the selection of tx parameters
51
 * on a per-packet basis.
52
 *
53
 * This class is typically subclassed and extended by
54
 * rate control implementations
51
 */
55
 */
52
class WifiRemoteStationInfo
56
struct WifiRemoteStation
53
{
57
{
54
public:
58
  virtual ~WifiRemoteStation () {};
55
  WifiRemoteStationInfo ();
59
  WifiRemoteStationState *m_state;  //!< Remote station state
56
  /**
60
  uint32_t m_ssrc;                  //!< STA short retry count
57
   * \brief Updates average frame error rate when data or RTS was transmitted successfully.
61
  uint32_t m_slrc;                  //!< STA long retry count
58
   *
62
  uint8_t m_tid;                    //!< traffic ID
59
   * \param retryCounter is slrc or ssrc value at the moment of success transmission.
63
};
60
   */
64
61
  void NotifyTxSuccess (uint32_t retryCounter);
65
/**
62
  /// Updates average frame error rate when final data or RTS has failed.
66
 * A struct that holds information about each remote station.
63
  void NotifyTxFailed ();
67
 */
68
struct WifiRemoteStationState
69
{
64
  /**
70
  /**
65
   * Return frame error rate (probability that frame is corrupted due to transmission error).
71
   * State of the station
66
   * \returns the frame error rate
67
   */
72
   */
68
  double GetFrameErrorRate () const;
73
  enum
69
private:
74
  {
75
    BRAND_NEW,
76
    DISASSOC,
77
    WAIT_ASSOC_TX_OK,
78
    GOT_ASSOC_TX_OK
79
  } m_state;
80
70
  /**
81
  /**
71
   * \brief Calculate averaging coefficient for frame error rate. Depends on time of the last update.
82
   * This member is the list of WifiMode objects that comprise the
72
   *
83
   * OperationalRateSet parameter for this remote station. This list
73
   * \attention Calling this method twice gives different results,
84
   * is constructed through calls to
74
   * because it resets time of last update.
85
   * WifiRemoteStationManager::AddSupportedMode(), and an API that
75
   *
86
   * allows external access to it is available through
76
   * \return average coefficient for frame error rate
87
   * WifiRemoteStationManager::GetNSupported() and
88
   * WifiRemoteStationManager::GetSupported().
77
   */
89
   */
78
  double CalculateAveragingCoefficient ();
90
  WifiModeList m_operationalRateSet; //!< opertional rate set
79
  /// averaging coefficient depends on the memory time
91
  WifiModeList m_operationalMcsSet; //!< operational MCS set
80
  Time m_memoryTime;
92
  Mac48Address m_address;  //!< Mac48Address of the remote station
81
  /// when last update has occurred
93
  WifiRemoteStationInfo m_info; //!< remote station info
82
  Time m_lastUpdate;
94
83
  /// moving percentage of failed frames
95
  uint16_t m_channelWidth;    //!< Channel width (in MHz) supported by the remote station
84
  double m_failAvg;
96
  bool m_shortGuardInterval;  //!< Flag if HT/VHT short guard interval is supported by the remote station
97
  uint16_t m_guardInterval;   //!< HE Guard interval duration (in nanoseconds) supported by the remote station
98
  uint8_t m_streams;          //!< Number of supported streams by the remote station
99
  uint8_t m_ness;             //!< Number of streams in beamforming of the remote station
100
  bool m_stbc;                //!< Flag if STBC is supported by the remote station
101
  bool m_ldpc;                //!< Flag if LDPC is supported by the remote station
102
  bool m_aggregation;         //!< Flag if MPDU aggregation is used by the remote station
103
  bool m_greenfield;          //!< Flag if greenfield is supported by the remote station
104
  bool m_shortPreamble;       //!< Flag if short PLCP preamble is supported by the remote station
105
  bool m_shortSlotTime;       //!< Flag if short ERP slot time is supported by the remote station
106
  bool m_qosSupported;        //!< Flag if HT is supported by the station
107
  bool m_htSupported;         //!< Flag if HT is supported by the station
108
  bool m_vhtSupported;        //!< Flag if VHT is supported by the station
109
  bool m_heSupported;         //!< Flag if HE is supported by the station
85
};
110
};
86
111
87
/**
112
/**
 Lines 110-115    Link Here 
110
  };
135
  };
111
136
112
  /**
137
  /**
138
   * A vector of WifiRemoteStations
139
   */
140
  typedef std::vector <WifiRemoteStation *> Stations;
141
  /**
142
   * A vector of WifiRemoteStationStates
143
   */
144
  typedef std::vector <WifiRemoteStationState *> StationStates;
145
146
  /**
113
   * Set up PHY associated with this device since it is the object that
147
   * Set up PHY associated with this device since it is the object that
114
   * knows the full set of transmit rates that are supported.
148
   * knows the full set of transmit rates that are supported.
115
   *
149
   *
 Lines 854-864    Link Here 
854
  /**
888
  /**
855
   * \return the number of antennas supported by the phy layer
889
   * \return the number of antennas supported by the phy layer
856
   */
890
   */
857
  uint8_t GetNumberOfAntennas (void);
891
  uint8_t GetNumberOfAntennas (void) const;
858
  /**
892
  /**
859
   * \return the maximum number of spatial streams supported by the phy layer
893
   * \return the maximum number of spatial streams supported by the phy layer
860
   */
894
   */
861
  uint8_t GetMaxNumberOfTransmitStreams (void);
895
  uint8_t GetMaxNumberOfTransmitStreams (void) const;
862
896
863
  /**
897
  /**
864
   * TracedCallback signature for power change events.
898
   * TracedCallback signature for power change events.
 Lines 1038-1061    Link Here 
1038
   */
1072
   */
1039
  uint8_t GetNess (const WifiRemoteStation *station) const;
1073
  uint8_t GetNess (const WifiRemoteStation *station) const;
1040
  /**
1074
  /**
1041
   * Return the preamble to be used for the transmission.
1075
   * \returns whether HT greenfield should be used for a given destination address.
1042
   *
1076
   *
1043
   * \param mode the mode selected for the transmission
1077
   * \param dest the destination address
1044
   * \param dest address of the recipient
1045
   *
1078
   *
1046
   * \return the preamble to be used for the transmission
1079
   * \return whether HT greenfield should be used for a given destination address
1047
   */
1080
   */
1048
  WifiPreamble GetPreambleForTransmission (WifiMode mode, Mac48Address dest);
1081
  bool UseGreenfieldForDestination (Mac48Address dest) const;
1049
  /**
1050
   * Return the channel width that corresponds to the selected mode (instead of
1051
   * letting the PHY's default channel width). This is especially useful when using
1052
   * non-HT modes with HT/VHT/HE capable stations (with default width above 20 MHz).
1053
   *
1054
   * \param mode selected WifiMode
1055
   * \param maxSupportedChannelWidth maximum channel width supported by the PHY layer
1056
   * \return channel width adapted to the selected mode
1057
   */
1058
  static uint16_t GetChannelWidthForTransmission (WifiMode mode, uint16_t maxSupportedChannelWidth);
1059
1082
1060
  /**
1083
  /**
1061
   * Return the WifiPhy.
1084
   * Return the WifiPhy.
 Lines 1351-1368    Link Here 
1351
  WifiRemoteStation* Lookup (Mac48Address address, const WifiMacHeader *header) const;
1374
  WifiRemoteStation* Lookup (Mac48Address address, const WifiMacHeader *header) const;
1352
1375
1353
  /**
1376
  /**
1354
   * Return whether the modulation class of the selected mode for the
1355
   * control answer frame is allowed.
1356
   *
1357
   * \param modClassReq modulation class of the request frame
1358
   * \param modClassAnswer modulation class of the answer frame
1359
   *
1360
   * \return true if the modulation class of the selected mode for the
1361
   * control answer frame is allowed, false otherwise
1362
   */
1363
  bool IsAllowedControlAnswerModulationClass (WifiModulationClass modClassReq, WifiModulationClass modClassAnswer) const;
1364
1365
  /**
1366
   * Get control answer mode function.
1377
   * Get control answer mode function.
1367
   *
1378
   *
1368
   * \param reqMode request mode
1379
   * \param reqMode request mode
 Lines 1395-1409    Link Here 
1395
  uint32_t GetNFragments (const WifiMacHeader *header, Ptr<const Packet> packet);
1406
  uint32_t GetNFragments (const WifiMacHeader *header, Ptr<const Packet> packet);
1396
1407
1397
  /**
1408
  /**
1398
   * A vector of WifiRemoteStations
1399
   */
1400
  typedef std::vector <WifiRemoteStation *> Stations;
1401
  /**
1402
   * A vector of WifiRemoteStationStates
1403
   */
1404
  typedef std::vector <WifiRemoteStationState *> StationStates;
1405
1406
  /**
1407
   * This is a pointer to the WifiPhy associated with this
1409
   * This is a pointer to the WifiPhy associated with this
1408
   * WifiRemoteStationManager that is set on call to
1410
   * WifiRemoteStationManager that is set on call to
1409
   * WifiRemoteStationManager::SetupPhy(). Through this pointer the
1411
   * WifiRemoteStationManager::SetupPhy(). Through this pointer the
 Lines 1475-1547    Link Here 
1475
  TracedCallback<Mac48Address> m_macTxFinalDataFailed;
1477
  TracedCallback<Mac48Address> m_macTxFinalDataFailed;
1476
};
1478
};
1477
1479
1478
/**
1479
 * A struct that holds information about each remote station.
1480
 */
1481
struct WifiRemoteStationState
1482
{
1483
  /**
1484
   * State of the station
1485
   */
1486
  enum
1487
  {
1488
    BRAND_NEW,
1489
    DISASSOC,
1490
    WAIT_ASSOC_TX_OK,
1491
    GOT_ASSOC_TX_OK
1492
  } m_state;
1493
1494
  /**
1495
   * This member is the list of WifiMode objects that comprise the
1496
   * OperationalRateSet parameter for this remote station. This list
1497
   * is constructed through calls to
1498
   * WifiRemoteStationManager::AddSupportedMode(), and an API that
1499
   * allows external access to it is available through
1500
   * WifiRemoteStationManager::GetNSupported() and
1501
   * WifiRemoteStationManager::GetSupported().
1502
   */
1503
  WifiModeList m_operationalRateSet; //!< opertional rate set
1504
  WifiModeList m_operationalMcsSet; //!< operational MCS set
1505
  Mac48Address m_address;  //!< Mac48Address of the remote station
1506
  WifiRemoteStationInfo m_info; //!< remote station info
1507
1508
  uint16_t m_channelWidth;    //!< Channel width (in MHz) supported by the remote station
1509
  bool m_shortGuardInterval;  //!< Flag if HT/VHT short guard interval is supported by the remote station
1510
  uint16_t m_guardInterval;   //!< HE Guard interval duration (in nanoseconds) supported by the remote station
1511
  uint8_t m_streams;          //!< Number of supported streams by the remote station
1512
  uint8_t m_ness;             //!< Number of streams in beamforming of the remote station
1513
  bool m_stbc;                //!< Flag if STBC is supported by the remote station
1514
  bool m_ldpc;                //!< Flag if LDPC is supported by the remote station
1515
  bool m_aggregation;         //!< Flag if MPDU aggregation is used by the remote station
1516
  bool m_greenfield;          //!< Flag if greenfield is supported by the remote station
1517
  bool m_shortPreamble;       //!< Flag if short PLCP preamble is supported by the remote station
1518
  bool m_shortSlotTime;       //!< Flag if short ERP slot time is supported by the remote station
1519
  bool m_qosSupported;        //!< Flag if HT is supported by the station
1520
  bool m_htSupported;         //!< Flag if HT is supported by the station
1521
  bool m_vhtSupported;        //!< Flag if VHT is supported by the station
1522
  bool m_heSupported;         //!< Flag if HE is supported by the station
1523
};
1524
1525
/**
1526
 * \brief hold per-remote-station state.
1527
 *
1528
 * The state in this class is used to keep track
1529
 * of association status if we are in an infrastructure
1530
 * network and to perform the selection of tx parameters
1531
 * on a per-packet basis.
1532
 *
1533
 * This class is typically subclassed and extended by
1534
 * rate control implementations
1535
 */
1536
struct WifiRemoteStation
1537
{
1538
  virtual ~WifiRemoteStation ();
1539
  WifiRemoteStationState *m_state;  //!< Remote station state
1540
  uint32_t m_ssrc;                  //!< STA short retry count
1541
  uint32_t m_slrc;                  //!< STA long retry count
1542
  uint8_t m_tid;                    //!< traffic ID
1543
};
1544
1545
} //namespace ns3
1480
} //namespace ns3
1546
1481
1547
#endif /* WIFI_REMOTE_STATION_MANAGER_H */
1482
#endif /* WIFI_REMOTE_STATION_MANAGER_H */
(-)a/src/wifi/model/wifi-utils.cc (+72 lines)
 Lines 104-109    Link Here 
104
  return gi;
104
  return gi;
105
}
105
}
106
106
107
uint16_t
108
GetChannelWidthForTransmission (WifiMode mode, uint16_t maxSupportedChannelWidth)
109
{
110
  WifiModulationClass modulationClass = mode.GetModulationClass ();
111
  if (maxSupportedChannelWidth > 20
112
      && (modulationClass == WifiModulationClass::WIFI_MOD_CLASS_OFDM // all non-HT OFDM control and management frames
113
          || modulationClass == WifiModulationClass::WIFI_MOD_CLASS_ERP_OFDM)) // special case of beacons at 2.4 GHz
114
    {
115
      return 20;
116
    }
117
  //at 2.4 GHz basic rate can be non-ERP DSSS
118
  if (modulationClass == WifiModulationClass::WIFI_MOD_CLASS_DSSS
119
      || modulationClass == WifiModulationClass::WIFI_MOD_CLASS_HR_DSSS)
120
    {
121
      return 22;
122
    }
123
  return maxSupportedChannelWidth;
124
}
125
126
WifiPreamble
127
GetPreambleForTransmission (WifiModulationClass modulation, bool useShortPreamble, bool useGreenfield)
128
{
129
  if (modulation == WIFI_MOD_CLASS_HE)
130
    {
131
      return WIFI_PREAMBLE_HE_SU;
132
    }
133
  else if (modulation == WIFI_MOD_CLASS_VHT)
134
    {
135
      return WIFI_PREAMBLE_VHT;
136
    }
137
  else if (modulation == WIFI_MOD_CLASS_HT && useGreenfield)
138
    {
139
      //If protection for greenfield is used we go for HT_MF preamble which is the default protection for GF format defined in the standard.
140
      return WIFI_PREAMBLE_HT_GF;
141
    }
142
  else if (modulation == WIFI_MOD_CLASS_HT)
143
    {
144
      return WIFI_PREAMBLE_HT_MF;
145
    }
146
  else if (useShortPreamble)
147
    {
148
      return WIFI_PREAMBLE_SHORT;
149
    }
150
  else
151
    {
152
      return WIFI_PREAMBLE_LONG;
153
    }
154
}
155
156
bool
157
IsAllowedControlAnswerModulationClass (WifiModulationClass modClassReq, WifiModulationClass modClassAnswer)
158
{
159
  switch (modClassReq)
160
    {
161
    case WIFI_MOD_CLASS_DSSS:
162
      return (modClassAnswer == WIFI_MOD_CLASS_DSSS);
163
    case WIFI_MOD_CLASS_HR_DSSS:
164
      return (modClassAnswer == WIFI_MOD_CLASS_DSSS || modClassAnswer == WIFI_MOD_CLASS_HR_DSSS);
165
    case WIFI_MOD_CLASS_ERP_OFDM:
166
      return (modClassAnswer == WIFI_MOD_CLASS_DSSS || modClassAnswer == WIFI_MOD_CLASS_HR_DSSS || modClassAnswer == WIFI_MOD_CLASS_ERP_OFDM);
167
    case WIFI_MOD_CLASS_OFDM:
168
      return (modClassAnswer == WIFI_MOD_CLASS_OFDM);
169
    case WIFI_MOD_CLASS_HT:
170
    case WIFI_MOD_CLASS_VHT:
171
    case WIFI_MOD_CLASS_HE:
172
      return true;
173
    default:
174
      NS_FATAL_ERROR ("Modulation class not defined");
175
      return false;
176
    }
177
}
178
107
uint32_t
179
uint32_t
108
GetAckSize (void)
180
GetAckSize (void)
109
{
181
{
(-)a/src/wifi/model/wifi-utils.h (+33 lines)
 Lines 22-27    Link Here 
22
#define WIFI_UTILS_H
22
#define WIFI_UTILS_H
23
23
24
#include "block-ack-type.h"
24
#include "block-ack-type.h"
25
#include "wifi-preamble.h"
26
#include "wifi-mode.h"
25
27
26
namespace ns3 {
28
namespace ns3 {
27
29
 Lines 93-98    Link Here 
93
 */
95
 */
94
uint16_t ConvertGuardIntervalToNanoSeconds (WifiMode mode, bool htShortGuardInterval, Time heGuardInterval);
96
uint16_t ConvertGuardIntervalToNanoSeconds (WifiMode mode, bool htShortGuardInterval, Time heGuardInterval);
95
/**
97
/**
98
 * Return the preamble to be used for the transmission.
99
 *
100
 * \param modulation the modulation selected for the transmission
101
 * \param useShortPreamble whether short preamble should be used
102
 * \param useGreenfield whether HT greenfield should be used
103
 *
104
 * \return the preamble to be used for the transmission
105
 */
106
WifiPreamble GetPreambleForTransmission (WifiModulationClass modulation, bool useShortPreamble, bool useGreenfield);
107
/**
108
 * Return the channel width that corresponds to the selected mode (instead of
109
 * letting the PHY's default channel width). This is especially useful when using
110
 * non-HT modes with HT/VHT/HE capable stations (with default width above 20 MHz).
111
 *
112
 * \param mode selected WifiMode
113
 * \param maxSupportedChannelWidth maximum channel width supported by the PHY layer
114
 * \return channel width adapted to the selected mode
115
 */
116
uint16_t GetChannelWidthForTransmission (WifiMode mode, uint16_t maxSupportedChannelWidth);
117
/**
118
 * Return whether the modulation class of the selected mode for the
119
 * control answer frame is allowed.
120
 *
121
 * \param modClassReq modulation class of the request frame
122
 * \param modClassAnswer modulation class of the answer frame
123
 *
124
 * \return true if the modulation class of the selected mode for the
125
 * control answer frame is allowed, false otherwise
126
 */
127
bool IsAllowedControlAnswerModulationClass (WifiModulationClass modClassReq, WifiModulationClass modClassAnswer);
128
/**
96
 * Return the total ACK size (including FCS trailer).
129
 * Return the total ACK size (including FCS trailer).
97
 *
130
 *
98
 * \return the total ACK size
131
 * \return the total ACK size
(-)a/src/wifi/wscript (+4 lines)
 Lines 19-24    Link Here 
19
        'model/yans-wifi-channel.cc',
19
        'model/yans-wifi-channel.cc',
20
        'model/spectrum-wifi-phy.cc',
20
        'model/spectrum-wifi-phy.cc',
21
        'model/wifi-phy-tag.cc',
21
        'model/wifi-phy-tag.cc',
22
        'model/tx-vector-tag.cc',
22
        'model/wifi-spectrum-phy-interface.cc',
23
        'model/wifi-spectrum-phy-interface.cc',
23
        'model/wifi-spectrum-signal-parameters.cc',
24
        'model/wifi-spectrum-signal-parameters.cc',
24
        'model/wifi-mac-header.cc',
25
        'model/wifi-mac-header.cc',
 Lines 37-42    Link Here 
37
        'model/wifi-mac.cc',
38
        'model/wifi-mac.cc',
38
        'model/regular-wifi-mac.cc',
39
        'model/regular-wifi-mac.cc',
39
        'model/infrastructure-wifi-mac.cc',
40
        'model/infrastructure-wifi-mac.cc',
41
        'model/wifi-remote-station-info.cc',
40
        'model/wifi-remote-station-manager.cc',
42
        'model/wifi-remote-station-manager.cc',
41
        'model/ap-wifi-mac.cc',
43
        'model/ap-wifi-mac.cc',
42
        'model/sta-wifi-mac.cc',
44
        'model/sta-wifi-mac.cc',
 Lines 125-135    Link Here 
125
        'model/yans-wifi-phy.h',
127
        'model/yans-wifi-phy.h',
126
        'model/spectrum-wifi-phy.h',
128
        'model/spectrum-wifi-phy.h',
127
        'model/wifi-phy-tag.h',
129
        'model/wifi-phy-tag.h',
130
        'model/tx-vector-tag.h',
128
        'model/yans-wifi-channel.h',
131
        'model/yans-wifi-channel.h',
129
        'model/wifi-phy.h',
132
        'model/wifi-phy.h',
130
        'model/wifi-spectrum-phy-interface.h',
133
        'model/wifi-spectrum-phy-interface.h',
131
        'model/wifi-spectrum-signal-parameters.h',
134
        'model/wifi-spectrum-signal-parameters.h',
132
        'model/interference-helper.h',
135
        'model/interference-helper.h',
136
        'model/wifi-remote-station-info.h',
133
        'model/wifi-remote-station-manager.h',
137
        'model/wifi-remote-station-manager.h',
134
        'model/ap-wifi-mac.h',
138
        'model/ap-wifi-mac.h',
135
        'model/sta-wifi-mac.h',
139
        'model/sta-wifi-mac.h',

Return to bug 3003