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

(-)a/CHANGES.html (+2 lines)
 Lines 57-62   us a note on ns-developers mailing list.</p> Link Here 
57
</ul>
57
</ul>
58
<h2>Changes to existing API:</h2>
58
<h2>Changes to existing API:</h2>
59
<ul>
59
<ul>
60
<li>The attributes <b>RegularWifiMac::HtSupported</b>, <b>RegularWifiMac::VhtSupported</b>, <b>RegularWifiMac::HeSupported</b>, <b>RegularWifiMac::RifsSupported</b>, <b>WifiPhy::ShortGuardEnabled</b>, <b>WifiPhy::GuardInterval</b> and <b>WifiPhy::GreenfieldEnabled</b> have been deprecated. Intead, it is advised to use <b>WifiNetDevice::HtConfiguration</b>, <b>WifiNetDevice::VhtConfiguration</b> and <b>WifiNetDevice::HeConfiguration</b>.
61
</li>
60
</ul>
62
</ul>
61
<h2>Changes to build system:</h2>
63
<h2>Changes to build system:</h2>
62
<ul>
64
<ul>
(-)a/examples/wireless/80211n-mimo.cc (-2 / +3 lines)
 Lines 137-144   int main (int argc, char *argv[]) Link Here 
137
          YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
137
          YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
138
          phy.SetChannel (channel.Create ());
138
          phy.SetChannel (channel.Create ());
139
139
140
          // Set guard interval
141
          phy.Set ("ShortGuardEnabled", BooleanValue (shortGuardInterval));
142
          // Set MIMO capabilities
140
          // Set MIMO capabilities
143
          phy.Set ("Antennas", UintegerValue (nStreams));
141
          phy.Set ("Antennas", UintegerValue (nStreams));
144
          phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (nStreams));
142
          phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (nStreams));
 Lines 184-189   int main (int argc, char *argv[]) Link Here 
184
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (40));
182
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (40));
185
            }
183
            }
186
184
185
          // Set guard interval
186
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (shortGuardInterval));
187
187
          // mobility.
188
          // mobility.
188
          MobilityHelper mobility;
189
          MobilityHelper mobility;
189
          Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
190
          Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
(-)a/examples/wireless/he-wifi-network.cc (-4 / +2 lines)
 Lines 127-135   int main (int argc, char *argv[]) Link Here 
127
              YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
127
              YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
128
              phy.SetChannel (channel.Create ());
128
              phy.SetChannel (channel.Create ());
129
129
130
              // Set guard interval
131
              phy.Set ("GuardInterval", TimeValue (NanoSeconds (gi)));
132
133
              WifiMacHelper mac;
130
              WifiMacHelper mac;
134
              WifiHelper wifi;
131
              WifiHelper wifi;
135
              if (frequency == 5.0)
132
              if (frequency == 5.0)
 Lines 167-174   int main (int argc, char *argv[]) Link Here 
167
              NetDeviceContainer apDevice;
164
              NetDeviceContainer apDevice;
168
              apDevice = wifi.Install (phy, mac, wifiApNode);
165
              apDevice = wifi.Install (phy, mac, wifiApNode);
169
166
170
              // Set channel width
167
              // Set channel width and guard interval
171
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (channelWidth));
168
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (channelWidth));
169
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HeConfiguration/GuardInterval", TimeValue (NanoSeconds (gi)));
172
170
173
              // mobility.
171
              // mobility.
174
              MobilityHelper mobility;
172
              MobilityHelper mobility;
(-)a/examples/wireless/ht-wifi-network.cc (-3 / +3 lines)
 Lines 127-135   int main (int argc, char *argv[]) Link Here 
127
              YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
127
              YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
128
              phy.SetChannel (channel.Create ());
128
              phy.SetChannel (channel.Create ());
129
129
130
              // Set guard interval
131
              phy.Set ("ShortGuardEnabled", BooleanValue (sgi));
132
133
              WifiMacHelper mac;
130
              WifiMacHelper mac;
134
              WifiHelper wifi;
131
              WifiHelper wifi;
135
              if (frequency == 5.0)
132
              if (frequency == 5.0)
 Lines 169-174   int main (int argc, char *argv[]) Link Here 
169
166
170
              // Set channel width
167
              // Set channel width
171
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (channelWidth));
168
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (channelWidth));
169
              
170
              // Set guard interval
171
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (sgi));
172
172
173
              // mobility.
173
              // mobility.
174
              MobilityHelper mobility;
174
              MobilityHelper mobility;
(-)a/examples/wireless/mixed-network.cc (-5 / +9 lines)
 Lines 36-41    Link Here 
36
#include "ns3/wifi-mac.h"
36
#include "ns3/wifi-mac.h"
37
#include "ns3/packet-sink-helper.h"
37
#include "ns3/packet-sink-helper.h"
38
#include "ns3/packet-sink.h"
38
#include "ns3/packet-sink.h"
39
#include "ns3/ht-configuration.h"
39
40
40
// This example shows how to configure mixed networks (i.e. mixed b/g and HT/non-HT) and how are performance in several scenarios.
41
// This example shows how to configure mixed networks (i.e. mixed b/g and HT/non-HT) and how are performance in several scenarios.
41
//
42
//
 Lines 191-204   Experiment::Run (Parameters params) Link Here 
191
  wifi.SetStandard (WIFI_PHY_STANDARD_80211n_2_4GHZ);
192
  wifi.SetStandard (WIFI_PHY_STANDARD_80211n_2_4GHZ);
192
  NetDeviceContainer nNGFStaDevice, nGFStaDevice;
193
  NetDeviceContainer nNGFStaDevice, nGFStaDevice;
193
  mac.SetType ("ns3::StaWifiMac",
194
  mac.SetType ("ns3::StaWifiMac",
194
               "RifsSupported", BooleanValue (params.rifsSupported),
195
               "Ssid", SsidValue (ssid),
195
               "Ssid", SsidValue (ssid),
196
               "BE_MaxAmpduSize", UintegerValue (0),
196
               "BE_MaxAmpduSize", UintegerValue (0),
197
               "BE_BlockAckThreshold", UintegerValue (2),
197
               "BE_BlockAckThreshold", UintegerValue (2),
198
               "ShortSlotTimeSupported", BooleanValue (params.enableShortSlotTime));
198
               "ShortSlotTimeSupported", BooleanValue (params.enableShortSlotTime));
199
  phy.Set ("GreenfieldEnabled", BooleanValue (false));
200
  nNGFStaDevice = wifi.Install (phy, mac, wifiNNGFStaNodes);
199
  nNGFStaDevice = wifi.Install (phy, mac, wifiNNGFStaNodes);
201
  phy.Set ("GreenfieldEnabled", BooleanValue (true));
202
  nGFStaDevice = wifi.Install (phy, mac, wifiNGFStaNodes);
200
  nGFStaDevice = wifi.Install (phy, mac, wifiNGFStaNodes);
203
201
204
  // AP
202
  // AP
 Lines 209-219   Experiment::Run (Parameters params) Link Here 
209
               "EnableBeaconJitter", BooleanValue (false),
207
               "EnableBeaconJitter", BooleanValue (false),
210
               "BE_MaxAmpduSize", UintegerValue (0),
208
               "BE_MaxAmpduSize", UintegerValue (0),
211
               "BE_BlockAckThreshold", UintegerValue (2),
209
               "BE_BlockAckThreshold", UintegerValue (2),
212
               "RifsSupported", BooleanValue (params.rifsSupported),
213
               "RifsMode", BooleanValue (params.rifsMode),
210
               "RifsMode", BooleanValue (params.rifsMode),
214
               "EnableNonErpProtection", BooleanValue (params.enableErpProtection),
211
               "EnableNonErpProtection", BooleanValue (params.enableErpProtection),
215
               "ShortSlotTimeSupported", BooleanValue (params.enableShortSlotTime));
212
               "ShortSlotTimeSupported", BooleanValue (params.enableShortSlotTime));
216
  phy.Set ("GreenfieldEnabled", BooleanValue (params.apSupportsGreenfield));
217
  apDevice = wifi.Install (phy, mac, wifiApNode);
213
  apDevice = wifi.Install (phy, mac, wifiApNode);
218
214
219
  // Set TXOP limit
215
  // Set TXOP limit
 Lines 221-226   Experiment::Run (Parameters params) Link Here 
221
    {
217
    {
222
      Ptr<NetDevice> dev = wifiApNode.Get (0)->GetDevice (0);
218
      Ptr<NetDevice> dev = wifiApNode.Get (0)->GetDevice (0);
223
      Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice> (dev);
219
      Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice> (dev);
220
      Ptr<HtConfiguration> htConfiguration = wifi_dev->GetHtConfiguration ();
221
      htConfiguration->SetGreenfieldSupported (params.apSupportsGreenfield);
222
      htConfiguration->SetRifsSupported (params.rifsSupported);
224
      Ptr<WifiMac> wifi_mac = wifi_dev->GetMac ();
223
      Ptr<WifiMac> wifi_mac = wifi_dev->GetMac ();
225
      PointerValue ptr;
224
      PointerValue ptr;
226
      wifi_mac->GetAttribute ("BE_Txop", ptr);
225
      wifi_mac->GetAttribute ("BE_Txop", ptr);
 Lines 231-236   Experiment::Run (Parameters params) Link Here 
231
    {
230
    {
232
      Ptr<NetDevice> dev = wifiNNGFStaNodes.Get (0)->GetDevice (0);
231
      Ptr<NetDevice> dev = wifiNNGFStaNodes.Get (0)->GetDevice (0);
233
      Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice> (dev);
232
      Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice> (dev);
233
      Ptr<HtConfiguration> htConfiguration = wifi_dev->GetHtConfiguration ();
234
      htConfiguration->SetRifsSupported (params.rifsSupported);
234
      Ptr<WifiMac> wifi_mac = wifi_dev->GetMac ();
235
      Ptr<WifiMac> wifi_mac = wifi_dev->GetMac ();
235
      PointerValue ptr;
236
      PointerValue ptr;
236
      wifi_mac->GetAttribute ("BE_Txop", ptr);
237
      wifi_mac->GetAttribute ("BE_Txop", ptr);
 Lines 241-246   Experiment::Run (Parameters params) Link Here 
241
    {
242
    {
242
      Ptr<NetDevice> dev = wifiNGFStaNodes.Get (0)->GetDevice (0);
243
      Ptr<NetDevice> dev = wifiNGFStaNodes.Get (0)->GetDevice (0);
243
      Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice> (dev);
244
      Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice> (dev);
245
      Ptr<HtConfiguration> htConfiguration = wifi_dev->GetHtConfiguration ();
246
      htConfiguration->SetGreenfieldSupported (true);
247
      htConfiguration->SetRifsSupported (params.rifsSupported);
244
      Ptr<WifiMac> wifi_mac = wifi_dev->GetMac ();
248
      Ptr<WifiMac> wifi_mac = wifi_dev->GetMac ();
245
      PointerValue ptr;
249
      PointerValue ptr;
246
      wifi_mac->GetAttribute ("BE_Txop", ptr);
250
      wifi_mac->GetAttribute ("BE_Txop", ptr);
(-)a/examples/wireless/rate-adaptation-distance.cc (-2 / +3 lines)
 Lines 196-203   int main (int argc, char *argv[]) Link Here 
196
  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
196
  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
197
  wifiPhy.SetChannel (wifiChannel.Create ());
197
  wifiPhy.SetChannel (wifiChannel.Create ());
198
198
199
  wifiPhy.Set ("ShortGuardEnabled", BooleanValue (shortGuardInterval));
200
201
  NetDeviceContainer wifiApDevices;
199
  NetDeviceContainer wifiApDevices;
202
  NetDeviceContainer wifiStaDevices;
200
  NetDeviceContainer wifiStaDevices;
203
  NetDeviceContainer wifiDevices;
201
  NetDeviceContainer wifiDevices;
 Lines 296-301   int main (int argc, char *argv[]) Link Here 
296
  // Set channel width
294
  // Set channel width
297
  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (chWidth));
295
  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (chWidth));
298
296
297
  // Set guard interval
298
  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (shortGuardInterval));
299
299
  // Configure the mobility.
300
  // Configure the mobility.
300
  MobilityHelper mobility;
301
  MobilityHelper mobility;
301
  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
302
  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
(-)a/examples/wireless/vht-wifi-network.cc (-3 / +3 lines)
 Lines 129-137   int main (int argc, char *argv[]) Link Here 
129
              YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
129
              YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
130
              phy.SetChannel (channel.Create ());
130
              phy.SetChannel (channel.Create ());
131
131
132
              // Set guard interval
133
              phy.Set ("ShortGuardEnabled", BooleanValue (sgi));
134
135
              WifiHelper wifi;
132
              WifiHelper wifi;
136
              wifi.SetStandard (WIFI_PHY_STANDARD_80211ac);
133
              wifi.SetStandard (WIFI_PHY_STANDARD_80211ac);
137
              WifiMacHelper mac;
134
              WifiMacHelper mac;
 Lines 159-164   int main (int argc, char *argv[]) Link Here 
159
              // Set channel width
156
              // Set channel width
160
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (channelWidth));
157
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (channelWidth));
161
158
159
              // Set guard interval
160
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (sgi));
161
162
              // mobility.
162
              // mobility.
163
              MobilityHelper mobility;
163
              MobilityHelper mobility;
164
              Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
164
              Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
(-)a/examples/wireless/wifi-multi-tos.cc (-3 / +3 lines)
 Lines 74-82   int main (int argc, char *argv[]) Link Here 
74
  YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
74
  YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
75
  phy.SetChannel (channel.Create ());
75
  phy.SetChannel (channel.Create ());
76
76
77
  // Set guard interval
78
  phy.Set ("ShortGuardEnabled", BooleanValue (useShortGuardInterval));
79
80
  WifiMacHelper mac;
77
  WifiMacHelper mac;
81
  WifiHelper wifi;
78
  WifiHelper wifi;
82
  wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
79
  wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
 Lines 105-110   int main (int argc, char *argv[]) Link Here 
105
  // Set channel width
102
  // Set channel width
106
  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (channelWidth));
103
  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (channelWidth));
107
104
105
  // Set guard interval
106
  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (useShortGuardInterval));
107
108
  // mobility
108
  // mobility
109
  MobilityHelper mobility;
109
  MobilityHelper mobility;
110
  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
110
  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
(-)a/examples/wireless/wifi-spectrum-per-example.cc (-42 / +21 lines)
 Lines 180-206   int main (int argc, char *argv[]) Link Here 
180
          phy.Set ("TxPowerStart", DoubleValue (1)); // dBm (1.26 mW)
180
          phy.Set ("TxPowerStart", DoubleValue (1)); // dBm (1.26 mW)
181
          phy.Set ("TxPowerEnd", DoubleValue (1));
181
          phy.Set ("TxPowerEnd", DoubleValue (1));
182
          phy.Set ("Frequency", UintegerValue (5180));
182
          phy.Set ("Frequency", UintegerValue (5180));
183
184
          if (i <= 7)
185
            {
186
              phy.Set ("ShortGuardEnabled", BooleanValue (false));
187
              phy.Set ("ChannelWidth", UintegerValue (20));
188
            }
189
          else if (i > 7 && i <= 15)
190
            {
191
              phy.Set ("ShortGuardEnabled", BooleanValue (true));
192
              phy.Set ("ChannelWidth", UintegerValue (20));
193
            }
194
          else if (i > 15 && i <= 23)
195
            {
196
              phy.Set ("ShortGuardEnabled", BooleanValue (false));
197
              phy.Set ("ChannelWidth", UintegerValue (40));
198
            }
199
          else
200
            {
201
              phy.Set ("ShortGuardEnabled", BooleanValue (true));
202
              phy.Set ("ChannelWidth", UintegerValue (40));
203
            }
204
        }
183
        }
205
      else if (wifiType == "ns3::SpectrumWifiPhy")
184
      else if (wifiType == "ns3::SpectrumWifiPhy")
206
        {
185
        {
 Lines 223-249   int main (int argc, char *argv[]) Link Here 
223
          spectrumPhy.Set ("Frequency", UintegerValue (5180));
202
          spectrumPhy.Set ("Frequency", UintegerValue (5180));
224
          spectrumPhy.Set ("TxPowerStart", DoubleValue (1)); // dBm  (1.26 mW)
203
          spectrumPhy.Set ("TxPowerStart", DoubleValue (1)); // dBm  (1.26 mW)
225
          spectrumPhy.Set ("TxPowerEnd", DoubleValue (1));
204
          spectrumPhy.Set ("TxPowerEnd", DoubleValue (1));
226
227
          if (i <= 7)
228
            {
229
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (false));
230
              spectrumPhy.Set ("ChannelWidth", UintegerValue (20));
231
            }
232
          else if (i > 7 && i <= 15)
233
            {
234
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (true));
235
              spectrumPhy.Set ("ChannelWidth", UintegerValue (20));
236
            }
237
          else if (i > 15 && i <= 23)
238
            {
239
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (false));
240
              spectrumPhy.Set ("ChannelWidth", UintegerValue (40));
241
            }
242
          else
243
            {
244
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (true));
245
              spectrumPhy.Set ("ChannelWidth", UintegerValue (40));
246
            }
247
        }
205
        }
248
      else
206
      else
249
        {
207
        {
 Lines 446-451   int main (int argc, char *argv[]) Link Here 
446
          apDevice = wifi.Install (spectrumPhy, mac, wifiApNode);
404
          apDevice = wifi.Install (spectrumPhy, mac, wifiApNode);
447
        }
405
        }
448
406
407
      if (i <= 7)
408
        {
409
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (20));
410
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (false));
411
        }
412
      else if (i > 7 && i <= 15)
413
        {
414
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (20));
415
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (true));
416
        }
417
      else if (i > 15 && i <= 23)
418
        {
419
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (40));
420
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (false));
421
        }
422
      else
423
        {
424
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (40));
425
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (true));
426
        }
427
449
      // mobility.
428
      // mobility.
450
      MobilityHelper mobility;
429
      MobilityHelper mobility;
451
      Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
430
      Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
(-)a/examples/wireless/wifi-spectrum-per-interference.cc (-42 / +21 lines)
 Lines 209-235   int main (int argc, char *argv[]) Link Here 
209
          channel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
209
          channel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
210
          phy.SetChannel (channel.Create ());
210
          phy.SetChannel (channel.Create ());
211
          phy.Set ("Frequency", UintegerValue (5180));
211
          phy.Set ("Frequency", UintegerValue (5180));
212
213
          if (i <= 7)
214
            {
215
              phy.Set ("ShortGuardEnabled", BooleanValue (false));
216
              phy.Set ("ChannelWidth", UintegerValue (20));
217
            }
218
          else if (i > 7 && i <= 15)
219
            {
220
              phy.Set ("ShortGuardEnabled", BooleanValue (true));
221
              phy.Set ("ChannelWidth", UintegerValue (20));
222
            }
223
          else if (i > 15 && i <= 23)
224
            {
225
              phy.Set ("ShortGuardEnabled", BooleanValue (false));
226
              phy.Set ("ChannelWidth", UintegerValue (40));
227
            }
228
          else
229
            {
230
              phy.Set ("ShortGuardEnabled", BooleanValue (true));
231
              phy.Set ("ChannelWidth", UintegerValue (40));
232
            }
233
        }
212
        }
234
      else if (wifiType == "ns3::SpectrumWifiPhy")
213
      else if (wifiType == "ns3::SpectrumWifiPhy")
235
        {
214
        {
 Lines 250-276   int main (int argc, char *argv[]) Link Here 
250
          spectrumPhy.SetChannel (spectrumChannel);
229
          spectrumPhy.SetChannel (spectrumChannel);
251
          spectrumPhy.SetErrorRateModel (errorModelType);
230
          spectrumPhy.SetErrorRateModel (errorModelType);
252
          spectrumPhy.Set ("Frequency", UintegerValue (5180)); // channel 36 at 20 MHz
231
          spectrumPhy.Set ("Frequency", UintegerValue (5180)); // channel 36 at 20 MHz
253
254
          if (i <= 7)
255
            {
256
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (false));
257
              spectrumPhy.Set ("ChannelWidth", UintegerValue (20));
258
            }
259
          else if (i > 7 && i <= 15)
260
            {
261
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (true));
262
              spectrumPhy.Set ("ChannelWidth", UintegerValue (20));
263
            }
264
          else if (i > 15 && i <= 23)
265
            {
266
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (false));
267
              spectrumPhy.Set ("ChannelWidth", UintegerValue (40));
268
            }
269
          else
270
            {
271
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (true));
272
              spectrumPhy.Set ("ChannelWidth", UintegerValue (40));
273
            }
274
        }
232
        }
275
      else
233
      else
276
        {
234
        {
 Lines 472-477   int main (int argc, char *argv[]) Link Here 
472
          apDevice = wifi.Install (spectrumPhy, mac, wifiApNode);
430
          apDevice = wifi.Install (spectrumPhy, mac, wifiApNode);
473
        }
431
        }
474
432
433
      if (i <= 7)
434
        {
435
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (20));
436
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (false));
437
        }
438
      else if (i > 7 && i <= 15)
439
        {
440
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (20));
441
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (true));
442
        }
443
      else if (i > 15 && i <= 23)
444
        {
445
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (40));
446
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (false));
447
        }
448
      else
449
        {
450
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (40));
451
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (true));
452
        }
453
475
      // mobility.
454
      // mobility.
476
      MobilityHelper mobility;
455
      MobilityHelper mobility;
477
      Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
456
      Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
(-)a/examples/wireless/wifi-spectrum-saturation-example.cc (-61 / +22 lines)
 Lines 151-207   int main (int argc, char *argv[]) Link Here 
151
          phy.Set ("TxPowerStart", DoubleValue (1));
151
          phy.Set ("TxPowerStart", DoubleValue (1));
152
          phy.Set ("TxPowerEnd", DoubleValue (1));
152
          phy.Set ("TxPowerEnd", DoubleValue (1));
153
153
154
          if (i <= 7)
154
          if (i > 31 && i <= 39)
155
            {
155
            {
156
              phy.Set ("ShortGuardEnabled", BooleanValue (false));
157
              channelWidth = 20;
158
            }
159
          else if (i > 7 && i <= 15)
160
            {
161
              phy.Set ("ShortGuardEnabled", BooleanValue (true));
162
              channelWidth = 20;
163
            }
164
          else if (i > 15 && i <= 23)
165
            {
166
              phy.Set ("ShortGuardEnabled", BooleanValue (false));
167
              channelWidth = 40;
168
            }
169
          else if (i > 23 && i <= 31)
170
            {
171
              phy.Set ("ShortGuardEnabled", BooleanValue (true));
172
              channelWidth = 40;
173
            }
174
          else if (i > 31 && i <= 39)
175
            {
176
              phy.Set ("ShortGuardEnabled", BooleanValue (false));
177
              phy.Set ("Antennas", UintegerValue (2));
156
              phy.Set ("Antennas", UintegerValue (2));
178
              phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
157
              phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
179
              phy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
158
              phy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
180
              channelWidth = 20;
181
            }
159
            }
182
          else if (i > 39 && i <= 47)
160
          else if (i > 39 && i <= 47)
183
            {
161
            {
184
              phy.Set ("ShortGuardEnabled", BooleanValue (true));
185
              phy.Set ("Antennas", UintegerValue (2));
162
              phy.Set ("Antennas", UintegerValue (2));
186
              phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
163
              phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
187
              phy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
164
              phy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
188
              channelWidth = 20;
189
            }
165
            }
190
          else if (i > 47 && i <= 55)
166
          else if (i > 47 && i <= 55)
191
            {
167
            {
192
              phy.Set ("ShortGuardEnabled", BooleanValue (false));
193
              phy.Set ("Antennas", UintegerValue (2));
168
              phy.Set ("Antennas", UintegerValue (2));
194
              phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
169
              phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
195
              phy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
170
              phy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
196
              channelWidth = 40;
197
            }
171
            }
198
          else if (i > 55 && i <= 63)
172
          else if (i > 55 && i <= 63)
199
            {
173
            {
200
              phy.Set ("ShortGuardEnabled", BooleanValue (true));
201
              phy.Set ("Antennas", UintegerValue (2));
174
              phy.Set ("Antennas", UintegerValue (2));
202
              phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
175
              phy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
203
              phy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
176
              phy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
204
              channelWidth = 40;
205
            }
177
            }
206
        }
178
        }
207
      else if (wifiType == "ns3::SpectrumWifiPhy")
179
      else if (wifiType == "ns3::SpectrumWifiPhy")
 Lines 225-281   int main (int argc, char *argv[]) Link Here 
225
          spectrumPhy.Set ("TxPowerStart", DoubleValue (1));
197
          spectrumPhy.Set ("TxPowerStart", DoubleValue (1));
226
          spectrumPhy.Set ("TxPowerEnd", DoubleValue (1));
198
          spectrumPhy.Set ("TxPowerEnd", DoubleValue (1));
227
199
228
          if (i <= 7)
200
          if (i > 31 && i <= 39)
229
            {
230
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (false));
231
              channelWidth = 20;
232
            }
233
          else if (i > 7 && i <= 15)
234
            {
201
            {
235
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (true));
236
              channelWidth = 20;
237
            }
238
          else if (i > 15 && i <= 23)
239
            {
240
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (false));
241
              channelWidth = 40;
242
            }
243
          else if (i > 23 && i <= 31)
244
            {
245
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (true));
246
              channelWidth = 40;
247
            }
248
          else if (i > 31 && i <= 39)
249
            {
250
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (false));
251
              spectrumPhy.Set ("Antennas", UintegerValue (2));
202
              spectrumPhy.Set ("Antennas", UintegerValue (2));
252
              spectrumPhy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
203
              spectrumPhy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
253
              spectrumPhy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
204
              spectrumPhy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
254
              channelWidth = 20;
255
            }
205
            }
256
          else if (i > 39 && i <= 47)
206
          else if (i > 39 && i <= 47)
257
            {
207
            {
258
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (true));
259
              spectrumPhy.Set ("Antennas", UintegerValue (2));
208
              spectrumPhy.Set ("Antennas", UintegerValue (2));
260
              spectrumPhy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
209
              spectrumPhy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
261
              spectrumPhy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
210
              spectrumPhy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
262
              channelWidth = 20;
263
            }
211
            }
264
          else if (i > 47 && i <= 55)
212
          else if (i > 47 && i <= 55)
265
            {
213
            {
266
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (false));
267
              spectrumPhy.Set ("Antennas", UintegerValue (2));
214
              spectrumPhy.Set ("Antennas", UintegerValue (2));
268
              spectrumPhy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
215
              spectrumPhy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
269
              spectrumPhy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
216
              spectrumPhy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
270
              channelWidth = 40;
271
            }
217
            }
272
          else if (i > 55 && i <= 63)
218
          else if (i > 55 && i <= 63)
273
            {
219
            {
274
              spectrumPhy.Set ("ShortGuardEnabled", BooleanValue (true));
275
              spectrumPhy.Set ("Antennas", UintegerValue (2));
220
              spectrumPhy.Set ("Antennas", UintegerValue (2));
276
              spectrumPhy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
221
              spectrumPhy.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
277
              spectrumPhy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
222
              spectrumPhy.Set ("MaxSupportedRxSpatialStreams", UintegerValue (2));
278
              channelWidth = 40;
279
            }
223
            }
280
        }
224
        }
281
      else
225
      else
 Lines 642-650   int main (int argc, char *argv[]) Link Here 
642
          apDevice = wifi.Install (spectrumPhy, mac, wifiApNode);
586
          apDevice = wifi.Install (spectrumPhy, mac, wifiApNode);
643
        }
587
        }
644
588
645
      // Channel width must be set *after* installation because the attribute
589
     if ((i <= 7) || (i > 31 && i <= 39))
646
      // is overwritten by the ConfigureStandard method ()
590
        {
647
      Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (channelWidth));
591
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (20));
592
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (false));
593
        }
594
      else if ((i > 7 && i <= 15) || (i > 39 && i <= 47))
595
        {
596
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (20));
597
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (true));
598
        }
599
      else if ((i > 15 && i <= 23) || (i > 47 && i <= 55))
600
        {
601
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (40));
602
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (false));
603
        }
604
      else
605
        {
606
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (40));
607
          Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (true));
608
        }
648
609
649
      // mobility.
610
      // mobility.
650
      MobilityHelper mobility;
611
      MobilityHelper mobility;
