« Return to Thread: 802.11 10Mhz Channel

Re: 802.11 10Mhz Channel

by Ramon Bauza :: Rate this Message:

Reply to Author | View in Thread

Hello,

I would like to submit for code review the attached patch implementing half
and quarter-clocked Wifi operation using 5 and 10 Mhz channels spacing. We
would be glad to merge this new functionality in the main branch if ns-3
developers think it may be interesting for other people. The following files
have been modified (ns-3-dev):

src/devices/wifi/interference-helper.cc
src/devices/wifi/interference-helper.h
src/devices/wifi/wifi-phy.cc
src/devices/wifi/wifi-phy.h
src/devices/wifi/wifi-phy-standard.h
src/devices/wifi/yans-error-rate-model.cc
src/devices/wifi/yans-wifi-phy.cc
src/devices/wifi/yans-wifi-phy.h
src/helper/nqos-wifi-mac-helper.cc
src/helper/nqos-wifi-mac-helper.h
src/helper/qos-wifi-mac-helper.cc
src/helper/qos-wifi-mac-helper.h
src/helper/wifi-helper.cc
src/helper/wifi-helper.h

Apart from the modifications pointed out in the previous email posted some
weeks ago, we have also modified some of the wifi helpers. In order not to
make the user set weird values for the MAC parameters (slot,sifs, etc) from
the script, we have modified the WifiMacHelper incorporating two new
functions (Configure80211_10MhzParameters and Configure80211_5MhzParameters)
that allows the user to automatically select the default MAC parameters for
5Mhz and 10Mhz channel spacing (we have also moved the function SetType and
the ObjectFactory m_mac from NqosWifiMacHelper and QosWifiMacHelper to
WifiMacHelper).

Looking forward to your comments.

Best regards,
Ramon Bauza.

2009/5/29 Ramon Bauza <monbauza@...>

