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

(-)a/src/wifi/doc/wifi.rst (+32 lines)
 Lines 331-336    Link Here 
331
This creates the WifiNetDevice which includes also a WifiRemoteStationManager, a
331
This creates the WifiNetDevice which includes also a WifiRemoteStationManager, a
332
WifiMac, and a WifiPhy (connected to the matching WifiChannel).
332
WifiMac, and a WifiPhy (connected to the matching WifiChannel).
333
333
334
The ``WifiHelper::SetStandard`` method set various default timing parameters as defined in the selected standard version, overwriting values that may exist or have been previously configured.
335
In order to change parameters that are overwritten by ``WifiHelper::SetStandard``, this should be done post-install using ``Config::Set``::
336
337
  WifiHelper wifi = WifiHelper::Default ();
338
  wifi.SetStandard (WIFI_PHY_STANDARD_80211n_2_4GHZ);
339
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue("OfdmRate65MbpsBW20MHz"), "ControlMode", StringValue("OfdmRate6_5MbpsBW20MHz"));
340
  HtWifiMacHelper mac = HtWifiMacHelper::Default ();
341
342
  //Install PHY and MAC
343
  Ssid ssid = Ssid ("ns3-wifi");
344
  mac.SetType ("ns3::StaWifiMac",
345
  "Ssid", SsidValue (ssid),
346
  "ActiveProbing", BooleanValue (false));
347
348
  NetDeviceContainer staDevice;
349
  staDevice = wifi.Install (phy, mac, wifiStaNode);
350
351
  mac.SetType ("ns3::ApWifiMac",
352
  "Ssid", SsidValue (ssid));
353
354
  NetDeviceContainer apDevice;
355
  apDevice = wifi.Install (phy, mac, wifiApNode);
356
357
  //Once install is done, we overwrite the standard timing values
358
  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/Slot", TimeValue (MicroSeconds (slot)));
359
  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/Sifs", TimeValue (MicroSeconds (sifs)));
360
  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/AckTimeout", TimeValue (MicroSeconds (ackTimeout)));
361
  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/CtsTimeout", TimeValue (MicroSeconds (ctsTimeout)));
362
  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/Rifs", TimeValue (MicroSeconds (rifs)));
363
  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/BasicBlockAckTimeout", TimeValue (MicroSeconds (basicBlockAckTimeout)));
364
  Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/CompressedBlockAckTimeout", TimeValue (MicroSeconds (compressedBlockAckTimeout)));
365
334
There are many |ns3| attributes that can be set on the above helpers to
366
There are many |ns3| attributes that can be set on the above helpers to
335
deviate from the default behavior; the example scripts show how to do some of
367
deviate from the default behavior; the example scripts show how to do some of
336
this reconfiguration.
368
this reconfiguration.
(-)a/src/wifi/helper/wifi-helper.h (-2 / +20 lines)
 Lines 160-170    Link Here 
160
   */
160
   */
161
  virtual NetDeviceContainer Install (const WifiPhyHelper &phy,
161
  virtual NetDeviceContainer Install (const WifiPhyHelper &phy,
162
                              const WifiMacHelper &mac, std::string nodeName) const;
162
                              const WifiMacHelper &mac, std::string nodeName) const;
163
164
  /**
163
  /**
165
   * \param standard the phy standard to configure during installation
164
   * \param standard the phy standard to configure during installation
166
   *
165
   *
167
   * By default, all objects are configured for 802.11a
166
   * This method sets standards-compliant defaults for WifiMac
167
   * parameters such as sifs time, slot time, timeout values, etc.,
168
   * based on the standard selected.  It results in
169
   * WifiMac::ConfigureStandard(standard) being called on each
170
   * installed mac object.
171
   *
172
   * The default standard of 802.11a will be applied if SetStandard()
173
   * is not called.
174
   *
175
   * Note that WifiMac::ConfigureStandard () will overwrite certain
176
   * defaults in the attribute system, so if a user wants to manipulate
177
   * any default values affected by ConfigureStandard() while using this
178
   * helper, the user should use a post-install configuration such as
179
   * Config::Set() on any objects that this helper creates, such as:
180
   * \code
181
   * Config::Set ("/NodeList/0/DeviceList/0/$ns3::WifiNetDevice/Mac/Slot", TimeValue (MicroSeconds (slot)));
182
   * \endcode
183
   *
184
   * \sa WifiMac::ConfigureStandard
185
   * \sa Config::Set
168
   */
186
   */