(-)a/src/wave/helper/wave-helper.cc (-1 / +1 lines)
 Lines 392-398   WaveHelper::Install (const WifiPhyHelper &phyHelper, const WifiMacHelper &macHe Link Here 
392
      for (std::vector<uint32_t>::const_iterator k = m_macsForChannelNumber.begin ();
392
      for (std::vector<uint32_t>::const_iterator k = m_macsForChannelNumber.begin ();
393
           k != m_macsForChannelNumber.end (); ++k)
393
           k != m_macsForChannelNumber.end (); ++k)
394
        {
394
        {
395
          Ptr<WifiMac> wifiMac = macHelper.Create ();
395
          Ptr<WifiMac> wifiMac = macHelper.Create (device);
396
          Ptr<OcbWifiMac> ocbMac = DynamicCast<OcbWifiMac> (wifiMac);
396
          Ptr<OcbWifiMac> ocbMac = DynamicCast<OcbWifiMac> (wifiMac);
397
          // we use WaveMacLow to replace original MacLow
397
          // we use WaveMacLow to replace original MacLow
398
          ocbMac->EnableForWave (device);
398
          ocbMac->EnableForWave (device);
(-)a/src/wave/model/wave-net-device.h (-2 / +2 lines)
 Lines 25-31    Link Here 
25
#include "ns3/packet.h"
25
#include "ns3/packet.h"
26
#include "ns3/traced-callback.h"
26
#include "ns3/traced-callback.h"
27
#include "ns3/mac48-address.h"
27
#include "ns3/mac48-address.h"
28
#include "ns3/net-device.h"
28
#include "ns3/wifi-net-device.h"
29
#include "ocb-wifi-mac.h"
29
#include "ocb-wifi-mac.h"
30
#include "vendor-specific-action.h"
30
#include "vendor-specific-action.h"
31
#include "channel-coordinator.h"
31
#include "channel-coordinator.h"
 Lines 157-163   struct TxProfile Link Here 
157
 * UtcTime GetUtcTime ();
157
 * UtcTime GetUtcTime ();
158
 * void SetUtcTime ();
158
 * void SetUtcTime ();
159
 */
159
 */
160
class WaveNetDevice : public NetDevice
160
class WaveNetDevice : public WifiNetDevice
161
{
161
{
162
public:
162
public:
163
  /**
163
  /**
(-)a/src/wifi/doc/source/wifi-user.rst (-14 / +43 lines)
 Lines 151-164   Note that we haven't actually created any WifiPhy objects yet; we've just Link Here 
151
prepared the YansWifiPhyHelper by telling it which channel it is connected to.
151
prepared the YansWifiPhyHelper by telling it which channel it is connected to.
152
The Phy objects are created in the next step.
152
The Phy objects are created in the next step.
153
153
154
802.11n/ac PHY layer can use either either long (800 ns) or short (400 ns) OFDM guard intervals. To configure this parameter, the following line of code could be used (in this example, it enables the support of a short guard interval)::
155
156
 wifiPhyHelper.Set ("ShortGuardEnabled", BooleanValue(true));
157
158
802.11ax PHY layer can use either either 3200 ns, 1600 ns or 800 ns OFDM guard intervals. To configure this parameter, the following line of code could be used (in this example, it enables the support of 1600 ns guard interval)::
159
160
 wifiPhyHelper.Set ("GuardInterval", TimeValue(NanoSeconds (1600)));
161
162
In order to enable 802.11n/ac/ax MIMO, the number of antennas as well as the number of supported spatial streams need to be configured.
154
In order to enable 802.11n/ac/ax MIMO, the number of antennas as well as the number of supported spatial streams need to be configured.
163
For example, this code enables MIMO with 2 antennas and 2 spatial streams::
155
For example, this code enables MIMO with 2 antennas and 2 spatial streams::
164
156
 Lines 173-190   For example, this code configures a node with 3 antennas that supports 2 spatial Link Here 
173
 wifiPhyHelper.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
165
 wifiPhyHelper.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2));
174
 wifiPhyHelper.Set ("MaxSupportedRxSpatialStreams", UintegerValue (1));
166
 wifiPhyHelper.Set ("MaxSupportedRxSpatialStreams", UintegerValue (1));
175
167
176
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::
177
178
 wifiPhyHelper.Set ("GreenfieldEnabled",BooleanValue(true));
179
180
802.11n PHY layer can support both 20 (default) or 40 MHz channel width, and 802.11ac/ax PHY layer can use either 20, 40, 80 (default) or 160 MHz channel width.  See below for further documentation on setting the frequency, channel width, and channel number.
168
802.11n PHY layer can support both 20 (default) or 40 MHz channel width, and 802.11ac/ax PHY layer can use either 20, 40, 80 (default) or 160 MHz channel width.  See below for further documentation on setting the frequency, channel width, and channel number.
181
169
182
::
170
::
183
171
184
  WifiHelper wifi;
172
  WifiHelper wifi;
185
  wifi.SetStandard (WIFI_PHY_STANDARD_80211ac);
173
  wifi.SetStandard (WIFI_PHY_STANDARD_80211ac);
186
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", 
174
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
187
                                "DataMode", StringValue ("VhtMcs9"), 
175
                                "DataMode", StringValue ("VhtMcs9"),
188
                                "ControlMode", StringValue ("VhtMcs0"));
176
                                "ControlMode", StringValue ("VhtMcs0"));
189
177
190
  //Install PHY and MAC
178
  //Install PHY and MAC
 Lines 751-756   There are many |ns3| attributes that can be set on the above helpers to Link Here 
751
deviate from the default behavior; the example scripts show how to do some of
739
deviate from the default behavior; the example scripts show how to do some of
752
this reconfiguration.
740
this reconfiguration.
753
741
742
743
HT configuration
744
======================
745
746
Once the ``ns3::WifiHelper::Install`` has been called, a HT configuration object has been created for 802.11n/ac/ax devices.
747
The object is used to configure HT-specific attributes.
748
749
802.11n/ac PHY layer can use either either long (800 ns) or short (400 ns) OFDM guard intervals. To configure this parameter for a given device, the following lines of code could be used (in this example, it enables the support of a short guard interval for the first station)::
750
751
 Ptr<NetDevice> nd = wifiStaDevices.Get (0);
752
 Ptr<WifiNetDevice> wnd = nd->GetObject<WifiNetDevice> ();
753
 Ptr<HtConfiguration> htConfiguration = wnd->GetHtConfiguration ();
754
 htConfiguration->SetShortGuardIntervalSupported (true);
755
756
It is also possible to configure HT-specific attributes using ``Config::Set``.
757
The following line of code enables the support of a short guard interval for all stations:
758
759
 Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (true));
760
761
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::
762
763
 htConfiguration->SetGreenfieldSupported (true);
764
765
766
VHT configuration
767
======================
768
769
Once the ``ns3::WifiHelper::Install`` has been called, a HT configuration object has been created for 802.11n/ac devices.
770
The object is used to configure VHT-specific attributes.
771
772
HE configuration
773
======================
774
775
Once the ``ns3::WifiHelper::Install`` has been called, a HE configuration object has been created for 802.11ax devices.
776
The object is used to configure HE-specific attributes.
777
778
802.11ax PHY layer can use either either 3200 ns, 1600 ns or 800 ns OFDM guard intervals. To configure this parameter, the following line of code could be used (in this example, it enables the support of 1600 ns guard interval)::
779
780
 Ptr<HeConfiguration> heConfiguration = wnd->GetHeConfiguration ();
781
 heConfiguration->SetGuardInterval (NanoSeconds (1600));
782
754
Mobility configuration
783
Mobility configuration
755
======================
784
======================
756
785
(-)a/src/wifi/examples/wifi-manager-example.cc (-4 / +8 lines)
 Lines 54-59    Link Here 
54
#include "ns3/packet-socket-helper.h"
54
#include "ns3/packet-socket-helper.h"
55
#include "ns3/packet-socket-client.h"
55
#include "ns3/packet-socket-client.h"
56
#include "ns3/packet-socket-server.h"
56
#include "ns3/packet-socket-server.h"
57
#include "ns3/ht-configuration.h"
58
#include "ns3/he-configuration.h"
57
59
58
using namespace ns3;
60
using namespace ns3;
59
61
 Lines 420-436   int main (int argc, char *argv[]) Link Here 
420
      || serverSelectedStandard.m_name == "802.11ac")
422
      || serverSelectedStandard.m_name == "802.11ac")
421
    {
423
    {
422
      wifiPhyPtrServer->SetChannelWidth (serverSelectedStandard.m_width);
424
      wifiPhyPtrServer->SetChannelWidth (serverSelectedStandard.m_width);
423
      wifiPhyPtrServer->SetShortGuardInterval (serverShortGuardInterval == 400);
424
      wifiPhyPtrClient->SetChannelWidth (clientSelectedStandard.m_width);
425
      wifiPhyPtrClient->SetChannelWidth (clientSelectedStandard.m_width);
425
      wifiPhyPtrClient->SetShortGuardInterval (clientShortGuardInterval == 400);
426
      Ptr<HtConfiguration> clientHtConfiguration = wndClient->GetHtConfiguration ();
427
      clientHtConfiguration->SetShortGuardIntervalSupported (clientShortGuardInterval == 400);
428
      Ptr<HtConfiguration> serverHtConfiguration = wndServer->GetHtConfiguration ();
429
      serverHtConfiguration->SetShortGuardIntervalSupported (serverShortGuardInterval == 400);
426
    }
430
    }
427
  else if (serverSelectedStandard.m_name == "802.11ax-5GHz"
431
  else if (serverSelectedStandard.m_name == "802.11ax-5GHz"
428
           || serverSelectedStandard.m_name == "802.11ax-2.4GHz")
432
           || serverSelectedStandard.m_name == "802.11ax-2.4GHz")
429
    {
433
    {
430
      wifiPhyPtrServer->SetChannelWidth (serverSelectedStandard.m_width);
434
      wifiPhyPtrServer->SetChannelWidth (serverSelectedStandard.m_width);
431
      wifiPhyPtrServer->SetGuardInterval (NanoSeconds (serverShortGuardInterval));
432
      wifiPhyPtrClient->SetChannelWidth (clientSelectedStandard.m_width);
435
      wifiPhyPtrClient->SetChannelWidth (clientSelectedStandard.m_width);
433
      wifiPhyPtrClient->SetGuardInterval (NanoSeconds (clientShortGuardInterval));
436
      wndServer->GetHeConfiguration ()->SetGuardInterval (NanoSeconds (clientShortGuardInterval));
437
      wndClient->GetHeConfiguration ()->SetGuardInterval (NanoSeconds (clientShortGuardInterval));
434
    }
438
    }
435
  NS_LOG_DEBUG ("Channel width " << wifiPhyPtrClient->GetChannelWidth () << " noiseDbm " << noiseDbm);
439
  NS_LOG_DEBUG ("Channel width " << wifiPhyPtrClient->GetChannelWidth () << " noiseDbm " << noiseDbm);
436
  NS_LOG_DEBUG ("NSS " << wifiPhyPtrClient->GetMaxSupportedTxSpatialStreams ());
440
  NS_LOG_DEBUG ("NSS " << wifiPhyPtrClient->GetMaxSupportedTxSpatialStreams ());
(-)a/src/wifi/helper/wifi-helper.cc (-1 / +19 lines)
 Lines 34-39    Link Here 
34
#include "ns3/net-device-queue-interface.h"
34
#include "ns3/net-device-queue-interface.h"
35
#include "ns3/wifi-mac-queue.h"
35
#include "ns3/wifi-mac-queue.h"
36
#include "ns3/qos-utils.h"
36
#include "ns3/qos-utils.h"
37
#include "ns3/ht-configuration.h"
38
#include "ns3/vht-configuration.h"
39
#include "ns3/he-configuration.h"
37
#include "wifi-helper.h"
40
#include "wifi-helper.h"
38
41
39
namespace ns3 {
42
namespace ns3 {
 Lines 646-653   WifiHelper::Install (const WifiPhyHelper &phyHelper, Link Here 
646
    {
649
    {
647
      Ptr<Node> node = *i;
650
      Ptr<Node> node = *i;
648
      Ptr<WifiNetDevice> device = CreateObject<WifiNetDevice> ();
651
      Ptr<WifiNetDevice> device = CreateObject<WifiNetDevice> ();
652
      if (m_standard >= WIFI_PHY_STANDARD_80211n_2_4GHZ)
653
        {
654
          Ptr<HtConfiguration> htConfiguration = CreateObject<HtConfiguration> ();
655
          device->SetHtConfiguration (htConfiguration);
656
        }
657
      if ((m_standard == WIFI_PHY_STANDARD_80211ac) || (m_standard == WIFI_PHY_STANDARD_80211ax_5GHZ))
658
        {
659
          Ptr<VhtConfiguration> vhtConfiguration = CreateObject<VhtConfiguration> ();
660
          device->SetVhtConfiguration (vhtConfiguration);
661
        }
662
      if (m_standard >= WIFI_PHY_STANDARD_80211ax_2_4GHZ)
663
        {
664
          Ptr<HeConfiguration> heConfiguration = CreateObject<HeConfiguration> ();
665
          device->SetHeConfiguration (heConfiguration);
666
        }
649
      Ptr<WifiRemoteStationManager> manager = m_stationManager.Create<WifiRemoteStationManager> ();
667
      Ptr<WifiRemoteStationManager> manager = m_stationManager.Create<WifiRemoteStationManager> ();
650
      Ptr<WifiMac> mac = macHelper.Create ();
668
      Ptr<WifiMac> mac = macHelper.Create (device);
651
      Ptr<WifiPhy> phy = phyHelper.Create (node, device);
669
      Ptr<WifiPhy> phy = phyHelper.Create (node, device);
652
      mac->SetAddress (Mac48Address::Allocate ());
670
      mac->SetAddress (Mac48Address::Allocate ());
653
      mac->ConfigureStandard (m_standard);
671
      mac->ConfigureStandard (m_standard);
(-)a/src/wifi/helper/wifi-mac-helper.cc (-1 / +3 lines)
 Lines 18-23    Link Here 
18
 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
18
 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
19
 */
19
 */
20
20
21
#include "ns3/net-device.h"
21
#include "wifi-mac-helper.h"
22
#include "wifi-mac-helper.h"
22
#include "ns3/wifi-mac.h"
23
#include "ns3/wifi-mac.h"
23
#include "ns3/boolean.h"
24
#include "ns3/boolean.h"
 Lines 64-72   WifiMacHelper::SetType (std::string type, Link Here 
64
}
65
}
65
66
66
Ptr<WifiMac>
67
Ptr<WifiMac>
67
WifiMacHelper::Create (void) const
68
WifiMacHelper::Create (Ptr<NetDevice> device) const
68
{
69
{
69
  Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
70
  Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
71
  mac->SetDevice (device);
70
  return mac;
72
  return mac;
71
}
73
}
72
74
(-)a/src/wifi/helper/wifi-mac-helper.h (-1 / +2 lines)
 Lines 26-31    Link Here 
26
namespace ns3 {
26
namespace ns3 {
27
27
28
class WifiMac;
28
class WifiMac;
29
class NetDevice;
29
30
30
/**
31
/**
31
 * \brief create MAC layers for a ns3::WifiNetDevice.
32
 * \brief create MAC layers for a ns3::WifiNetDevice.
 Lines 103-109   public: Link Here 
103
   *
104
   *
104
   * This allows the ns3::WifiHelper class to create MAC objects from ns3::WifiHelper::Install.
105
   * This allows the ns3::WifiHelper class to create MAC objects from ns3::WifiHelper::Install.
105
   */
106
   */
106
  virtual Ptr<WifiMac> Create (void) const;
107
  virtual Ptr<WifiMac> Create (Ptr<NetDevice> device) const;
107
108
108
109
109
protected:
110
protected:
(-)a/src/wifi/model/aarf-wifi-manager.cc (-30 / +18 lines)
 Lines 100-105   AarfWifiManager::~AarfWifiManager () Link Here 
100
  NS_LOG_FUNCTION (this);
100
  NS_LOG_FUNCTION (this);
101
}
101
}
102
102
103
void
104
AarfWifiManager::DoInitialize ()
105
{
106
  NS_LOG_FUNCTION (this);
107
  if (GetHtSupported ())
108
    {
109
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
110
    }
111
  if (GetVhtSupported ())
112
    {
113
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
114
    }
115
  if (GetHeSupported ())
116
    {
117
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
118
    }
119
}
120
103
WifiRemoteStation *
121
WifiRemoteStation *
104
AarfWifiManager::DoCreateStation (void) const
122
AarfWifiManager::DoCreateStation (void) const
105
{
123
{
 Lines 285-318   AarfWifiManager::IsLowLatency (void) const Link Here 
285
  return true;
303
  return true;
286
}
304
}
287
305
288
void
289
AarfWifiManager::SetHtSupported (bool enable)
290
{
291
  //HT is not supported by this algorithm.
292
  if (enable)
293
    {
294
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
295
    }
296
}
297
298
void
299
AarfWifiManager::SetVhtSupported (bool enable)
300
{
301
  //VHT is not supported by this algorithm.
302
  if (enable)
303
    {
304
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
305
    }
306
}
307
308
void
309
AarfWifiManager::SetHeSupported (bool enable)
310
{
311
  //HE is not supported by this algorithm.
312
  if (enable)
313
    {
314
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
315
    }
316
}
317
318
} //namespace ns3
306
} //namespace ns3
(-)a/src/wifi/model/aarf-wifi-manager.h (-5 / +2 lines)
 Lines 50-62   public: Link Here 
50
  AarfWifiManager ();
50
  AarfWifiManager ();
51
  virtual ~AarfWifiManager ();
51
  virtual ~AarfWifiManager ();
52
52
53
  // Inherited from WifiRemoteStationManager
54
  void SetHtSupported (bool enable);
55
  void SetVhtSupported (bool enable);
56
  void SetHeSupported (bool enable);
57
53
58
private:
54
private:
59
  //overridden from base class
55
  // Overridden from base class.
56
  void DoInitialize (void);
60
  WifiRemoteStation * DoCreateStation (void) const;
57
  WifiRemoteStation * DoCreateStation (void) const;
61
  void DoReportRxOk (WifiRemoteStation *station,
58
  void DoReportRxOk (WifiRemoteStation *station,
62
                     double rxSnr, WifiMode txMode);
59
                     double rxSnr, WifiMode txMode);
(-)a/src/wifi/model/aarfcd-wifi-manager.cc (-30 / +18 lines)
 Lines 126-131   AarfcdWifiManager::~AarfcdWifiManager () Link Here 
126
  NS_LOG_FUNCTION (this);
126
  NS_LOG_FUNCTION (this);
127
}
127
}
128
128
129
void
130
AarfcdWifiManager::DoInitialize ()
131
{
132
  NS_LOG_FUNCTION (this);
133
  if (GetHtSupported ())
134
    {
135
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
136
    }
137
  if (GetVhtSupported ())
138
    {
139
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
140
    }
141
  if (GetHeSupported ())
142
    {
143
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
144
    }
145
}
146
129
WifiRemoteStation *
147
WifiRemoteStation *
130
AarfcdWifiManager::DoCreateStation (void) const
148
AarfcdWifiManager::DoCreateStation (void) const
131
{
149
{
 Lines 412-445   AarfcdWifiManager::ResetRtsWnd (AarfcdWifiRemoteStation *station) Link Here 
412
  station->m_rtsWnd = m_minRtsWnd;
430
  station->m_rtsWnd = m_minRtsWnd;
413
}
431
}
414
432
415
void
416
AarfcdWifiManager::SetHtSupported (bool enable)
417
{
418
  //HT is not supported by this algorithm.
419
  if (enable)
420
    {
421
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
422
    }
423
}
424
425
void
426
AarfcdWifiManager::SetVhtSupported (bool enable)
427
{
428
  //VHT is not supported by this algorithm.
429
  if (enable)
430
    {
431
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
432
    }
433
}
434
435
void
436
AarfcdWifiManager::SetHeSupported (bool enable)
437
{
438
  //HE is not supported by this algorithm.
439
  if (enable)
440
    {
441
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
442
    }
443
}
444
445
} //namespace ns3
433
} //namespace ns3
(-)a/src/wifi/model/aarfcd-wifi-manager.h (-5 / +2 lines)
 Lines 52-64   public: Link Here 
52
  AarfcdWifiManager ();
52
  AarfcdWifiManager ();
53
  virtual ~AarfcdWifiManager ();
53
  virtual ~AarfcdWifiManager ();
54
54
55
  // Inherited from WifiRemoteStationManager
56
  void SetHtSupported (bool enable);
57
  void SetVhtSupported (bool enable);
58
  void SetHeSupported (bool enable);
59
55
60
private:
56
private:
61
  // overridden from base class
57
  // Overridden from base class.
58
  void DoInitialize (void);
62
  WifiRemoteStation * DoCreateStation (void) const;
59
  WifiRemoteStation * DoCreateStation (void) const;
63
  void DoReportRxOk (WifiRemoteStation *station,
60
  void DoReportRxOk (WifiRemoteStation *station,
64
                     double rxSnr, WifiMode txMode);
61
                     double rxSnr, WifiMode txMode);
(-)a/src/wifi/model/amrr-wifi-manager.cc (-30 / +18 lines)
 Lines 103-108   AmrrWifiManager::~AmrrWifiManager () Link Here 
103
  NS_LOG_FUNCTION (this);
103
  NS_LOG_FUNCTION (this);
104
}
104
}
105
105
106
void
107
AmrrWifiManager::DoInitialize ()
108
{
109
  NS_LOG_FUNCTION (this);
110
  if (GetHtSupported ())
111
    {
112
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
113
    }
114
  if (GetVhtSupported ())
115
    {
116
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
117
    }
118
  if (GetHeSupported ())
119
    {
120
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
121
    }
122
}
123
106
WifiRemoteStation *
124
WifiRemoteStation *
107
AmrrWifiManager::DoCreateStation (void) const
125
AmrrWifiManager::DoCreateStation (void) const
108
{
126
{
 Lines 392-425   AmrrWifiManager::IsLowLatency (void) const Link Here 
392
  return true;
410
  return true;
393
}
411
}
394
412
395
void
396
AmrrWifiManager::SetHtSupported (bool enable)
397
{
398
  //HT is not supported by this algorithm.
399
  if (enable)
400
    {
401
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
402
    }
403
}
404
405
void
406
AmrrWifiManager::SetVhtSupported (bool enable)
407
{
408
  //VHT is not supported by this algorithm.
409
  if (enable)
410
    {
411
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
412
    }
413
}
414
415
void
416
AmrrWifiManager::SetHeSupported (bool enable)
417
{
418
  //HE is not supported by this algorithm.
419
  if (enable)
420
    {
421
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
422
    }
423
}
424
425
} //namespace ns3
413
} //namespace ns3
(-)a/src/wifi/model/amrr-wifi-manager.h (-6 / +2 lines)
 Lines 53-66   public: Link Here 
53
  AmrrWifiManager ();
53
  AmrrWifiManager ();
54
  virtual ~AmrrWifiManager ();
54
  virtual ~AmrrWifiManager ();
55
55
56
  // Inherited from WifiRemoteStationManager
57
  void SetHtSupported (bool enable);
58
  void SetVhtSupported (bool enable);
59
  void SetHeSupported (bool enable);
60
61
56
62
private:
57
private:
63
  //overridden from base class
58
  // Overridden from base class.
59
  void DoInitialize (void);
64
  WifiRemoteStation * DoCreateStation (void) const;
60
  WifiRemoteStation * DoCreateStation (void) const;
65
  void DoReportRxOk (WifiRemoteStation *station,
61
  void DoReportRxOk (WifiRemoteStation *station,
66
                     double rxSnr, WifiMode txMode);
62
                     double rxSnr, WifiMode txMode);
(-)a/src/wifi/model/ap-wifi-mac.cc (-3 / +9 lines)
 Lines 34-39    Link Here 
34
#include "msdu-aggregator.h"
34
#include "msdu-aggregator.h"
35
#include "amsdu-subframe-header.h"
35
#include "amsdu-subframe-header.h"
36
#include "wifi-phy.h"
36
#include "wifi-phy.h"
37
#include "wifi-net-device.h"
38
#include "ht-configuration.h"
37
39
38
namespace ns3 {
40
namespace ns3 {
39
41
 Lines 562-567   ApWifiMac::GetHtOperation (void) const Link Here 
562
  HtOperation operation;
564
  HtOperation operation;
563
  if (GetHtSupported ())
565
  if (GetHtSupported ())
564
    {
566
    {
567
      Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
568
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
565
      operation.SetHtSupported (1);
569
      operation.SetHtSupported (1);
566
      operation.SetPrimaryChannel (m_phy->GetChannelNumber ());
570
      operation.SetPrimaryChannel (m_phy->GetChannelNumber ());
567
      operation.SetRifsMode (GetRifsMode ());
571
      operation.SetRifsMode (GetRifsMode ());
 Lines 589-595   ApWifiMac::GetHtOperation (void) const Link Here 
589
            }
593
            }
590
          uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
594
          uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
591
          NS_ASSERT (nss > 0 && nss < 5);
595
          NS_ASSERT (nss > 0 && nss < 5);
592
          uint64_t dataRate = mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetShortGuardInterval () ? 400 : 800, nss);
596
          uint64_t dataRate = mcs.GetDataRate (m_phy->GetChannelWidth (), htConfiguration->GetShortGuardIntervalSupported () ? 400 : 800, nss);
593
          if (dataRate > maxSupportedRate)
597
          if (dataRate > maxSupportedRate)
594
            {
598
            {
595
              maxSupportedRate = dataRate;
599
              maxSupportedRate = dataRate;
 Lines 612-618   ApWifiMac::GetHtOperation (void) const Link Here 
612
                    }
616
                    }
613
                  uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
617
                  uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
614
                  NS_ASSERT (nss > 0 && nss < 5);
618
                  NS_ASSERT (nss > 0 && nss < 5);
615
                  uint64_t dataRate = mcs.GetDataRate (m_stationManager->GetChannelWidthSupported (i->second), m_stationManager->GetShortGuardInterval (i->second) ? 400 : 800, nss);
619
                  uint64_t dataRate = mcs.GetDataRate (m_stationManager->GetChannelWidthSupported (i->second), m_stationManager->GetShortGuardIntervalSupported (i->second) ? 400 : 800, nss);
616
                  if (dataRate > maxSupportedRateByHtSta)
620
                  if (dataRate > maxSupportedRateByHtSta)
617
                    {
621
                    {
618
                      maxSupportedRateByHtSta = dataRate;
622
                      maxSupportedRateByHtSta = dataRate;
 Lines 1584-1590   ApWifiMac::GetRifsMode (void) const Link Here 
1584
          rifsMode = true;
1588
          rifsMode = true;
1585
        }
1589
        }
1586
    }
1590
    }
1587
  if (GetRifsSupported () && rifsMode)
1591
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
1592
  Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
1593
  if (htConfiguration && htConfiguration->GetRifsSupported () && rifsMode)
1588
    {
1594
    {
1589
      m_stationManager->SetRifsPermitted (true);
1595
      m_stationManager->SetRifsPermitted (true);
1590
    }
1596
    }
(-)a/src/wifi/model/aparf-wifi-manager.cc (-30 / +18 lines)
 Lines 134-139   AparfWifiManager::SetupPhy (const Ptr<WifiPhy> phy) Link Here 
134
  WifiRemoteStationManager::SetupPhy (phy);
134
  WifiRemoteStationManager::SetupPhy (phy);
135
}
135
}
136
136
137
void
138
AparfWifiManager::DoInitialize ()
139
{
140
  NS_LOG_FUNCTION (this);
141
  if (GetHtSupported ())
142
    {
143
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
144
    }
145
  if (GetVhtSupported ())
146
    {
147
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
148
    }
149
  if (GetHeSupported ())
150
    {
151
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
152
    }
153
}
154
137
WifiRemoteStation *
155
WifiRemoteStation *
138
AparfWifiManager::DoCreateStation (void) const
156
AparfWifiManager::DoCreateStation (void) const
139
{
157
{
 Lines 380-413   AparfWifiManager::IsLowLatency (void) const Link Here 
380
  return true;
398
  return true;
381
}
399
}
382
400
383
void
384
AparfWifiManager::SetHtSupported (bool enable)
385
{
386
  //HT is not supported by this algorithm.
387
  if (enable)
388
    {
389
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
390
    }
391
}
392
393
void
394
AparfWifiManager::SetVhtSupported (bool enable)
395
{
396
  //VHT is not supported by this algorithm.
397
  if (enable)
398
    {
399
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
400
    }
401
}
402
403
void
404
AparfWifiManager::SetHeSupported (bool enable)
405
{
406
  //HE is not supported by this algorithm.
407
  if (enable)
408
    {
409
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
410
    }
411
}
412
413
} //namespace ns3
401
} //namespace ns3
(-)a/src/wifi/model/aparf-wifi-manager.h (-4 / +2 lines)
 Lines 55-63   public: Link Here 
55
55
56
  // Inherited from WifiRemoteStationManager
56
  // Inherited from WifiRemoteStationManager
57
  void SetupPhy (const Ptr<WifiPhy> phy);
57
  void SetupPhy (const Ptr<WifiPhy> phy);
58
  void SetHtSupported (bool enable);
59
  void SetVhtSupported (bool enable);
60
  void SetHeSupported (bool enable);