> Hello everyone,
>
> I am Ramon Bauza, a researcher at Miguel Hernandez University (Spain).
> Currently, I am involved in the EU FP7 project iTETRIS which aims at
> creating an integrated traffic and wireless simulation platform that will
> allow evaluating traffic management strategies and communication protocols
> in vehicular environments. The iTETRIS project employs SUMO and ns-3 as
> traffic simulation and wireless simulation platforms respectively.
>
> Our research group at UMH, it is charge of implementing the 802.11p (WAVE)
> standard in ns-3. 802.11p is based on 802.11a, being the channel bandwidth
> and thus also the data rates the main differences between both (802.11p uses
> a 10Mhz whereas 802.11a uses 20Mhz). After implementing 802.11p in ns-3, we
> will also look into and implement propagation models for vehicular
> environments that consider LOS/NLOS visibility conditions,
> vehicle-to-vehicle and vehicle-to-infraestructure communications, and
> shadowing and multipath fading effects.
>
> In order to model a 10Mhz channel in ns-3, some additions/modifications
> should be done (some weeks ago I posted a message in the user mailing list
> regarding this
> http://groups.google.com/group/ns-3-users/browse_thread/thread/f27b1ddcf9f1d532#).
> Apart from 802.11p, I think other 802.11 standards employ 10MHz channels and
> thus probably the modeling of 10Mhz channels would also be useful for the
> ns-3 community working on 802.11-related topics. In fact, the IEEE Std
> 802.11TM-2007 standard considers 10Mhz channel spacing using OFDM. If you
> consider that the modeling of 10Mhz channels may be beneficial for other
> users we would be glad to merge the 10Mhz modeling in the main branch.
>
> Below, I compile the needed functions and modifications we plan to
> introduce in ns-3 at the PHY layer for modeling a 10Mhz channel:
>
> + wifi-phy-standard.h
>
>   Add WIFI_PHY_STANDARD_80211_10Mhz in the enum WifiPhyStandard
>
> + wifi-phy.h and wifi-phy.cc
>
>   Declare and define the following new functions:
>
>     static WifiMode Get3mb10Mhz (void);
>     static WifiMode Get4_5mb10Mhz (void);
>     static WifiMode Get6mb10Mhz (void);
>     static WifiMode Get9mb10Mhz (void);
>     static WifiMode Get12mb10Mhz (void);
>     static WifiMode Get18mb10Mhz (void);
>     static WifiMode Get24mb10Mhz (void);
>     static WifiMode Get27mb10Mhz (void);
>
> + yans-wifi-phy.h and yans-wifi-phy.cc
>
>   Declare and define the void Configure80211_10Mhz (void) function.
>   Modify the void SetStandard (enum WifiPhyStandard standard) function so
> that the user can also select a 10Mhz channel.
>
> + interference-helper.h and interference-helper.cc
>
>   Declare and define void Configure80211_10MhzParameters (void);
>
> One function that should be modified is
> InterferenceHelper::CalculateTxDuration (uint32_t size, WifiMode
> payloadMode, WifiPreamble preamble) const since it assumes that the symbol
> duration is always 4us (20 Mhz channel). This function should employ a
> symbol duration according to the channel used (10Mhz or 20Mhz). One possible
> solution to solve this would be to have a new variable in the class
> InterferenceHelper which allows differentiating the channel used. This
> variable could be of type WifiPhyStandard. In the function Time
> InterferenceHelper::CalculateTxDuration, this new variable would be examined
> and the packet txon duration will be calculated based on the bandwidth
> channel.
>
> Please, I would like to have your comments on this in order to proceed with
> the implementation.
>
> Thank you in advance.
> Best regards,
> Ramon.
>
> --------------------------------------------------------------------------
> Ramon Bauza
> Ubiquitous Wireless Communications Research Laboratory
> Uwicore, http://www.uwicore.umh.es
> Signal Theory and Communications Division
> University Miguel Hernández (Spain)
> Tel: +34 96522 2031
> Fax: +34 96665 8903
>
> ----------------------------------------------------------------------------
>

[patchWifi10and5MhzChannels.diff]

Los ficheros binarios ns-3-dev/.hg/dirstate y ns-3-spacing/.hg/dirstate son distintos
Los ficheros binarios ns-3-dev/regression.pyc y ns-3-spacing/regression.pyc son distintos
diff -u -r -N ns-3-dev/src/devices/wifi/interference-helper.cc ns-3-spacing/src/devices/wifi/interference-helper.cc
--- ns-3-dev/src/devices/wifi/interference-helper.cc 2009-07-09 18:14:07.000000000 +0200
+++ ns-3-spacing/src/devices/wifi/interference-helper.cc 2009-07-09 12:27:49.000000000 +0200
@@ -241,6 +241,18 @@
       delay += m_plcpLongPreambleDelayUs;
       delay += lrint (ceil ((size * 8.0 + 48.0) / payloadMode.GetDataRate () / 4e-6) * 4);
       break;
+    case WIFI_PHY_STANDARD_80211_10Mhz:
+      delay += m_plcpLongPreambleDelayUs;
+      // symbol duration is 8us
+      delay += 8;
+      delay += lrint (ceil ((size * 8.0 + 16.0 + 6.0) / payloadMode.GetDataRate () / 8e-6) * 8);
+      break;
+    case WIFI_PHY_STANDARD_80211_5Mhz:
+      delay += m_plcpLongPreambleDelayUs;
+      // symbol duration is 16us
+      delay += 16;
+      delay += lrint (ceil ((size * 8.0 + 16.0 + 6.0) / payloadMode.GetDataRate () / 1.6e-5) * 16);
+      break;
     default:
      NS_ASSERT (false);
      break;
@@ -277,6 +289,34 @@
   m_maxPacketDuration = CalculateTxDuration (4095, WifiPhy::Get1mbb (), WIFI_PREAMBLE_LONG);
 }
 