169
  virtual void SetStandard (enum WifiPhyStandard standard);
187
  virtual void SetStandard (enum WifiPhyStandard standard);
170
188
(-)a/src/wifi/model/wifi-mac.h (-7 / +27 lines)
 Lines 273-278    Link Here 
273
  void NotifyRxDrop (Ptr<const Packet> packet);
273
  void NotifyRxDrop (Ptr<const Packet> packet);
274
  /**
274
  /**
275
   * \param standard the wifi standard to be configured
275
   * \param standard the wifi standard to be configured
276
   *
277
   * This method sets standards-compliant defaults for WifiMac
278
   * parameters such as sifs time, slot time, timeout values, etc.,
279
   * based on the standard selected.
280
   * \sa WifiMac::Configure80211a
281
   * \sa WifiMac::Configure80211b
282
   * \sa WifiMac::Configure80211g
283
   * \sa WifiMac::Configure80211_10Mhz
284
   * \sa WifiMac::Configure80211_5Mhz
285
   * \sa WifiMac::Configure80211n_2_4Ghz
286
   * \sa WifiMac::Configure80211n_5Ghz
276
   */
287
   */
277
  void ConfigureStandard (enum WifiPhyStandard standard);
288
  void ConfigureStandard (enum WifiPhyStandard standard);
278
289
 Lines 373-403    Link Here 
373
  Time m_maxPropagationDelay;
384
  Time m_maxPropagationDelay;
374
385
375
  /**
386
  /**
376
   * Configure appropriate timing parameters for 802.11a.
387
   * This method sets 802.11a standards-compliant defaults for following attributes:
388
   * Sifs, Slot, EifsNoDifs, Pifs, CtsTimeout, and AckTimeout.
377
   */
389
   */
378
  void Configure80211a (void);
390
  void Configure80211a (void);
379
  /**
391
  /**
380
   * Configure appropriate timing parameters for 802.11b.
392
   * This method sets 802.11b standards-compliant defaults for following attributes:
393
   * Sifs, Slot, EifsNoDifs, Pifs, CtsTimeout, and AckTimeout.
381
   */
394
   */
382
  void Configure80211b (void);
395
  void Configure80211b (void);
383
  /**
396
  /**
384
   * Configure appropriate timing parameters for 802.11g.
397
   * This method sets 802.11g standards-compliant defaults for following attributes:  
398
   * Sifs, Slot, EifsNoDifs, Pifs, CtsTimeout, and AckTimeout.
399
   * There is no support for short slot time.
385
   */
400
   */
386
  void Configure80211g (void);
401
  void Configure80211g (void);
387
  /**
402
  /**
388
   * Configure appropriate timing parameters for 802.11 with 10Mhz channel spacing.
403
   * This method sets 802.11 with 10Mhz channel spacing standards-compliant defaults
404
   * for following attributes: Sifs, Slot, EifsNoDifs, Pifs, CtsTimeout, and AckTimeout.
389
   */
405
   */
390
  void Configure80211_10Mhz (void);
406
  void Configure80211_10Mhz (void);
391
  /**
407
  /**
392
   * Configure appropriate timing parameters for 802.11 with 5Mhz channel spacing.
408
   * This method sets 802.11 with 5Mhz channel spacing standards-compliant defaults
409
   * for following attributes: Sifs, Slot, EifsNoDifs, Pifs, CtsTimeout, and AckTimeout.
393
   */
410
   */
394
  void Configure80211_5Mhz ();
411
  void Configure80211_5Mhz ();
395
  /**
412
  /**
396
   * Configure appropriate timing parameters for 802.11n operating at 2.4Ghz.
413
   * This method sets 802.11n 2.4 GHz standards-compliant defaults for following attributes:
414
   * Sifs, Slot, EifsNoDifs, Pifs, CtsTimeout, and AckTimeout.
415
   * There is no support for short slot time.
397
   */
416
   */
398
  void Configure80211n_2_4Ghz (void);
417
  void Configure80211n_2_4Ghz (void);
399
  /**
418
  /**
400
   * Configure appropriate timing parameters for 802.11n operating at 5Ghz.
419
   * This method sets 802.11n 5 GHz standards-compliant defaults for following attributes:
420
   * Sifs, Slot, EifsNoDifs, Pifs, CtsTimeout, and AckTimeout.
401
   */
421
   */
402
  void Configure80211n_5Ghz (void);
422
  void Configure80211n_5Ghz (void);
403
423

Return to bug 1801