61
58
62
  /**
59
  /**
63
   * Enumeration of the possible states of the channel.
60
   * Enumeration of the possible states of the channel.
 Lines 71-77   public: Link Here 
71
68
72
69
73
private:
70
private:
74
  //overridden from base class
71
  // Overridden from base class.
72
  void DoInitialize (void);
75
  WifiRemoteStation * DoCreateStation (void) const;
73
  WifiRemoteStation * DoCreateStation (void) const;
76
  void DoReportRxOk (WifiRemoteStation *station,
74
  void DoReportRxOk (WifiRemoteStation *station,
77
                     double rxSnr, WifiMode txMode);
75
                     double rxSnr, WifiMode txMode);
(-)a/src/wifi/model/arf-wifi-manager.cc (-30 / +18 lines)
 Lines 84-89   ArfWifiManager::~ArfWifiManager () Link Here 
84
  NS_LOG_FUNCTION (this);
84
  NS_LOG_FUNCTION (this);
85
}
85
}
86
86
87
void
88
ArfWifiManager::DoInitialize ()
89
{
90
  NS_LOG_FUNCTION (this);
91
  if (GetHtSupported ())
92
    {
93
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
94
    }
95
  if (GetVhtSupported ())
96
    {
97
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
98
    }
99
  if (GetHeSupported ())
100
    {
101
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
102
    }
103
}
104
87
WifiRemoteStation *
105
WifiRemoteStation *
88
ArfWifiManager::DoCreateStation (void) const
106
ArfWifiManager::DoCreateStation (void) const
89
{
107
{
 Lines 262-295   ArfWifiManager::IsLowLatency (void) const Link Here 
262
  return true;
280
  return true;
263
}
281
}
264
282
265
void
266
ArfWifiManager::SetHtSupported (bool enable)
267
{
268
  //HT is not supported by this algorithm.
269
  if (enable)
270
    {
271
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
272
    }
273
}
274
275
void
276
ArfWifiManager::SetVhtSupported (bool enable)
277
{
278
  //VHT is not supported by this algorithm.
279
  if (enable)
280
    {
281
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
282
    }
283
}
284
285
void
286
ArfWifiManager::SetHeSupported (bool enable)
287
{
288
  //HE is not supported by this algorithm.
289
  if (enable)
290
    {
291
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
292
    }
293
}
294
295
} //namespace ns3
283
} //namespace ns3
(-)a/src/wifi/model/arf-wifi-manager.h (-6 / +2 lines)
 Lines 56-69   public: Link Here 
56
  ArfWifiManager ();
56
  ArfWifiManager ();
57
  virtual ~ArfWifiManager ();
57
  virtual ~ArfWifiManager ();
58
58
59
  // Inherited from WifiRemoteStationManager
60
  void SetHtSupported (bool enable);
61
  void SetVhtSupported (bool enable);
62
  void SetHeSupported (bool enable);
63
64
59
65
private:
60
private:
66
  //overridden from base class
61
  // Overridden from base class.
62
  void DoInitialize (void);
67
  WifiRemoteStation * DoCreateStation (void) const;
63
  WifiRemoteStation * DoCreateStation (void) const;
68
  void DoReportRxOk (WifiRemoteStation *station,
64
  void DoReportRxOk (WifiRemoteStation *station,
69
                     double rxSnr, WifiMode txMode);
65
                     double rxSnr, WifiMode txMode);
(-)a/src/wifi/model/block-ack-manager.cc (-1 / +1 lines)
 Lines 126-132   BlockAckManager::CreateAgreement (const MgtAddBaRequestHeader *reqHdr, Mac48Addr Link Here 
126
  agreement.SetWinEnd ((agreement.GetStartingSequence () + agreement.GetBufferSize () - 1) % 4096);
126
  agreement.SetWinEnd ((agreement.GetStartingSequence () + agreement.GetBufferSize () - 1) % 4096);
127
  agreement.SetTimeout (reqHdr->GetTimeout ());
127
  agreement.SetTimeout (reqHdr->GetTimeout ());
128
  agreement.SetAmsduSupport (reqHdr->IsAmsduSupported ());
128
  agreement.SetAmsduSupport (reqHdr->IsAmsduSupported ());
129
  agreement.SetHtSupported (m_stationManager->HasHtSupported ());
129
  agreement.SetHtSupported (m_stationManager->GetHtSupported ());
130
  if (reqHdr->IsImmediateBlockAck ())
130
  if (reqHdr->IsImmediateBlockAck ())
131
    {
131
    {
132
      agreement.SetImmediateBlockAck ();
132
      agreement.SetImmediateBlockAck ();
(-)a/src/wifi/model/cara-wifi-manager.cc (-30 / +18 lines)
 Lines 91-96   CaraWifiManager::~CaraWifiManager () Link Here 
91
  NS_LOG_FUNCTION (this);
91
  NS_LOG_FUNCTION (this);
92
}
92
}
93
93
94
void
95
CaraWifiManager::DoInitialize ()
96
{
97
  NS_LOG_FUNCTION (this);
98
  if (GetHtSupported ())
99
    {
100
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
101
    }
102
  if (GetVhtSupported ())
103
    {
104
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
105
    }
106
  if (GetHeSupported ())
107
    {
108
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
109
    }
110
}
111
94
WifiRemoteStation *
112
WifiRemoteStation *
95
CaraWifiManager::DoCreateStation (void) const
113
CaraWifiManager::DoCreateStation (void) const
96
{
114
{
 Lines 240-273   CaraWifiManager::IsLowLatency (void) const Link Here 
240
  return true;
258
  return true;
241
}
259
}
242
260
243
void
244
CaraWifiManager::SetHtSupported (bool enable)
245
{
246
  //HT is not supported by this algorithm.
247
  if (enable)
248
    {
249
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
250
    }
251
}
252
253
void
254
CaraWifiManager::SetVhtSupported (bool enable)
255
{
256
  //VHT is not supported by this algorithm.
257
  if (enable)
258
    {
259
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
260
    }
261
}
262
263
void
264
CaraWifiManager::SetHeSupported (bool enable)
265
{
266
  //HE is not supported by this algorithm.
267
  if (enable)
268
    {
269
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
270
    }
271
}
272
273
} //namespace ns3
261
} //namespace ns3
(-)a/src/wifi/model/cara-wifi-manager.h (-6 / +2 lines)
 Lines 52-65   public: Link Here 
52
  CaraWifiManager ();
52
  CaraWifiManager ();
53
  virtual ~CaraWifiManager ();
53
  virtual ~CaraWifiManager ();
54
54
55
  // Inherited from WifiRemoteStationManager
56
  void SetHtSupported (bool enable);
57
  void SetVhtSupported (bool enable);
58
  void SetHeSupported (bool enable);
59
60
55
61
private:
56
private:
62
  //overridden from base class
57
  // Overridden from base class.
58
  void DoInitialize (void);
63
  WifiRemoteStation * DoCreateStation (void) const;
59
  WifiRemoteStation * DoCreateStation (void) const;
64
  void DoReportRxOk (WifiRemoteStation *station,
60
  void DoReportRxOk (WifiRemoteStation *station,
65
                     double rxSnr, WifiMode txMode);
61
                     double rxSnr, WifiMode txMode);
(-)a/src/wifi/model/constant-rate-wifi-manager.cc (-2 / +2 lines)
 Lines 118-131   WifiTxVector 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, GetShortGuardInterval (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, 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, GetShortGuardInterval (st), NanoSeconds (GetGuardInterval (st))), 1, 1, 0, GetChannelWidthForTransmission (m_ctlMode, GetChannelWidth (st)), GetAggregation (st), false);
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);
129
}
129
}
130
130
131
bool
131
bool
(-)a/src/wifi/model/he-configuration.cc (+67 lines)
Line 0    Link Here 
1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2018 University of Washington
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
 */
19
20
#include "ns3/log.h"
21
#include "ns3/nstime.h"
22
#include "ns3/uinteger.h"
23
#include "he-configuration.h"
24
25
namespace ns3 {
26
27
NS_LOG_COMPONENT_DEFINE ("HeConfiguration");
28
NS_OBJECT_ENSURE_REGISTERED (HeConfiguration);
29
30
HeConfiguration::HeConfiguration ()
31
{
32
  NS_LOG_FUNCTION (this);
33
}
34
35
TypeId
36
HeConfiguration::GetTypeId (void)
37
{
38
  static ns3::TypeId tid = ns3::TypeId ("ns3::HeConfiguration")
39
    .SetParent<Object> ()
40
    .SetGroupName ("Wifi")
41
    .AddConstructor<HeConfiguration> ()
42
    .AddAttribute ("GuardInterval",
43
                   "Specify the shortest guard interval duration that can be used for HE transmissions."
44
                   "Possible values are 800ns, 1600ns or 3200ns.",
45
                   TimeValue (NanoSeconds (3200)),
46
                   MakeTimeAccessor (&HeConfiguration::GetGuardInterval,
47
                                     &HeConfiguration::SetGuardInterval),
48
                   MakeTimeChecker (NanoSeconds (800), NanoSeconds (3200)))
49
    ;
50
    return tid;
51
}
52
53
void
54
HeConfiguration::SetGuardInterval (Time guardInterval)
55
{
56
  NS_LOG_FUNCTION (this << guardInterval);
57
  NS_ASSERT (guardInterval == NanoSeconds (800) || guardInterval == NanoSeconds (1600) || guardInterval == NanoSeconds (3200));
58
  m_guardInterval = guardInterval;
59
}
60
61
Time
62
HeConfiguration::GetGuardInterval (void) const
63
{
64
  return m_guardInterval;
65
}
66
67
} //namespace ns3
(-)a/src/wifi/model/he-configuration.h (+57 lines)
Line 0    Link Here 
1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2018 University of Washington
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
 */
19
20
#ifndef HE_CONFIGURATION_H
21
#define HE_CONFIGURATION_H
22
23
#include "ns3/object.h"
24
25
namespace ns3 {
26
27
/**
28
 * \brief HE configuration
29
 * \ingroup wifi
30
 *
31
 * This object stores HE configuration information, for use in modifying
32
 * AP or STA behavior and for constructing HE-related information elements.
33
 *
34
 */
35
class HeConfiguration : public Object
36
{
37
public:
38
  HeConfiguration ();
39
  static TypeId GetTypeId (void);
40
41
  /**
42
   * \param guardInterval the supported HE guard interval
43
   */
44
  void SetGuardInterval (Time guardInterval);
45
  /**
46
   * \return the supported HE guard interval
47
   */
48
  Time GetGuardInterval (void) const;
49
50
51
private:
52
  Time m_guardInterval; //!< Supported HE guard interval
53
};
54
55
} //namespace ns3
56
57
#endif /* HE_CONFIGURATION_H */
(-)a/src/wifi/model/ht-configuration.cc (+109 lines)
Line 0    Link Here 
1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2018  Sébastien Deronne
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: Sébastien Deronne <sebastien.deronne@gmail.com>
19
 */
20
21
#include "ns3/log.h"
22
#include "ns3/boolean.h"
23
#include "ht-configuration.h"
24
25
namespace ns3 {
26
27
NS_LOG_COMPONENT_DEFINE ("HtConfiguration");
28
29
NS_OBJECT_ENSURE_REGISTERED (HtConfiguration);
30
31
HtConfiguration::HtConfiguration ()
32
{
33
  NS_LOG_FUNCTION (this);
34
}
35
36
HtConfiguration::~HtConfiguration ()
37
{
38
  NS_LOG_FUNCTION (this);
39
}
40
41
TypeId
42
HtConfiguration::GetTypeId (void)
43
{
44
  static ns3::TypeId tid = ns3::TypeId ("ns3::HtConfiguration")
45
    .SetParent<Object> ()
46
    .SetGroupName ("Wifi")
47
    .AddConstructor<HtConfiguration> ()
48
    .AddAttribute ("ShortGuardIntervalSupported",
49
                   "Whether or not short guard interval is supported.",
50
                   BooleanValue (false),
51
                   MakeBooleanAccessor (&HtConfiguration::GetShortGuardIntervalSupported,
52
                                        &HtConfiguration::SetShortGuardIntervalSupported),
53
                   MakeBooleanChecker ())
54
    .AddAttribute ("GreenfieldSupported",
55
                   "Whether or not Greenfield is supported.",
56
                   BooleanValue (false),
57
                   MakeBooleanAccessor (&HtConfiguration::GetGreenfieldSupported,
58
                                        &HtConfiguration::SetGreenfieldSupported),
59
                   MakeBooleanChecker ())
60
    .AddAttribute ("RifsSupported",
61
                   "Whether or not RIFS is supported.",
62
                   BooleanValue (false),
63
                   MakeBooleanAccessor (&HtConfiguration::SetRifsSupported,
64
                                        &HtConfiguration::GetRifsSupported),
65
                   MakeBooleanChecker ())
66
    ;
67
    return tid;
68
}
69
70
void
71
HtConfiguration::SetShortGuardIntervalSupported (bool enable)
72
{
73
  NS_LOG_FUNCTION (this << enable);
74
  m_sgiSupported = enable;
75
}
76
77
bool
78
HtConfiguration::GetShortGuardIntervalSupported (void) const
79
{
80
  return m_sgiSupported;
81
}
82
83
void
84
HtConfiguration::SetGreenfieldSupported (bool enable)
85
{
86
  NS_LOG_FUNCTION (this << enable);
87
  m_greenfieldSupported = enable;
88
}
89
90
bool
91
HtConfiguration::GetGreenfieldSupported (void) const
92
{
93
  return m_greenfieldSupported;
94
}
95
96
void
97
HtConfiguration::SetRifsSupported (bool enable)
98
{
99
  NS_LOG_FUNCTION (this << enable);
100
  m_rifsSupported = enable;
101
}
102
103
bool
104
HtConfiguration::GetRifsSupported (void) const
105
{
106
  return m_rifsSupported;
107
}
108
109
} //namespace ns3
(-)a/src/wifi/model/ht-configuration.h (+98 lines)
Line 0    Link Here 
1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2018  Sébastien Deronne
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: Sébastien Deronne <sebastien.deronne@gmail.com>
19
 */
20
21
#ifndef HT_CONFIGURATION_H
22
#define HT_CONFIGURATION_H
23
24
#include "ns3/object.h"
25
26
namespace ns3 {
27
28
/**
29
 * \brief HT configuration
30
 * \ingroup wifi
31
 *
32
 * This object stores HT configuration information, for use in modifying
33
 * AP or STA behavior and for constructing HT-related information elements.
34
 *
35
 */
36
class HtConfiguration : public Object
37
{
38
public:
39
  HtConfiguration ();
40
  virtual ~HtConfiguration ();
41
42
  static TypeId GetTypeId (void);
43
44
  /**
45
   * Enable or disable SGI support.
46
   *
47
   * \param enable true if SGI is to be supported,
48
   *               false otherwise
49
   */
50
  void SetShortGuardIntervalSupported (bool enable);
51
  /**
52
   * \return whether the device supports SGI.
53
   *
54
   * \return true if SGI is supported,
55
   *         false otherwise.
56
   */
57
  bool GetShortGuardIntervalSupported (void) const;
58
59
  /**
60
   * Enable or disable Greenfield support.
61
   *
62
   * \param enable true if Greenfield is to be supported,
63
   *               false otherwise
64
   */
65
  void SetGreenfieldSupported (bool enable);
66
  /**
67
   * \return whether the device supports Greenfield.
68
   *
69
   * \return true if Greenfield is supported,
70
   *         false otherwise.
71
   */
72
  bool GetGreenfieldSupported (void) const;
73
74
  /**
75
   * Enable or disable RIFS support.
76
   *
77
   * \param enable true if RIFS is to be supported,
78
   *               false otherwise
79
   */
80
  void SetRifsSupported (bool enable);
81
  /**
82
   * \return whether the device supports RIFS capability.
83
   *
84
   * \return true if short RIFS is supported,
85
   *         false otherwise.
86
   */
87
  bool GetRifsSupported (void) const;
88
89
90
private:
91
  bool m_sgiSupported; ///< flag whether short guard interval is supported
92
  bool m_rifsSupported; ///< flag whether RIFS is supported
93
  bool m_greenfieldSupported; ///< flag whether Greenfield is supported
94
};
95
96
} //namespace ns3
97
98
#endif /* HT_CONFIGURATION_H */
(-)a/src/wifi/model/ideal-wifi-manager.cc (-16 / +20 lines)
 Lines 118-124   IdealWifiManager::DoInitialize () Link Here 
118
      AddSnrThreshold (txVector, GetPhy ()->CalculateSnr (txVector, m_ber));
118
      AddSnrThreshold (txVector, GetPhy ()->CalculateSnr (txVector, m_ber));
119
    }
119
    }
120
  // Add all Ht and Vht MCSes
120
  // Add all Ht and Vht MCSes
121
  if (HasVhtSupported () == true || HasHtSupported () == true || HasHeSupported () == true)
121
  if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