+void
+InterferenceHelper::Configure80211_10MhzParameters (void)
+{
+  NS_LOG_FUNCTION (this);
+  m_80211_standard = WIFI_PHY_STANDARD_80211_10Mhz;
+  m_plcpLongPreambleDelayUs = 32;
+  m_plcpShortPreambleDelayUs = 32;
+  m_longPlcpHeaderMode = WifiPhy::Get3mb10Mhz ();
+  m_shortPlcpHeaderMode = WifiPhy::Get3mb10Mhz ();
+  m_plcpHeaderLength = 4 + 1 + 12 + 1 + 6;
+  /* 4095 bytes at a 3Mb/s rate with a 1/2 coding rate. */
+  m_maxPacketDuration = CalculateTxDuration (4095, WifiPhy::Get3mb10Mhz (), WIFI_PREAMBLE_LONG);
+}
+
+void
+InterferenceHelper::Configure80211_5MhzParameters (void)
+{
+  NS_LOG_FUNCTION (this);
+  m_80211_standard = WIFI_PHY_STANDARD_80211_5Mhz;
+  m_plcpLongPreambleDelayUs = 64;
+  m_plcpShortPreambleDelayUs = 64;
+  m_longPlcpHeaderMode = WifiPhy::Get1_5mb5Mhz ();
+  m_shortPlcpHeaderMode = WifiPhy::Get1_5mb5Mhz ();
+  m_plcpHeaderLength = 4 + 1 + 12 + 1 + 6;
+  /* 4095 bytes at a 1.5Mb/s rate with a 1/2 coding rate. */
+  m_maxPacketDuration = CalculateTxDuration (4095, WifiPhy::Get1_5mb5Mhz (), WIFI_PREAMBLE_LONG);
+}
+
 void
 InterferenceHelper::AppendEvent (Ptr<InterferenceHelper::Event> event)
 {
diff -u -r -N ns-3-dev/src/devices/wifi/interference-helper.h ns-3-spacing/src/devices/wifi/interference-helper.h
--- ns-3-dev/src/devices/wifi/interference-helper.h 2009-07-09 18:14:07.000000000 +0200
+++ ns-3-spacing/src/devices/wifi/interference-helper.h 2009-07-09 12:26:29.000000000 +0200
@@ -71,6 +71,8 @@
 
   void Configure80211aParameters (void);
   void Configure80211bParameters (void);
+  void Configure80211_10MhzParameters (void);
+  void Configure80211_5MhzParameters (void);
   void SetNoiseFigure (double value);
   void SetErrorRateModel (Ptr<ErrorRateModel> rate);
 
diff -u -r -N ns-3-dev/src/devices/wifi/wifi-phy.cc ns-3-spacing/src/devices/wifi/wifi-phy.cc
--- ns-3-dev/src/devices/wifi/wifi-phy.cc 2009-07-09 18:14:07.000000000 +0200
+++ ns-3-spacing/src/devices/wifi/wifi-phy.cc 2009-07-09 12:22:34.000000000 +0200
@@ -244,6 +244,150 @@
   return mode;
 }
 
+WifiMode
+WifiPhy::Get3mb10Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-3mbs-10Mhz",
+                                                      true,
+                                                      10000000, 3000000, 6000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get4_5mb10Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-4.5mbs-10Mhz",
+                                                      false,
+                                                      10000000, 4500000, 6000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get6mb10Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-6mbs-10Mhz",
+                                                      true,
+                                                      10000000, 6000000, 12000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get9mb10Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-9mbs-10Mhz",
+                                                      false,
+                                                      10000000, 9000000, 12000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get12mb10Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-12mbs-10Mhz",
+                                                      true,
+                                                      10000000, 12000000, 24000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get18mb10Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-18mbs-10Mhz",
+                                                      false,
+                                                      10000000, 18000000, 24000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get24mb10Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-24mbs-10Mhz",
+                                                      false,
+                                                      10000000, 24000000, 36000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get27mb10Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-27mbs-10Mhz",
+                                                      false,
+                                                      10000000, 27000000, 36000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get1_5mb5Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-1_5mbs-5Mhz",
+                                                      true,
+                                                      5000000, 1500000, 3000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get2_25mb5Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-2.25mbs-5Mhz",
+                                                      false,
+                                                      5000000, 2250000, 3000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get3mb5Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-3mbs-5Mhz",
+                                                      true,
+                                                      5000000, 3000000, 6000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get4_5mb5Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-4.5mbs-5Mhz",
+                                                      false,
+                                                      5000000, 4500000, 6000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get6mb5Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-6mbs-5Mhz",
+                                                      true,
+                                                      5000000, 6000000, 12000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get9mb5Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-9mbs-5Mhz",
+                                                      false,
+                                                      10000000, 9000000, 12000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get12mb5Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-12mbs-5Mhz",
+                                                      false,
+                                                      10000000, 12000000, 18000000);
+  return mode;
+}
+
+WifiMode
+WifiPhy::Get13_5mb5Mhz (void)
+{
+  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-13.5mbs-5Mhz",
+                                                      false,
+                                                      10000000, 13500000, 18000000);
+  return mode;
+}
+
 
 } // namespace ns3
 
@@ -265,6 +409,22 @@
     ns3::WifiPhy::Get2mbb ();
     ns3::WifiPhy::Get5_5mbb ();
     ns3::WifiPhy::Get11mbb ();
+    ns3::WifiPhy::Get3mb10Mhz ();
+    ns3::WifiPhy::Get4_5mb10Mhz ();
+    ns3::WifiPhy::Get6mb10Mhz ();
+    ns3::WifiPhy::Get9mb10Mhz ();
+    ns3::WifiPhy::Get12mb10Mhz ();
+    ns3::WifiPhy::Get18mb10Mhz ();
+    ns3::WifiPhy::Get24mb10Mhz ();
+    ns3::WifiPhy::Get27mb10Mhz ();
+    ns3::WifiPhy::Get1_5mb5Mhz ();
+    ns3::WifiPhy::Get2_25mb5Mhz ();
+    ns3::WifiPhy::Get3mb5Mhz ();
+    ns3::WifiPhy::Get4_5mb5Mhz ();
+    ns3::WifiPhy::Get6mb5Mhz ();
+    ns3::WifiPhy::Get9mb5Mhz ();
+    ns3::WifiPhy::Get12mb5Mhz ();
+    ns3::WifiPhy::Get13_5mb5Mhz ();
   }
 } g_constructor;
 }