122
    {
122
    {
123
      nModes = GetPhy ()->GetNMcs ();
123
      nModes = GetPhy ()->GetNMcs ();
124
      for (uint8_t i = 0; i < nModes; i++)
124
      for (uint8_t i = 0; i < nModes; i++)
 Lines 129-135   IdealWifiManager::DoInitialize () Link Here 
129
              mode = GetPhy ()->GetMcs (i);
129
              mode = GetPhy ()->GetMcs (i);
130
              if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
130
              if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
131
                {
131
                {
132
                  uint16_t guardInterval = GetPhy ()->GetShortGuardInterval () ? 400 : 800;
132
                  uint16_t guardInterval = GetShortGuardIntervalSupported () ? 400 : 800;
133
                  txVector.SetGuardInterval (guardInterval);
133
                  txVector.SetGuardInterval (guardInterval);
134
                  //derive NSS from the MCS index
134
                  //derive NSS from the MCS index
135
                  nss = (mode.GetMcsValue () / 8) + 1;
135
                  nss = (mode.GetMcsValue () / 8) + 1;
 Lines 147-157   IdealWifiManager::DoInitialize () Link Here 
147
                  uint16_t guardInterval;
147
                  uint16_t guardInterval;
148
                  if (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
148
                  if (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
149
                    {
149
                    {
150
                      guardInterval = GetPhy ()->GetShortGuardInterval () ? 400 : 800;
150
                      guardInterval = GetShortGuardIntervalSupported () ? 400 : 800;
151
                    }
151
                    }
152
                  else
152
                  else
153
                    {
153
                    {
154
                      guardInterval = static_cast<uint16_t> (GetPhy ()->GetGuardInterval ().GetNanoSeconds ());
154
                      guardInterval = GetGuardInterval ();
155
                    }
155
                    }
156
                  txVector.SetGuardInterval (guardInterval);
156
                  txVector.SetGuardInterval (guardInterval);
157
                  for (uint8_t k = 1; k <= GetPhy ()->GetMaxSupportedTxSpatialStreams (); k++)
157
                  for (uint8_t k = 1; k <= GetPhy ()->GetMaxSupportedTxSpatialStreams (); k++)
 Lines 316-323   IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st) Link Here 
316
    }
316
    }
317
  else
317
  else
318
    {
318
    {
319
      if ((HasVhtSupported () == true || HasHtSupported () == true || HasHeSupported () == true)
319
      if ((GetHtSupported () || GetVhtSupported () || GetHeSupported ())
320
          && (GetHtSupported (st) == true || GetVhtSupported (st) == true || GetHeSupported (st) == true))
320
          && (GetHtSupported (st) || GetVhtSupported (st) || GetHeSupported (st)))
321
        {
321
        {
322
          for (uint8_t i = 0; i < GetNMcsSupported (station); i++)
322
          for (uint8_t i = 0; i < GetNMcsSupported (station); i++)
323
            {
323
            {
 Lines 325-339   IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st) Link Here 
325
              txVector.SetMode (mode);
325
              txVector.SetMode (mode);
326
              if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
326
              if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
327
                {
327
                {
328
                  guardInterval = static_cast<uint16_t> (std::max (GetShortGuardInterval (station) ? 400 : 800, GetPhy ()->GetShortGuardInterval () ? 400 : 800));
328
                  guardInterval = static_cast<uint16_t> (std::max (GetShortGuardIntervalSupported (station) ? 400 : 800, GetShortGuardIntervalSupported () ? 400 : 800));
329
                  txVector.SetGuardInterval (guardInterval);
329
                  txVector.SetGuardInterval (guardInterval);
330
                  // If the node and peer are both VHT capable, only search VHT modes
330
                  // If the node and peer are both VHT capable, only search VHT modes
331
                  if (HasVhtSupported () && GetVhtSupported (station))
331
                  if (GetVhtSupported () && GetVhtSupported (station))
332
                    {
332
                    {
333
                      continue;
333
                      continue;
334
                    }
334
                    }
335
                  // If the node and peer are both HE capable, only search HE modes
335
                  // If the node and peer are both HE capable, only search HE modes
336
                  if (HasHeSupported () && GetHeSupported (station))
336
                  if (GetHeSupported () && GetHeSupported (station))
337
                    {
337
                    {
338
                      continue;
338
                      continue;
339
                    }
339
                    }
 Lines 369-383   IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st) Link Here 
369
                }
369
                }
370
              else if (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
370
              else if (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
371
                {
371
                {
372
                  guardInterval = static_cast<uint16_t> (std::max (GetShortGuardInterval (station) ? 400 : 800, GetPhy ()->GetShortGuardInterval () ? 400 : 800));
372
                  guardInterval = static_cast<uint16_t> (std::max (GetShortGuardIntervalSupported (station) ? 400 : 800, GetShortGuardIntervalSupported () ? 400 : 800));
373
                  txVector.SetGuardInterval (guardInterval);
373
                  txVector.SetGuardInterval (guardInterval);
374
                  // If the node and peer are both HE capable, only search HE modes
374
                  // If the node and peer are both HE capable, only search HE modes
375
                  if (HasHeSupported () && GetHeSupported (station))
375
                  if (GetHeSupported () && GetHeSupported (station))
376
                    {
376
                    {
377
                      continue;
377
                      continue;
378
                    }
378
                    }
379
                  // If the node and peer are not both VHT capable, only search HT modes
379
                  // If the node and peer are not both VHT capable, only search HT modes
380
                  if (!HasVhtSupported () || !GetVhtSupported (station))
380
                  if (!GetVhtSupported () || !GetVhtSupported (station))
381
                    {
381
                    {
382
                      continue;
382
                      continue;
383
                    }
383
                    }
 Lines 413-422   IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st) Link Here 
413
                }
413
                }
414
              else //HE
414
              else //HE
415
                {
415
                {
416
                  guardInterval = std::max (GetGuardInterval (station), static_cast<uint16_t> (GetPhy ()->GetGuardInterval ().GetNanoSeconds ()));
416
                  guardInterval = std::max (GetGuardInterval (station), GetGuardInterval ());
417
                  txVector.SetGuardInterval (guardInterval);
417
                  txVector.SetGuardInterval (guardInterval);
418
                  // If the node and peer are not both HE capable, only search (V)HT modes
418
                  // If the node and peer are not both HE capable, only search (V)HT modes
419
                  if (!HasHeSupported () || !GetHeSupported (station))
419
                  if (!GetHeSupported () || !GetHeSupported (station))
420
                    {
420
                    {
421
                      continue;
421
                      continue;
422
                    }
422
                    }
 Lines 488-498   IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st) Link Here 
488
  NS_LOG_DEBUG ("Found maxMode: " << maxMode << " channelWidth: " << channelWidth);
488
  NS_LOG_DEBUG ("Found maxMode: " << maxMode << " channelWidth: " << channelWidth);
489
  if (maxMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
489
  if (maxMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
490
    {
490
    {
491
      guardInterval = std::max (GetGuardInterval (station), static_cast<uint16_t> (GetPhy ()->GetGuardInterval ().GetNanoSeconds ()));
491
      guardInterval = std::max (GetGuardInterval (station), GetGuardInterval ());
492
    }
493
  else if ((maxMode.GetModulationClass () == WIFI_MOD_CLASS_HT) || (maxMode.GetModulationClass () == WIFI_MOD_CLASS_VHT))
494
    {
495
      guardInterval = static_cast<uint16_t> (std::max (GetShortGuardIntervalSupported (station) ? 400 : 800, GetShortGuardIntervalSupported () ? 400 : 800));
492
    }
496
    }
493
  else
497
  else
494
    {
498
    {
495
      guardInterval = static_cast<uint16_t> (std::max (GetShortGuardInterval (station) ? 400 : 800, GetPhy ()->GetShortGuardInterval () ? 400 : 800));
499
      guardInterval = 800;
496
    }
500
    }
497
  if (m_currentRate != maxMode.GetDataRate (channelWidth, guardInterval, selectedNss))
501
  if (m_currentRate != maxMode.GetDataRate (channelWidth, guardInterval, selectedNss))
498
    {
502
    {
(-)a/src/wifi/model/mac-low.cc (-12 / +12 lines)
 Lines 1356-1366   MacLow::ForwardDown (Ptr<const Packet> packet, const WifiMacHeader* hdr, WifiTxV Link Here 
1356
                ", seq=0x" << std::hex << m_currentHdr.GetSequenceControl () << std::dec);
1356
                ", seq=0x" << std::hex << m_currentHdr.GetSequenceControl () << std::dec);
1357
  if (!m_ampdu || hdr->IsAck () || hdr->IsRts () || hdr->IsCts () || hdr->IsBlockAck () || hdr->IsMgt ())
1357
  if (!m_ampdu || hdr->IsAck () || hdr->IsRts () || hdr->IsCts () || hdr->IsBlockAck () || hdr->IsMgt ())
1358
    {
1358
    {
1359
      if (hdr->IsCfPoll () && m_stationManager->HasPcfSupported ())
1359
      if (hdr->IsCfPoll () && m_stationManager->GetPcfSupported ())
1360
        {
1360
        {
1361
          Simulator::Schedule (GetPifs () + m_phy->CalculateTxDuration (packet->GetSize (), txVector, m_phy->GetFrequency ()), &MacLow::CfPollTimeout, this);
1361
          Simulator::Schedule (GetPifs () + m_phy->CalculateTxDuration (packet->GetSize (), txVector, m_phy->GetFrequency ()), &MacLow::CfPollTimeout, this);
1362
        }
1362
        }
1363
      if (hdr->IsBeacon () && m_stationManager->HasPcfSupported ())
1363
      if (hdr->IsBeacon () && m_stationManager->GetPcfSupported ())
1364
        {
1364
        {
1365
          if (Simulator::Now () > m_lastBeacon + m_beaconInterval)
1365
          if (Simulator::Now () > m_lastBeacon + m_beaconInterval)
1366
            {
1366
            {
 Lines 1368-1374   MacLow::ForwardDown (Ptr<const Packet> packet, const WifiMacHeader* hdr, WifiTxV Link Here 
1368
            }
1368
            }
1369
          m_lastBeacon = Simulator::Now ();
1369
          m_lastBeacon = Simulator::Now ();
1370
        }
1370
        }
1371
      else if (hdr->IsCfEnd () && m_stationManager->HasPcfSupported ())
1371
      else if (hdr->IsCfEnd () && m_stationManager->GetPcfSupported ())
1372
        {
1372
        {
1373
          m_cfpStart = NanoSeconds (0);
1373
          m_cfpStart = NanoSeconds (0);
1374
          m_cfpForeshortening = NanoSeconds (0);
1374
          m_cfpForeshortening = NanoSeconds (0);
 Lines 1989-1995   void Link Here 
1989
MacLow::EndTxNoAck (void)
1989
MacLow::EndTxNoAck (void)
1990
{
1990
{
1991
  NS_LOG_FUNCTION (this);
1991
  NS_LOG_FUNCTION (this);
1992
  if (m_currentHdr.IsBeacon () && m_stationManager->HasPcfSupported ())
1992
  if (m_currentHdr.IsBeacon () && m_stationManager->GetPcfSupported ())
1993
    {
1993
    {
1994
      m_cfpStart = Simulator::Now ();
1994
      m_cfpStart = Simulator::Now ();
1995
    }
1995
    }
 Lines 2039-2047   MacLow::SendAckAfterData (Mac48Address source, Time duration, WifiMode dataTxMod Link Here 
2039
bool
2039
bool
2040
MacLow::ReceiveMpdu (Ptr<Packet> packet, WifiMacHeader hdr)
2040
MacLow::ReceiveMpdu (Ptr<Packet> packet, WifiMacHeader hdr)
2041
{
2041
{
2042
  if (m_stationManager->HasHtSupported ()
2042
  if (m_stationManager->GetHtSupported ()
2043
      || m_stationManager->HasVhtSupported ()
2043
      || m_stationManager->GetVhtSupported ()
2044
      || m_stationManager->HasHeSupported ())
2044
      || m_stationManager->GetHeSupported ())
2045
    {
2045
    {
2046
      Mac48Address originator = hdr.GetAddr2 ();
2046
      Mac48Address originator = hdr.GetAddr2 ();
2047
      uint8_t tid = 0;
2047
      uint8_t tid = 0;
 Lines 2380-2388   MacLow::SendBlockAckAfterBlockAckRequest (const CtrlBAckRequestHeader reqHdr, Ma Link Here 
2380
          (*i).second.FillBlockAckBitmap (&blockAck);
2380
          (*i).second.FillBlockAckBitmap (&blockAck);
2381
          NS_LOG_DEBUG ("Got block Ack Req with seq " << reqHdr.GetStartingSequence ());
2381
          NS_LOG_DEBUG ("Got block Ack Req with seq " << reqHdr.GetStartingSequence ());
2382
2382
2383
          if (!m_stationManager->HasHtSupported ()
2383
          if (!m_stationManager->GetHtSupported ()
2384
              && !m_stationManager->HasVhtSupported ()
2384
              && !m_stationManager->GetVhtSupported ()
2385
              && !m_stationManager->HasHeSupported ())
2385
              && !m_stationManager->GetHeSupported ())
2386
            {
2386
            {
2387
              /* All packets with smaller sequence than starting sequence control must be passed up to Wifimac
2387
              /* All packets with smaller sequence than starting sequence control must be passed up to Wifimac
2388
               * See 9.10.3 in IEEE 802.11e standard.
2388
               * See 9.10.3 in IEEE 802.11e standard.
 Lines 2539-2545   MacLow::StopMpduAggregation (Ptr<const Packet> peekedPacket, WifiMacHeader peeke Link Here 
2539
  AcIndex ac = QosUtilsMapTidToAc (tid);
2539
  AcIndex ac = QosUtilsMapTidToAc (tid);
2540
  std::map<AcIndex, Ptr<QosTxop> >::const_iterator edcaIt = m_edca.find (ac);
2540
  std::map<AcIndex, Ptr<QosTxop> >::const_iterator edcaIt = m_edca.find (ac);
2541
2541
2542
  if (m_phy->GetGreenfield ())
2542
  if (m_stationManager->GetGreenfieldSupported ())
2543
    {
2543
    {
2544
      aPPDUMaxTime = MicroSeconds (10000);
2544
      aPPDUMaxTime = MicroSeconds (10000);
2545
    }
2545
    }
 Lines 2966-2972   MacLow::GetRemainingCfpDuration (void) const Link Here 
2966
bool
2966
bool
2967
MacLow::IsCfPeriod (void) const
2967
MacLow::IsCfPeriod (void) const
2968
{
2968
{
2969
  return (m_stationManager->HasPcfSupported () && m_cfpStart.IsStrictlyPositive ());
2969
  return (m_stationManager->GetPcfSupported () && m_cfpStart.IsStrictlyPositive ());
2970
}
2970
}
2971
2971
2972
bool
2972
bool
(-)a/src/wifi/model/minstrel-ht-wifi-manager.cc (-36 / +26 lines)
 Lines 139-151   MinstrelHtWifiManager::MinstrelHtWifiManager () Link Here 
139
MinstrelHtWifiManager::~MinstrelHtWifiManager ()
139
MinstrelHtWifiManager::~MinstrelHtWifiManager ()
140
{
140
{
141
  NS_LOG_FUNCTION (this);
141
  NS_LOG_FUNCTION (this);
142
  if (HasHtSupported ())
142
  for (uint8_t i = 0; i < m_numGroups; i++)
143
    {
143
    {
144
      for (uint8_t i = 0; i < m_numGroups; i++)
144
      m_minstrelGroups[i].ratesFirstMpduTxTimeTable.clear ();
145
        {
145
      m_minstrelGroups[i].ratesTxTimeTable.clear ();
146
          m_minstrelGroups[i].ratesFirstMpduTxTimeTable.clear ();
147
          m_minstrelGroups[i].ratesTxTimeTable.clear ();
148
        }
149
    }
146
    }
150
}
147
}
151
148
 Lines 170-179   MinstrelHtWifiManager::SetupPhy (const Ptr<WifiPhy> phy) Link Here 
170
}
167
}
171
168
172
void
169
void
170
MinstrelHtWifiManager::SetupMac (const Ptr<WifiMac> mac)
171
{
172
  NS_LOG_FUNCTION (this << mac);
173
  m_legacyManager->SetupMac (mac);
174
  WifiRemoteStationManager::SetupMac (mac);
175
}
176
177
void
173
MinstrelHtWifiManager::DoInitialize ()
178
MinstrelHtWifiManager::DoInitialize ()
174
{
179
{
175
  NS_LOG_FUNCTION (this);
180
  NS_LOG_FUNCTION (this);
176
181
  if (GetHeSupported ())
182
    {
183
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
184
    }
177
  /**
185
  /**
178
   * Here we initialize m_minstrelGroups with all the possible groups.
186
   * Here we initialize m_minstrelGroups with all the possible groups.
179
   * If a group is not supported by the device, then it is marked as not supported.
187
   * If a group is not supported by the device, then it is marked as not supported.
 Lines 181-192   MinstrelHtWifiManager::DoInitialize () Link Here 
181
   */
189
   */
182
190
183
  // Check if the device supports HT or VHT
191
  // Check if the device supports HT or VHT
184
  if (HasHtSupported () || HasVhtSupported ())
192
  if (GetHtSupported () || GetVhtSupported ())
185
    {
193
    {
186
      m_numGroups = MAX_SUPPORTED_STREAMS * MAX_HT_STREAM_GROUPS;
194
      m_numGroups = MAX_SUPPORTED_STREAMS * MAX_HT_STREAM_GROUPS;
187
      m_numRates = MAX_HT_GROUP_RATES;
195
      m_numRates = MAX_HT_GROUP_RATES;
188
196
189
      if (HasVhtSupported ())
197
      if (GetVhtSupported ())
190
        {
198
        {
191
          m_numGroups += MAX_SUPPORTED_STREAMS * MAX_VHT_STREAM_GROUPS;
199
          m_numGroups += MAX_SUPPORTED_STREAMS * MAX_VHT_STREAM_GROUPS;
192
          m_numRates = MAX_VHT_GROUP_RATES;
200
          m_numRates = MAX_VHT_GROUP_RATES;
 Lines 221-227   MinstrelHtWifiManager::DoInitialize () Link Here 
221
                  m_minstrelGroups[groupId].isSupported = false;
229
                  m_minstrelGroups[groupId].isSupported = false;
222
230
223
                  // Check capabilities of the device
231
                  // Check capabilities of the device
224
                  if (!(!GetPhy ()->GetShortGuardInterval () && m_minstrelGroups[groupId].sgi)                   ///Is SGI supported by the transmitter?
232
                  if (!(!GetShortGuardIntervalSupported () && m_minstrelGroups[groupId].sgi)                   ///Is SGI supported by the transmitter?
225
                      && (GetPhy ()->GetChannelWidth () >= m_minstrelGroups[groupId].chWidth)               ///Is channel width supported by the transmitter?
233
                      && (GetPhy ()->GetChannelWidth () >= m_minstrelGroups[groupId].chWidth)               ///Is channel width supported by the transmitter?
226
                      && (GetPhy ()->GetMaxSupportedTxSpatialStreams () >= m_minstrelGroups[groupId].streams))  ///Are streams supported by the transmitter?
234
                      && (GetPhy ()->GetMaxSupportedTxSpatialStreams () >= m_minstrelGroups[groupId].streams))  ///Are streams supported by the transmitter?
227
                    {
235
                    {
 Lines 242-248   MinstrelHtWifiManager::DoInitialize () Link Here 
242
            }
250
            }
243
        }
251
        }
244
252
245
      if (HasVhtSupported ())
253
      if (GetVhtSupported ())
246
        {
254
        {
247
          // Initialize all VHT groups
255
          // Initialize all VHT groups
248
          for (uint16_t chWidth = 20; chWidth <= MAX_VHT_WIDTH; chWidth *= 2)
256
          for (uint16_t chWidth = 20; chWidth <= MAX_VHT_WIDTH; chWidth *= 2)
 Lines 260-266   MinstrelHtWifiManager::DoInitialize () Link Here 
260
                      m_minstrelGroups[groupId].isSupported = false;
268
                      m_minstrelGroups[groupId].isSupported = false;
261
269
262
                      // Check capabilities of the device
270
                      // Check capabilities of the device
263
                      if (!(!GetPhy ()->GetShortGuardInterval () && m_minstrelGroups[groupId].sgi)                   ///Is SGI supported by the transmitter?
271
                      if (!(!GetShortGuardIntervalSupported () && m_minstrelGroups[groupId].sgi)                   ///Is SGI supported by the transmitter?
264
                          && (GetPhy ()->GetChannelWidth () >= m_minstrelGroups[groupId].chWidth)               ///Is channel width supported by the transmitter?
272
                          && (GetPhy ()->GetChannelWidth () >= m_minstrelGroups[groupId].chWidth)               ///Is channel width supported by the transmitter?
265
                          && (GetPhy ()->GetMaxSupportedTxSpatialStreams () >= m_minstrelGroups[groupId].streams))  ///Are streams supported by the transmitter?
273
                          && (GetPhy ()->GetMaxSupportedTxSpatialStreams () >= m_minstrelGroups[groupId].streams))  ///Are streams supported by the transmitter?
266
                        {
274
                        {
 Lines 287-300   MinstrelHtWifiManager::DoInitialize () Link Here 
287
    }
295
    }
288
}
296
}
289
297
290
void
291
MinstrelHtWifiManager::SetupMac (const Ptr<WifiMac> mac)
292
{
293
  NS_LOG_FUNCTION (this << mac);
294
  m_legacyManager->SetupMac (mac);
295
  WifiRemoteStationManager::SetupMac (mac);
296
}
297
298
bool
298
bool
299
MinstrelHtWifiManager::IsValidMcs (Ptr<WifiPhy> phy, uint8_t streams, uint16_t chWidth, WifiMode mode)
299
MinstrelHtWifiManager::IsValidMcs (Ptr<WifiPhy> phy, uint8_t streams, uint16_t chWidth, WifiMode mode)
300
{
300
{
 Lines 315-321   MinstrelHtWifiManager::CalculateFirstMpduTxDuration (Ptr<WifiPhy> phy, uint8_t s Link Here 
315
  txvector.SetGuardInterval (sgi ? 400 : 800);
315
  txvector.SetGuardInterval (sgi ? 400 : 800);
316
  txvector.SetChannelWidth (chWidth);
316
  txvector.SetChannelWidth (chWidth);
317
  txvector.SetNess (0);
317
  txvector.SetNess (0);
318
  txvector.SetStbc (phy->GetStbc ());
318
  txvector.SetStbc (0);
319
  txvector.SetMode (mode);
319
  txvector.SetMode (mode);
320
  txvector.SetPreambleType (WIFI_PREAMBLE_HT_MF);
320
  txvector.SetPreambleType (WIFI_PREAMBLE_HT_MF);
321
  return phy->CalculateTxDuration (m_frameLength, txvector, phy->GetFrequency (), MPDU_IN_AGGREGATE, 0);
321
  return phy->CalculateTxDuration (m_frameLength, txvector, phy->GetFrequency (), MPDU_IN_AGGREGATE, 0);
 Lines 330-336   MinstrelHtWifiManager::CalculateMpduTxDuration (Ptr<WifiPhy> phy, uint8_t stream Link Here 
330
  txvector.SetGuardInterval (sgi ? 400 : 800);
330
  txvector.SetGuardInterval (sgi ? 400 : 800);
331
  txvector.SetChannelWidth (chWidth);
331
  txvector.SetChannelWidth (chWidth);
332
  txvector.SetNess (0);
332
  txvector.SetNess (0);
333
  txvector.SetStbc (phy->GetStbc ());
333
  txvector.SetStbc (0);
334
  txvector.SetMode (mode);
334
  txvector.SetMode (mode);
335
  txvector.SetPreambleType (WIFI_PREAMBLE_NONE);
335
  txvector.SetPreambleType (WIFI_PREAMBLE_NONE);
336
  return phy->CalculateTxDuration (m_frameLength, txvector, phy->GetFrequency (), MPDU_IN_AGGREGATE, 0);
336
  return phy->CalculateTxDuration (m_frameLength, txvector, phy->GetFrequency (), MPDU_IN_AGGREGATE, 0);
 Lines 404-410   MinstrelHtWifiManager::DoCreateStation (void) const Link Here 
404
  station->m_ampduPacketCount = 0;
404
  station->m_ampduPacketCount = 0;
405
405
406
  // If the device supports HT
406
  // If the device supports HT
407
  if (HasHtSupported () || HasVhtSupported ())
407
  if (GetHtSupported () || GetVhtSupported ())
408
    {
408
    {
409
      /**
409
      /**
410
       * Assume the station is HT.
410
       * Assume the station is HT.
 Lines 860-871   MinstrelHtWifiManager::DoGetDataTxVector (WifiRemoteStation *st) Link Here 
860
      McsGroup group = m_minstrelGroups[groupId];
860
      McsGroup group = m_minstrelGroups[groupId];
861
861
862
      // Check consistency of rate selected.
862
      // Check consistency of rate selected.
863
      if ((group.sgi && !GetShortGuardInterval (station)) || group.chWidth > GetChannelWidth (station)  ||  group.streams > GetNumberOfSupportedStreams (station))
863
      if ((group.sgi && !GetShortGuardIntervalSupported (station)) || group.chWidth > GetChannelWidth (station)  ||  group.streams > GetNumberOfSupportedStreams (station))
864
        {
864
        {
865
          NS_FATAL_ERROR ("Inconsistent group selected. Group: (" << +group.streams <<
865
          NS_FATAL_ERROR ("Inconsistent group selected. Group: (" << +group.streams <<
866
                         "," << +group.sgi << "," << group.chWidth << ")" <<
866
                         "," << +group.sgi << "," << group.chWidth << ")" <<
867
                         " Station capabilities: (" << GetNumberOfSupportedStreams (station) <<
867
                         " Station capabilities: (" << GetNumberOfSupportedStreams (station) <<
868
                         "," << GetShortGuardInterval (station) << "," << GetChannelWidth (station) << ")");
868
                         "," << GetShortGuardIntervalSupported (station) << "," << GetChannelWidth (station) << ")");
869
        }
869
        }
870
      WifiMode mode = GetMcsSupported (station, mcsIndex);
870
      WifiMode mode = GetMcsSupported (station, mcsIndex);
871
      uint64_t dataRate = mode.GetDataRate (group.chWidth, group.sgi ? 400 : 800, group.streams);
871
      uint64_t dataRate = mode.GetDataRate (group.chWidth, group.sgi ? 400 : 800, group.streams);
 Lines 1453-1459   MinstrelHtWifiManager::RateInit (MinstrelHtWifiRemoteStation *station) Link Here 
1453
          station->m_groupsTable[groupId].m_supported = false;
1453
          station->m_groupsTable[groupId].m_supported = false;
1454
          if (!(!GetVhtSupported (station) && m_minstrelGroups[groupId].isVht)                    ///Is VHT supported by the receiver?
1454
          if (!(!GetVhtSupported (station) && m_minstrelGroups[groupId].isVht)                    ///Is VHT supported by the receiver?
1455
              && (m_minstrelGroups[groupId].isVht || !GetVhtSupported (station) || !m_useVhtOnly) ///If it is an HT MCS, check if VHT only is disabled
1455
              && (m_minstrelGroups[groupId].isVht || !GetVhtSupported (station) || !m_useVhtOnly) ///If it is an HT MCS, check if VHT only is disabled
1456
              && !(!GetShortGuardInterval (station) && m_minstrelGroups[groupId].sgi)             ///Is SGI supported by the receiver?
1456
              && !(!GetShortGuardIntervalSupported (station) && m_minstrelGroups[groupId].sgi)             ///Is SGI supported by the receiver?
1457
              && (GetChannelWidth (station) >= m_minstrelGroups[groupId].chWidth)                 ///Is channel width supported by the receiver?
1457
              && (GetChannelWidth (station) >= m_minstrelGroups[groupId].chWidth)                 ///Is channel width supported by the receiver?
1458
              && (GetNumberOfSupportedStreams (station) >= m_minstrelGroups[groupId].streams))    ///Are streams supported by the receiver?
1458
              && (GetNumberOfSupportedStreams (station) >= m_minstrelGroups[groupId].streams))    ///Are streams supported by the receiver?
1459
            {
1459
            {
 Lines 1829-1842   MinstrelHtWifiManager::GetHtDeviceMcsList (void) const Link Here 
1829
  return htMcsList;
1829
  return htMcsList;
1830
}
1830
}
1831
1831
1832
void
1833
MinstrelHtWifiManager::SetHeSupported (bool enable)
1834
{
1835
  //HE is not supported yet by this algorithm.
1836
  if (enable)
1837
    {
1838
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
1839
    }
1840
}
1841
1842
} // namespace ns3
1832
} // namespace ns3
(-)a/src/wifi/model/minstrel-ht-wifi-manager.h (-1 lines)
 Lines 204-210   public: Link Here 
204
  // Inherited from WifiRemoteStationManager
204
  // Inherited from WifiRemoteStationManager
205
  void SetupPhy (const Ptr<WifiPhy> phy);
205
  void SetupPhy (const Ptr<WifiPhy> phy);
206
  void SetupMac (const Ptr<WifiMac> mac);
206
  void SetupMac (const Ptr<WifiMac> mac);
207
  void SetHeSupported (bool enable); //HE rates not yet supported
208
207
209
  /**
208
  /**
210
   * TracedCallback signature for rate change events.
209
   * TracedCallback signature for rate change events.
(-)a/src/wifi/model/minstrel-wifi-manager.cc (-30 / +18 lines)
 Lines 132-137   MinstrelWifiManager::SetupMac (const Ptr<WifiMac> mac) Link Here 
132
  WifiRemoteStationManager::SetupMac (mac);
132
  WifiRemoteStationManager::SetupMac (mac);
133
}
133
}
134
134
135
void
136
MinstrelWifiManager::DoInitialize ()
137
{
138
  NS_LOG_FUNCTION (this);
139
  if (GetHtSupported ())
140
    {
141
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
142
    }
143
  if (GetVhtSupported ())
144
    {
145
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
146
    }
147
  if (GetHeSupported ())
148
    {
149
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
150
    }
151
}
152
135
int64_t
153
int64_t
136
MinstrelWifiManager::AssignStreams (int64_t stream)
154
MinstrelWifiManager::AssignStreams (int64_t stream)
137
{
155
{
 Lines 1083-1116   MinstrelWifiManager::PrintTable (MinstrelWifiRemoteStation *station) Link Here 
1083
  station->m_statsFile.flush ();
1101
  station->m_statsFile.flush ();
1084
}
1102
}
1085
1103
1086
void
1087
MinstrelWifiManager::SetHtSupported (bool enable)
1088
{
1089
  //HT is not supported by this algorithm.
1090
  if (enable)
1091
    {
1092
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
1093
    }
1094
}
1095
1096
void
1097
MinstrelWifiManager::SetVhtSupported (bool enable)
1098
{
1099
  //VHT is not supported by this algorithm.
1100
  if (enable)
1101
    {
1102
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
1103
    }
1104
}
1105
1106
void
1107
MinstrelWifiManager::SetHeSupported (bool enable)
1108
{
1109
  //HE is not supported by this algorithm.
1110
  if (enable)
1111
    {
1112
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
1113
    }
1114
}
1115
1116
} //namespace ns3
1104
} //namespace ns3
(-)a/src/wifi/model/minstrel-wifi-manager.h (-4 / +2 lines)
 Lines 168-176   public: Link Here 
168
  // Inherited from WifiRemoteStationManager
168
  // Inherited from WifiRemoteStationManager
169
  void SetupPhy (const Ptr<WifiPhy> phy);
169
  void SetupPhy (const Ptr<WifiPhy> phy);
170
  void SetupMac (const Ptr<WifiMac> mac);
170
  void SetupMac (const Ptr<WifiMac> mac);
171
  void SetHtSupported (bool enable);
172
  void SetVhtSupported (bool enable);
173
  void SetHeSupported (bool enable);
174
171
175
  /**
172
  /**
176
   * Assign a fixed random variable stream number to the random variables
173
   * Assign a fixed random variable stream number to the random variables
 Lines 258-264   public: Link Here 
258
  void InitSampleTable (MinstrelWifiRemoteStation *station);
255
  void InitSampleTable (MinstrelWifiRemoteStation *station);
259
256
260
private:
257
private:
261
  //overridden from base class
258
  // Overridden from base class.
259
  void DoInitialize (void);
262
  WifiRemoteStation * DoCreateStation (void) const;
260
  WifiRemoteStation * DoCreateStation (void) const;
263
  void DoReportRxOk (WifiRemoteStation *station,
261
  void DoReportRxOk (WifiRemoteStation *station,
264
                     double rxSnr, WifiMode txMode);
262
                     double rxSnr, WifiMode txMode);
(-)a/src/wifi/model/onoe-wifi-manager.cc (-30 / +18 lines)
 Lines 89-94   OnoeWifiManager::~OnoeWifiManager () Link Here 
89
  NS_LOG_FUNCTION (this);
89
  NS_LOG_FUNCTION (this);
90
}
90
}
91
91
92
void
93
OnoeWifiManager::DoInitialize ()
94
{
95
  NS_LOG_FUNCTION (this);
96
  if (GetHtSupported ())
97
    {
98
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
99
    }
100
  if (GetVhtSupported ())
101
    {
102
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
103
    }
104
  if (GetHeSupported ())
105
    {
106
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
107
    }
108
}
109
92
WifiRemoteStation *
110
WifiRemoteStation *
93
OnoeWifiManager::DoCreateStation (void) const
111
OnoeWifiManager::DoCreateStation (void) const
94
{
112
{
 Lines 344-377   OnoeWifiManager::IsLowLatency (void) const Link Here 
344
  return false;
362
  return false;
345
}
363
}
346
364
347
void
348
OnoeWifiManager::SetHtSupported (bool enable)
349
{
350
  //HT is not supported by this algorithm.
351
  if (enable)
352
    {
353
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
354
    }
355
}
356
357
void
358
OnoeWifiManager::SetVhtSupported (bool enable)
359
{
360
  //VHT is not supported by this algorithm.
361
  if (enable)
362
    {
363
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
364
    }
365
}
366
367
void
368
OnoeWifiManager::SetHeSupported (bool enable)
369
{
370
  //HE is not supported by this algorithm.
371
  if (enable)
372
    {
373
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
374
    }
375
}
376
377
} //namespace ns3
365
} //namespace ns3
(-)a/src/wifi/model/onoe-wifi-manager.h (-6 / +2 lines)
 Lines 54-67   public: Link Here 
54
  OnoeWifiManager ();
54
  OnoeWifiManager ();
55
  virtual ~OnoeWifiManager ();
55
  virtual ~OnoeWifiManager ();
56
56
57
  // Inherited from WifiRemoteStationManager
58
  void SetHtSupported (bool enable);
59
  void SetVhtSupported (bool enable);
60
  void SetHeSupported (bool enable);
61
62
57
63
private:
58
private:
64
  //overridden from base class
59
  // Overridden from base class.
60
  void DoInitialize (void);
65
  WifiRemoteStation * DoCreateStation (void) const;
61
  WifiRemoteStation * DoCreateStation (void) const;
66
  void DoReportRxOk (WifiRemoteStation *station,
62
  void DoReportRxOk (WifiRemoteStation *station,
67
                     double rxSnr, WifiMode txMode);
63
                     double rxSnr, WifiMode txMode);
(-)a/src/wifi/model/parf-wifi-manager.cc (-30 / +18 lines)
 Lines 102-107   ParfWifiManager::SetupPhy (const Ptr<WifiPhy> phy) Link Here 
102
  WifiRemoteStationManager::SetupPhy (phy);
102
  WifiRemoteStationManager::SetupPhy (phy);
103
}
103
}
104
104
105
void
106
ParfWifiManager::DoInitialize ()
107
{
108
  NS_LOG_FUNCTION (this);
109
  if (GetHtSupported ())
110
    {
111
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
112
    }
113
  if (GetVhtSupported ())
114
    {
115
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
116
    }
117
  if (GetHeSupported ())
118
    {
119
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
120
    }
121
}
122
105
WifiRemoteStation *
123
WifiRemoteStation *
106
ParfWifiManager::DoCreateStation (void) const
124
ParfWifiManager::DoCreateStation (void) const
107
{
125
{
 Lines 352-385   ParfWifiManager::IsLowLatency (void) const Link Here 
352
  return true;
370
  return true;
353
}
371
}
354
372
355
void
356
ParfWifiManager::SetHtSupported (bool enable)
357
{
358
  //HT is not supported by this algorithm.
359
  if (enable)
360
    {
361
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
362
    }
363
}
364
365
void
366
ParfWifiManager::SetVhtSupported (bool enable)
367
{
368
  //VHT is not supported by this algorithm.
369
  if (enable)
370
    {
371
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
372
    }
373
}
374
375
void
376
ParfWifiManager::SetHeSupported (bool enable)
377
{
378
  //HE is not supported by this algorithm.
379
  if (enable)
380
    {
381
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
382
    }
383
}
384
385
} //namespace ns3
373
} //namespace ns3
(-)a/src/wifi/model/parf-wifi-manager.h (-4 / +2 lines)
 Lines 53-65   public: Link Here 
53
53
54
  // Inherited from WifiRemoteStationManager
54
  // Inherited from WifiRemoteStationManager
55
  void SetupPhy (const Ptr<WifiPhy> phy);
55
  void SetupPhy (const Ptr<WifiPhy> phy);
56
  void SetHtSupported (bool enable);
57
  void SetVhtSupported (bool enable);
58
  void SetHeSupported (bool enable);
59
56
60
57
61
private:
58
private:
62
  //overridden from base class
59
  // Overridden from base class.
60
  void DoInitialize (void);
63
  WifiRemoteStation * DoCreateStation (void) const;
61
  WifiRemoteStation * DoCreateStation (void) const;
64
  void DoReportRxOk (WifiRemoteStation *station,
62
  void DoReportRxOk (WifiRemoteStation *station,
65
                     double rxSnr, WifiMode txMode);
63
                     double rxSnr, WifiMode txMode);
(-)a/src/wifi/model/qos-txop.cc (-5 / +5 lines)
 Lines 950-959   bool Link Here 
950
QosTxop::NeedFragmentation (void) const
950
QosTxop::NeedFragmentation (void) const
951
{
951
{
952
  NS_LOG_FUNCTION (this);
952
  NS_LOG_FUNCTION (this);
953
  if (m_stationManager->HasVhtSupported ()
953
  if (m_stationManager->GetVhtSupported ()
954
      || m_stationManager->HasHeSupported ()
954
      || m_stationManager->GetHeSupported ()
955
      || GetAmpduExist (m_currentHdr.GetAddr1 ())
955
      || GetAmpduExist (m_currentHdr.GetAddr1 ())
956
      || (m_stationManager->HasHtSupported ()
956
      || (m_stationManager->GetHtSupported ()
957
          && m_currentHdr.IsQosData ()
957
          && m_currentHdr.IsQosData ()
958
          && GetBaAgreementExists (m_currentHdr.GetAddr1 (), GetTid (m_currentPacket, m_currentHdr))
958
          && GetBaAgreementExists (m_currentHdr.GetAddr1 (), GetTid (m_currentPacket, m_currentHdr))
959
          && GetMpduAggregator ()->GetMaxAmpduSize () >= m_currentPacket->GetSize ()))
959
          && GetMpduAggregator ()->GetMaxAmpduSize () >= m_currentPacket->GetSize ()))
 Lines 1347-1354   QosTxop::SetupBlockAckIfNeeded (void) Link Here 
1347
  uint32_t packets = m_queue->GetNPacketsByTidAndAddress (tid, recipient);
1347
  uint32_t packets = m_queue->GetNPacketsByTidAndAddress (tid, recipient);
1348
  if ((GetBlockAckThreshold () > 0 && packets >= GetBlockAckThreshold ())
1348
  if ((GetBlockAckThreshold () > 0 && packets >= GetBlockAckThreshold ())
1349
      || (m_mpduAggregator != 0 && m_mpduAggregator->GetMaxAmpduSize () > 0 && packets > 1)
1349
      || (m_mpduAggregator != 0 && m_mpduAggregator->GetMaxAmpduSize () > 0 && packets > 1)
1350
      || m_stationManager->HasVhtSupported ()
1350
      || m_stationManager->GetVhtSupported ()
1351
      || m_stationManager->HasHeSupported ())
1351
      || m_stationManager->GetHeSupported ())
1352
    {
1352
    {
1353
      /* Block ack setup */
1353
      /* Block ack setup */
1354
      uint16_t startingSequence = m_txMiddle->GetNextSeqNumberByTidAndAddress (tid, recipient);
1354
      uint16_t startingSequence = m_txMiddle->GetNextSeqNumberByTidAndAddress (tid, recipient);
(-)a/src/wifi/model/regular-wifi-mac.cc (-93 / +102 lines)
 Lines 31-36    Link Here 
31
#include "wifi-utils.h"
31
#include "wifi-utils.h"
32
#include "mgt-headers.h"
32
#include "mgt-headers.h"
33
#include "amsdu-subframe-header.h"
33
#include "amsdu-subframe-header.h"
34
#include "wifi-net-device.h"
35
#include "ht-configuration.h"
36
#include "vht-configuration.h"
37
#include "he-configuration.h"
34
38
35
namespace ns3 {
39
namespace ns3 {
36
40
 Lines 40-50   NS_OBJECT_ENSURE_REGISTERED (RegularWifiMac); Link Here 
40
44
41
RegularWifiMac::RegularWifiMac ()
45
RegularWifiMac::RegularWifiMac ()
42
  : m_qosSupported (0),
46
  : m_qosSupported (0),
43
    m_htSupported (0),
44
    m_vhtSupported (0),
45
    m_erpSupported (0),
47
    m_erpSupported (0),
46
    m_dsssSupported (0),
48
    m_dsssSupported (0)
47
    m_heSupported (0)
48
{
49
{
49
  NS_LOG_FUNCTION (this);
50
  NS_LOG_FUNCTION (this);
50
  m_rxMiddle = Create<MacRxMiddle> ();
51
  m_rxMiddle = Create<MacRxMiddle> ();
 Lines 117-122   RegularWifiMac::DoDispose () Link Here 
117
118
118
  m_channelAccessManager->Dispose ();
119
  m_channelAccessManager->Dispose ();
119
  m_channelAccessManager = 0;
120
  m_channelAccessManager = 0;
121
  
122
  WifiMac::DoDispose ();
120
}
123
}
121
124
122
void
125
void
 Lines 124-136   RegularWifiMac::SetWifiRemoteStationManager (const Ptr<WifiRemoteStationManager> Link Here 
124
{
127
{
125
  NS_LOG_FUNCTION (this << stationManager);
128
  NS_LOG_FUNCTION (this << stationManager);
126
  m_stationManager = stationManager;
129
  m_stationManager = stationManager;
127
  m_stationManager->SetHtSupported (GetHtSupported ());
128
  m_stationManager->SetVhtSupported (GetVhtSupported ());
129
  m_stationManager->SetHeSupported (GetHeSupported ());
130
  m_low->SetWifiRemoteStationManager (stationManager);
130
  m_low->SetWifiRemoteStationManager (stationManager);
131
132
  m_txop->SetWifiRemoteStationManager (stationManager);
131
  m_txop->SetWifiRemoteStationManager (stationManager);
133
134
  for (EdcaQueues::const_iterator i = m_edca.begin (); i != m_edca.end (); ++i)
132
  for (EdcaQueues::const_iterator i = m_edca.begin (); i != m_edca.end (); ++i)
135
    {
133
    {
136
      i->second->SetWifiRemoteStationManager (stationManager);
134
      i->second->SetWifiRemoteStationManager (stationManager);
 Lines 148-164   RegularWifiMac::GetExtendedCapabilities (void) const Link Here 
148
{
146
{
149
  NS_LOG_FUNCTION (this);
147
  NS_LOG_FUNCTION (this);
150
  ExtendedCapabilities capabilities;
148
  ExtendedCapabilities capabilities;
151
  if (m_htSupported || m_vhtSupported)
149
  capabilities.SetHtSupported (GetHtSupported ());
152
    {
150
  capabilities.SetVhtSupported (GetVhtSupported ());
153
      if (m_htSupported)
154
        {
155
          capabilities.SetHtSupported (1);
156
        }
157
      if (m_vhtSupported)
158
        {
159
          capabilities.SetVhtSupported (1);
160
        }
161
    }
162
  //TODO: to be completed
151
  //TODO: to be completed
163
  return capabilities;
152
  return capabilities;
164
}
153
}
 Lines 168-184   RegularWifiMac::GetHtCapabilities (void) const Link Here 
168
{
157
{
169
  NS_LOG_FUNCTION (this);
158
  NS_LOG_FUNCTION (this);
170
  HtCapabilities capabilities;
159
  HtCapabilities capabilities;
171
  if (m_htSupported)
160
  if (GetHtSupported ())
172
    {
161
    {
162
      Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
163
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
164
      bool greenfieldSupported = htConfiguration->GetGreenfieldSupported ();
165
      bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported ();
173
      capabilities.SetHtSupported (1);
166
      capabilities.SetHtSupported (1);
174
      capabilities.SetLdpc (m_phy->GetLdpc ());
167
      capabilities.SetLdpc (0);
175
      capabilities.SetSupportedChannelWidth (m_phy->GetChannelWidth () >= 40);
168
      capabilities.SetSupportedChannelWidth (m_phy->GetChannelWidth () >= 40);
176
      capabilities.SetShortGuardInterval20 (m_phy->GetShortGuardInterval ());
169
      capabilities.SetShortGuardInterval20 (sgiSupported);
177
      capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () >= 40 && m_phy->GetShortGuardInterval ());
170
      capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () >= 40 && sgiSupported);
178
      capabilities.SetGreenfield (m_phy->GetGreenfield ());
171
      capabilities.SetGreenfield (greenfieldSupported);
179
      uint32_t maxAmsduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize));
172
      uint32_t maxAmsduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize));
180
      capabilities.SetMaxAmsduLength (maxAmsduLength > 3839); //0 if 3839 and 1 if 7935
173
      capabilities.SetMaxAmsduLength (maxAmsduLength > 3839); //0 if 3839 and 1 if 7935
181
      capabilities.SetLSigProtectionSupport (!m_phy->GetGreenfield ());
174
      capabilities.SetLSigProtectionSupport (!greenfieldSupported);
182
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize))
175
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize))
183
                                                                      + 1.0)
176
                                                                      + 1.0)
184
                                                            / std::log (2.0))
177
                                                            / std::log (2.0))
 Lines 197-203   RegularWifiMac::GetHtCapabilities (void) const Link Here 
197
          capabilities.SetRxMcsBitmask (mcs.GetMcsValue ());
190
          capabilities.SetRxMcsBitmask (mcs.GetMcsValue ());
198
          uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
191
          uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
199
          NS_ASSERT (nss > 0 && nss < 5);
192
          NS_ASSERT (nss > 0 && nss < 5);
200
          uint64_t dataRate = mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetShortGuardInterval () ? 400 : 800, nss);
193
          uint64_t dataRate = mcs.GetDataRate (m_phy->GetChannelWidth (), sgiSupported ? 400 : 800, nss);
201
          if (dataRate > maxSupportedRate)
194
          if (dataRate > maxSupportedRate)
202
            {
195
            {
203
              maxSupportedRate = dataRate;
196
              maxSupportedRate = dataRate;
 Lines 219-226   RegularWifiMac::GetVhtCapabilities (void) const Link Here 
219
{
212
{
220
  NS_LOG_FUNCTION (this);
213
  NS_LOG_FUNCTION (this);
221
  VhtCapabilities capabilities;
214
  VhtCapabilities capabilities;
222
  if (m_vhtSupported)
215
  if (GetVhtSupported ())
223
    {
216
    {
217
      Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
218
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
219
      bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported ();
224
      capabilities.SetVhtSupported (1);
220
      capabilities.SetVhtSupported (1);
225
      if (m_phy->GetChannelWidth () == 160)
221
      if (m_phy->GetChannelWidth () == 160)
226
        {
222
        {
 Lines 232-240   RegularWifiMac::GetVhtCapabilities (void) const Link Here 
232
        }
228
        }
233
      uint32_t maxMpduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize)) + 56; //see section 9.11 of 11ac standard
229
      uint32_t maxMpduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize)) + 56; //see section 9.11 of 11ac standard
234
      capabilities.SetMaxMpduLength (uint8_t (maxMpduLength > 3895) + uint8_t (maxMpduLength > 7991)); //0 if 3895, 1 if 7991, 2 for 11454
230
      capabilities.SetMaxMpduLength (uint8_t (maxMpduLength > 3895) + uint8_t (maxMpduLength > 7991)); //0 if 3895, 1 if 7991, 2 for 11454
235
      capabilities.SetRxLdpc (m_phy->GetLdpc ());
231
      capabilities.SetRxLdpc (0);
236
      capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && m_phy->GetShortGuardInterval ());
232
      capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && sgiSupported);
237
      capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && m_phy->GetShortGuardInterval ());
233
      capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && sgiSupported);
238
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize)) + 1.0) / std::log (2.0)) - 13.0), 0.0);
234
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize)) + 1.0) / std::log (2.0)) - 13.0), 0.0);
239
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
235
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
240
      capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 7 for VHT
236
      capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 7 for VHT
 Lines 285-292   RegularWifiMac::GetHeCapabilities (void) const Link Here 
285
{
281
{
286
  NS_LOG_FUNCTION (this);
282
  NS_LOG_FUNCTION (this);
287
  HeCapabilities capabilities;
283
  HeCapabilities capabilities;
288
  if (m_heSupported)
284
  if (GetHeSupported ())
289
    {
285
    {
286
      Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
287
      Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
290
      capabilities.SetHeSupported (1);
288
      capabilities.SetHeSupported (1);
291
      uint8_t channelWidthSet = 0;
289
      uint8_t channelWidthSet = 0;
292
      if (m_phy->GetChannelWidth () >= 40 && Is2_4Ghz (m_phy->GetFrequency ()))
290
      if (m_phy->GetChannelWidth () >= 40 && Is2_4Ghz (m_phy->GetFrequency ()))
 Lines 303-314   RegularWifiMac::GetHeCapabilities (void) const Link Here 
303
        }
301
        }
304
      capabilities.SetChannelWidthSet (channelWidthSet);
302
      capabilities.SetChannelWidthSet (channelWidthSet);
305
      uint8_t gi = 0;
303
      uint8_t gi = 0;
306
      if (m_phy->GetGuardInterval () <= NanoSeconds (1600))
304
      if (heConfiguration->GetGuardInterval () <= NanoSeconds (1600))
307
        {
305
        {
308
          //todo: We assume for now that if we support 800ns GI then 1600ns GI is supported as well
306
          //todo: We assume for now that if we support 800ns GI then 1600ns GI is supported as well
309
          gi |= 0x01;
307
          gi |= 0x01;
310
        }
308
        }
311
      if (m_phy->GetGuardInterval () == NanoSeconds (800))
309
      if (heConfiguration->GetGuardInterval () == NanoSeconds (800))
312
        {
310
        {
313
          gi |= 0x02;
311
          gi |= 0x02;
314
        }
312
        }
 Lines 580-655   RegularWifiMac::GetQosSupported () const Link Here 
580
void
578
void
581
RegularWifiMac::SetVhtSupported (bool enable)
579
RegularWifiMac::SetVhtSupported (bool enable)
582
{
580
{
583
  NS_LOG_FUNCTION (this << enable);
581
  //To be removed once deprecated API is cleaned up
584
  m_vhtSupported = enable;
585
  if (enable)
586
    {
587
      SetQosSupported (true);
588
    }
589
  if (!enable && !m_htSupported)
590
    {
591
      DisableAggregation ();
592
    }
593
  else
594
    {
595
      EnableAggregation ();
596
    }
597
}
582
}
598
583
599
void
584
void
600
RegularWifiMac::SetHtSupported (bool enable)
585
RegularWifiMac::SetHtSupported (bool enable)
601
{
586
{
602
  NS_LOG_FUNCTION (this << enable);
587
  //To be removed once deprecated API is cleaned up
603
  m_htSupported = enable;
604
  if (enable)
605
    {
606
      SetQosSupported (true);
607
    }
608
  if (!enable && !m_vhtSupported)
609
    {
610
      DisableAggregation ();
611
    }
612
  else
613
    {
614
      EnableAggregation ();
615
    }
616
}
588
}
617
589
618
void
590
void
619
RegularWifiMac::SetHeSupported (bool enable)
591
RegularWifiMac::SetHeSupported (bool enable)
620
{
592
{
621
  NS_LOG_FUNCTION (this << enable);
593
  //To be removed once deprecated API is cleaned up
622
  m_heSupported = enable;
623
  if (enable)
624
    {
625
      SetQosSupported (true);
626
    }
627
  if (!enable && !m_htSupported && !m_vhtSupported)
628
    {
629
      DisableAggregation ();
630
    }
631
  else
632
    {
633
      EnableAggregation ();
634
    }
635
}
594
}
636
595
637
bool
596
bool
638
RegularWifiMac::GetVhtSupported () const
597
RegularWifiMac::GetHtSupported () const
639
{
598
{
640
  return m_vhtSupported;
599
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
600
  if (device->GetHtConfiguration ())
601
    {
602
      return true;
603
    }
604
  return false;
641
}
605
}
642
606
643
bool
607
bool
644
RegularWifiMac::GetHtSupported () const
608
RegularWifiMac::GetVhtSupported () const
645
{
609
{
646
  return m_htSupported;
610
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
611
  if (device->GetVhtConfiguration ())
612
    {
613
      return true;
614
    }
615
  return false;
647
}
616
}
648
617
649
bool
618
bool
650
RegularWifiMac::GetHeSupported () const
619
RegularWifiMac::GetHeSupported () const
651
{
620
{
652
  return m_heSupported;
621
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
622
  if (device->GetHeConfiguration ())
623
    {
624
      return true;
625
    }
626
  return false;
653
}
627
}
654
628
655
bool
629
bool
 Lines 870-881   void Link Here 
870
RegularWifiMac::SetRifsSupported (bool enable)
844
RegularWifiMac::SetRifsSupported (bool enable)
871
{
845
{
872
  NS_LOG_FUNCTION (this << enable);
846
  NS_LOG_FUNCTION (this << enable);
847
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
848
  if (device)
849
    {
850
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
851
      if (htConfiguration)
852
        {
853
          htConfiguration->SetRifsSupported (enable);
854
        }
855
    }
873
  m_rifsSupported = enable;
856
  m_rifsSupported = enable;
874
}
857
}
875
858
876
bool
859
bool
877
RegularWifiMac::GetRifsSupported (void) const
860
RegularWifiMac::GetRifsSupported (void) const
878
{
861
{
862
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
863
  if (device)
864
    {
865
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
866
      if (htConfiguration)
867
        {
868
          return htConfiguration->GetRifsSupported ();
869
        }
870
    }
879
  return m_rifsSupported;
871
  return m_rifsSupported;
880
}
872
}
881
873
 Lines 1090-1108   RegularWifiMac::GetTypeId (void) Link Here 
1090
                   BooleanValue (false),
1082
                   BooleanValue (false),
1091
                   MakeBooleanAccessor (&RegularWifiMac::SetHtSupported,
1083
                   MakeBooleanAccessor (&RegularWifiMac::SetHtSupported,
1092
                                        &RegularWifiMac::GetHtSupported),
1084
                                        &RegularWifiMac::GetHtSupported),
1093
                   MakeBooleanChecker ())
1085
                   MakeBooleanChecker (),
1086
                   TypeId::DEPRECATED, "Not used anymore")
1094
    .AddAttribute ("VhtSupported",
1087
    .AddAttribute ("VhtSupported",
1095
                   "This Boolean attribute is set to enable 802.11ac support at this STA.",
1088
                   "This Boolean attribute is set to enable 802.11ac support at this STA.",
1096
                   BooleanValue (false),
1089
                   BooleanValue (false),
1097
                   MakeBooleanAccessor (&RegularWifiMac::SetVhtSupported,
1090
                   MakeBooleanAccessor (&RegularWifiMac::SetVhtSupported,
1098
                                        &RegularWifiMac::GetVhtSupported),
1091
                                        &RegularWifiMac::GetVhtSupported),
1099
                   MakeBooleanChecker ())
1092
                   MakeBooleanChecker (),
1093
                   TypeId::DEPRECATED, "Not used anymore")
1100
    .AddAttribute ("HeSupported",
1094
    .AddAttribute ("HeSupported",
1101
                   "This Boolean attribute is set to enable 802.11ax support at this STA.",
1095
                   "This Boolean attribute is set to enable 802.11ax support at this STA.",
1102
                   BooleanValue (false),
1096
                   BooleanValue (false),
1103
                   MakeBooleanAccessor (&RegularWifiMac::SetHeSupported,
1097
                   MakeBooleanAccessor (&RegularWifiMac::SetHeSupported,
1104
                                        &RegularWifiMac::GetHeSupported),
1098
                                        &RegularWifiMac::GetHeSupported),
1105
                   MakeBooleanChecker ())
1099
                   MakeBooleanChecker (),
1100
                   TypeId::DEPRECATED, "Not used anymore")
1106
    .AddAttribute ("CtsToSelfSupported",
1101
    .AddAttribute ("CtsToSelfSupported",
1107
                   "Use CTS to Self when using a rate that is not in the basic rate set.",
1102
                   "Use CTS to Self when using a rate that is not in the basic rate set.",
1108
                   BooleanValue (false),
1103
                   BooleanValue (false),
 Lines 1227-1233   RegularWifiMac::GetTypeId (void) Link Here 
1227
                   BooleanValue (false),
1222
                   BooleanValue (false),
1228
                   MakeBooleanAccessor (&RegularWifiMac::SetRifsSupported,
1223
                   MakeBooleanAccessor (&RegularWifiMac::SetRifsSupported,
1229
                                        &RegularWifiMac::GetRifsSupported),
1224
                                        &RegularWifiMac::GetRifsSupported),
1230
                   MakeBooleanChecker ())
1225
                   MakeBooleanChecker (),
1226
                   TypeId::DEPRECATED, "Use the HtConfiguration instead")
1231
    .AddAttribute ("Txop",
1227
    .AddAttribute ("Txop",
1232
                   "The Txop object.",
1228
                   "The Txop object.",
1233
                   PointerValue (),
1229
                   PointerValue (),
 Lines 1274-1291   RegularWifiMac::FinishConfigureStandard (WifiPhyStandard standard) Link Here 
1274
  switch (standard)
1270
  switch (standard)
1275
    {
1271
    {
1276
    case WIFI_PHY_STANDARD_80211ax_5GHZ:
1272
    case WIFI_PHY_STANDARD_80211ax_5GHZ:
1277
      SetHeSupported (true);
1278
    case WIFI_PHY_STANDARD_80211ac:
1273
    case WIFI_PHY_STANDARD_80211ac:
1279
      SetVhtSupported (true);
1280
    case WIFI_PHY_STANDARD_80211n_5GHZ:
1274
    case WIFI_PHY_STANDARD_80211n_5GHZ:
1281
      SetHtSupported (true);
1275
      {
1282
      cwmin = 15;
1276
        EnableAggregation ();
1283
      cwmax = 1023;
1277
        //To be removed once deprecated RifsSupported attribute is removed
1284
      break;
1278
        Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
1279
        Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
1280
        NS_ASSERT (htConfiguration);
1281
        htConfiguration->SetRifsSupported (m_rifsSupported);
1282
        SetQosSupported (true);
1283
        cwmin = 15;
1284
        cwmax = 1023;
1285
        break;
1286
      }
1285
    case WIFI_PHY_STANDARD_80211ax_2_4GHZ:
1287
    case WIFI_PHY_STANDARD_80211ax_2_4GHZ:
1286
      SetHeSupported (true);
1287
    case WIFI_PHY_STANDARD_80211n_2_4GHZ:
1288
    case WIFI_PHY_STANDARD_80211n_2_4GHZ:
1288
      SetHtSupported (true);
1289
      {
1290
        EnableAggregation ();
1291
        //To be removed once deprecated RifsSupported attribute is removed
1292
        Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
1293
        Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
1294
        NS_ASSERT (htConfiguration);
1295
        htConfiguration->SetRifsSupported (m_rifsSupported);
1296
        SetQosSupported (true);
1297
      }
1289
    case WIFI_PHY_STANDARD_80211g:
1298
    case WIFI_PHY_STANDARD_80211g:
1290
      SetErpSupported (true);
1299
      SetErpSupported (true);
1291
    case WIFI_PHY_STANDARD_holland:
1300
    case WIFI_PHY_STANDARD_holland:
(-)a/src/wifi/model/regular-wifi-mac.h (-25 / +3 lines)
 Lines 138-143   public: Link Here 
138
   *
138
   *
139
   * \param enable true if RIFS is to be supported,
139
   * \param enable true if RIFS is to be supported,
140
   *               false otherwise
140
   *               false otherwise
141
   * \deprecated
141
   */
142
   */
142
  void SetRifsSupported (bool enable);
143
  void SetRifsSupported (bool enable);
143
  /**
144
  /**
 Lines 145-153   public: Link Here 
145
   *
146
   *
146
   * \return true if short RIFS is supported,
147
   * \return true if short RIFS is supported,
147
   *         false otherwise.
148
   *         false otherwise.
149
   * \deprecated
148
   */
150
   */
149
  bool GetRifsSupported (void) const;
151
  bool GetRifsSupported (void) const;
150
151
  /**
152
  /**
152
   * \return the MAC address associated to this MAC layer.
153
   * \return the MAC address associated to this MAC layer.
153
   */
154
   */
 Lines 649-672   private: Link Here 
649
   */
650
   */
650
  bool m_qosSupported;
651
  bool m_qosSupported;
651
  /**
652
  /**
652
    * This Boolean is set \c true iff this WifiMac is to model
653
    * 802.11n. It is exposed through the attribute system.
654
    *
655
    * At the moment, this flag is the sole selection between HT and
656
    * non-HT operation for the STA (whether IBSS, AP, or
657
    * non-AP). Ultimately, we will want a HT-enabled STA to be able to
658
    * fall back to non-HT operation with a non-HT peer. This'll
659
    * require further intelligence - i.e., per-association HT
660
    * state. Having a big switch seems like a good intermediate stage,
661
    * however.
662
    */
663
  bool m_htSupported;
664
  /**
665
   * This Boolean is set \c true iff this WifiMac is to model
666
   * 802.11ac. It is exposed through the attribute system.
667
   */
668
  bool m_vhtSupported;
669
  /**
670
   * This Boolean is set \c true iff this WifiMac is to model
653
   * This Boolean is set \c true iff this WifiMac is to model
671
   * 802.11g. It is exposed through the attribute system.
654
   * 802.11g. It is exposed through the attribute system.
672
   */
655
   */
 Lines 676-686   private: Link Here 
676
   * 802.11b. It is exposed through the attribute system.
659
   * 802.11b. It is exposed through the attribute system.
677
   */
660
   */
678
  bool m_dsssSupported;
661
  bool m_dsssSupported;
679
  /**
680
   * This Boolean is set \c true iff this WifiMac is to model
681
   * 802.11ax. It is exposed through the attribute system.
682
   */
683
  bool m_heSupported;
684
662
685
  /// Configure aggregation function
663
  /// Configure aggregation function
686
  void ConfigureAggregation (void);
664
  void ConfigureAggregation (void);
 Lines 703-709   private: Link Here 
703
  TracedCallback<const WifiMacHeader &> m_txErrCallback; ///< transmit error callback
681
  TracedCallback<const WifiMacHeader &> m_txErrCallback; ///< transmit error callback
704
682
705
  bool m_shortSlotTimeSupported; ///< flag whether short slot time is supported
683
  bool m_shortSlotTimeSupported; ///< flag whether short slot time is supported
706
  bool m_rifsSupported; ///< flag whether RIFS is supported
684
  bool m_rifsSupported; ///< flag whether RIFS is supported (deprecated)
707
};
685
};
708
686
709
} //namespace ns3
687
} //namespace ns3
(-)a/src/wifi/model/rraa-wifi-manager.cc (-31 / +18 lines)
 Lines 105-111   RraaWifiManager::GetTypeId (void) Link Here 
105
  return tid;
105
  return tid;
106
}
106
}
107
107
108
109
RraaWifiManager::RraaWifiManager ()
108
RraaWifiManager::RraaWifiManager ()
110
  : WifiRemoteStationManager (),
109
  : WifiRemoteStationManager (),
111
    m_currentRate (0)
110
    m_currentRate (0)
 Lines 147-152   RraaWifiManager::SetupMac (const Ptr<WifiMac> mac) Link Here 
147
  WifiRemoteStationManager::SetupMac (mac);
146
  WifiRemoteStationManager::SetupMac (mac);
148
}
147
}
149
148
149
void
150
RraaWifiManager::DoInitialize ()
151
{
152
  NS_LOG_FUNCTION (this);
153
  if (GetHtSupported ())
154
    {
155
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
156
    }
157
  if (GetVhtSupported ())
158
    {
159
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
160
    }
161
  if (GetHeSupported ())
162
    {
163
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
164
    }
165
}
166
150
Time
167
Time
151
RraaWifiManager::GetCalcTxTime (WifiMode mode) const
168
RraaWifiManager::GetCalcTxTime (WifiMode mode) const
152
{
169
{
 Lines 463-496   RraaWifiManager::IsLowLatency (void) const Link Here 
463
  return true;
480
  return true;
464
}
481
}
465
482
466
void
467
RraaWifiManager::SetHtSupported (bool enable)
468
{
469
  //HT is not supported by this algorithm.
470
  if (enable)
471
    {
472
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
473
    }
474
}
475
476
void
477
RraaWifiManager::SetVhtSupported (bool enable)
478
{
479
  //VHT is not supported by this algorithm.
480
  if (enable)
481
    {
482
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
483
    }
484
}
485
486
void
487
RraaWifiManager::SetHeSupported (bool enable)
488
{
489
  //HE is not supported by this algorithm.
490
  if (enable)
491
    {
492
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
493
    }
494
}
495
496
} //namespace ns3
483
} //namespace ns3
(-)a/src/wifi/model/rraa-wifi-manager.h (-4 / +2 lines)
 Lines 70-82   public: Link Here 
70
  // Inherited from WifiRemoteStationManager
70
  // Inherited from WifiRemoteStationManager
71
  virtual void SetupPhy (const Ptr<WifiPhy> phy);
71
  virtual void SetupPhy (const Ptr<WifiPhy> phy);
72
  virtual void SetupMac (const Ptr<WifiMac> mac);
72
  virtual void SetupMac (const Ptr<WifiMac> mac);
73
  void SetHtSupported (bool enable);
74
  void SetVhtSupported (bool enable);
75
  void SetHeSupported (bool enable);
76
73
77
74
78
private:
75
private:
79
  //overridden from base class
76
  // Overridden from base class.
77
  void DoInitialize (void);
80
  WifiRemoteStation * DoCreateStation (void) const;
78
  WifiRemoteStation * DoCreateStation (void) const;
81
  void DoReportRxOk (WifiRemoteStation *station,
79
  void DoReportRxOk (WifiRemoteStation *station,
82
                     double rxSnr, WifiMode txMode);
80
                     double rxSnr, WifiMode txMode);
(-)a/src/wifi/model/rrpaa-wifi-manager.cc (-30 / +18 lines)
 Lines 176-181   RrpaaWifiManager::SetupMac (const Ptr<WifiMac> mac) Link Here 
176
  WifiRemoteStationManager::SetupMac (mac);
176
  WifiRemoteStationManager::SetupMac (mac);
177
}
177
}
178
178
179
void
180
RrpaaWifiManager::DoInitialize ()
181
{
182
  NS_LOG_FUNCTION (this);
183
  if (GetHtSupported ())
184
    {
185
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
186
    }
187
  if (GetVhtSupported ())
188
    {
189
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
190
    }
191
  if (GetHeSupported ())
192
    {
193
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
194
    }
195
}
196
179
Time
197
Time
180
RrpaaWifiManager::GetCalcTxTime (WifiMode mode) const
198
RrpaaWifiManager::GetCalcTxTime (WifiMode mode) const
181
{
199
{
 Lines 600-633   RrpaaWifiManager::IsLowLatency (void) const Link Here 
600
  return true;
618
  return true;
601
}
619
}
602
620
603
void
604
RrpaaWifiManager::SetHtSupported (bool enable)
605
{
606
  //HT is not supported by this algorithm.
607
  if (enable)
608
    {
609
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HT rates");
610
    }
611
}
612
613
void
614
RrpaaWifiManager::SetVhtSupported (bool enable)
615
{
616
  //VHT is not supported by this algorithm.
617
  if (enable)
618
    {
619
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support VHT rates");
620
    }
621
}
622
623
void
624
RrpaaWifiManager::SetHeSupported (bool enable)
625
{
626
  //HE is not supported by this algorithm.
627
  if (enable)
628
    {
629
      NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rates");
630
    }
631
}
632
633
} // namespace ns3
621
} // namespace ns3
(-)a/src/wifi/model/rrpaa-wifi-manager.h (-4 / +2 lines)
 Lines 82-90   public: Link Here 
82
  // Inherited from WifiRemoteStationManager
82
  // Inherited from WifiRemoteStationManager
83
  virtual void SetupPhy (const Ptr<WifiPhy> phy);
83
  virtual void SetupPhy (const Ptr<WifiPhy> phy);
84
  virtual void SetupMac (const Ptr<WifiMac> mac);
84
  virtual void SetupMac (const Ptr<WifiMac> mac);
85
  virtual void SetHtSupported (bool enable);
86
  virtual void SetVhtSupported (bool enable);
87
  virtual void SetHeSupported (bool enable);
88
85
89
  /**
86
  /**
90
   * Assign a fixed random variable stream number to the random variables
87
   * Assign a fixed random variable stream number to the random variables
 Lines 98-104   public: Link Here 
98
  int64_t AssignStreams (int64_t stream);
95
  int64_t AssignStreams (int64_t stream);
99
96
100
private:
97
private:
101
  //overridden from base class
98
  // Overridden from base class.
99
  void DoInitialize (void);
102
  virtual WifiRemoteStation * DoCreateStation (void) const;
100
  virtual WifiRemoteStation * DoCreateStation (void) const;
103
  virtual void DoReportRxOk (WifiRemoteStation *station,
101
  virtual void DoReportRxOk (WifiRemoteStation *station,
104
                             double rxSnr, WifiMode txMode);
102
                             double rxSnr, WifiMode txMode);
(-)a/src/wifi/model/sta-wifi-mac.cc (-2 / +8 lines)
 Lines 28-33    Link Here 
28
#include "mac-low.h"
28
#include "mac-low.h"
29
#include "mgt-headers.h"
29
#include "mgt-headers.h"
30
#include "snr-tag.h"
30
#include "snr-tag.h"
31
#include "wifi-net-device.h"
32
#include "ht-configuration.h"
31
33
32
namespace ns3 {
34
namespace ns3 {
33
35
 Lines 802-808   StaWifiMac::UpdateApInfoFromBeacon (MgtBeaconHeader beacon, Mac48Address apAddr, Link Here 
802
            {
804
            {
803
              m_stationManager->SetUseGreenfieldProtection (false);
805
              m_stationManager->SetUseGreenfieldProtection (false);
804
            }
806
            }
805
          if (!GetVhtSupported () && GetRifsSupported () && htOperation.GetRifsMode ())
807
          Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
808
          Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
809
          if (!GetVhtSupported () && htConfiguration && htConfiguration->GetRifsSupported () && htOperation.GetRifsMode ())
806
            {
810
            {
807
              m_stationManager->SetRifsPermitted (true);
811
              m_stationManager->SetRifsPermitted (true);
808
            }
812
            }
 Lines 1001-1007   StaWifiMac::UpdateApInfoFromAssocResp (MgtAssocResponseHeader assocResp, Mac48Ad Link Here 
1001
            {
1005
            {
1002
              m_stationManager->SetUseGreenfieldProtection (false);
1006
              m_stationManager->SetUseGreenfieldProtection (false);
1003
            }
1007
            }
1004
          if (!GetVhtSupported () && GetRifsSupported () && htOperation.GetRifsMode ())
1008
          Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
1009
          Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
1010
          if (!GetVhtSupported () && htConfiguration && htConfiguration->GetRifsSupported () && htOperation.GetRifsMode ())
1005
            {
1011
            {
1006
              m_stationManager->SetRifsPermitted (true);
1012
              m_stationManager->SetRifsPermitted (true);
1007
            }
1013
            }
(-)a/src/wifi/model/sta-wifi-mac.h (+8 lines)
 Lines 26-31    Link Here 
26
#include "infrastructure-wifi-mac.h"
26
#include "infrastructure-wifi-mac.h"
27
#include "mgt-headers.h"
27
#include "mgt-headers.h"
28
28
29
class TwoLevelAggregationTest;
30
class AmpduAggregationTest;
31
29
namespace ns3  {
32
namespace ns3  {
30
33
31
class SupportedRates;
34
class SupportedRates;
 Lines 102-107   struct ApInfo Link Here 
102
class StaWifiMac : public InfrastructureWifiMac
105
class StaWifiMac : public InfrastructureWifiMac
103
{
106
{
104
public:
107
public:
108
  /// Allow test cases to access private members
109
  friend class ::TwoLevelAggregationTest;
110
  /// Allow test cases to access private members
111
  friend class ::AmpduAggregationTest;
112
105
  /**
113
  /**
106
   * \brief Get the type ID.
114
   * \brief Get the type ID.
107
   * \return the object TypeId
115
   * \return the object TypeId
(-)a/src/wifi/model/vht-configuration.cc (+51 lines)
Line 0    Link Here 
1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2018  Sébastien Deronne
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: Sébastien Deronne <sebastien.deronne@gmail.com>
19
 */
20
21
#include "ns3/log.h"
22
#include "vht-configuration.h"
23
24
namespace ns3 {
25
26
NS_LOG_COMPONENT_DEFINE ("VhtConfiguration");
27
28
NS_OBJECT_ENSURE_REGISTERED (VhtConfiguration);
29
30
VhtConfiguration::VhtConfiguration ()
31
{
32
  NS_LOG_FUNCTION (this);
33
}
34
35
VhtConfiguration::~VhtConfiguration ()
36
{
37
  NS_LOG_FUNCTION (this);
38
}
39
40
TypeId
41
VhtConfiguration::GetTypeId (void)
42
{
43
  static ns3::TypeId tid = ns3::TypeId ("ns3::VhtConfiguration")
44
    .SetParent<Object> ()
45
    .SetGroupName ("Wifi")
46
    .AddConstructor<VhtConfiguration> ()
47
    ;
48
    return tid;
49
}
50
51
} //namespace ns3
(-)a/src/wifi/model/vht-configuration.h (+47 lines)
Line 0    Link Here 
1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2018  Sébastien Deronne
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: Sébastien Deronne <sebastien.deronne@gmail.com>
19
 */
20
21
#ifndef VHT_CONFIGURATION_H
22
#define VHT_CONFIGURATION_H
23
24
#include "ns3/object.h"
25
26
namespace ns3 {
27
28
/**
29
 * \brief VHT configuration
30
 * \ingroup wifi
31
 *
32
 * This object stores VHT configuration information, for use in modifying
33
 * AP or STA behavior and for constructing VHT-related information elements.
34
 *
35
 */
36
class VhtConfiguration : public Object
37
{
38
public:
39
  VhtConfiguration ();
40
  virtual ~VhtConfiguration ();
41
42
  static TypeId GetTypeId (void);
43
};
44
45
} //namespace ns3
46
47
#endif /* VHT_CONFIGURATION_H */
(-)a/src/wifi/model/wifi-mac.cc (+18 lines)
 Lines 208-213   WifiMac::GetTypeId (void) Link Here 
208
}
208
}
209
209
210
void
210
void
211
WifiMac::DoDispose ()
212
{
213
  m_device = 0;
214
}
215
216
void
217
WifiMac::SetDevice (const Ptr<NetDevice> device)
218
{
219
  m_device = device;
220
}
221
222
Ptr<NetDevice>
223
WifiMac::GetDevice (void) const
224
{
225
  return m_device;
226
}
227
228
void
211
WifiMac::SetMaxPropagationDelay (Time delay)
229
WifiMac::SetMaxPropagationDelay (Time delay)
212
{
230
{
213
  NS_LOG_FUNCTION (this << delay);
231
  NS_LOG_FUNCTION (this << delay);
(-)a/src/wifi/model/wifi-mac.h (-4 / +17 lines)
 Lines 21-26    Link Here 
21
#ifndef WIFI_MAC_H
21
#ifndef WIFI_MAC_H
22
#define WIFI_MAC_H
22
#define WIFI_MAC_H
23
23
24
#include "ns3/net-device.h"
24
#include "wifi-phy-standard.h"
25
#include "wifi-phy-standard.h"
25
#include "wifi-remote-station-manager.h"
26
#include "wifi-remote-station-manager.h"
26
#include "qos-utils.h"
27
#include "qos-utils.h"
 Lines 42-47   class Txop; Link Here 
42
class WifiMac : public Object
43
class WifiMac : public Object
43
{
44
{
44
public:
45
public:
46
  virtual void DoDispose ();
47
45
  /**
48
  /**
46
   * \brief Get the type ID.
49
   * \brief Get the type ID.
47
   * \return the object TypeId
50
   * \return the object TypeId
 Lines 49-54   public: Link Here 
49
  static TypeId GetTypeId (void);
52
  static TypeId GetTypeId (void);
50
53
51
  /**
54
  /**
55
   * Sets the device this PHY is associated with.
56
   *
57
   * \param device the device this PHY is associated with
58
   */
59
  void SetDevice (const Ptr<NetDevice> device);
60
  /**
61
   * Return the device this PHY is associated with
62
   *
63
   * \return the device this PHY is associated with
64
   */
65
  Ptr<NetDevice> GetDevice (void) const;
66
67
  /**
52
   * \param slotTime the slot duration
68
   * \param slotTime the slot duration
53
   */
69
   */
54
  virtual void SetSlot (Time slotTime) = 0;
70
  virtual void SetSlot (Time slotTime) = 0;
 Lines 151-160   public: Link Here 
151
   * \return whether the device supports short slot time capability.
167
   * \return whether the device supports short slot time capability.
152
   */
168
   */
153
  virtual bool GetShortSlotTimeSupported (void) const = 0;
169
  virtual bool GetShortSlotTimeSupported (void) const = 0;
154
  /**
155
   * \return whether the device supports RIFS capability.
156
   */
157
  virtual bool GetRifsSupported (void) const = 0;
158
170
159
  /**
171
  /**
160
   * \param packet the packet to send.
172
   * \param packet the packet to send.
 Lines 398-403   private: Link Here 
398
  virtual void FinishConfigureStandard (WifiPhyStandard standard) = 0;
410
  virtual void FinishConfigureStandard (WifiPhyStandard standard) = 0;
399
411
400
  Time m_maxPropagationDelay; ///< maximum propagation delay
412
  Time m_maxPropagationDelay; ///< maximum propagation delay
413
  Ptr<NetDevice> m_device;    ///< Pointer to the device
401
414
402
  /**
415
  /**
403
   * This method sets 802.11a standards-compliant defaults for following attributes:
416
   * This method sets 802.11a standards-compliant defaults for following attributes:
(-)a/src/wifi/model/wifi-net-device.cc (+54 lines)
 Lines 27-32    Link Here 
27
#include "wifi-net-device.h"
27
#include "wifi-net-device.h"
28
#include "wifi-phy.h"
28
#include "wifi-phy.h"
29
#include "wifi-mac.h"
29
#include "wifi-mac.h"
30
#include "ht-configuration.h"
31
#include "vht-configuration.h"
32
#include "he-configuration.h"
30
33
31
namespace ns3 {
34
namespace ns3 {
32
35
 Lines 65-70   WifiNetDevice::GetTypeId (void) Link Here 
65
                   MakePointerAccessor (&WifiNetDevice::SetRemoteStationManager,
68
                   MakePointerAccessor (&WifiNetDevice::SetRemoteStationManager,
66
                                        &WifiNetDevice::GetRemoteStationManager),
69
                                        &WifiNetDevice::GetRemoteStationManager),
67
                   MakePointerChecker<WifiRemoteStationManager> ())
70
                   MakePointerChecker<WifiRemoteStationManager> ())
71
    .AddAttribute ("HtConfiguration",
72
                   "The HtConfiguration object.",
73
                   PointerValue (),
74
                   MakePointerAccessor (&WifiNetDevice::GetHtConfiguration),
75
                   MakePointerChecker<HtConfiguration> ())
76
    .AddAttribute ("VhtConfiguration",
77
                   "The VhtConfiguration object.",
78
                   PointerValue (),
79
                   MakePointerAccessor (&WifiNetDevice::GetVhtConfiguration),
80
                   MakePointerChecker<VhtConfiguration> ())
81
    .AddAttribute ("HeConfiguration",
82
                   "The HeConfiguration object.",
83
                   PointerValue (),
84
                   MakePointerAccessor (&WifiNetDevice::GetHeConfiguration),
85
                   MakePointerChecker<HeConfiguration> ())
68
  ;
86
  ;
69
  return tid;
87
  return tid;
70
}
88
}
 Lines 394-397   WifiNetDevice::SupportsSendFrom (void) const Link Here 
394
  return m_mac->SupportsSendFrom ();
412
  return m_mac->SupportsSendFrom ();
395
}
413
}
396
414
415
void
416
WifiNetDevice::SetHtConfiguration (Ptr<HtConfiguration> htConfiguration)
417
{
418
  m_htConfiguration = htConfiguration;
419
}
420
421
Ptr<HtConfiguration>
422
WifiNetDevice::GetHtConfiguration (void) const
423
{
424
  return m_htConfiguration;
425
}
426
427
void
428
WifiNetDevice::SetVhtConfiguration (Ptr<VhtConfiguration> vhtConfiguration)
429
{
430
  m_vhtConfiguration = vhtConfiguration;
431
}
432
433
Ptr<VhtConfiguration>
434
WifiNetDevice::GetVhtConfiguration (void) const
435
{
436
  return m_vhtConfiguration;
437
}
438
439
void
440
WifiNetDevice::SetHeConfiguration (Ptr<HeConfiguration> heConfiguration)
441
{
442
  m_heConfiguration = heConfiguration;
443
}
444
445
Ptr<HeConfiguration>
446
WifiNetDevice::GetHeConfiguration (void) const
447
{
448
  return m_heConfiguration;
449
}
450
397
} //namespace ns3
451
} //namespace ns3
(-)a/src/wifi/model/wifi-net-device.h (+31 lines)
 Lines 29-34   namespace ns3 { Link Here 
29
class WifiRemoteStationManager;
29
class WifiRemoteStationManager;
30
class WifiPhy;
30
class WifiPhy;
31
class WifiMac;
31
class WifiMac;
32
class HtConfiguration;
33
class VhtConfiguration;
34
class HeConfiguration;
32
35
33
/// This value conforms to the 802.11 specification
36
/// This value conforms to the 802.11 specification
34
static const uint16_t MAX_MSDU_SIZE = 2304;
37
static const uint16_t MAX_MSDU_SIZE = 2304;
 Lines 84-89   public: Link Here 
84
   */
87
   */
85
  Ptr<WifiRemoteStationManager> GetRemoteStationManager (void) const;
88
  Ptr<WifiRemoteStationManager> GetRemoteStationManager (void) const;
86
89
90
  /**
91
   * \param htConfiguration pointer to HtConfiguration
92
   */
93
  void SetHtConfiguration (Ptr<HtConfiguration> htConfiguration);
94
  /**
95
   * \return pointer to HtConfiguration if it exists
96
   */
97
  Ptr<HtConfiguration> GetHtConfiguration (void) const;
98
  /**
99
   * \param vhtConfiguration pointer to VhtConfiguration
100
   */
101
  void SetVhtConfiguration (Ptr<VhtConfiguration> vhtConfiguration);
102
  /**
103
   * \return pointer to VhtConfiguration if it exists
104
   */
105
  Ptr<VhtConfiguration> GetVhtConfiguration (void) const;
106
  /**
107
   * \param heConfiguration pointer to HeConfiguration
108
   */
109
  void SetHeConfiguration (Ptr<HeConfiguration> heConfiguration);
110
  /**
111
   * \return pointer to HeConfiguration if it exists
112
   */
113
  Ptr<HeConfiguration> GetHeConfiguration (void) const;
114
87
  //inherited from NetDevice base class.
115
  //inherited from NetDevice base class.
88
  void SetIfIndex (const uint32_t index);
116
  void SetIfIndex (const uint32_t index);
89
  uint32_t GetIfIndex (void) const;
117
  uint32_t GetIfIndex (void) const;
 Lines 162-167   private: Link Here 
162
  Ptr<WifiPhy> m_phy; //!< the phy
190
  Ptr<WifiPhy> m_phy; //!< the phy
163
  Ptr<WifiMac> m_mac; //!< the MAC
191
  Ptr<WifiMac> m_mac; //!< the MAC
164
  Ptr<WifiRemoteStationManager> m_stationManager; //!< the station manager
192
  Ptr<WifiRemoteStationManager> m_stationManager; //!< the station manager
193
  Ptr<HtConfiguration> m_htConfiguration; //!< the HtConfiguration
194
  Ptr<VhtConfiguration> m_vhtConfiguration; //!< the VhtConfiguration
195
  Ptr<HeConfiguration> m_heConfiguration; //!< the HeConfiguration
165
  NetDevice::ReceiveCallback m_forwardUp; //!< forward up callback
196
  NetDevice::ReceiveCallback m_forwardUp; //!< forward up callback
166
  NetDevice::PromiscReceiveCallback m_promiscRx; //!< promiscious receive callback
197
  NetDevice::PromiscReceiveCallback m_promiscRx; //!< promiscious receive callback
167
198
(-)a/src/wifi/model/wifi-phy.cc (-41 / +75 lines)
 Lines 31-36    Link Here 
31
#include "frame-capture-model.h"
31
#include "frame-capture-model.h"
32
#include "wifi-radio-energy-model.h"
32
#include "wifi-radio-energy-model.h"
33
#include "error-rate-model.h"
33
#include "error-rate-model.h"
34
#include "wifi-net-device.h"
35
#include "ht-configuration.h"
36
#include "he-configuration.h"
34
37
35
namespace ns3 {
38
namespace ns3 {
36
39
 Lines 264-296   WifiPhy::GetTypeId (void) Link Here 
264
                   BooleanValue (false),
267
                   BooleanValue (false),
265
                   MakeBooleanAccessor (&WifiPhy::GetShortGuardInterval,
268
                   MakeBooleanAccessor (&WifiPhy::GetShortGuardInterval,
266
                                        &WifiPhy::SetShortGuardInterval),
269
                                        &WifiPhy::SetShortGuardInterval),
267
                   MakeBooleanChecker ())
270
                   MakeBooleanChecker (),
271
                   TypeId::DEPRECATED, "Use the HtConfiguration instead")
268
    .AddAttribute ("GuardInterval",
272
    .AddAttribute ("GuardInterval",
269
                   "Whether 800ns, 1600ns or 3200ns guard interval is used for HE transmissions."
273
                   "Whether 800ns, 1600ns or 3200ns guard interval is used for HE transmissions."
270
                   "This parameter is only valuable for 802.11ax STAs and APs.",
274
                   "This parameter is only valuable for 802.11ax STAs and APs.",
271
                   TimeValue (NanoSeconds (3200)),
275
                   TimeValue (NanoSeconds (3200)),
272
                   MakeTimeAccessor (&WifiPhy::GetGuardInterval,
276
                   MakeTimeAccessor (&WifiPhy::GetGuardInterval,
273
                                     &WifiPhy::SetGuardInterval),
277
                                     &WifiPhy::SetGuardInterval),
274
                   MakeTimeChecker (NanoSeconds (400), NanoSeconds (3200)))
278
                   MakeTimeChecker (NanoSeconds (800), NanoSeconds (3200)),
275
    .AddAttribute ("LdpcEnabled",
279
                   TypeId::DEPRECATED, "Use the HeConfiguration instead")
276
                   "Whether or not LDPC is enabled (not supported yet!).",
277
                   BooleanValue (false),
278
                   MakeBooleanAccessor (&WifiPhy::GetLdpc,
279
                                        &WifiPhy::SetLdpc),
280
                   MakeBooleanChecker ())
281
    .AddAttribute ("STBCEnabled",
282
                   "Whether or not STBC is enabled (not supported yet!).",
283
                   BooleanValue (false),
284
                   MakeBooleanAccessor (&WifiPhy::GetStbc,
285
                                        &WifiPhy::SetStbc),
286
                   MakeBooleanChecker ())
287
    .AddAttribute ("GreenfieldEnabled",
280
    .AddAttribute ("GreenfieldEnabled",
288
                   "Whether or not Greenfield is enabled."
281
                   "Whether or not Greenfield is enabled."
289
                   "This parameter is only valuable for 802.11n STAs and APs.",
282
                   "This parameter is only valuable for 802.11n STAs and APs.",
290
                   BooleanValue (false),
283
                   BooleanValue (false),
291
                   MakeBooleanAccessor (&WifiPhy::GetGreenfield,
284
                   MakeBooleanAccessor (&WifiPhy::GetGreenfield,
292
                                        &WifiPhy::SetGreenfield),
285
                                        &WifiPhy::SetGreenfield),
293
                   MakeBooleanChecker ())
286
                   MakeBooleanChecker (),
287
                   TypeId::DEPRECATED, "Use the HtConfiguration instead")
294
    .AddAttribute ("ShortPlcpPreambleSupported",
288
    .AddAttribute ("ShortPlcpPreambleSupported",
295
                   "Whether or not short PLCP preamble is supported."
289
                   "Whether or not short PLCP preamble is supported."
296
                   "This parameter is only valuable for 802.11b STAs and APs."
290
                   "This parameter is only valuable for 802.11b STAs and APs."
 Lines 568-608   WifiPhy::GetRxGain (void) const Link Here 
568
}
562
}
569
563
570
void
564
void
571
WifiPhy::SetLdpc (bool ldpc)
572
{
573
  NS_LOG_FUNCTION (this << ldpc);
574
  m_ldpc = ldpc;
575
}
576
577
bool
578
WifiPhy::GetLdpc (void) const
579
{
580
  return m_ldpc;
581
}
582
583
void
584
WifiPhy::SetStbc (bool stbc)
585
{
586
  NS_LOG_FUNCTION (this << stbc);
587
  m_stbc = stbc;
588
}
589
590
bool
591
WifiPhy::GetStbc (void) const
592
{
593
  return m_stbc;
594
}
595
596
void
597
WifiPhy::SetGreenfield (bool greenfield)
565
WifiPhy::SetGreenfield (bool greenfield)
598
{
566
{
599
  NS_LOG_FUNCTION (this << greenfield);
567
  NS_LOG_FUNCTION (this << greenfield);
568
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
569
  if (device)
570
    {
571
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
572
      if (htConfiguration)
573
        {
574
          htConfiguration->SetGreenfieldSupported (greenfield);
575
        }
576
    }
600
  m_greenfield = greenfield;
577
  m_greenfield = greenfield;
601
}
578
}
602
579
603
bool
580
bool
604
WifiPhy::GetGreenfield (void) const
581
WifiPhy::GetGreenfield (void) const
605
{
582
{
583
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
584
  if (device)
585
    {
586
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
587
      if (htConfiguration)
588
        {
589
          return htConfiguration->GetGreenfieldSupported ();
590
        }
591
    }
606
  return m_greenfield;
592
  return m_greenfield;
607
}
593
}
608
594
 Lines 610-621   void Link Here 
610
WifiPhy::SetShortGuardInterval (bool shortGuardInterval)
596
WifiPhy::SetShortGuardInterval (bool shortGuardInterval)
611
{
597
{
612
  NS_LOG_FUNCTION (this << shortGuardInterval);
598
  NS_LOG_FUNCTION (this << shortGuardInterval);
599
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
600
  if (device)
601
    {
602
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
603
      if (htConfiguration)
604
        {
605
          htConfiguration->SetShortGuardIntervalSupported (shortGuardInterval);
606
        }
607
    }
613
  m_shortGuardInterval = shortGuardInterval;
608
  m_shortGuardInterval = shortGuardInterval;
614
}
609
}
615
610
616
bool
611
bool
617
WifiPhy::GetShortGuardInterval (void) const
612
WifiPhy::GetShortGuardInterval (void) const
618
{
613
{
614
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
615
  if (device)
616
    {
617
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
618
      if (htConfiguration)
619
        {
620
          return htConfiguration->GetShortGuardIntervalSupported ();
621
        }
622
    }
619
  return m_shortGuardInterval;
623
  return m_shortGuardInterval;
620
}
624
}
621
625
 Lines 624-635   WifiPhy::SetGuardInterval (Time guardInterval) Link Here 
624
{
628
{
625
  NS_LOG_FUNCTION (this << guardInterval);
629
  NS_LOG_FUNCTION (this << guardInterval);
626
  NS_ASSERT (guardInterval == NanoSeconds (800) || guardInterval == NanoSeconds (1600) || guardInterval == NanoSeconds (3200));
630
  NS_ASSERT (guardInterval == NanoSeconds (800) || guardInterval == NanoSeconds (1600) || guardInterval == NanoSeconds (3200));
631
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
632
  if (device)
633
    {
634
      Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
635
      if (heConfiguration)
636
        {
637
          heConfiguration->SetGuardInterval (guardInterval);
638
        }
639
    }
627
  m_guardInterval = guardInterval;
640
  m_guardInterval = guardInterval;
628
}
641
}
629
642
630
Time
643
Time
631
WifiPhy::GetGuardInterval (void) const
644
WifiPhy::GetGuardInterval (void) const
632
{
645
{
646
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
647
  if (device)
648
    {
649
      Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
650
      if (heConfiguration)
651
        {
652
          return heConfiguration->GetGuardInterval ();
653
        }
654
    }
633
  return m_guardInterval;
655
  return m_guardInterval;
634
}
656
}
635
657
 Lines 650-655   void Link Here 
650
WifiPhy::SetDevice (const Ptr<NetDevice> device)
672
WifiPhy::SetDevice (const Ptr<NetDevice> device)
651
{
673
{
652
  m_device = device;
674
  m_device = device;
675
  //TODO: to be removed once deprecated API is cleaned up
676
  Ptr<HtConfiguration> htConfiguration = DynamicCast<WifiNetDevice> (device)->GetHtConfiguration ();
677
  if (htConfiguration)
678
    {
679
      htConfiguration->SetShortGuardIntervalSupported (m_shortGuardInterval);
680
      htConfiguration->SetGreenfieldSupported (m_greenfield);
681
    }
682
  Ptr<HeConfiguration> heConfiguration = DynamicCast<WifiNetDevice> (device)->GetHeConfiguration ();
683
  if (heConfiguration)
684
    {
685
      heConfiguration->SetGuardInterval (m_guardInterval);
686
    }
653
}
687
}
654
688
655
Ptr<NetDevice>
689
Ptr<NetDevice>
(-)a/src/wifi/model/wifi-phy.h (-28 / +15 lines)
 Lines 1350-1404   public: Link Here 
1350
   * Enable or disable support for HT/VHT short guard interval.
1350
   * Enable or disable support for HT/VHT short guard interval.
1351
   *
1351
   *
1352
   * \param shortGuardInterval Enable or disable support for short guard interval
1352
   * \param shortGuardInterval Enable or disable support for short guard interval
1353
   *
1354
   * \deprecated
1353
   */
1355
   */
1354
  void SetShortGuardInterval (bool shortGuardInterval);
1356
  void SetShortGuardInterval (bool shortGuardInterval);
1355
  /**
1357
  /**
1356
   * Return whether short guard interval is supported.
1358
   * Return whether short guard interval is supported.
1357
   *
1359
   *
1358
   * \return true if short guard interval is supported, false otherwise
1360
   * \return true if short guard interval is supported, false otherwise
1361
   *
1362
   * \deprecated
1359
   */
1363
   */
1360
  bool GetShortGuardInterval (void) const;
1364
  bool GetShortGuardInterval (void) const;
1361
  /**
1365
  /**
1362
   * \param guardInterval the supported HE guard interval
1366
   * \param guardInterval the supported HE guard interval
1367
   *
1368
   * \deprecated
1363
   */
1369
   */
1364
  void SetGuardInterval (Time guardInterval);
1370
  void SetGuardInterval (Time guardInterval);
1365
  /**
1371
  /**
1366
   * \return the supported HE guard interval
1372
   * \return the supported HE guard interval
1367
   */
1368
  Time GetGuardInterval (void) const;
1369
  /**
1370
   * Enable or disable LDPC.
1371
   * \param ldpc Enable or disable LDPC
1372
   */
1373
  void SetLdpc (bool ldpc);
1374
  /**
1375
   * Return if LDPC is supported.
1376
   *
1373
   *
1377
   * \return true if LDPC is supported, false otherwise
1374
   * \deprecated
1378
   */
1375
   */
1379
  bool GetLdpc (void) const;
1376
  Time GetGuardInterval (void) const;
1380
  /**
1381
   * Enable or disable STBC.
1382
   *
1383
   * \param stbc Enable or disable STBC
1384
   */
1385
  void SetStbc (bool stbc);
1386
  /**
1387
   * Return whether STBC is supported.
1388
   *
1389
   * \return true if STBC is supported, false otherwise
1390
   */
1391
  bool GetStbc (void) const;
1392
  /**
1377
  /**
1393
   * Enable or disable Greenfield support.
1378
   * Enable or disable Greenfield support.
1394
   *
1379
   *
1395
   * \param greenfield Enable or disable Greenfield
1380
   * \param greenfield Enable or disable Greenfield
1381
   *
1382
   * \deprecated
1396
   */
1383
   */
1397
  void SetGreenfield (bool greenfield);
1384
  void SetGreenfield (bool greenfield);
1398
  /**
1385
  /**
1399
   * Return whether Greenfield is supported.
1386
   * Return whether Greenfield is supported.
1400
   *
1387
   *
1401
   * \return true if Greenfield is supported, false otherwise
1388
   * \return true if Greenfield is supported, false otherwise
1389
   *
1390
   * \deprecated
1402
   */
1391
   */
1403
  bool GetGreenfield (void) const;
1392
  bool GetGreenfield (void) const;
1404
  /**
1393
  /**
 Lines 1761-1773   private: Link Here 
1761
  double   m_txPowerEndDbm;       //!< Maximum transmission power (dBm)
1750
  double   m_txPowerEndDbm;       //!< Maximum transmission power (dBm)
1762
  uint8_t  m_nTxPower;            //!< Number of available transmission power levels
1751
  uint8_t  m_nTxPower;            //!< Number of available transmission power levels
1763
1752
1764
  bool     m_ldpc;               //!< Flag if LDPC is used
1753
  bool     m_greenfield;         //!< Flag if GreenField format is supported (deprecated)
1765
  bool     m_stbc;               //!< Flag if STBC is used
1754
  bool     m_shortGuardInterval; //!< Flag if HT/VHT short guard interval is supported (deprecated)
1766
  bool     m_greenfield;         //!< Flag if GreenField format is supported
1767
  bool     m_shortGuardInterval; //!< Flag if HT/VHT short guard interval is supported
1768
  bool     m_shortPreamble;      //!< Flag if short PLCP preamble is supported
1755
  bool     m_shortPreamble;      //!< Flag if short PLCP preamble is supported
1769
1756
1770
  Time m_guardInterval; //!< Supported HE guard interval
1757
  Time m_guardInterval; //!< Supported HE guard interval (deprecated)
1771
1758
1772
  uint8_t m_numberOfAntennas;  //!< Number of transmitters
1759
  uint8_t m_numberOfAntennas;  //!< Number of transmitters
1773
  uint8_t m_txSpatialStreams;  //!< Number of supported TX spatial streams
1760
  uint8_t m_txSpatialStreams;  //!< Number of supported TX spatial streams
(-)a/src/wifi/model/wifi-remote-station-manager.cc (-53 / +93 lines)
 Lines 22-30    Link Here 
22
#include "ns3/boolean.h"
22
#include "ns3/boolean.h"
23
#include "ns3/uinteger.h"
23
#include "ns3/uinteger.h"
24
#include "ns3/enum.h"
24
#include "ns3/enum.h"
25
#include "ns3/packet.h"
26
#include "ns3/simulator.h"
25
#include "ns3/simulator.h"
27
#include "ns3/tag.h"
28
#include "wifi-remote-station-manager.h"
26
#include "wifi-remote-station-manager.h"
29
#include "wifi-phy.h"
27
#include "wifi-phy.h"
30
#include "wifi-mac.h"
28
#include "wifi-mac.h"
 Lines 34-43    Link Here 
34
#include "ht-capabilities.h"
32
#include "ht-capabilities.h"
35
#include "vht-capabilities.h"
33
#include "vht-capabilities.h"
36
#include "he-capabilities.h"
34
#include "he-capabilities.h"
37
35
#include "ht-configuration.h"
38
/***************************************************************
36
#include "vht-configuration.h"
39
 *           Packet Mode Tagger
37
#include "he-configuration.h"
40
 ***************************************************************/
38
#include "wifi-net-device.h"
41
39
42
namespace ns3 {
40
namespace ns3 {
43
41
 Lines 403-412   WifiRemoteStationManager::GetTypeId (void) Link Here 
403
}
401
}
404
402
405
WifiRemoteStationManager::WifiRemoteStationManager ()
403
WifiRemoteStationManager::WifiRemoteStationManager ()
406
  : m_htSupported (false),
404
  : m_pcfSupported (false),
407
    m_vhtSupported (false),
408
    m_heSupported (false),
409
    m_pcfSupported (false),
410
    m_useNonErpProtection (false),
405
    m_useNonErpProtection (false),
411
    m_useNonHtProtection (false),
406
    m_useNonHtProtection (false),
412
    m_useGreenfieldProtection (false),
407
    m_useGreenfieldProtection (false),
 Lines 441-447   WifiRemoteStationManager::SetupPhy (const Ptr<WifiPhy> phy) Link Here 
441
  m_wifiPhy = phy;
436
  m_wifiPhy = phy;
442
  m_defaultTxMode = phy->GetMode (0);
437
  m_defaultTxMode = phy->GetMode (0);
443
  NS_ASSERT (m_defaultTxMode.IsMandatory ());
438
  NS_ASSERT (m_defaultTxMode.IsMandatory ());
444
  if (HasHtSupported () || HasVhtSupported () || HasHeSupported ())
439
  if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
445
    {
440
    {
446
      m_defaultTxMcs = phy->GetMcs (0);
441
      m_defaultTxMcs = phy->GetMcs (0);
447
    }
442
    }
 Lines 480-492   WifiRemoteStationManager::SetRtsCtsThreshold (uint32_t threshold) Link Here 
480
}
475
}
481
476
482
void
477
void
483
WifiRemoteStationManager::SetHtSupported (bool enable)
484
{
485
  NS_LOG_FUNCTION (this << enable);
486
  m_htSupported = enable;
487
}
488
489
void
490
WifiRemoteStationManager::SetFragmentationThreshold (uint32_t threshold)
478
WifiRemoteStationManager::SetFragmentationThreshold (uint32_t threshold)
491
{
479
{
492
  NS_LOG_FUNCTION (this << threshold);
480
  NS_LOG_FUNCTION (this << threshold);
 Lines 533-577   WifiRemoteStationManager::GetRifsPermitted (void) const Link Here 
533
}
521
}
534
522
535
bool
523
bool
536
WifiRemoteStationManager::HasHtSupported (void) const
524
WifiRemoteStationManager::GetHtSupported (void) const
537
{
525
{
538
  return m_htSupported;
526
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
527
  Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
528
  if (htConfiguration)
529
    {
530
      return true;
531
    }
532
  return false;
539
}
533
}
540
534
541
void
535
bool
542
WifiRemoteStationManager::SetVhtSupported (bool enable)
536
WifiRemoteStationManager::GetVhtSupported (void) const
543
{
537
{
544
  m_vhtSupported = enable;
538
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
539
  Ptr<VhtConfiguration> vhtConfiguration = device->GetVhtConfiguration ();
540
  if (vhtConfiguration)
541
    {
542
      return true;
543
    }
544
  return false;
545
}
545
}
546
546
547
bool
547
bool
548
WifiRemoteStationManager::HasVhtSupported (void) const
548
WifiRemoteStationManager::GetHeSupported (void) const
549
{
549
{
550
  return m_vhtSupported;
550
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
551
  Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
552
  if (heConfiguration)
553
    {
554
      return true;
555
    }
556
  return false;
551
}
557
}
552
558
553
void
559
void
554
WifiRemoteStationManager::SetHeSupported (bool enable)
560
WifiRemoteStationManager::SetPcfSupported (bool enable)
555
{
561
{
556
  m_heSupported = enable;
562
  m_pcfSupported = enable;
557
}
563
}
558
564
559
bool
565
bool
560
WifiRemoteStationManager::HasHeSupported (void) const
566
WifiRemoteStationManager::GetPcfSupported (void) const
561
{
567
{
562
  return m_heSupported;
568
  return m_pcfSupported;
563
}
569
}
564
570
565
void
571
bool
566
WifiRemoteStationManager::SetPcfSupported (bool enable)
572
WifiRemoteStationManager::GetGreenfieldSupported (void) const
567
{
573
{
568
  m_pcfSupported = enable;
574
  if (GetHtSupported ())
575
    {
576
      Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
577
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
578
      NS_ASSERT (htConfiguration); //If HT is supported, we should have a HT configuration attached
579
      if (htConfiguration->GetGreenfieldSupported ())
580
        {
581
          return true;
582
        }
583
    }
584
  return false;
569
}
585
}
570
586
571
bool
587
bool
572
WifiRemoteStationManager::HasPcfSupported (void) const
588
WifiRemoteStationManager::GetShortGuardIntervalSupported (void) const
573
{
589
{
574
  return m_pcfSupported;
590
  if (GetHtSupported ())
591
    {
592
      Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
593
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
594
      NS_ASSERT (htConfiguration); //If HT is supported, we should have a HT configuration attached
595
      if (htConfiguration->GetShortGuardIntervalSupported ())
596
        {
597
          return true;
598
        }
599
    }
600
  return false;
601
}
602
603
uint16_t
604
WifiRemoteStationManager::GetGuardInterval (void) const
605
{
606
  uint16_t gi = 0;
607
  if (GetHeSupported ())
608
    {
609
      Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
610
      Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
611
      NS_ASSERT (heConfiguration); //If HE is supported, we should have a HE configuration attached
612
      gi = static_cast<uint16_t>(heConfiguration->GetGuardInterval ().GetNanoSeconds ());
613
    }
614
  return gi;
575
}
615
}
576
616
577
uint32_t
617
uint32_t
 Lines 808-818   WifiRemoteStationManager::GetDataTxVector (Mac48Address address, const WifiMacHe Link Here 
808
      v.SetPreambleType (GetPreambleForTransmission (mode, address));
848
      v.SetPreambleType (GetPreambleForTransmission (mode, address));
809
      v.SetTxPowerLevel (m_defaultTxPowerLevel);
849
      v.SetTxPowerLevel (m_defaultTxPowerLevel);
810
      v.SetChannelWidth (GetChannelWidthForTransmission (mode, m_wifiPhy->GetChannelWidth ()));
850
      v.SetChannelWidth (GetChannelWidthForTransmission (mode, m_wifiPhy->GetChannelWidth ()));
811
      v.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mode, m_wifiPhy->GetShortGuardInterval (), m_wifiPhy->GetGuardInterval ()));
851
      v.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
812
      v.SetNTx (1);
852
      v.SetNTx (1);
813
      v.SetNss (1);
853
      v.SetNss (1);
814
      v.SetNess (0);
854
      v.SetNess (0);
815
      v.SetStbc (m_wifiPhy->GetStbc ());
855
      v.SetStbc (0);
816
      return v;
856
      return v;
817
    }
857
    }
818
  if (!IsLowLatency ())
858
  if (!IsLowLatency ())
 Lines 838-844   WifiRemoteStationManager::GetDataTxVector (Mac48Address address, const WifiMacHe Link Here 
838
      txVector.SetMode (mgtMode);
878
      txVector.SetMode (mgtMode);
839
      txVector.SetPreambleType (GetPreambleForTransmission (mgtMode, address));
879
      txVector.SetPreambleType (GetPreambleForTransmission (mgtMode, address));
840
      txVector.SetChannelWidth (GetChannelWidthForTransmission (mgtMode, m_wifiPhy->GetChannelWidth ()));
880
      txVector.SetChannelWidth (GetChannelWidthForTransmission (mgtMode, m_wifiPhy->GetChannelWidth ()));
841
      txVector.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mgtMode, m_wifiPhy->GetShortGuardInterval (), m_wifiPhy->GetGuardInterval ()));
881
      txVector.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mgtMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
842
    }
882
    }
843
  return txVector;
883
  return txVector;
844
}
884
}
 Lines 883-889   WifiRemoteStationManager::DoGetCtsToSelfTxVector (void) Link Here 