diff -u -r -N ns-3-dev/src/devices/wifi/wifi-phy.h ns-3-spacing/src/devices/wifi/wifi-phy.h
--- ns-3-dev/src/devices/wifi/wifi-phy.h 2009-07-09 18:14:07.000000000 +0200
+++ ns-3-spacing/src/devices/wifi/wifi-phy.h 2009-07-09 12:21:10.000000000 +0200
@@ -256,6 +256,22 @@
   static WifiMode Get2mbb (void);
   static WifiMode Get5_5mbb (void);
   static WifiMode Get11mbb (void);
+  static WifiMode Get3mb10Mhz (void);
+  static WifiMode Get4_5mb10Mhz (void);
+  static WifiMode Get6mb10Mhz (void);
+  static WifiMode Get9mb10Mhz (void);
+  static WifiMode Get12mb10Mhz (void);
+  static WifiMode Get18mb10Mhz (void);
+  static WifiMode Get24mb10Mhz (void);
+  static WifiMode Get27mb10Mhz (void);
+  static WifiMode Get1_5mb5Mhz (void);
+  static WifiMode Get2_25mb5Mhz (void);
+  static WifiMode Get3mb5Mhz (void);
+  static WifiMode Get4_5mb5Mhz (void);
+  static WifiMode Get6mb5Mhz (void);
+  static WifiMode Get9mb5Mhz (void);
+  static WifiMode Get12mb5Mhz (void);
+  static WifiMode Get13_5mb5Mhz (void);
 
 
   /**
diff -u -r -N ns-3-dev/src/devices/wifi/wifi-phy-standard.h ns-3-spacing/src/devices/wifi/wifi-phy-standard.h
--- ns-3-dev/src/devices/wifi/wifi-phy-standard.h 2009-07-09 18:14:07.000000000 +0200
+++ ns-3-spacing/src/devices/wifi/wifi-phy-standard.h 2009-07-09 12:23:11.000000000 +0200
@@ -25,6 +25,8 @@
 enum WifiPhyStandard {
   WIFI_PHY_STANDARD_80211a,
   WIFI_PHY_STANDARD_80211b,
+  WIFI_PHY_STANDARD_80211_10Mhz,
+  WIFI_PHY_STANDARD_80211_5Mhz,
   WIFI_PHY_STANDARD_holland
 };
 
diff -u -r -N ns-3-dev/src/devices/wifi/yans-error-rate-model.cc ns-3-spacing/src/devices/wifi/yans-error-rate-model.cc
--- ns-3-dev/src/devices/wifi/yans-error-rate-model.cc 2009-07-09 18:14:07.000000000 +0200
+++ ns-3-spacing/src/devices/wifi/yans-error-rate-model.cc 2009-07-09 12:38:14.000000000 +0200
@@ -176,7 +176,7 @@
 double
 YansErrorRateModel::GetChunkSuccessRate (WifiMode mode, double snr, uint32_t nbits) const
 {
-  if (mode == WifiPhy::Get6mba ())
+  if (mode == WifiPhy::Get6mba () || mode == WifiPhy::Get3mb10Mhz () || mode == WifiPhy::Get1_5mb5Mhz ())
     {
       return GetFecBpskBer (snr,
                             nbits,
@@ -186,7 +186,7 @@
                             11 // adFree
                             );      
     }
-  else if (mode == WifiPhy::Get9mba ())
+  else if (mode == WifiPhy::Get9mba () || mode == WifiPhy::Get4_5mb10Mhz () || mode == WifiPhy::Get2_25mb5Mhz ())
     {
       return GetFecBpskBer (snr,
                             nbits,
@@ -196,7 +196,7 @@
                             8 // adFree
                             );
     }
-  else if (mode == WifiPhy::Get12mba ())
+  else if (mode == WifiPhy::Get12mba () || mode == WifiPhy::Get6mb10Mhz () || mode == WifiPhy::Get3mb5Mhz ())
     {
       return GetFecQamBer (snr,
                            nbits,
@@ -208,7 +208,7 @@
                            0   // adFreePlusOne
                            );
     }
-  else if (mode == WifiPhy::Get18mba ())
+  else if (mode == WifiPhy::Get18mba () || mode == WifiPhy::Get9mb10Mhz () || mode == WifiPhy::Get4_5mb5Mhz ())
     {
       return GetFecQamBer (snr,
                            nbits,
@@ -220,7 +220,7 @@
                            31 // adFreePlusOne
                            );
     }
-  else if (mode == WifiPhy::Get24mba ())
+  else if (mode == WifiPhy::Get24mba () || mode == WifiPhy::Get12mb10Mhz () || mode == WifiPhy::Get6mb5Mhz ())
     {
       return GetFecQamBer (snr,
                            nbits,
@@ -232,7 +232,7 @@
                            0   // adFreePlusOne
                            );
     }
-  else if (mode == WifiPhy::Get36mba ())
+  else if (mode == WifiPhy::Get36mba () || mode == WifiPhy::Get18mb10Mhz () || mode == WifiPhy::Get9mb5Mhz ())
     {
       return GetFecQamBer (snr,
                            nbits,
@@ -244,7 +244,7 @@
                            31  // adFreePlusOne
                            );
     }
-  else if (mode == WifiPhy::Get48mba ())
+  else if (mode == WifiPhy::Get48mba () || mode == WifiPhy::Get24mb10Mhz () || mode == WifiPhy::Get12mb5Mhz ())
     {
       return GetFecQamBer (snr,
                            nbits,
@@ -256,7 +256,7 @@
                            16  // adFreePlusOne
                            );
     }
-  else if (mode == WifiPhy::Get54mba ())
+  else if (mode == WifiPhy::Get54mba () || mode == WifiPhy::Get27mb10Mhz () || mode == WifiPhy::Get13_5mb5Mhz ())
     {
       return GetFecQamBer (snr,
                            nbits,
diff -u -r -N ns-3-dev/src/devices/wifi/yans-wifi-phy.cc ns-3-spacing/src/devices/wifi/yans-wifi-phy.cc
--- ns-3-dev/src/devices/wifi/yans-wifi-phy.cc 2009-07-09 18:14:07.000000000 +0200
+++ ns-3-spacing/src/devices/wifi/yans-wifi-phy.cc 2009-07-09 12:25:35.000000000 +0200
@@ -111,6 +111,8 @@
                    MakeEnumAccessor (&YansWifiPhy::SetStandard),
                    MakeEnumChecker (WIFI_PHY_STANDARD_80211a, "802.11a",
                                     WIFI_PHY_STANDARD_80211b, "802.11b",
+                                    WIFI_PHY_STANDARD_80211_10Mhz,"802.11_10Mhz",
+                                    WIFI_PHY_STANDARD_80211_5Mhz,"802-11_5Mhz",
                                     WIFI_PHY_STANDARD_holland, "holland"))
     .AddAttribute ("State", "The state of the PHY layer",
                    PointerValue (),
@@ -156,6 +158,12 @@
   case WIFI_PHY_STANDARD_80211b:
     Configure80211b ();
     break;
+  case WIFI_PHY_STANDARD_80211_10Mhz:
+    Configure80211_10Mhz ();
+    break;
+  case WIFI_PHY_STANDARD_80211_5Mhz:
+    Configure80211_5Mhz ();
+    break;
   case WIFI_PHY_STANDARD_holland:
     ConfigureHolland ();
     break;
@@ -461,6 +469,36 @@
 }
 
 void
+YansWifiPhy::Configure80211_10Mhz (void)
+{
+  NS_LOG_FUNCTION (this);
+  m_interference.Configure80211_10MhzParameters ();
+  m_modes.push_back (WifiPhy::Get3mb10Mhz ());
+  m_modes.push_back (WifiPhy::Get4_5mb10Mhz ());
+  m_modes.push_back (WifiPhy::Get6mb10Mhz ());
+  m_modes.push_back (WifiPhy::Get9mb10Mhz ());
+  m_modes.push_back (WifiPhy::Get12mb10Mhz ());
+  m_modes.push_back (WifiPhy::Get18mb10Mhz ());
+  m_modes.push_back (WifiPhy::Get24mb10Mhz ());
+  m_modes.push_back (WifiPhy::Get27mb10Mhz  ());
+}
+
+void
+YansWifiPhy::Configure80211_5Mhz (void)
+{
+  NS_LOG_FUNCTION (this);
+  m_interference.Configure80211_5MhzParameters ();
+  m_modes.push_back (WifiPhy::Get1_5mb5Mhz ());
+  m_modes.push_back (WifiPhy::Get2_25mb5Mhz ());
+  m_modes.push_back (WifiPhy::Get3mb5Mhz ());
+  m_modes.push_back (WifiPhy::Get4_5mb5Mhz ());
+  m_modes.push_back (WifiPhy::Get6mb5Mhz ());
+  m_modes.push_back (WifiPhy::Get9mb5Mhz ());
+  m_modes.push_back (WifiPhy::Get12mb5Mhz ());
+  m_modes.push_back (WifiPhy::Get13_5mb5Mhz  ());
+}
+
+void
 YansWifiPhy::ConfigureHolland (void)
 {
   NS_LOG_FUNCTION (this);
diff -u -r -N ns-3-dev/src/devices/wifi/yans-wifi-phy.h ns-3-spacing/src/devices/wifi/yans-wifi-phy.h
--- ns-3-dev/src/devices/wifi/yans-wifi-phy.h 2009-07-09 18:14:07.000000000 +0200
+++ ns-3-spacing/src/devices/wifi/yans-wifi-phy.h 2009-07-09 12:24:31.000000000 +0200
@@ -125,6 +125,8 @@
   virtual void DoDispose (void);
   void Configure80211a (void);
   void Configure80211b (void);
+  void Configure80211_10Mhz (void);
+  void Configure80211_5Mhz ();
   void ConfigureHolland (void);
   double GetEdThresholdW (void) const;
   double DbmToW (double dbm) const;
diff -u -r -N ns-3-dev/src/helper/nqos-wifi-mac-helper.cc ns-3-spacing/src/helper/nqos-wifi-mac-helper.cc
--- ns-3-dev/src/helper/nqos-wifi-mac-helper.cc 2009-07-09 18:14:07.000000000 +0200
+++ ns-3-spacing/src/helper/nqos-wifi-mac-helper.cc 2009-07-09 12:35:22.000000000 +0200
@@ -41,28 +41,6 @@
 }
 
 void
-NqosWifiMacHelper::SetType (std::string type,
-                            std::string n0, const AttributeValue &v0,
-                            std::string n1, const AttributeValue &v1,
-                            std::string n2, const AttributeValue &v2,
-                            std::string n3, const AttributeValue &v3,
-                            std::string n4, const AttributeValue &v4,
-                            std::string n5, const AttributeValue &v5,
-                            std::string n6, const AttributeValue &v6,
-                            std::string n7, const AttributeValue &v7)
-{
-  m_mac.SetTypeId (type);
-  m_mac.Set (n0, v0);
-  m_mac.Set (n1, v1);
-  m_mac.Set (n2, v2);
-  m_mac.Set (n3, v3);
-  m_mac.Set (n4, v4);
-  m_mac.Set (n5, v5);
-  m_mac.Set (n6, v6);
-  m_mac.Set (n7, v7);
-}
-
-void
 NqosWifiMacHelper::SetDcaParameters (std::string n0, const AttributeValue &v0,
                                      std::string n1, const AttributeValue &v1,
                                      std::string n2, const AttributeValue &v2,
diff -u -r -N ns-3-dev/src/helper/nqos-wifi-mac-helper.h ns-3-spacing/src/helper/nqos-wifi-mac-helper.h
--- ns-3-dev/src/helper/nqos-wifi-mac-helper.h 2009-07-09 18:14:07.000000000 +0200
+++ ns-3-spacing/src/helper/nqos-wifi-mac-helper.h 2009-07-09 12:35:14.000000000 +0200
@@ -39,37 +39,6 @@
    */
   static NqosWifiMacHelper Default (void);
   /**
-   * \param type the type of ns3::WifiMac to create.
-   * \param n0 the name of the attribute to set
-   * \param v0 the value of the attribute to set
-   * \param n1 the name of the attribute to set
-   * \param v1 the value of the attribute to set
-   * \param n2 the name of the attribute to set
-   * \param v2 the value of the attribute to set
-   * \param n3 the name of the attribute to set
-   * \param v3 the value of the attribute to set
-   * \param n4 the name of the attribute to set
-   * \param v4 the value of the attribute to set
-   * \param n5 the name of the attribute to set
-   * \param v5 the value of the attribute to set
-   * \param n6 the name of the attribute to set
-   * \param v6 the value of the attribute to set
-   * \param n7 the name of the attribute to set
-   * \param v7 the value of the attribute to set
-   *
-   * All the attributes specified in this method should exist
-   * in the requested mac.
-   */
-  void SetType (std::string type,
-                std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
-                std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
-                std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
-                std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
-                std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
-                std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
-                std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
-                std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
-  /**
    * \param n0 the name of the attribute to set
    * \param v0 the value of the attribute to set
    * \param n1 the name of the attribute to set
@@ -91,7 +60,6 @@
    */
   virtual Ptr<WifiMac> Create (void) const;
 
-  ObjectFactory m_mac;
   ObjectFactory m_queue;
 };
 
diff -u -r -N ns-3-dev/src/helper/qos-wifi-mac-helper.cc ns-3-spacing/src/helper/qos-wifi-mac-helper.cc
--- ns-3-dev/src/helper/qos-wifi-mac-helper.cc 2009-07-09 18:14:07.000000000 +0200
+++ ns-3-spacing/src/helper/qos-wifi-mac-helper.cc 2009-07-09 12:34:19.000000000 +0200
@@ -69,28 +69,6 @@
 }
 
 void
-QosWifiMacHelper::SetType (std::string type,
-                           std::string n0, const AttributeValue &v0,
-                           std::string n1, const AttributeValue &v1,
-                           std::string n2, const AttributeValue &v2,
-                           std::string n3, const AttributeValue &v3,
-                           std::string n4, const AttributeValue &v4,
-                           std::string n5, const AttributeValue &v5,
-                           std::string n6, const AttributeValue &v6,
-                           std::string n7, const AttributeValue &v7)
-{
-  m_mac.SetTypeId (type);
-  m_mac.Set (n0, v0);
-  m_mac.Set (n1, v1);
-  m_mac.Set (n2, v2);
-  m_mac.Set (n3, v3);
-  m_mac.Set (n4, v4);
-  m_mac.Set (n5, v5);
-  m_mac.Set (n6, v6);
-  m_mac.Set (n7, v7);
-}
-
-void
 QosWifiMacHelper::SetMsduAggregatorForAc (AccessClass accessClass, std::string type,
                                           std::string n0, const AttributeValue &v0,
                                           std::string n1, const AttributeValue &v1,
diff -u -r -N ns-3-dev/src/helper/qos-wifi-mac-helper.h ns-3-spacing/src/helper/qos-wifi-mac-helper.h
--- ns-3-dev/src/helper/qos-wifi-mac-helper.h 2009-07-09 18:14:07.000000000 +0200
+++ ns-3-spacing/src/helper/qos-wifi-mac-helper.h 2009-07-09 12:34:06.000000000 +0200
@@ -41,37 +41,6 @@
    */
   static QosWifiMacHelper Default (void);
   /**
-   * \param type the type of ns3::WifiMac to create.
-   * \param n0 the name of the attribute to set
-   * \param v0 the value of the attribute to set
-   * \param n1 the name of the attribute to set
-   * \param v1 the value of the attribute to set
-   * \param n2 the name of the attribute to set
-   * \param v2 the value of the attribute to set
-   * \param n3 the name of the attribute to set
-   * \param v3 the value of the attribute to set
-   * \param n4 the name of the attribute to set
-   * \param v4 the value of the attribute to set
-   * \param n5 the name of the attribute to set
-   * \param v5 the value of the attribute to set
-   * \param n6 the name of the attribute to set
-   * \param v6 the value of the attribute to set
-   * \param n7 the name of the attribute to set
-   * \param v7 the value of the attribute to set
-   *
-   * All the attributes specified in this method should exist
-   * in the requested mac.
-   */
-  void SetType (std::string type,
-                std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
-                std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
-                std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
-                std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
-                std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
-                std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
-                std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
-                std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
-  /**
    * \param accessClass access class for which we are setting aggregator. Possibilities
    *  are: AC_BK, AC_BE, AC_VI, AC_VO.
    * \param type the type of ns3::WifiMac to create.
@@ -117,7 +86,6 @@
    */
   virtual Ptr<WifiMac> Create (void) const;
 
-  ObjectFactory m_mac;
   std::map<AccessClass, ObjectFactory> m_queues;
   std::map<AccessClass, ObjectFactory> m_aggregators;
 };
diff -u -r -N ns-3-dev/src/helper/wifi-helper.cc ns-3-spacing/src/helper/wifi-helper.cc
--- ns-3-dev/src/helper/wifi-helper.cc 2009-07-09 18:14:07.000000000 +0200
+++ ns-3-spacing/src/helper/wifi-helper.cc 2009-07-09 18:03:54.000000000 +0200
@@ -152,4 +152,54 @@
   LogComponentEnable ("YansWifiPhy", LOG_LEVEL_ALL);
 }
 