883
  return WifiTxVector (defaultMode,
923
  return WifiTxVector (defaultMode,
884
                       GetDefaultTxPowerLevel (),
924
                       GetDefaultTxPowerLevel (),
885
                       defaultPreamble,
925
                       defaultPreamble,
886
                       ConvertGuardIntervalToNanoSeconds (defaultMode, m_wifiPhy->GetShortGuardInterval (), m_wifiPhy->GetGuardInterval ()),
926
                       ConvertGuardIntervalToNanoSeconds (defaultMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())),
887
                       GetNumberOfAntennas (),
927
                       GetNumberOfAntennas (),
888
                       GetMaxNumberOfTransmitStreams (),
928
                       GetMaxNumberOfTransmitStreams (),
889
                       0,
929
                       0,
 Lines 1102-1108   WifiRemoteStationManager::NeedCtsToSelf (WifiTxVector txVector) Link Here 
1102
              return false;
1142
              return false;
1103
            }
1143
            }
1104
        }
1144
        }
1105
      if (HasHtSupported ())
1145
      if (GetHtSupported ())
1106
        {
1146
        {
1107
          //search for the BSS Basic MCS set, if the used mode is in the basic set then there is no need for Cts To Self
1147
          //search for the BSS Basic MCS set, if the used mode is in the basic set then there is no need for Cts To Self
1108
          for (WifiModeListIterator i = m_bssBasicMcsSet.begin (); i != m_bssBasicMcsSet.end (); i++)
1148
          for (WifiModeListIterator i = m_bssBasicMcsSet.begin (); i != m_bssBasicMcsSet.end (); i++)
 Lines 1364-1370   WifiRemoteStationManager::GetControlAnswerMode (WifiMode reqMode) Link Here 
1364
          found = true;
1404
          found = true;
1365
        }
1405
        }