+void
+WifiMacHelper::SetType (std::string type,
+                           std::string n0, const AttributeValue &v0,
+                           std::string n1, const AttributeValue &v1,
+                           std::string n2, const AttributeValue &v2,
+                           std::string n3, const AttributeValue &v3,
+                           std::string n4, const AttributeValue &v4,
+                           std::string n5, const AttributeValue &v5,
+                           std::string n6, const AttributeValue &v6,
+                           std::string n7, const AttributeValue &v7)
+{
+  m_mac.SetTypeId (type);
+  m_mac.Set (n0, v0);
+  m_mac.Set (n1, v1);
+  m_mac.Set (n2, v2);
+  m_mac.Set (n3, v3);
+  m_mac.Set (n4, v4);
+  m_mac.Set (n5, v5);
+  m_mac.Set (n6, v6);
+  m_mac.Set (n7, v7);
+}
+
+void
+WifiMacHelper::Configure80211_10MhzParameters (std::string type, Ssid ssid)
+{
+  Time MaxPropagationDelay = Seconds (1000.0 / 300000000.0);
+  SetType (type,
+    "Ssid", SsidValue (ssid),
+    "Sifs", TimeValue (MicroSeconds(32)),
+    "Slot", TimeValue (MicroSeconds(13)),
+    "EifsNoDifs", TimeValue (MicroSeconds(32+88)),
+    "Pifs", TimeValue (MicroSeconds(32+13)),
+    "CtsTimeout", TimeValue (MicroSeconds(32+88+13+MaxPropagationDelay.GetMicroSeconds ()*2)),
+    "AckTimeout", TimeValue (MicroSeconds(32+88+13+MaxPropagationDelay.GetMicroSeconds ()*2)));
+}
+
+void
+WifiMacHelper::Configure80211_5MhzParameters (std::string type, Ssid ssid)
+{
+  Time MaxPropagationDelay = Seconds (1000.0 / 300000000.0);
+  SetType (type,
+    "Ssid", SsidValue (ssid),
+    "Sifs", TimeValue (MicroSeconds(64)),
+    "Slot", TimeValue (MicroSeconds(21)),
+    "EifsNoDifs", TimeValue (MicroSeconds(64+176)),
+    "Pifs", TimeValue (MicroSeconds(64+21)),
+    "CtsTimeout", TimeValue (MicroSeconds(64+176+21+MaxPropagationDelay.GetMicroSeconds ()*2)),
+    "AckTimeout", TimeValue (MicroSeconds(64+176+21+MaxPropagationDelay.GetMicroSeconds ()*2)));
+}
+
 } // namespace ns3