1366
    }
1406
    }
1367
  if (HasHtSupported () || HasVhtSupported () || HasHeSupported ())
1407
  if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
1368
    {
1408
    {
1369
      if (!found)
1409
      if (!found)
1370
        {
1410
        {
 Lines 1433-1439   WifiRemoteStationManager::GetControlAnswerMode (WifiMode reqMode) Link Here 
1433
          found = true;
1473
          found = true;
1434
        }
1474
        }
1435
    }
1475
    }
1436
  if (HasHtSupported () || HasVhtSupported () || HasHeSupported ())
1476
  if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
1437
    {
1477
    {
1438
      for (uint8_t idx = 0; idx < m_wifiPhy->GetNMcs (); idx++)
1478
      for (uint8_t idx = 0; idx < m_wifiPhy->GetNMcs (); idx++)
1439
        {
1479
        {
 Lines 1484-1490   WifiRemoteStationManager::GetCtsTxVector (Mac48Address address, WifiMode rtsMode Link Here 
1484
  v.SetGuardInterval (DoGetCtsTxGuardInterval (address, ctsMode));
1524
  v.SetGuardInterval (DoGetCtsTxGuardInterval (address, ctsMode));
1485
  v.SetNss (DoGetCtsTxNss (address, ctsMode));
1525
  v.SetNss (DoGetCtsTxNss (address, ctsMode));
1486
  v.SetNess (DoGetCtsTxNess (address, ctsMode));
1526
  v.SetNess (DoGetCtsTxNess (address, ctsMode));
1487
  v.SetStbc (m_wifiPhy->GetStbc ());
1527
  v.SetStbc (0);
1488
  return v;
1528
  return v;
1489
}
1529
}
1490
1530
 Lines 1501-1507   WifiRemoteStationManager::GetAckTxVector (Mac48Address address, WifiMode dataMod Link Here 
1501
  v.SetGuardInterval (DoGetAckTxGuardInterval (address, ackMode));
1541
  v.SetGuardInterval (DoGetAckTxGuardInterval (address, ackMode));
1502
  v.SetNss (DoGetAckTxNss (address, ackMode));
1542
  v.SetNss (DoGetAckTxNss (address, ackMode));
1503
  v.SetNess (DoGetAckTxNess (address, ackMode));
1543
  v.SetNess (DoGetAckTxNess (address, ackMode));
1504
  v.SetStbc (m_wifiPhy->GetStbc ());
1544
  v.SetStbc (0);
1505
  return v;
1545
  return v;
1506
}
1546
}
1507
1547
 Lines 1518-1524   WifiRemoteStationManager::GetBlockAckTxVector (Mac48Address address, WifiMode bl Link Here 
1518
  v.SetGuardInterval (DoGetBlockAckTxGuardInterval (address, blockAckMode));
1558
  v.SetGuardInterval (DoGetBlockAckTxGuardInterval (address, blockAckMode));
1519
  v.SetNss (DoGetBlockAckTxNss (address, blockAckMode));
1559
  v.SetNss (DoGetBlockAckTxNss (address, blockAckMode));
1520
  v.SetNess (DoGetBlockAckTxNess (address, blockAckMode));
1560
  v.SetNess (DoGetBlockAckTxNess (address, blockAckMode));
1521
  v.SetStbc (m_wifiPhy->GetStbc ());
1561
  v.SetStbc (0);
1522
  return v;
1562
  return v;
1523
}
1563
}
1524
1564
 Lines 1537-1543   WifiRemoteStationManager::DoGetCtsTxChannelWidth (Mac48Address address, WifiMode Link Here 
1537
uint16_t
1577
uint16_t
1538
WifiRemoteStationManager::DoGetCtsTxGuardInterval (Mac48Address address, WifiMode ctsMode)
1578
WifiRemoteStationManager::DoGetCtsTxGuardInterval (Mac48Address address, WifiMode ctsMode)
1539
{
1579
{
1540
  return ConvertGuardIntervalToNanoSeconds (ctsMode, m_wifiPhy->GetShortGuardInterval (), m_wifiPhy->GetGuardInterval ());
1580
  return ConvertGuardIntervalToNanoSeconds (ctsMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ()));
1541
}
1581
}
1542
1582
1543
uint8_t
1583
uint8_t
 Lines 1567-1573   WifiRemoteStationManager::DoGetAckTxChannelWidth (Mac48Address address, WifiMode Link Here 
1567
uint16_t
1607
uint16_t
1568
WifiRemoteStationManager::DoGetAckTxGuardInterval (Mac48Address address, WifiMode ackMode)
1608
WifiRemoteStationManager::DoGetAckTxGuardInterval (Mac48Address address, WifiMode ackMode)
1569
{
1609
{
1570
  return ConvertGuardIntervalToNanoSeconds (ackMode, m_wifiPhy->GetShortGuardInterval (), m_wifiPhy->GetGuardInterval ());
1610
  return ConvertGuardIntervalToNanoSeconds (ackMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ()));
1571
}
1611
}
1572
1612
1573
uint8_t
1613
uint8_t
 Lines 1597-1603   WifiRemoteStationManager::DoGetBlockAckTxChannelWidth (Mac48Address address, Wif Link Here 
1597
uint16_t
1637
uint16_t
1598
WifiRemoteStationManager::DoGetBlockAckTxGuardInterval (Mac48Address address, WifiMode blockAckMode)
1638
WifiRemoteStationManager::DoGetBlockAckTxGuardInterval (Mac48Address address, WifiMode blockAckMode)
1599
{
1639
{
1600
  return ConvertGuardIntervalToNanoSeconds (blockAckMode, m_wifiPhy->GetShortGuardInterval (), m_wifiPhy->GetGuardInterval ());
1640
  return ConvertGuardIntervalToNanoSeconds (blockAckMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ()));
1601
}
1641
}
1602
1642
1603
uint8_t
1643
uint8_t
 Lines 1643-1651   WifiRemoteStationManager::LookupState (Mac48Address address) const Link Here 
1643
  state->m_operationalRateSet.push_back (GetDefaultMode ());
1683
  state->m_operationalRateSet.push_back (GetDefaultMode ());
1644
  state->m_operationalMcsSet.push_back (GetDefaultMcs ());
1684
  state->m_operationalMcsSet.push_back (GetDefaultMcs ());
1645
  state->m_channelWidth = m_wifiPhy->GetChannelWidth ();
1685
  state->m_channelWidth = m_wifiPhy->GetChannelWidth ();
1646
  state->m_shortGuardInterval = m_wifiPhy->GetShortGuardInterval ();
1686
  state->m_shortGuardInterval = GetShortGuardIntervalSupported ();
1647
  state->m_guardInterval = static_cast<uint16_t> (m_wifiPhy->GetGuardInterval ().GetNanoSeconds ());
1687
  state->m_guardInterval = GetGuardInterval ();
1648
  state->m_greenfield = m_wifiPhy->GetGreenfield ();
1688
  state->m_greenfield = GetGreenfieldSupported ();
1649
  state->m_streams = 1;
1689
  state->m_streams = 1;
1650
  state->m_ness = 0;
1690
  state->m_ness = 0;
1651
  state->m_aggregation = false;
1691
  state->m_aggregation = false;
 Lines 2069-2075   WifiRemoteStationManager::GetChannelWidth (const WifiRemoteStation *station) con Link Here 
2069
}
2109
}
2070
2110
2071
bool
2111
bool
2072
WifiRemoteStationManager::GetShortGuardInterval (const WifiRemoteStation *station) const
2112
WifiRemoteStationManager::GetShortGuardIntervalSupported (const WifiRemoteStation *station) const
2073
{
2113
{
2074
  return station->m_state->m_shortGuardInterval;
2114
  return station->m_state->m_shortGuardInterval;
2075
}
2115
}
 Lines 2174-2180   WifiRemoteStationManager::GetChannelWidthSupported (Mac48Address address) const Link Here 