diff -u -r -N ns-3-dev/src/helper/wifi-helper.h ns-3-spacing/src/helper/wifi-helper.h
--- ns-3-dev/src/helper/wifi-helper.h 2009-07-09 18:14:07.000000000 +0200
+++ ns-3-spacing/src/helper/wifi-helper.h 2009-07-09 12:33:10.000000000 +0200
@@ -27,6 +27,7 @@
 #include "ns3/object-factory.h"
 #include "ns3/node-container.h"
 #include "ns3/net-device-container.h"
+#include "ns3/wifi-mac.h"
 
 namespace ns3 {
 
@@ -73,6 +74,43 @@
    * to create MAC objects from ns3::WifiHelper::Install.
    */
   virtual Ptr<WifiMac> Create (void) const = 0;
+  /**
+   * \param type the type of ns3::WifiMac to create.
+   * \param n0 the name of the attribute to set
+   * \param v0 the value of the attribute to set
+   * \param n1 the name of the attribute to set
+   * \param v1 the value of the attribute to set
+   * \param n2 the name of the attribute to set
+   * \param v2 the value of the attribute to set
+   * \param n3 the name of the attribute to set
+   * \param v3 the value of the attribute to set
+   * \param n4 the name of the attribute to set
+   * \param v4 the value of the attribute to set
+   * \param n5 the name of the attribute to set
+   * \param v5 the value of the attribute to set
+   * \param n6 the name of the attribute to set
+   * \param v6 the value of the attribute to set
+   * \param n7 the name of the attribute to set
+   * \param v7 the value of the attribute to set
+   *
+   * All the attributes specified in this method should exist
+   * in the requested mac.
+   */
+  void SetType (std::string type,
+                std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
+                std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
+                std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
+                std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
+                std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
+                std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
+                std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
+                std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
+  /// Configure MAC parameters to 10 MHz "half-clocked" channels, see Table 17-15 of IEEE 802.11-2007 std
+  void Configure80211_10MhzParameters (std::string type, Ssid ssid);
+  /// Configure MAC parameters to 5 MHz "quarter-clocked" channels, see Table 17-15 of IEEE 802.11-2007 std
+  void Configure80211_5MhzParameters (std::string type, Ssid ssid);
+protected:
+  ObjectFactory m_mac;
 };
 
 /**
Los ficheros binarios ns-3-dev/wutils.pyc y ns-3-spacing/wutils.pyc son distintos

 « Return to Thread: 802.11 10Mhz Channel