2174
}
2214
}
2175
2215
2176
bool
2216
bool
2177
WifiRemoteStationManager::GetShortGuardInterval (Mac48Address address) const
2217
WifiRemoteStationManager::GetShortGuardIntervalSupported (Mac48Address address) const
2178
{
2218
{
2179
  return LookupState (address)->m_shortGuardInterval;
2219
  return LookupState (address)->m_shortGuardInterval;
2180
}
2220
}
 Lines 2240-2246   WifiRemoteStationManager::GetPreambleForTransmission (WifiMode mode, Mac48Addres Link Here 
2240
    {
2280
    {
2241
      preamble = WIFI_PREAMBLE_VHT;
2281
      preamble = WIFI_PREAMBLE_VHT;
2242
    }
2282
    }
2243
  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT && m_wifiPhy->GetGreenfield () && GetGreenfieldSupported (dest) && !GetUseGreenfieldProtection ())
2283
  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT && GetGreenfieldSupported () && GetGreenfieldSupported (dest) && !GetUseGreenfieldProtection ())
2244
    {
2284
    {
2245
      //If protection for greenfield is used we go for HT_MF preamble which is the default protection for GF format defined in the standard.
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.
2246
      preamble = WIFI_PREAMBLE_HT_GF;
2286
      preamble = WIFI_PREAMBLE_HT_GF;
(-)a/src/wifi/model/wifi-remote-station-manager.h (-28 / +25 lines)
 Lines 191-243   public: Link Here 
191
   */
191
   */
192
  void AddStationHeCapabilities (Mac48Address from, HeCapabilities hecapabilities);
192
  void AddStationHeCapabilities (Mac48Address from, HeCapabilities hecapabilities);
193
  /**
193
  /**
194
   * Enable or disable HT capability support.
195
   *
196
   * \param enable enable or disable HT capability support
197
   */
198
  virtual void SetHtSupported (bool enable);
199
  /**
200
   * Return whether the device has HT capability support enabled.
194
   * Return whether the device has HT capability support enabled.
201
   *
195
   *
202
   * \return true if HT capability support is enabled, false otherwise
196
   * \return true if HT capability support is enabled, false otherwise
203
   */
197
   */
204
  bool HasHtSupported (void) const;
198
  bool GetHtSupported (void) const;
205
  /**
206
   * Enable or disable VHT capability support.
207
   *
208
   * \param enable enable or disable VHT capability support
209
   */
210
  virtual void SetVhtSupported (bool enable);
211
  /**
199
  /**
212
   * Return whether the device has VHT capability support enabled.
200
   * Return whether the device has VHT capability support enabled.
213
   *
201
   *
214
   * \return true if VHT capability support is enabled, false otherwise
202
   * \return true if VHT capability support is enabled, false otherwise
215
   */
203
   */
216
  bool HasVhtSupported (void) const;
204
  bool GetVhtSupported (void) const;
217
  /**
218
   * Enable or disable HE capability support.
219
   *
220
   * \param enable enable or disable HE capability support
221
   */
222
  virtual void SetHeSupported (bool enable);
223
  /**
205
  /**
224
   * Return whether the device has HE capability support enabled.
206
   * Return whether the device has HE capability support enabled.
225
   *
207
   *
226
   * \return true if HE capability support is enabled, false otherwise
208
   * \return true if HE capability support is enabled, false otherwise
227
   */
209
   */
228
  bool HasHeSupported (void) const;
210
  bool GetHeSupported (void) const;
229
  /**
211
  /**
230
   * Enable or disable PCF capability support.
212
   * Enable or disable PCF capability support.
231
   *
213
   *
232
   * \param enable enable or disable PCF capability support
214
   * \param enable enable or disable PCF capability support
233
   */
215
   */
234
  virtual void SetPcfSupported (bool enable);
216
  void SetPcfSupported (bool enable);
235
  /**
217
  /**
236
   * Return whether the device has PCF capability support enabled.
218
   * Return whether the device has PCF capability support enabled.
237
   *
219
   *
238
   * \return true if PCF capability support is enabled, false otherwise
220
   * \return true if PCF capability support is enabled, false otherwise
239
   */
221
   */
240
  bool HasPcfSupported (void) const;
222
  bool GetPcfSupported (void) const;
223
  /**
224
   * Return whether the device has HT Greenfield support enabled.
225
   *
226
   * \return true if HT Grenfield support is enabled, false otherwise
227
   */
228
  bool GetGreenfieldSupported (void) const;
229
  /**
230
   * Return whether the device has SGI support enabled.
231
   *
232
   * \return true if SGI support is enabled, false otherwise
233
   */
234
  bool GetShortGuardIntervalSupported (void) const;
235
  /**
236
   * Return the supported HE guard interval duration (in nanoseconds).
237
   *
238
   * \return the supported HE guard interval duration (in nanoseconds)
239
   */
240
  uint16_t GetGuardInterval (void) const;
241
  /**
241
  /**
242
   * Enable or disable protection for non-ERP stations.
242
   * Enable or disable protection for non-ERP stations.
243
   *
243
   *
 Lines 450-456   public: Link Here 
450
   * \return true if the station supports HT/VHT short guard interval,
450
   * \return true if the station supports HT/VHT short guard interval,
451
   *         false otherwise
451
   *         false otherwise
452
   */
452
   */
453
  bool GetShortGuardInterval (Mac48Address address) const;
453
  bool GetShortGuardIntervalSupported (Mac48Address address) const;
454
  /**
454
  /**
455
   * Return the number of spatial streams supported by the station.
455
   * Return the number of spatial streams supported by the station.
456
   *
456
   *
 Lines 993-999   protected: Link Here 
993
   * \return true if the station supports HT/VHT short guard interval,
993
   * \return true if the station supports HT/VHT short guard interval,
994
   *         false otherwise
994
   *         false otherwise
995
   */
995
   */
996
  bool GetShortGuardInterval (const WifiRemoteStation *station) const;
996
  bool GetShortGuardIntervalSupported (const WifiRemoteStation *station) const;
997
  /**
997
  /**
998
   * Return the HE guard interval duration supported by the station.
998
   * Return the HE guard interval duration supported by the station.
999
   *
999
   *
 Lines 1438-1446   private: Link Here 
1438
  WifiMode m_defaultTxMode; //!< The default transmission mode
1438
  WifiMode m_defaultTxMode; //!< The default transmission mode
1439
  WifiMode m_defaultTxMcs;   //!< The default transmission modulation-coding scheme (MCS)
1439
  WifiMode m_defaultTxMcs;   //!< The default transmission modulation-coding scheme (MCS)
1440
1440
1441
  bool m_htSupported;  //!< Flag if HT capability is supported
1442
  bool m_vhtSupported; //!< Flag if VHT capability is supported
1443
  bool m_heSupported;  //!< Flag if HE capability is supported
1444
  bool m_pcfSupported; //!< Flag if PCF capability is supported
1441
  bool m_pcfSupported; //!< Flag if PCF capability is supported
1445
  uint32_t m_maxSsrc;  //!< Maximum STA short retry count (SSRC)
1442
  uint32_t m_maxSsrc;  //!< Maximum STA short retry count (SSRC)
1446
  uint32_t m_maxSlrc;  //!< Maximum STA long retry count (SLRC)
1443
  uint32_t m_maxSlrc;  //!< Maximum STA long retry count (SLRC)
(-)a/src/wifi/model/wifi-utils.cc (-1 / +22 lines)
 Lines 18-29    Link Here 
18
 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
18
 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
19
 */
19
 */
20
20
21
#include "ns3/packet.h"
22
#include "ns3/nstime.h"
21
#include "ns3/nstime.h"
23
#include "wifi-utils.h"
22
#include "wifi-utils.h"
24
#include "ctrl-headers.h"
23
#include "ctrl-headers.h"
25
#include "wifi-mac-header.h"
24
#include "wifi-mac-header.h"
26
#include "wifi-mac-trailer.h"
25
#include "wifi-mac-trailer.h"
26
#include "wifi-net-device.h"
27
#include "ht-configuration.h"
28
#include "he-configuration.h"
27
#include "wifi-mode.h"
29
#include "wifi-mode.h"
28
30
29
namespace ns3 {
31
namespace ns3 {
 Lines 65-70   Is5Ghz (double frequency) Link Here 
65
}
67
}
66
68
67
uint16_t
69
uint16_t
70
ConvertGuardIntervalToNanoSeconds (WifiMode mode, const Ptr<WifiNetDevice> device)
71
{
72
  uint16_t gi = 800;
73
  if (mode.GetModulationClass () == WIFI_MOD_CLASS_HE)
74
    {
75
      Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
76
      NS_ASSERT (heConfiguration); //If HE modulation is used, we should have a HE configuration attached
77
      gi = static_cast<uint16_t> (heConfiguration->GetGuardInterval ().GetNanoSeconds ());
78
    }
79
  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT || mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
80
    {
81
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
82
      NS_ASSERT (htConfiguration); //If HT/VHT modulation is used, we should have a HT configuration attached
83
      gi = htConfiguration->GetShortGuardIntervalSupported () ? 400 : 800;
84
    }
85
  return gi;
86
}
87
88
uint16_t
68
ConvertGuardIntervalToNanoSeconds (WifiMode mode, bool htShortGuardInterval, Time heGuardInterval)
89
ConvertGuardIntervalToNanoSeconds (WifiMode mode, bool htShortGuardInterval, Time heGuardInterval)
69
{
90
{
70
  uint16_t gi;
91
  uint16_t gi;
(-)a/src/wifi/model/wifi-utils.h (+10 lines)
 Lines 25-30    Link Here 
25
25
26
namespace ns3 {
26
namespace ns3 {
27
27
28
class WifiNetDevice;
28
class WifiMacHeader;
29
class WifiMacHeader;
29
class WifiMode;
30
class WifiMode;
30
class Packet;
31
class Packet;
 Lines 76-81   bool Is5Ghz (double frequency); Link Here 
76
 * Convert the guard interval to nanoseconds based on the wifimode.
77
 * Convert the guard interval to nanoseconds based on the wifimode.
77
 *
78
 *
78
 * \param mode the wifimode
79
 * \param mode the wifimode
80
 * \param device pointer to the WifiNetDevice object
81
 *
82
 * \return the guard interval duration in nanoseconds
83
 */
84
uint16_t ConvertGuardIntervalToNanoSeconds (WifiMode mode, const Ptr<WifiNetDevice> device);
85
/**
86
 * Convert the guard interval to nanoseconds based on the wifimode.
87
 *
88
 * \param mode the wifimode
79
 * \param htShortGuardInterval whether HT/VHT short guard interval is enabled
89
 * \param htShortGuardInterval whether HT/VHT short guard interval is enabled
80
 * \param heGuardInterval the HE guard interval duration
90
 * \param heGuardInterval the HE guard interval duration
81
 *
91
 *
(-)a/src/wifi/test/power-rate-adaptation-test.cc (-1 / +2 lines)
 Lines 73-79   PowerRateAdaptationTest::ConfigureNode () Link Here 
73
  /*
73
  /*
74
   * Create mac layer. We use Adhoc because association is not needed to get supported rates.
74
   * Create mac layer. We use Adhoc because association is not needed to get supported rates.
75
   */
75
   */
76
  Ptr<WifiNetDevice> dev = CreateObject<WifiNetDevice> ();
76
  Ptr<AdhocWifiMac> mac = CreateObject<AdhocWifiMac> ();
77
  Ptr<AdhocWifiMac> mac = CreateObject<AdhocWifiMac> ();
78
  mac->SetDevice (dev);
77
  mac->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
79
  mac->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
78
80
79
  /*
81
  /*
 Lines 84-90   PowerRateAdaptationTest::ConfigureNode () Link Here 
84
  /*
86
  /*
85
   * Create and configure phy layer.
87
   * Create and configure phy layer.
86
   */
88
   */
87
  Ptr<WifiNetDevice> dev = CreateObject<WifiNetDevice> ();
88
  Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
89
  Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
89
  phy->SetChannel (channel);
90
  phy->SetChannel (channel);
90
  phy->SetDevice (dev);
91
  phy->SetDevice (dev);
(-)a/src/wifi/test/wifi-aggregation-test.cc (-113 / +92 lines)
 Lines 22-35    Link Here 
22
#include "ns3/test.h"
22
#include "ns3/test.h"
23
#include "ns3/simulator.h"
23
#include "ns3/simulator.h"
24
#include "ns3/wifi-mac-queue.h"
24
#include "ns3/wifi-mac-queue.h"
25
#include "ns3/mac-low.h"
25
#include "ns3/sta-wifi-mac.h"
26
#include "ns3/qos-txop.h"
27
#include "ns3/yans-wifi-phy.h"
26
#include "ns3/yans-wifi-phy.h"
28
#include "ns3/mac-tx-middle.h"
27
#include "ns3/mac-tx-middle.h"
28
#include "ns3/mac-low.h"
29
#include "ns3/msdu-aggregator.h"
29
#include "ns3/msdu-aggregator.h"
30
#include "ns3/mpdu-aggregator.h"
30
#include "ns3/mpdu-aggregator.h"
31
#include "ns3/mgt-headers.h"
31
#include "ns3/wifi-net-device.h"
32
#include "ns3/wifi-remote-station-manager.h"
32
#include "ns3/ht-configuration.h"
33
33
34
using namespace ns3;
34
using namespace ns3;
35
35
 Lines 46-59   public: Link Here 
46
46
47
private:
47
private:
48
  virtual void DoRun (void);
48
  virtual void DoRun (void);
49
  Ptr<MacLow> m_low; ///< MacLow
49
  Ptr<WifiNetDevice> m_device; ///<WifiNetDevice
50
  Ptr<StaWifiMac> m_mac; ///< Mac
50
  Ptr<YansWifiPhy> m_phy; ///< Phy
51
  Ptr<YansWifiPhy> m_phy; ///< Phy
51
  Ptr<QosTxop> m_txop; ///< QosTxop
52
  Ptr<MacTxMiddle> m_txMiddle; ///< MacTxMiddle
53
  Ptr<WifiRemoteStationManager> m_manager; ///< remote station manager
52
  Ptr<WifiRemoteStationManager> m_manager; ///< remote station manager
54
  ObjectFactory m_factory; ///< factory
53
  ObjectFactory m_factory; ///< factory
55
  Ptr<MpduAggregator> m_mpduAggregator; ///< A-MPDU aggregrator
56
  Ptr<ChannelAccessManager> m_channelAccessManager; ///< channel access manager
57
};
54
};
58
55
59
AmpduAggregationTest::AmpduAggregationTest ()
56
AmpduAggregationTest::AmpduAggregationTest ()
 Lines 65-74   void Link Here 
65
AmpduAggregationTest::DoRun (void)
62
AmpduAggregationTest::DoRun (void)
66
{
63
{
67
  /*
64
  /*
65
   * Create device and attach HT configuration.
66
   */
67
  m_device = CreateObject<WifiNetDevice> ();
68
  Ptr<HtConfiguration> htConfiguration = CreateObject<HtConfiguration> ();
69
  m_device->SetHtConfiguration (htConfiguration);
70
71
  /*
68
   * Create and configure phy layer.
72
   * Create and configure phy layer.
69
   */
73
   */
70
  m_phy = CreateObject<YansWifiPhy> ();
74
  m_phy = CreateObject<YansWifiPhy> ();
75
  m_phy->SetDevice (m_device);
71
  m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
76
  m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
77
  m_device->SetPhy (m_phy);
72
78
73
  /*
79
  /*
74
   * Create and configure manager.
80
   * Create and configure manager.
 Lines 78-116   AmpduAggregationTest::DoRun (void) Link Here 
78
  m_factory.Set ("DataMode", StringValue ("HtMcs7"));
84
  m_factory.Set ("DataMode", StringValue ("HtMcs7"));
79
  m_manager = m_factory.Create<WifiRemoteStationManager> ();
85
  m_manager = m_factory.Create<WifiRemoteStationManager> ();
80
  m_manager->SetupPhy (m_phy);
86
  m_manager->SetupPhy (m_phy);
81
  m_manager->SetHtSupported (true);
87
  m_device->SetRemoteStationManager (m_manager);
82
88
83
  /*
89
  /*
84
   * Create and configure mac layer.
90
   * Create and configure mac layer.
85
   */
91
   */
86
  m_low = CreateObject<MacLow> ();
92
  m_mac = CreateObject<StaWifiMac> ();
87
  m_low->SetPhy (m_phy);
93
  m_mac->SetDevice (m_device);
88
  m_low->SetWifiRemoteStationManager (m_manager);
94
  m_mac->SetWifiPhy (m_phy);
89
  m_low->SetAddress (Mac48Address ("00:00:00:00:00:01"));
95
  m_mac->SetWifiRemoteStationManager (m_manager);
90
96
  m_mac->SetAddress (Mac48Address ("00:00:00:00:00:01"));
91
  m_channelAccessManager = CreateObject<ChannelAccessManager> ();
97
  m_mac->ConfigureStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
92
  m_channelAccessManager->SetupLow (m_low);
98
  m_device->SetMac (m_mac);
93
  m_channelAccessManager->SetupPhyListener (m_phy);
94
  m_channelAccessManager->SetSlot (MicroSeconds (9));
95
96
  m_txop = CreateObject<QosTxop> ();
97
  m_txop->SetMacLow (m_low);
98
  m_txop->SetAccessCategory (AC_BE);
99
  m_txop->SetWifiRemoteStationManager (m_manager);
100
  m_txop->SetChannelAccessManager (m_channelAccessManager);
101
102
  m_txMiddle = Create<MacTxMiddle> ();
103
  m_txop->SetTxMiddle (m_txMiddle);
104
  m_txop->CompleteConfig ();
105
99
106
  /*
100
  /*
107
   * Configure MPDU aggregation.
101
   * Configure MPDU aggregation.
108
   */
102
   */
109
  m_factory = ObjectFactory ();
103
  m_mac->GetBEQueue ()->GetMpduAggregator ()->SetMaxAmpduSize (65535);
110
  m_factory.SetTypeId ("ns3::MpduAggregator");
111
  m_mpduAggregator = m_factory.Create<MpduAggregator> ();
112
  m_mpduAggregator->SetMaxAmpduSize (65535);
113
  m_txop->SetMpduAggregator (m_mpduAggregator);
114
104
115
  /*
105
  /*
116
   * Create a dummy packet of 1500 bytes and fill mac header fields.
106
   * Create a dummy packet of 1500 bytes and fill mac header fields.
 Lines 122-128   AmpduAggregationTest::DoRun (void) Link Here 
122
  hdr.SetAddr2 (Mac48Address ("00:00:00:00:00:01"));
112
  hdr.SetAddr2 (Mac48Address ("00:00:00:00:00:01"));
123
  hdr.SetType (WIFI_MAC_QOSDATA);
113
  hdr.SetType (WIFI_MAC_QOSDATA);
124
  hdr.SetQosTid (0);
114
  hdr.SetQosTid (0);
125
  uint16_t sequence = m_txMiddle->GetNextSequenceNumberFor (&hdr);
115
  uint16_t sequence = m_mac->m_txMiddle->GetNextSequenceNumberFor (&hdr);
126
  hdr.SetSequenceNumber (sequence);
116
  hdr.SetSequenceNumber (sequence);
127
  hdr.SetFragmentNumber (0);
117
  hdr.SetFragmentNumber (0);
128
  hdr.SetNoMoreFragments ();
118
  hdr.SetNoMoreFragments ();
 Lines 137-156   AmpduAggregationTest::DoRun (void) Link Here 
137
  reqHdr.SetBufferSize (0);
127
  reqHdr.SetBufferSize (0);
138
  reqHdr.SetTimeout (0);
128
  reqHdr.SetTimeout (0);
139
  reqHdr.SetStartingSequence (0);
129
  reqHdr.SetStartingSequence (0);
140
  m_txop->m_baManager->CreateAgreement (&reqHdr, hdr.GetAddr1 ());
130
  m_mac->GetBEQueue ()->m_baManager->CreateAgreement (&reqHdr, hdr.GetAddr1 ());
141
131
142
  //-----------------------------------------------------------------------------------------------------
132
  //-----------------------------------------------------------------------------------------------------
143
133
144
  /*
134
  /*
145
   * Test behavior when no other packets are in the queue
135
   * Test behavior when no other packets are in the queue
146
   */
136
   */
147
  m_low->m_currentHdr = hdr;
137
  m_mac->GetBEQueue ()->GetLow ()->m_currentHdr = hdr;
148
  m_low->m_currentPacket = pkt->Copy ();
138
  m_mac->GetBEQueue ()->GetLow ()->m_currentPacket = pkt->Copy ();
149
  m_low->m_currentTxVector = m_low->GetDataTxVector (m_low->m_currentPacket, &m_low->m_currentHdr);
139
  m_mac->GetBEQueue ()->GetLow ()->m_currentTxVector = m_mac->GetBEQueue ()->GetLow ()->GetDataTxVector (m_mac->GetBEQueue ()->GetLow ()->m_currentPacket, &m_mac->GetBEQueue ()->GetLow ()->m_currentHdr);
150
140
151
  bool isAmpdu = m_low->IsAmpdu (pkt, hdr);
141
  bool isAmpdu = m_mac->GetBEQueue ()->GetLow ()->IsAmpdu (pkt, hdr);
152
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, false, "a single packet should not result in an A-MPDU");
142
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, false, "a single packet should not result in an A-MPDU");
153
  NS_TEST_EXPECT_MSG_EQ (m_low->m_aggregateQueue[0]->GetNPackets (), 0, "aggregation queue is not flushed");
143
  NS_TEST_EXPECT_MSG_EQ (m_mac->GetBEQueue ()->GetLow ()->m_aggregateQueue[0]->GetNPackets (), 0, "aggregation queue is not flushed");
154
144
155
  //-----------------------------------------------------------------------------------------------------
145
  //-----------------------------------------------------------------------------------------------------
156
146
 Lines 171-192   AmpduAggregationTest::DoRun (void) Link Here 
171
  hdr2.SetType (WIFI_MAC_QOSDATA);
161
  hdr2.SetType (WIFI_MAC_QOSDATA);
172
  hdr2.SetQosTid (0);
162
  hdr2.SetQosTid (0);
173
163
174
  m_txop->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt1, hdr1));
164
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt1, hdr1));
175
  m_txop->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt2, hdr2));
165
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt2, hdr2));
176
166
177
  isAmpdu = m_low->IsAmpdu (pkt, hdr);
167
  isAmpdu = m_mac->GetBEQueue ()->GetLow ()->IsAmpdu (pkt, hdr);
178
  uint32_t aggregationQueueSize = m_low->m_aggregateQueue[0]->GetNPackets ();
168
  uint32_t aggregationQueueSize = m_mac->GetBEQueue ()->GetLow ()->m_aggregateQueue[0]->GetNPackets ();
179
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, true, "MPDU aggregation failed");
169
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, true, "MPDU aggregation failed");
180
  NS_TEST_EXPECT_MSG_EQ (m_low->m_currentPacket->GetSize (), 4606, "A-MPDU size is not correct");
170
  NS_TEST_EXPECT_MSG_EQ (m_mac->GetBEQueue ()->GetLow ()->m_currentPacket->GetSize (), 4606, "A-MPDU size is not correct");
181
  NS_TEST_EXPECT_MSG_EQ (aggregationQueueSize, 3, "aggregation queue should not be empty");
171
  NS_TEST_EXPECT_MSG_EQ (aggregationQueueSize, 3, "aggregation queue should not be empty");
182
  NS_TEST_EXPECT_MSG_EQ (m_txop->GetWifiMacQueue ()->GetNPackets (), 0, "queue should be empty");
172
  NS_TEST_EXPECT_MSG_EQ (m_mac->GetBEQueue ()->GetWifiMacQueue ()->GetNPackets (), 0, "queue should be empty");
183
173
184
  Ptr <WifiMacQueueItem> dequeuedItem;
174
  Ptr <WifiMacQueueItem> dequeuedItem;
185
  WifiMacHeader dequeuedHdr;
175
  WifiMacHeader dequeuedHdr;
186
  uint32_t i = 0;
176
  uint32_t i = 0;
187
  for (; aggregationQueueSize > 0; aggregationQueueSize--, i++)
177
  for (; aggregationQueueSize > 0; aggregationQueueSize--, i++)
188
    {
178
    {
189
      dequeuedItem = m_low->m_aggregateQueue[0]->Dequeue ();
179
      dequeuedItem = m_mac->GetBEQueue ()->GetLow ()->m_aggregateQueue[0]->Dequeue ();
190
      dequeuedHdr = dequeuedItem->GetHeader ();
180
      dequeuedHdr = dequeuedItem->GetHeader ();
191
      NS_TEST_EXPECT_MSG_EQ (dequeuedHdr.GetSequenceNumber (), i, "wrong sequence number");
181
      NS_TEST_EXPECT_MSG_EQ (dequeuedHdr.GetSequenceNumber (), i, "wrong sequence number");
192
    }
182
    }
 Lines 219-254   AmpduAggregationTest::DoRun (void) Link Here 
219
  hdr3.SetType (WIFI_MAC_DATA);
209
  hdr3.SetType (WIFI_MAC_DATA);
220
  hdr3.SetQosTid (0);
210
  hdr3.SetQosTid (0);
221
211
222
  m_txop->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt3, hdr3));
212
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt3, hdr3));
223
213
224
  isAmpdu = m_low->IsAmpdu (pkt1, hdr1);
214
  isAmpdu = m_mac->GetBEQueue ()->GetLow ()->IsAmpdu (pkt1, hdr1);
225
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, false, "a single packet for this destination should not result in an A-MPDU");
215
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, false, "a single packet for this destination should not result in an A-MPDU");
226
  NS_TEST_EXPECT_MSG_EQ (m_low->m_aggregateQueue[0]->GetNPackets (), 0, "aggregation queue is not flushed");
216
  NS_TEST_EXPECT_MSG_EQ (m_mac->GetBEQueue ()->GetLow ()->m_aggregateQueue[0]->GetNPackets (), 0, "aggregation queue is not flushed");
227
217
228
  m_txop->m_currentHdr = hdr2;
218
  m_mac->GetBEQueue ()->m_currentHdr = hdr2;
229
  m_txop->m_currentPacket = pkt2->Copy ();
219
  m_mac->GetBEQueue ()->m_currentPacket = pkt2->Copy ();
230
  isAmpdu = m_low->IsAmpdu (pkt2, hdr2);
220
  isAmpdu = m_mac->GetBEQueue ()->GetLow ()->IsAmpdu (pkt2, hdr2);
231
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, false, "no MPDU aggregation should be performed if there is no agreement");
221
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, false, "no MPDU aggregation should be performed if there is no agreement");
232
  NS_TEST_EXPECT_MSG_EQ (m_low->m_aggregateQueue[0]->GetNPackets (), 0, "aggregation queue is not flushed");
222
  NS_TEST_EXPECT_MSG_EQ (m_mac->GetBEQueue ()->GetLow ()->m_aggregateQueue[0]->GetNPackets (), 0, "aggregation queue is not flushed");
233
223
234
  m_manager->SetMaxSsrc (0); //set to 0 in order to fake that the maximum number of retries has been reached
224
  m_manager->SetMaxSsrc (0); //set to 0 in order to fake that the maximum number of retries has been reached
235
  m_txop->MissedAck ();
225
  m_mac->GetBEQueue ()->MissedAck ();
236
226
237
  NS_TEST_EXPECT_MSG_EQ (m_txop->m_currentPacket, 0, "packet should be discarded");
227
  NS_TEST_EXPECT_MSG_EQ (m_mac->GetBEQueue ()->m_currentPacket, 0, "packet should be discarded");
238
  m_txop->GetWifiMacQueue ()->Remove (pkt3);
228
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Remove (pkt3);
239
229
240
  Simulator::Destroy ();
230
  Simulator::Destroy ();
241
231
242
  m_txMiddle = 0;
232
  m_manager->Dispose ();
243
233
  m_manager = 0;
244
  m_low->Dispose ();
245
  m_low = 0;
246
234
247
  m_txop->Dispose ();
235
  m_device->Dispose ();
248
  m_txop = 0;
236
  m_device = 0;
249
237
250
  m_channelAccessManager->Dispose ();
238
  htConfiguration = 0;
251
  m_channelAccessManager = 0;
252
}
239
}
253
240
254
/**
241
/**
 Lines 264-276   public: Link Here 
264
251
265
private:
252
private:
266
  virtual void DoRun (void);
253
  virtual void DoRun (void);
267
  Ptr<MacLow> m_low; ///< MacLow
254
  Ptr<WifiNetDevice> m_device; ///<WifiNetDevice
255
  Ptr<StaWifiMac> m_mac; ///< Mac
268
  Ptr<YansWifiPhy> m_phy; ///< Phy
256
  Ptr<YansWifiPhy> m_phy; ///< Phy
269
  Ptr<QosTxop> m_txop; ///< QosTxop
270
  Ptr<WifiRemoteStationManager> m_manager; ///< remote station manager
257
  Ptr<WifiRemoteStationManager> m_manager; ///< remote station manager
271
  ObjectFactory m_factory; ///< factory
258
  ObjectFactory m_factory; ///< factory
272
  Ptr<MsduAggregator> m_msduAggregator; ///< A-MSDU aggregator
273
  Ptr<MpduAggregator> m_mpduAggregator; ///< A-MPDU aggregator
274
};
259
};
275
260
276
TwoLevelAggregationTest::TwoLevelAggregationTest ()
261
TwoLevelAggregationTest::TwoLevelAggregationTest ()
 Lines 282-291   void Link Here 
282
TwoLevelAggregationTest::DoRun (void)
267
TwoLevelAggregationTest::DoRun (void)
283
{
268
{
284
  /*
269
  /*
270
   * Create device and attach HT configuration.
271
   */
272
  m_device = CreateObject<WifiNetDevice> ();
273
  Ptr<HtConfiguration> htConfiguration = CreateObject<HtConfiguration> ();
274
  m_device->SetHtConfiguration (htConfiguration);
275
276
  /*
285
   * Create and configure phy layer.
277
   * Create and configure phy layer.
286
   */
278
   */
287
  m_phy = CreateObject<YansWifiPhy> ();
279
  m_phy = CreateObject<YansWifiPhy> ();
280
  m_phy->SetDevice (m_device);
288
  m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
281
  m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
282
  m_device->SetPhy (m_phy);
289
283
290
  /*
284
  /*
291
   * Create and configure manager.
285
   * Create and configure manager.
 Lines 295-325   TwoLevelAggregationTest::DoRun (void) Link Here 
295
  m_factory.Set ("DataMode", StringValue ("HtMcs7"));
289
  m_factory.Set ("DataMode", StringValue ("HtMcs7"));
296
  m_manager = m_factory.Create<WifiRemoteStationManager> ();
290
  m_manager = m_factory.Create<WifiRemoteStationManager> ();
297
  m_manager->SetupPhy (m_phy);
291
  m_manager->SetupPhy (m_phy);
292
  m_device->SetRemoteStationManager (m_manager);
298
293
299
  /*
294
  /*
300
   * Create and configure maclayer.
295
   * Create and configure mac layer.
301
   */
296
   */
302
  m_low = CreateObject<MacLow> ();
297
  m_mac = CreateObject<StaWifiMac> ();
303
  m_low->SetPhy (m_phy);
298
  m_mac->SetDevice (m_device);
304
  m_low->SetWifiRemoteStationManager (m_manager);
299
  m_mac->SetWifiPhy (m_phy);
305
300
  m_mac->SetWifiRemoteStationManager (m_manager);
306
  m_txop = CreateObject<QosTxop> ();
301
  m_mac->SetAddress (Mac48Address ("00:00:00:00:00:01"));
307
  m_txop->SetMacLow (m_low);
302
  m_mac->ConfigureStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
308
  m_txop->SetAccessCategory (AC_BE);
303
  m_device->SetMac (m_mac);
309
  m_txop->SetWifiRemoteStationManager (m_manager);
310
  m_txop->CompleteConfig ();
311
304
312
  /*
305
  /*
313
   * Configure aggregation.
306
   * Configure aggregation.
314
   */
307
   */
315
  m_msduAggregator = CreateObject<MsduAggregator> ();
308
  m_mac->GetBEQueue ()->GetMsduAggregator ()->SetMaxAmsduSize (4095);
316
  m_mpduAggregator = CreateObject<MpduAggregator> ();
309
  m_mac->GetBEQueue ()->GetMpduAggregator ()->SetMaxAmpduSize (65535);
317
318
  m_msduAggregator->SetMaxAmsduSize (4095);
319
  m_mpduAggregator->SetMaxAmpduSize (65535);
320
321
  m_txop->SetMsduAggregator (m_msduAggregator);
322
  m_txop->SetMpduAggregator (m_mpduAggregator);
323
310
324
  /*
311
  /*
325
   * Create dummy packets of 1500 bytes and fill mac header fields that will be used for the tests.
312
   * Create dummy packets of 1500 bytes and fill mac header fields that will be used for the tests.
 Lines 342-364   TwoLevelAggregationTest::DoRun (void) Link Here 
342
   *      - A-MSDU frame size should be 3030 bytes (= 2 packets + headers + padding);
329
   *      - A-MSDU frame size should be 3030 bytes (= 2 packets + headers + padding);
343
   *      - one packet should be removed from the queue (the other packet is removed later in MacLow::AggregateToAmpdu) .
330
   *      - one packet should be removed from the queue (the other packet is removed later in MacLow::AggregateToAmpdu) .
344
   */
331
   */
345
  m_txop->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt, hdr));
332
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt, hdr));
346
  m_txop->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt, hdr));
333
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt, hdr));
347
334
348
  Ptr<const WifiMacQueueItem> peekedItem = m_txop->GetWifiMacQueue ()->PeekByTidAndAddress (0, hdr.GetAddr1 ());
335
  Ptr<const WifiMacQueueItem> peekedItem = m_mac->GetBEQueue ()->GetWifiMacQueue ()->PeekByTidAndAddress (0, hdr.GetAddr1 ());
349
  Ptr<const Packet> peekedPacket = peekedItem->GetPacket ();
336
  Ptr<const Packet> peekedPacket = peekedItem->GetPacket ();
350
  peekedHdr = peekedItem->GetHeader ();
337
  peekedHdr = peekedItem->GetHeader ();
351
  tstamp = peekedItem->GetTimeStamp ();
338
  tstamp = peekedItem->GetTimeStamp ();
352
  m_low->m_currentPacket = peekedPacket->Copy ();
339
  m_mac->GetBEQueue ()->GetLow ()->m_currentPacket = peekedPacket->Copy ();
353
  m_low->m_currentHdr = peekedHdr;
340
  m_mac->GetBEQueue ()->GetLow ()->m_currentHdr = peekedHdr;
354
  m_low->m_currentTxVector = m_low->GetDataTxVector (m_low->m_currentPacket, &m_low->m_currentHdr);
341
  m_mac->GetBEQueue ()->GetLow ()->m_currentTxVector = m_mac->GetBEQueue ()->GetLow ()->GetDataTxVector (m_mac->GetBEQueue ()->GetLow ()->m_currentPacket, &m_mac->GetBEQueue ()->GetLow ()->m_currentHdr);
355
342
356
  Ptr<Packet> packet = m_low->PerformMsduAggregation (peekedPacket, &peekedHdr, &tstamp, currentAggregatedPacket, 0);
343
  Ptr<Packet> packet = m_mac->GetBEQueue ()->GetLow ()->PerformMsduAggregation (peekedPacket, &peekedHdr, &tstamp, currentAggregatedPacket, 0);
357
344
358
  bool result = (packet != 0);
345
  bool result = (packet != 0);
359
  NS_TEST_EXPECT_MSG_EQ (result, true, "aggregation failed");
346
  NS_TEST_EXPECT_MSG_EQ (result, true, "aggregation failed");
360
  NS_TEST_EXPECT_MSG_EQ (packet->GetSize (), 3030, "wrong packet size");
347
  NS_TEST_EXPECT_MSG_EQ (packet->GetSize (), 3030, "wrong packet size");
361
  NS_TEST_EXPECT_MSG_EQ (m_txop->GetWifiMacQueue ()->GetNPackets (), 0, "aggregated packets not removed from the queue");
348
  NS_TEST_EXPECT_MSG_EQ (m_mac->GetBEQueue ()->GetWifiMacQueue ()->GetNPackets (), 0, "aggregated packets not removed from the queue");
362
349
363
  //-----------------------------------------------------------------------------------------------------
350
  //-----------------------------------------------------------------------------------------------------
364
351
 Lines 367-380   TwoLevelAggregationTest::DoRun (void) Link Here 
367
   * It checks whether MSDU aggregation has been rejected because the maximum MPDU size is set to 0 (returned packet should be equal to 0).
354
   * It checks whether MSDU aggregation has been rejected because the maximum MPDU size is set to 0 (returned packet should be equal to 0).
368
   * This test is needed to ensure that no packets are removed from the queue in MacLow::PerformMsduAggregation, since aggregation will no occur in MacLow::AggregateToAmpdu.
355
   * This test is needed to ensure that no packets are removed from the queue in MacLow::PerformMsduAggregation, since aggregation will no occur in MacLow::AggregateToAmpdu.
369
   */
356
   */
370
  m_factory = ObjectFactory ();
357
  m_mac->GetBEQueue ()->GetMpduAggregator ()->SetMaxAmpduSize (65535);
371
  m_factory.SetTypeId ("ns3::MpduAggregator");
372
  m_mpduAggregator = m_factory.Create<MpduAggregator> ();
373
  m_mpduAggregator->SetMaxAmpduSize (65535);
374
  m_txop->SetMpduAggregator (m_mpduAggregator);
375
358
376
  m_txop->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt, hdr));
359
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt, hdr));
377
  packet = m_low->PerformMsduAggregation (peekedPacket, &peekedHdr, &tstamp, currentAggregatedPacket, 0);
360
  packet = m_mac->GetBEQueue ()->GetLow ()->PerformMsduAggregation (peekedPacket, &peekedHdr, &tstamp, currentAggregatedPacket, 0);
378
361
379
  result = (packet != 0);
362
  result = (packet != 0);
380
  NS_TEST_EXPECT_MSG_EQ (result, false, "maximum aggregated frame size check failed");
363
  NS_TEST_EXPECT_MSG_EQ (result, false, "maximum aggregated frame size check failed");
 Lines 386-410   TwoLevelAggregationTest::DoRun (void) Link Here 
386
   * It checks whether MSDU aggregation has been rejected because there is no packets ready in the queue (returned packet should be equal to 0).
369
   * It checks whether MSDU aggregation has been rejected because there is no packets ready in the queue (returned packet should be equal to 0).
387
   * This test is needed to ensure that there is no issue when the queue is empty.
370
   * This test is needed to ensure that there is no issue when the queue is empty.
388
   */
371
   */
389
  m_mpduAggregator->SetMaxAmpduSize (4095);
372
  m_mac->GetBEQueue ()->GetMpduAggregator ()->SetMaxAmpduSize (4095);
390
373
391
  m_txop->GetWifiMacQueue ()->Remove (pkt);
374
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Remove (pkt);
392
  m_txop->GetWifiMacQueue ()->Remove (pkt);
375
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Remove (pkt);
393
  packet = m_low->PerformMsduAggregation (peekedPacket, &peekedHdr, &tstamp, currentAggregatedPacket, 0);
376
  packet = m_mac->GetBEQueue ()->GetLow ()->PerformMsduAggregation (peekedPacket, &peekedHdr, &tstamp, currentAggregatedPacket, 0);
394
377
395
  result = (packet != 0);
378
  result = (packet != 0);
396
  NS_TEST_EXPECT_MSG_EQ (result, false, "aggregation failed to stop as queue is empty");
379
  NS_TEST_EXPECT_MSG_EQ (result, false, "aggregation failed to stop as queue is empty");
397
380
398
  Simulator::Destroy ();
381
  Simulator::Destroy ();
399
382
400
  m_low->Dispose ();
383
  m_device = 0;
401
  m_low = 0;
384
  htConfiguration = 0;
402
403
  m_txop->Dispose ();
404
  m_txop = 0;
405
}
385
}
406
386
407
408
/**
387
/**
409
 * \ingroup wifi-test
388
 * \ingroup wifi-test
410
 * \ingroup tests
389
 * \ingroup tests
(-)a/src/wifi/test/wifi-test.cc (+10 lines)
 Lines 43-48    Link Here 
43
#include "ns3/wifi-phy-tag.h"
43
#include "ns3/wifi-phy-tag.h"
44
#include "ns3/yans-wifi-phy.h"
44
#include "ns3/yans-wifi-phy.h"
45
#include "ns3/mgt-headers.h"
45
#include "ns3/mgt-headers.h"
46
#include "ns3/ht-configuration.h"
46
47
47
using namespace ns3;
48
using namespace ns3;
48
49
 Lines 131-136   WifiTest::CreateOne (Vector pos, Ptr<YansWifiChannel> channel) Link Here 
131
  Ptr<WifiNetDevice> dev = CreateObject<WifiNetDevice> ();
132
  Ptr<WifiNetDevice> dev = CreateObject<WifiNetDevice> ();
132
133
133
  Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
134
  Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
135
  mac->SetDevice (dev);
134
  mac->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
136
  mac->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
135
  Ptr<ConstantPositionMobilityModel> mobility = CreateObject<ConstantPositionMobilityModel> ();
137
  Ptr<ConstantPositionMobilityModel> mobility = CreateObject<ConstantPositionMobilityModel> ();
136
  Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
138
  Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
 Lines 298-303   InterferenceHelperSequenceTest::CreateOne (Vector pos, Ptr<YansWifiChannel> chan Link Here 
298
  Ptr<WifiNetDevice> dev = CreateObject<WifiNetDevice> ();
300
  Ptr<WifiNetDevice> dev = CreateObject<WifiNetDevice> ();
299
301
300
  Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
302
  Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
303
  mac->SetDevice (dev);
301
  mac->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
304
  mac->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
302
  Ptr<ConstantPositionMobilityModel> mobility = CreateObject<ConstantPositionMobilityModel> ();
305
  Ptr<ConstantPositionMobilityModel> mobility = CreateObject<ConstantPositionMobilityModel> ();
303
  Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
306
  Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
 Lines 492-497   DcfImmediateAccessBroadcastTestCase::DoRun (void) Link Here 
492
  Ptr<Node> txNode = CreateObject<Node> ();
495
  Ptr<Node> txNode = CreateObject<Node> ();
493
  Ptr<WifiNetDevice> txDev = CreateObject<WifiNetDevice> ();
496
  Ptr<WifiNetDevice> txDev = CreateObject<WifiNetDevice> ();
494
  Ptr<WifiMac> txMac = m_mac.Create<WifiMac> ();
497
  Ptr<WifiMac> txMac = m_mac.Create<WifiMac> ();
498
  txMac->SetDevice (txDev);
495
  txMac->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
499
  txMac->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
496
  //Fix the stream assignment to the Dcf Txop objects (backoffs)
500
  //Fix the stream assignment to the Dcf Txop objects (backoffs)
497
  //The below stream assignment will result in the Txop object
501
  //The below stream assignment will result in the Txop object
 Lines 1447-1462   Bug2831TestCase::DoRun (void) Link Here 
1447
1451
1448
  Ptr<Node> apNode = CreateObject<Node> ();
1452
  Ptr<Node> apNode = CreateObject<Node> ();
1449
  Ptr<WifiNetDevice> apDev = CreateObject<WifiNetDevice> ();
1453
  Ptr<WifiNetDevice> apDev = CreateObject<WifiNetDevice> ();
1454
  Ptr<HtConfiguration> apHtConfiguration = CreateObject<HtConfiguration> ();
1455
  apDev->SetHtConfiguration (apHtConfiguration);
1450
  ObjectFactory mac;
1456
  ObjectFactory mac;
1451
  mac.SetTypeId ("ns3::ApWifiMac");
1457
  mac.SetTypeId ("ns3::ApWifiMac");
1452
  mac.Set ("EnableBeaconJitter", BooleanValue (false));
1458
  mac.Set ("EnableBeaconJitter", BooleanValue (false));
1453
  Ptr<WifiMac> apMac = mac.Create<WifiMac> ();
1459
  Ptr<WifiMac> apMac = mac.Create<WifiMac> ();
1460
  apMac->SetDevice (apDev);
1454
  apMac->ConfigureStandard (WIFI_PHY_STANDARD_80211ax_5GHZ);
1461
  apMac->ConfigureStandard (WIFI_PHY_STANDARD_80211ax_5GHZ);
1455
1462
1456
  Ptr<Node> staNode = CreateObject<Node> ();
1463
  Ptr<Node> staNode = CreateObject<Node> ();
1457
  Ptr<WifiNetDevice> staDev = CreateObject<WifiNetDevice> ();
1464
  Ptr<WifiNetDevice> staDev = CreateObject<WifiNetDevice> ();
1465
  Ptr<HtConfiguration> staHtConfiguration = CreateObject<HtConfiguration> ();
1466
  staDev->SetHtConfiguration (staHtConfiguration);
1458
  mac.SetTypeId ("ns3::StaWifiMac");
1467
  mac.SetTypeId ("ns3::StaWifiMac");
1459
  Ptr<WifiMac> staMac = mac.Create<WifiMac> ();
1468
  Ptr<WifiMac> staMac = mac.Create<WifiMac> ();
1469
  staMac->SetDevice (staDev);
1460
  staMac->ConfigureStandard (WIFI_PHY_STANDARD_80211ax_5GHZ);
1470
  staMac->ConfigureStandard (WIFI_PHY_STANDARD_80211ax_5GHZ);
1461
1471
1462
  Ptr<ConstantPositionMobilityModel> apMobility = CreateObject<ConstantPositionMobilityModel> ();
1472
  Ptr<ConstantPositionMobilityModel> apMobility = CreateObject<ConstantPositionMobilityModel> ();
(-)a/src/wifi/wscript (+6 lines)
 Lines 84-92   def build(bld): Link Here 
84
        'model/frame-capture-model.cc',
84
        'model/frame-capture-model.cc',
85
        'model/simple-frame-capture-model.cc',
85
        'model/simple-frame-capture-model.cc',
86
        'model/he-operation.cc',
86
        'model/he-operation.cc',
87
        'model/he-configuration.cc',
87
        'model/extended-capabilities.cc',
88
        'model/extended-capabilities.cc',
88
        'model/cf-parameter-set.cc',
89
        'model/cf-parameter-set.cc',
89
        'model/wifi-mac-queue-item.cc',
90
        'model/wifi-mac-queue-item.cc',
91
        'model/ht-configuration.cc',
92
        'model/vht-configuration.cc',
90
        'helper/wifi-radio-energy-model-helper.cc',
93
        'helper/wifi-radio-energy-model-helper.cc',
91
        'helper/athstats-helper.cc',
94
        'helper/athstats-helper.cc',
92
        'helper/wifi-helper.cc',
95
        'helper/wifi-helper.cc',
 Lines 194-199   def build(bld): Link Here 
194
        'model/simple-frame-capture-model.h',
197
        'model/simple-frame-capture-model.h',
195
        'model/qos-blocked-destinations.h',
198
        'model/qos-blocked-destinations.h',
196
        'model/he-operation.h',
199
        'model/he-operation.h',
200
        'model/he-configuration.h',
197
        'model/extended-capabilities.h',
201
        'model/extended-capabilities.h',
198
        'model/cf-parameter-set.h',
202
        'model/cf-parameter-set.h',
199
        'model/wifi-mac-queue-item.h',
203
        'model/wifi-mac-queue-item.h',
 Lines 201-206   def build(bld): Link Here 
201
        'model/wifi-phy-listener.h',
205
        'model/wifi-phy-listener.h',
202
        'model/block-ack-type.h',
206
        'model/block-ack-type.h',
203
        'model/wifi-mpdu-type.h',
207
        'model/wifi-mpdu-type.h',
208
        'model/ht-configuration.h',
209
        'model/vht-configuration.h',
204
        'helper/wifi-radio-energy-model-helper.h',
210
        'helper/wifi-radio-energy-model-helper.h',
205
        'helper/athstats-helper.h',
211
        'helper/athstats-helper.h',
206
        'helper/wifi-helper.h',
212
        'helper/wifi-helper.h',

Return to bug 3000