merge with ns-3-dev
authorJosh Pelkey <jpelkey@ece.gatech.edu>
Wed Aug 05 14:03:54 2009 -0400 (6 months ago)
changeset 4716a1b6bd8eb43a
parent 4674 3036706cf681
parent 4715 637b9cacd0b5
child 4717 5940d8156b3c
merge with ns-3-dev
src/internet-stack/icmpv4-l4-protocol.cc
src/internet-stack/ipv4-checksum.cc
src/internet-stack/ipv4-checksum.h
src/internet-stack/ipv4-interface.cc
src/internet-stack/ipv4-l3-protocol.cc
src/internet-stack/tcp-l4-protocol.cc
src/node/ipv4-routing-protocol.h
     1.1 --- a/CHANGES.html	Wed Aug 05 11:28:01 2009 -0400
     1.2 +++ b/CHANGES.html	Wed Aug 05 14:03:54 2009 -0400
     1.3 @@ -44,6 +44,39 @@
     1.4  us a note on ns-developers mailing list.  </p>
     1.5  
     1.6  <hr>
     1.7 +<h1>Changes from ns-3.5 to ns-3.6</h1>
     1.8 +
     1.9 +<h2>Changes to build system:</h2>
    1.10 +<ul>
    1.11 +</ul>
    1.12 +
    1.13 +<h2>New API:</h2>
    1.14 +<ul>
    1.15 +</ul>
    1.16 +
    1.17 +<h2>Changes to existing API:</h2>
    1.18 +<ul>
    1.19 +<li><b>InterferenceHelper</b>
    1.20 +<p>The method InterferenceHelper::CalculateTxDuration (uint32_t size, WifiMode payloadMode, WifiPreamble preamble) has been made static, so that the frame duration depends only on the characteristics of the frame (i.e., the function parameters) and not on the particular standard which is used by the receiving PHY. This makes it now possible to correctly calculate the duration of incoming frames in scenarios in which devices using different PHY configurations coexist in the same channel (e.g., a BSS using short preamble and another BSS using long preamble). </p>
    1.21 +<p> The following member methods have been added to InterferenceHelper:</p>
    1.22 +<pre>
    1.23 +  static WifiMode GetPlcpHeaderMode (WifiMode, WifiPreamble);
    1.24 +  static uint32_t GetPlcpHeaderDurationMicroSeconds (WifiMode, WifiPreamble);
    1.25 +  static uint32_t GetPlcpPreambleDurationMicroSeconds (WifiMode, WifiPreamble);
    1.26 +  static uint32_t GetPayloadDurationMicroSeconds (size, WifiMode); </pre>
    1.27 +<p> The following member methods have been removed from InterferenceHelper:</p>
    1.28 +<pre>
    1.29 +  void Configure80211aParameters (void);
    1.30 +  void Configure80211bParameters (void);
    1.31 +  void Configure80211_10MhzParameters (void);
    1.32 +  void Configure80211_5MhzParameters (void);</pre>
    1.33 +</li>
    1.34 +<li><b>WifiMode</b>
    1.35 +<p>WifiMode now has a WifiPhyStandard attribute which identifies the standard the WifiMode belongs to. To properly set this attribute when creating a new WifiMode, it is now required to explicitly pass a WifiPhyStandard parameter to all WifiModeFactory::CreateXXXX() methods. The WifiPhyStandard value of an existing WifiMode can be retrieved using the new method WifiMode::GetStandard().</p>
    1.36 +</li>
    1.37 +</ul>
    1.38 +
    1.39 +<hr>
    1.40  <h1>Changes from ns-3.4 to ns-3.5</h1>
    1.41  
    1.42  <h2>Changes to build system:</h2>
     2.1 --- a/VERSION	Wed Aug 05 11:28:01 2009 -0400
     2.2 +++ b/VERSION	Wed Aug 05 14:03:54 2009 -0400
     2.3 @@ -1,1 +1,1 @@
     2.4 -3.5
     2.5 +3-dev
     3.1 --- a/bindings/python/ns3_module_core.py	Wed Aug 05 11:28:01 2009 -0400
     3.2 +++ b/bindings/python/ns3_module_core.py	Wed Aug 05 14:03:54 2009 -0400
     3.3 @@ -442,6 +442,16 @@
     3.4                     '__gnu_cxx::__normal_iterator< ns3::GlobalValue * const *, std::vector< ns3::GlobalValue * > >', 
     3.5                     [], 
     3.6                     is_static=True)
     3.7 +    ## global-value.h: static bool ns3::GlobalValue::GetValueByNameFailSafe(std::string name, ns3::AttributeValue & value) [member function]
     3.8 +    cls.add_method('GetValueByNameFailSafe', 
     3.9 +                   'bool', 
    3.10 +                   [param('std::string', 'name'), param('ns3::AttributeValue &', 'value')], 
    3.11 +                   is_static=True)
    3.12 +    ## global-value.h: static void ns3::GlobalValue::GetValueByName(std::string name, ns3::AttributeValue & value) [member function]
    3.13 +    cls.add_method('GetValueByName', 
    3.14 +                   'void', 
    3.15 +                   [param('std::string', 'name'), param('ns3::AttributeValue &', 'value')], 
    3.16 +                   is_static=True)
    3.17      return
    3.18  
    3.19  def register_Ns3IntToType__0_methods(root_module, cls):
     4.1 --- a/bindings/python/ns3_module_csma.py	Wed Aug 05 11:28:01 2009 -0400
     4.2 +++ b/bindings/python/ns3_module_csma.py	Wed Aug 05 14:03:54 2009 -0400
     4.3 @@ -205,13 +205,11 @@
     4.4      ## csma-channel.h: ns3::DataRate ns3::CsmaChannel::GetDataRate() [member function]
     4.5      cls.add_method('GetDataRate', 
     4.6                     'ns3::DataRate', 
     4.7 -                   [], 
     4.8 -                   is_virtual=True)
     4.9 +                   [])
    4.10      ## csma-channel.h: ns3::Time ns3::CsmaChannel::GetDelay() [member function]
    4.11      cls.add_method('GetDelay', 
    4.12                     'ns3::Time', 
    4.13 -                   [], 
    4.14 -                   is_virtual=True)
    4.15 +                   [])
    4.16      return
    4.17  
    4.18  def register_Ns3CsmaNetDevice_methods(root_module, cls):
     5.1 --- a/bindings/python/ns3_module_global_routing.py	Wed Aug 05 11:28:01 2009 -0400
     5.2 +++ b/bindings/python/ns3_module_global_routing.py	Wed Aug 05 14:03:54 2009 -0400
     5.3 @@ -83,17 +83,32 @@
     5.4      cls.add_method('PopulateRoutingTables', 
     5.5                     'void', 
     5.6                     [], 
     5.7 -                   is_static=True)
     5.8 +                   is_static=True, deprecated=True)
     5.9      ## global-route-manager.h: static void ns3::GlobalRouteManager::RecomputeRoutingTables() [member function]
    5.10      cls.add_method('RecomputeRoutingTables', 
    5.11                     'void', 
    5.12                     [], 
    5.13 -                   is_static=True)
    5.14 +                   is_static=True, deprecated=True)
    5.15      ## global-route-manager.h: static uint32_t ns3::GlobalRouteManager::AllocateRouterId() [member function]
    5.16      cls.add_method('AllocateRouterId', 
    5.17                     'uint32_t', 
    5.18                     [], 
    5.19                     is_static=True)
    5.20 +    ## global-route-manager.h: static void ns3::GlobalRouteManager::DeleteGlobalRoutes() [member function]
    5.21 +    cls.add_method('DeleteGlobalRoutes', 
    5.22 +                   'void', 
    5.23 +                   [], 
    5.24 +                   is_static=True)
    5.25 +    ## global-route-manager.h: static void ns3::GlobalRouteManager::BuildGlobalRoutingDatabase() [member function]
    5.26 +    cls.add_method('BuildGlobalRoutingDatabase', 
    5.27 +                   'void', 
    5.28 +                   [], 
    5.29 +                   is_static=True)
    5.30 +    ## global-route-manager.h: static void ns3::GlobalRouteManager::InitializeRoutes() [member function]
    5.31 +    cls.add_method('InitializeRoutes', 
    5.32 +                   'void', 
    5.33 +                   [], 
    5.34 +                   is_static=True)
    5.35      return
    5.36  
    5.37  def register_Ns3GlobalRoutingLSA_methods(root_module, cls):
    5.38 @@ -160,6 +175,11 @@
    5.39                     'ns3::Ipv4Mask', 
    5.40                     [], 
    5.41                     is_const=True)
    5.42 +    ## global-router-interface.h: ns3::Ptr<ns3::Node> ns3::GlobalRoutingLSA::GetNode() const [member function]
    5.43 +    cls.add_method('GetNode', 
    5.44 +                   'ns3::Ptr< ns3::Node >', 
    5.45 +                   [], 
    5.46 +                   is_const=True)
    5.47      ## global-router-interface.h: ns3::GlobalRoutingLSA::SPFStatus ns3::GlobalRoutingLSA::GetStatus() const [member function]
    5.48      cls.add_method('GetStatus', 
    5.49                     'ns3::GlobalRoutingLSA::SPFStatus', 
    5.50 @@ -191,6 +211,10 @@
    5.51      cls.add_method('SetNetworkLSANetworkMask', 
    5.52                     'void', 
    5.53                     [param('ns3::Ipv4Mask', 'mask')])
    5.54 +    ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetNode(ns3::Ptr<ns3::Node> node) [member function]
    5.55 +    cls.add_method('SetNode', 
    5.56 +                   'void', 
    5.57 +                   [param('ns3::Ptr< ns3::Node >', 'node')])
    5.58      ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetStatus(ns3::GlobalRoutingLSA::SPFStatus status) [member function]
    5.59      cls.add_method('SetStatus', 
    5.60                     'void', 
     6.1 --- a/bindings/python/ns3_module_wifi.py	Wed Aug 05 11:28:01 2009 -0400
     6.2 +++ b/bindings/python/ns3_module_wifi.py	Wed Aug 05 14:03:54 2009 -0400
     6.3 @@ -8,7 +8,7 @@
     6.4      ## wifi-preamble.h: ns3::WifiPreamble [enumeration]
     6.5      module.add_enum('WifiPreamble', ['WIFI_PREAMBLE_LONG', 'WIFI_PREAMBLE_SHORT'])
     6.6      ## wifi-phy-standard.h: ns3::WifiPhyStandard [enumeration]
     6.7 -    module.add_enum('WifiPhyStandard', ['WIFI_PHY_STANDARD_80211a', 'WIFI_PHY_STANDARD_80211b', 'WIFI_PHY_STANDARD_holland'])
     6.8 +    module.add_enum('WifiPhyStandard', ['WIFI_PHY_STANDARD_80211a', 'WIFI_PHY_STANDARD_80211b', 'WIFI_PHY_STANDARD_80211_10Mhz', 'WIFI_PHY_STANDARD_80211_5Mhz', 'WIFI_PHY_STANDARD_holland'])
     6.9      ## qos-utils.h: ns3::AccessClass [enumeration]
    6.10      module.add_enum('AccessClass', ['AC_VO', 'AC_VI', 'AC_BE', 'AC_BK', 'AC_UNDEF'])
    6.11      ## edca-txop-n.h: ns3::TypeOfStation [enumeration]
    6.12 @@ -264,19 +264,11 @@
    6.13      cls.add_method('CalculateSnrPer', 
    6.14                     'ns3::InterferenceHelper::SnrPer', 
    6.15                     [param('ns3::Ptr< ns3::InterferenceHelper::Event >', 'event')])
    6.16 -    ## interference-helper.h: ns3::Time ns3::InterferenceHelper::CalculateTxDuration(uint32_t size, ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) const [member function]
    6.17 +    ## interference-helper.h: static ns3::Time ns3::InterferenceHelper::CalculateTxDuration(uint32_t size, ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) [member function]
    6.18      cls.add_method('CalculateTxDuration', 
    6.19                     'ns3::Time', 
    6.20                     [param('uint32_t', 'size'), param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], 
    6.21 -                   is_const=True)
    6.22 -    ## interference-helper.h: void ns3::InterferenceHelper::Configure80211aParameters() [member function]
    6.23 -    cls.add_method('Configure80211aParameters', 
    6.24 -                   'void', 
    6.25 -                   [])
    6.26 -    ## interference-helper.h: void ns3::InterferenceHelper::Configure80211bParameters() [member function]
    6.27 -    cls.add_method('Configure80211bParameters', 
    6.28 -                   'void', 
    6.29 -                   [])
    6.30 +                   is_static=True)
    6.31      ## interference-helper.h: ns3::Time ns3::InterferenceHelper::GetEnergyDuration(double energyW) [member function]
    6.32      cls.add_method('GetEnergyDuration', 
    6.33                     'ns3::Time', 
    6.34 @@ -291,6 +283,26 @@
    6.35                     'double', 
    6.36                     [], 
    6.37                     is_const=True)
    6.38 +    ## interference-helper.h: static uint32_t ns3::InterferenceHelper::GetPayloadDurationMicroSeconds(uint32_t size, ns3::WifiMode payloadMode) [member function]
    6.39 +    cls.add_method('GetPayloadDurationMicroSeconds', 
    6.40 +                   'uint32_t', 
    6.41 +                   [param('uint32_t', 'size'), param('ns3::WifiMode', 'payloadMode')], 
    6.42 +                   is_static=True)
    6.43 +    ## interference-helper.h: static uint32_t ns3::InterferenceHelper::GetPlcpHeaderDurationMicroSeconds(ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) [member function]
    6.44 +    cls.add_method('GetPlcpHeaderDurationMicroSeconds', 
    6.45 +                   'uint32_t', 
    6.46 +                   [param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], 
    6.47 +                   is_static=True)
    6.48 +    ## interference-helper.h: static ns3::WifiMode ns3::InterferenceHelper::GetPlcpHeaderMode(ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) [member function]
    6.49 +    cls.add_method('GetPlcpHeaderMode', 
    6.50 +                   'ns3::WifiMode', 
    6.51 +                   [param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], 
    6.52 +                   is_static=True)
    6.53 +    ## interference-helper.h: static uint32_t ns3::InterferenceHelper::GetPlcpPreambleDurationMicroSeconds(ns3::WifiMode mode, ns3::WifiPreamble preamble) [member function]
    6.54 +    cls.add_method('GetPlcpPreambleDurationMicroSeconds', 
    6.55 +                   'uint32_t', 
    6.56 +                   [param('ns3::WifiMode', 'mode'), param('ns3::WifiPreamble', 'preamble')], 
    6.57 +                   is_static=True)
    6.58      ## interference-helper.h: void ns3::InterferenceHelper::SetErrorRateModel(ns3::Ptr<ns3::ErrorRateModel> rate) [member function]
    6.59      cls.add_method('SetErrorRateModel', 
    6.60                     'void', 
    6.61 @@ -457,6 +469,11 @@
    6.62                     'uint32_t', 
    6.63                     [], 
    6.64                     is_const=True)
    6.65 +    ## wifi-mode.h: ns3::WifiPhyStandard ns3::WifiMode::GetStandard() const [member function]
    6.66 +    cls.add_method('GetStandard', 
    6.67 +                   'ns3::WifiPhyStandard', 
    6.68 +                   [], 
    6.69 +                   is_const=True)
    6.70      ## wifi-mode.h: uint32_t ns3::WifiMode::GetUid() const [member function]
    6.71      cls.add_method('GetUid', 
    6.72                     'uint32_t', 
    6.73 @@ -487,25 +504,25 @@
    6.74  def register_Ns3WifiModeFactory_methods(root_module, cls):
    6.75      ## wifi-mode.h: ns3::WifiModeFactory::WifiModeFactory(ns3::WifiModeFactory const & arg0) [copy constructor]
    6.76      cls.add_constructor([param('ns3::WifiModeFactory const &', 'arg0')])
    6.77 -    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateBpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate) [member function]
    6.78 +    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateBpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, ns3::WifiPhyStandard standard) [member function]
    6.79      cls.add_method('CreateBpsk', 
    6.80                     'ns3::WifiMode', 
    6.81 -                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate')], 
    6.82 +                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('ns3::WifiPhyStandard', 'standard')], 
    6.83                     is_static=True)
    6.84 -    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateQam(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, uint8_t constellationSize) [member function]
    6.85 +    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateQam(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, uint8_t constellationSize, ns3::WifiPhyStandard standard) [member function]
    6.86      cls.add_method('CreateQam', 
    6.87                     'ns3::WifiMode', 
    6.88 -                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('uint8_t', 'constellationSize')], 
    6.89 +                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('uint8_t', 'constellationSize'), param('ns3::WifiPhyStandard', 'standard')], 
    6.90                     is_static=True)
    6.91 -    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateDbpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate) [member function]
    6.92 +    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateDbpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, ns3::WifiPhyStandard standard) [member function]
    6.93      cls.add_method('CreateDbpsk', 
    6.94                     'ns3::WifiMode', 
    6.95 -                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate')], 
    6.96 +                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('ns3::WifiPhyStandard', 'standard')], 
    6.97                     is_static=True)
    6.98 -    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateDqpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate) [member function]
    6.99 +    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateDqpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, ns3::WifiPhyStandard standard) [member function]
   6.100      cls.add_method('CreateDqpsk', 
   6.101                     'ns3::WifiMode', 
   6.102 -                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate')], 
   6.103 +                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('ns3::WifiPhyStandard', 'standard')], 
   6.104                     is_static=True)
   6.105      return
   6.106  
   6.107 @@ -1470,6 +1487,10 @@
   6.108      cls.add_method('NotifyRxDrop', 
   6.109                     'void', 
   6.110                     [param('ns3::Ptr< ns3::Packet const >', 'packet')])
   6.111 +    ## wifi-mac.h: void ns3::WifiMac::SetStandard(ns3::WifiPhyStandard standard) [member function]
   6.112 +    cls.add_method('SetStandard', 
   6.113 +                   'void', 
   6.114 +                   [param('ns3::WifiPhyStandard', 'standard')])
   6.115      return
   6.116  
   6.117  def register_Ns3WifiMacHeader_methods(root_module, cls):
   6.118 @@ -2053,6 +2074,86 @@
   6.119                     'ns3::WifiMode', 
   6.120                     [], 
   6.121                     is_static=True)
   6.122 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get3mb10Mhz() [member function]
   6.123 +    cls.add_method('Get3mb10Mhz', 
   6.124 +                   'ns3::WifiMode', 
   6.125 +                   [], 
   6.126 +                   is_static=True)
   6.127 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get4_5mb10Mhz() [member function]
   6.128 +    cls.add_method('Get4_5mb10Mhz', 
   6.129 +                   'ns3::WifiMode', 
   6.130 +                   [], 
   6.131 +                   is_static=True)
   6.132 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get6mb10Mhz() [member function]
   6.133 +    cls.add_method('Get6mb10Mhz', 
   6.134 +                   'ns3::WifiMode', 
   6.135 +                   [], 
   6.136 +                   is_static=True)
   6.137 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get9mb10Mhz() [member function]
   6.138 +    cls.add_method('Get9mb10Mhz', 
   6.139 +                   'ns3::WifiMode', 
   6.140 +                   [], 
   6.141 +                   is_static=True)
   6.142 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get12mb10Mhz() [member function]
   6.143 +    cls.add_method('Get12mb10Mhz', 
   6.144 +                   'ns3::WifiMode', 
   6.145 +                   [], 
   6.146 +                   is_static=True)
   6.147 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get18mb10Mhz() [member function]
   6.148 +    cls.add_method('Get18mb10Mhz', 
   6.149 +                   'ns3::WifiMode', 
   6.150 +                   [], 
   6.151 +                   is_static=True)
   6.152 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get24mb10Mhz() [member function]
   6.153 +    cls.add_method('Get24mb10Mhz', 
   6.154 +                   'ns3::WifiMode', 
   6.155 +                   [], 
   6.156 +                   is_static=True)
   6.157 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get27mb10Mhz() [member function]
   6.158 +    cls.add_method('Get27mb10Mhz', 
   6.159 +                   'ns3::WifiMode', 
   6.160 +                   [], 
   6.161 +                   is_static=True)
   6.162 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get1_5mb5Mhz() [member function]
   6.163 +    cls.add_method('Get1_5mb5Mhz', 
   6.164 +                   'ns3::WifiMode', 
   6.165 +                   [], 
   6.166 +                   is_static=True)
   6.167 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get2_25mb5Mhz() [member function]
   6.168 +    cls.add_method('Get2_25mb5Mhz', 
   6.169 +                   'ns3::WifiMode', 
   6.170 +                   [], 
   6.171 +                   is_static=True)
   6.172 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get3mb5Mhz() [member function]
   6.173 +    cls.add_method('Get3mb5Mhz', 
   6.174 +                   'ns3::WifiMode', 
   6.175 +                   [], 
   6.176 +                   is_static=True)
   6.177 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get4_5mb5Mhz() [member function]
   6.178 +    cls.add_method('Get4_5mb5Mhz', 
   6.179 +                   'ns3::WifiMode', 
   6.180 +                   [], 
   6.181 +                   is_static=True)
   6.182 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get6mb5Mhz() [member function]
   6.183 +    cls.add_method('Get6mb5Mhz', 
   6.184 +                   'ns3::WifiMode', 
   6.185 +                   [], 
   6.186 +                   is_static=True)
   6.187 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get9mb5Mhz() [member function]
   6.188 +    cls.add_method('Get9mb5Mhz', 
   6.189 +                   'ns3::WifiMode', 
   6.190 +                   [], 
   6.191 +                   is_static=True)
   6.192 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get12mb5Mhz() [member function]
   6.193 +    cls.add_method('Get12mb5Mhz', 
   6.194 +                   'ns3::WifiMode', 
   6.195 +                   [], 
   6.196 +                   is_static=True)
   6.197 +    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get13_5mb5Mhz() [member function]
   6.198 +    cls.add_method('Get13_5mb5Mhz', 
   6.199 +                   'ns3::WifiMode', 
   6.200 +                   [], 
   6.201 +                   is_static=True)
   6.202      ## wifi-phy.h: void ns3::WifiPhy::NotifyTxBegin(ns3::Ptr<ns3::Packet const> packet) [member function]
   6.203      cls.add_method('NotifyTxBegin', 
   6.204                     'void', 
   6.205 @@ -3128,6 +3229,16 @@
   6.206      cls.add_method('SetNOscillators', 
   6.207                     'void', 
   6.208                     [param('uint8_t', 'nOscillators')])
   6.209 +    ## jakes-propagation-loss-model.h: uint8_t ns3::JakesPropagationLossModel::GetNRays() const [member function]
   6.210 +    cls.add_method('GetNRays', 
   6.211 +                   'uint8_t', 
   6.212 +                   [], 
   6.213 +                   is_const=True)
   6.214 +    ## jakes-propagation-loss-model.h: uint8_t ns3::JakesPropagationLossModel::GetNOscillators() const [member function]
   6.215 +    cls.add_method('GetNOscillators', 
   6.216 +                   'uint8_t', 
   6.217 +                   [], 
   6.218 +                   is_const=True)
   6.219      ## jakes-propagation-loss-model.h: double ns3::JakesPropagationLossModel::DoCalcRxPower(double txPowerDbm, ns3::Ptr<ns3::MobilityModel> a, ns3::Ptr<ns3::MobilityModel> b) const [member function]
   6.220      cls.add_method('DoCalcRxPower', 
   6.221                     'double', 
     7.1 --- a/doc/modules	Wed Aug 05 11:28:01 2009 -0400
     7.2 +++ b/doc/modules	Wed Aug 05 14:03:54 2009 -0400
     7.3 @@ -49,14 +49,14 @@
     7.4   *    - an ARP module
     7.5   *    - a UDP and a TCP implementation
     7.6   *    
     7.7 + * @defgroup routing Routing
     7.8 + *
     7.9   * @defgroup helper Helpers
    7.10   * 
    7.11   * @defgroup applications Applications
    7.12   *
    7.13   * @defgroup mobility Mobility
    7.14   *
    7.15 - * @defgroup routing Routing
    7.16 - *
    7.17   * @defgroup constants Constants
    7.18   * @brief Constants you can change
    7.19   *
     8.1 --- a/examples/first.py	Wed Aug 05 11:28:01 2009 -0400
     8.2 +++ b/examples/first.py	Wed Aug 05 14:03:54 2009 -0400
     8.3 @@ -18,8 +18,6 @@
     8.4  ns3.LogComponentEnable("UdpEchoClientApplication", ns3.LOG_LEVEL_INFO)
     8.5  ns3.LogComponentEnable("UdpEchoServerApplication", ns3.LOG_LEVEL_INFO)
     8.6  
     8.7 -ns3.RandomVariable.UseGlobalSeed(1, 1, 2, 3, 5, 8)
     8.8 -
     8.9  nodes = ns3.NodeContainer()
    8.10  nodes.Create(2)
    8.11  
     9.1 --- a/examples/virtual-net-device.cc	Wed Aug 05 11:28:01 2009 -0400
     9.2 +++ b/examples/virtual-net-device.cc	Wed Aug 05 14:03:54 2009 -0400
     9.3 @@ -80,6 +80,7 @@
     9.4    bool
     9.5    N0VirtualSend (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber)
     9.6    {
     9.7 +    NS_LOG_DEBUG ("Send to " << m_n3Address << ": " << *packet);
     9.8      m_n0Socket->SendTo (packet, 0, InetSocketAddress (m_n3Address, 667));
     9.9      return true;
    9.10    }
    9.11 @@ -87,6 +88,7 @@
    9.12    bool
    9.13    N1VirtualSend (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber)
    9.14    {
    9.15 +    NS_LOG_DEBUG ("Send to " << m_n3Address << ": " << *packet);
    9.16      m_n1Socket->SendTo (packet, 0, InetSocketAddress (m_n3Address, 667));
    9.17      return true;
    9.18    }
    9.19 @@ -96,10 +98,12 @@
    9.20    {
    9.21      if (m_rng.GetValue () < 0.25)
    9.22        {
    9.23 +        NS_LOG_DEBUG ("Send to " << m_n0Address << ": " << *packet);
    9.24          m_n3Socket->SendTo (packet, 0, InetSocketAddress (m_n0Address, 667));
    9.25        }
    9.26      else 
    9.27        {
    9.28 +        NS_LOG_DEBUG ("Send to " << m_n1Address << ": " << *packet);
    9.29          m_n3Socket->SendTo (packet, 0, InetSocketAddress (m_n1Address, 667));
    9.30        }
    9.31      return true;
    9.32 @@ -108,6 +112,7 @@
    9.33    void N3SocketRecv (Ptr<Socket> socket)
    9.34    {
    9.35      Ptr<Packet> packet = socket->Recv (65535, 0);
    9.36 +    NS_LOG_DEBUG ("N3SocketRecv: " << *packet);
    9.37      SocketAddressTag socketAddressTag;
    9.38      packet->RemovePacketTag (socketAddressTag);
    9.39      m_n3Tap->Receive (packet, 0x0800, m_n3Tap->GetAddress (), m_n3Tap->GetAddress (), NetDevice::PACKET_HOST);
    9.40 @@ -116,6 +121,7 @@
    9.41    void N0SocketRecv (Ptr<Socket> socket)
    9.42    {
    9.43      Ptr<Packet> packet = socket->Recv (65535, 0);
    9.44 +    NS_LOG_DEBUG ("N0SocketRecv: " << *packet);
    9.45      SocketAddressTag socketAddressTag;
    9.46      packet->RemovePacketTag (socketAddressTag);
    9.47      m_n0Tap->Receive (packet, 0x0800, m_n0Tap->GetAddress (), m_n0Tap->GetAddress (), NetDevice::PACKET_HOST);
    9.48 @@ -124,6 +130,7 @@
    9.49    void N1SocketRecv (Ptr<Socket> socket)
    9.50    {
    9.51      Ptr<Packet> packet = socket->Recv (65535, 0);
    9.52 +    NS_LOG_DEBUG ("N1SocketRecv: " << *packet);
    9.53      SocketAddressTag socketAddressTag;
    9.54      packet->RemovePacketTag (socketAddressTag);
    9.55      m_n1Tap->Receive (packet, 0x0800, m_n1Tap->GetAddress (), m_n1Tap->GetAddress (), NetDevice::PACKET_HOST);
    9.56 @@ -192,6 +199,8 @@
    9.57  #if 0 
    9.58    LogComponentEnable ("VirtualNetDeviceExample", LOG_LEVEL_INFO);
    9.59  #endif
    9.60 +  Packet::EnablePrinting ();
    9.61 +  
    9.62  
    9.63    // Set up some default values for the simulation.  Use the 
    9.64    Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210));
    9.65 @@ -266,11 +275,11 @@
    9.66      Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
    9.67    apps = sink.Install (c.Get (3));
    9.68    apps.Start (Seconds (1.0));
    9.69 -  apps.Stop (Seconds (10.0));
    9.70 +  //apps.Stop (Seconds (10.0));
    9.71  
    9.72    // Create a similar flow from n3 to n1, starting at time 1.1 seconds
    9.73    onoff.SetAttribute ("Remote", 
    9.74 -                      AddressValue (InetSocketAddress (Ipv4Address ("11.0.0.2"), port)));
    9.75 +                      AddressValue (InetSocketAddress (Ipv4Address ("11.0.0.1"), port)));
    9.76    apps = onoff.Install (c.Get (3));
    9.77    apps.Start (Seconds (1.1));
    9.78    apps.Stop (Seconds (10.0));
    9.79 @@ -278,7 +287,7 @@
    9.80    // Create a packet sink to receive these packets
    9.81    apps = sink.Install (c.Get (1));
    9.82    apps.Start (Seconds (1.1));
    9.83 -  apps.Stop (Seconds (10.0));
    9.84 +  //apps.Stop (Seconds (10.0));
    9.85  
    9.86    std::ofstream ascii;
    9.87    ascii.open ("virtual-net-device.tr");
    10.1 --- a/src/common/pcap-writer.cc	Wed Aug 05 11:28:01 2009 -0400
    10.2 +++ b/src/common/pcap-writer.cc	Wed Aug 05 14:03:54 2009 -0400
    10.3 @@ -254,7 +254,7 @@
    10.4        Write16(PRISM_ITEM_LENGTH); 
    10.5        // convert from frequency to channel number. This conversion is
    10.6        // correct only for IEEE 802.11b/g channels 1-13.
    10.7 -      Write32((channelFreqMhz - 2407) / 5);
    10.8 +      Write32((2437 - 2407) / 5);
    10.9  
   10.10        Write32(PRISM_DID_RSSI);
   10.11        Write16(PRISM_STATUS_PRESENT);
   10.12 @@ -388,7 +388,7 @@
   10.13  
   10.14        Write8(rate); 
   10.15  
   10.16 -      Write16((uint16_t) channelFreqMhz); 
   10.17 +      Write16((uint16_t) 2437); 
   10.18  
   10.19        // we might want to make this setting depend on the WifiMode and
   10.20        // on the ChannelFrequency at some time in the future. But for now
    11.1 --- a/src/core/global-value.cc	Wed Aug 05 11:28:01 2009 -0400
    11.2 +++ b/src/core/global-value.cc	Wed Aug 05 14:03:54 2009 -0400
    11.3 @@ -174,6 +174,30 @@
    11.4  {
    11.5    return GetVector ()->end ();
    11.6  }
    11.7 +
    11.8 +bool
    11.9 +GlobalValue::GetValueByNameFailSafe (std::string name, AttributeValue &value)
   11.10 +{
   11.11 +  for (GlobalValue::Iterator gvit = GlobalValue::Begin (); gvit != GlobalValue::End (); ++gvit)
   11.12 +    {
   11.13 +      if ((*gvit)->GetName () == name)
   11.14 +         {
   11.15 +           (*gvit)->GetValue (value);  
   11.16 +           return true;
   11.17 +         }
   11.18 +    } 
   11.19 +  return false; // not found
   11.20 +}
   11.21 +
   11.22 +void
   11.23 +GlobalValue::GetValueByName (std::string name, AttributeValue &value)
   11.24 +{
   11.25 +  if (! GetValueByNameFailSafe (name, value))
   11.26 +    {
   11.27 +      NS_FATAL_ERROR ("Could not find GlobalValue named \"" << name << "\"");
   11.28 +    }
   11.29 +}
   11.30 +
   11.31  GlobalValue::Vector *
   11.32  GlobalValue::GetVector (void)
   11.33  {
    12.1 --- a/src/core/global-value.h	Wed Aug 05 11:28:01 2009 -0400
    12.2 +++ b/src/core/global-value.h	Wed Aug 05 14:03:54 2009 -0400
    12.3 @@ -114,6 +114,30 @@
    12.4     * \returns an iterator which represents a pointer to the last GlobalValue registered.
    12.5     */
    12.6    static Iterator End (void);
    12.7 +
    12.8 +
    12.9 +  /** 
   12.10 +   * finds the GlobalValue with the given name and returns its value
   12.11 +   * 
   12.12 +   * @param name the name of the GlobalValue to be found
   12.13 +   * @param value where to store the value of the found GlobalValue
   12.14 +   * 
   12.15 +   * @return true if the GlobalValue was found, false otherwise
   12.16 +   */
   12.17 +  static bool GetValueByNameFailSafe (std::string name, AttributeValue &value);
   12.18 +
   12.19 +  /** 
   12.20 +   * finds the GlobalValue with the given name and returns its
   12.21 +   * value. This method cannot fail, i.e., it will trigger a
   12.22 +   * NS_FATAL_ERROR if the requested GlobalValue is not found.
   12.23 +   * 
   12.24 +   * @param name the name of the GlobalValue to be found
   12.25 +   * @param value where to store the value of the found GlobalValue
   12.26 +   * 
   12.27 +   */
   12.28 +  static void GetValueByName (std::string name, AttributeValue &value);
   12.29 +  
   12.30 +
   12.31  private:
   12.32    friend class GlobalValueTests;
   12.33    static Vector *GetVector (void);
    13.1 --- a/src/core/ptr.h	Wed Aug 05 11:28:01 2009 -0400
    13.2 +++ b/src/core/ptr.h	Wed Aug 05 14:03:54 2009 -0400
    13.3 @@ -373,6 +373,13 @@
    13.4    return Ptr<T1> (dynamic_cast<T1 *> (PeekPointer (p)));
    13.5  }
    13.6  
    13.7 +template <typename T1, typename T2>
    13.8 +Ptr<T1>
    13.9 +StaticCast (Ptr<T2> const&p)
   13.10 +{
   13.11 +  return Ptr<T1> (static_cast<T1 *> (PeekPointer (p)));
   13.12 +}
   13.13 +
   13.14  
   13.15  /****************************************************
   13.16   *      Member method implementations.
    14.1 --- a/src/core/test.h	Wed Aug 05 11:28:01 2009 -0400
    14.2 +++ b/src/core/test.h	Wed Aug 05 14:03:54 2009 -0400
    14.3 @@ -115,7 +115,7 @@
    14.4  
    14.5  #define NS_TEST_ASSERT_EQUAL_FILELINE(got, expected, file, line)    \
    14.6    do {                                                              \
    14.7 -    if ((got) != (expected))                                        \
    14.8 +    if (! ((got) == (expected)))                                    \
    14.9        {                                                             \
   14.10          Failure () << file << ":" <<line                            \
   14.11                     << ": expected " << (expected)                   \
    15.1 --- a/src/devices/csma/csma-channel.h	Wed Aug 05 11:28:01 2009 -0400
    15.2 +++ b/src/devices/csma/csma-channel.h	Wed Aug 05 14:03:54 2009 -0400
    15.3 @@ -259,14 +259,14 @@
    15.4     * \return Returns the DataRate to be used by device transmitters.
    15.5     * with deviceId i.
    15.6     */
    15.7 -  virtual DataRate GetDataRate (void);
    15.8 +  DataRate GetDataRate (void);
    15.9  
   15.10    /**
   15.11     * Get the assigned speed-of-light delay of the channel
   15.12     *
   15.13     * \return Returns the delay used by the channel.
   15.14     */
   15.15 -  virtual Time GetDelay (void);
   15.16 +  Time GetDelay (void);
   15.17  
   15.18  private:
   15.19  
    16.1 --- a/src/devices/emu/emu-net-device.cc	Wed Aug 05 11:28:01 2009 -0400
    16.2 +++ b/src/devices/emu/emu-net-device.cc	Wed Aug 05 14:03:54 2009 -0400
    16.3 @@ -612,6 +612,19 @@
    16.4    Ptr<Packet> originalPacket = packet->Copy ();
    16.5  
    16.6    EthernetHeader header (false);
    16.7 +
    16.8 +  //
    16.9 +  // This device could be running in an environment where completely unexpected
   16.10 +  // kinds of packets are flying around, so we need to harden things a bit and
   16.11 +  // filter out packets we think are completely bogus, so we always check to see
   16.12 +  // that the packet is long enough to contain the header we want to remove.
   16.13 +  //
   16.14 +  if (packet->GetSize() < header.GetSerializedSize())
   16.15 +    {
   16.16 +      m_phyRxDropTrace (originalPacket);
   16.17 +      return;
   16.18 +    }
   16.19 +
   16.20    packet->RemoveHeader (header);
   16.21  
   16.22    NS_LOG_LOGIC ("Pkt source is " << header.GetSource ());
   16.23 @@ -628,6 +641,16 @@
   16.24    if (header.GetLengthType () <= 1500)
   16.25      {
   16.26        LlcSnapHeader llc;
   16.27 +      //
   16.28 +      // Check to see that the packet is long enough to possibly contain the
   16.29 +      // header we want to remove before just naively calling.
   16.30 +      //
   16.31 +      if (packet->GetSize() < llc.GetSerializedSize())
   16.32 +        {
   16.33 +          m_phyRxDropTrace (originalPacket);
   16.34 +          return;
   16.35 +        }
   16.36 +
   16.37        packet->RemoveHeader (llc);
   16.38        protocol = llc.GetType ();
   16.39      }
   16.40 @@ -787,10 +810,6 @@
   16.41    header.SetLengthType (packet->GetSize ());
   16.42    packet->AddHeader (header);
   16.43  
   16.44 -  EthernetTrailer trailer;
   16.45 -  trailer.CalcFcs (packet);
   16.46 -  packet->AddTrailer (trailer);
   16.47 -
   16.48    //
   16.49    // there's not much meaning associated with the different layers in this
   16.50    // device, so don't be surprised when they're all stacked together in 
    17.1 --- a/src/devices/virtual-net-device/virtual-net-device.cc	Wed Aug 05 11:28:01 2009 -0400
    17.2 +++ b/src/devices/virtual-net-device/virtual-net-device.cc	Wed Aug 05 14:03:54 2009 -0400
    17.3 @@ -115,6 +115,7 @@
    17.4  void VirtualNetDevice::DoDispose()
    17.5  {
    17.6    NS_LOG_FUNCTION_NOARGS ();
    17.7 +  m_node = 0;
    17.8    NetDevice::DoDispose ();
    17.9  }
   17.10  
    18.1 --- a/src/devices/wifi/dcf-manager-test.cc	Wed Aug 05 11:28:01 2009 -0400
    18.2 +++ b/src/devices/wifi/dcf-manager-test.cc	Wed Aug 05 14:03:54 2009 -0400
    18.3 @@ -379,6 +379,21 @@
    18.4    AddAccessRequest (30, 2, 70, 0);
    18.5    ExpectCollision (30, 0, 0); // backoff: 0 slots
    18.6    EndTest ();
    18.7 +  // Test shows when two frames are received without interval between
    18.8 +  // them:
    18.9 +  //  20          60         100   106     110  112
   18.10 +  //   |    rx     |    rx     |sifs | aifsn | tx | 
   18.11 +  //        |
   18.12 +  //       30 request access. backoff slots: 0
   18.13 +
   18.14 +  StartTest (4, 6 , 10);
   18.15 +  AddDcfState (1);
   18.16 +  AddRxOkEvt (20, 40);
   18.17 +  AddRxOkEvt (60, 40);
   18.18 +  AddAccessRequest (30, 2, 110, 0);
   18.19 +  ExpectCollision (30, 0, 0); // backoff: 0 slots
   18.20 +  EndTest ();
   18.21 +
   18.22  
   18.23    // The test below is subject to some discussion because I am 
   18.24    // not sure I understand the intent of the spec here.
    19.1 --- a/src/devices/wifi/dcf-manager.cc	Wed Aug 05 11:28:01 2009 -0400
    19.2 +++ b/src/devices/wifi/dcf-manager.cc	Wed Aug 05 14:03:54 2009 -0400
    19.3 @@ -433,7 +433,7 @@
    19.4  DcfManager::GetAccessGrantStart (void) const
    19.5  {
    19.6    Time rxAccessStart;
    19.7 -  if (m_lastRxEnd >= m_lastRxStart) 
    19.8 +  if (!m_rxing) 
    19.9      {
   19.10        rxAccessStart = m_lastRxEnd;
   19.11        if (!m_lastRxReceivedOk)
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/src/devices/wifi/interference-helper-tx-duration-test.cc	Wed Aug 05 14:03:54 2009 -0400
    20.3 @@ -0,0 +1,193 @@
    20.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    20.5 +/*
    20.6 + * Copyright (c) 2009 CTTC
    20.7 + *
    20.8 + * This program is free software; you can redistribute it and/or modify
    20.9 + * it under the terms of the GNU General Public License version 2 as 
   20.10 + * published by the Free Software Foundation;
   20.11 + *
   20.12 + * This program is distributed in the hope that it will be useful,
   20.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   20.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   20.15 + * GNU General Public License for more details.
   20.16 + *
   20.17 + * You should have received a copy of the GNU General Public License
   20.18 + * along with this program; if not, write to the Free Software
   20.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   20.20 + *
   20.21 + * Author: Nicola Baldo <nbaldo@cttc.es>
   20.22 + */
   20.23 +
   20.24 +#include<ns3/object.h>
   20.25 +#include<ns3/log.h>
   20.26 +#include <ns3/test.h>
   20.27 +#include<iostream>
   20.28 +#include"interference-helper.h"
   20.29 +#include"wifi-phy.h"
   20.30 +
   20.31 +NS_LOG_COMPONENT_DEFINE ("InterferenceHelperTxDurationTest");
   20.32 +
   20.33 +
   20.34 +#ifdef RUN_SELF_TESTS
   20.35 +
   20.36 +
   20.37 +namespace ns3 {
   20.38 +
   20.39 +class InterferenceHelperTxDurationTest : public Test {
   20.40 +public:
   20.41 +  InterferenceHelperTxDurationTest ();
   20.42 +  virtual ~InterferenceHelperTxDurationTest ();
   20.43 +  virtual bool RunTests (void);
   20.44 +
   20.45 +private:
   20.46 +
   20.47 +  /** 
   20.48 +   * Check if the payload tx duration returned by InterferenceHelper
   20.49 +   * corresponds to a known value of the pay
   20.50 +   * 
   20.51 +   * @param size size of payload in octets (includes everything after the PLCP header)
   20.52 +   * @param payloadMode the WifiMode used 
   20.53 +   * @param knownPlcpLengthFieldValue the known value of the Length field in the PLCP header
   20.54 +   * 
   20.55 +   * @return true if values correspond, false otherwise
   20.56 +   */
   20.57 +  bool CheckPayloadDuration(uint32_t size, WifiMode payloadMode,  uint32_t knownDurationMicroSeconds);
   20.58 +
   20.59 +  /** 
   20.60 +   * Check if the overall tx duration returned by InterferenceHelper
   20.61 +   * corresponds to a known value of the pay
   20.62 +   * 
   20.63 +   * @param size size of payload in octets (includes everything after the PLCP header)
   20.64 +   * @param payloadMode the WifiMode used 
   20.65 +   * @param preamble the WifiPreamble used
   20.66 +   * @param knownPlcpLengthFieldValue the known value of the Length field in the PLCP header
   20.67 +   * 
   20.68 +   * @return true if values correspond, false otherwise
   20.69 +   */
   20.70 +  bool CheckTxDuration(uint32_t size, WifiMode payloadMode,  WifiPreamble preamble, uint32_t knownDurationMicroSeconds);
   20.71 +  
   20.72 +};
   20.73 +
   20.74 +
   20.75 +// we need to create one instance of InterferenceHelperTxDurationTest
   20.76 +static InterferenceHelperTxDurationTest interferenceHelperTxDurationTestInstance;
   20.77 +
   20.78 +
   20.79 +InterferenceHelperTxDurationTest::InterferenceHelperTxDurationTest ()
   20.80 +  : Test ("InterferenceHelperTxDuration")
   20.81 +{
   20.82 +}
   20.83 +
   20.84 +
   20.85 +InterferenceHelperTxDurationTest::~InterferenceHelperTxDurationTest ()
   20.86 +{
   20.87 +}
   20.88 +
   20.89 +
   20.90 +
   20.91 +bool
   20.92 +InterferenceHelperTxDurationTest::CheckPayloadDuration(uint32_t size, WifiMode payloadMode, uint32_t knownDurationMicroSeconds)
   20.93 +{
   20.94 +  uint32_t calculatedDurationMicroSeconds = InterferenceHelper::GetPayloadDurationMicroSeconds (size, payloadMode);  
   20.95 +  if (calculatedDurationMicroSeconds != knownDurationMicroSeconds)
   20.96 +    {
   20.97 +      std::cerr << " size=" << size
   20.98 +                << " mode=" << payloadMode 
   20.99 +                << " known=" << knownDurationMicroSeconds
  20.100 +                << " calculated=" << calculatedDurationMicroSeconds
  20.101 +                << std::endl;
  20.102 +      return false;
  20.103 +    }
  20.104 +  return true;
  20.105 +}
  20.106 +
  20.107 +bool
  20.108 +InterferenceHelperTxDurationTest::CheckTxDuration(uint32_t size, WifiMode payloadMode, WifiPreamble preamble, uint32_t knownDurationMicroSeconds)
  20.109 +{
  20.110 +  uint32_t calculatedDurationMicroSeconds = InterferenceHelper::CalculateTxDuration (size, payloadMode, preamble).GetMicroSeconds ();  
  20.111 +  if (calculatedDurationMicroSeconds != knownDurationMicroSeconds)
  20.112 +    {
  20.113 +      std::cerr << " size=" << size
  20.114 +                << " mode=" << payloadMode 
  20.115 +                << " preamble=" << preamble
  20.116 +                << " known=" << knownDurationMicroSeconds
  20.117 +                << " calculated=" << calculatedDurationMicroSeconds
  20.118 +                << std::endl;
  20.119 +      return false;
  20.120 +    }
  20.121 +  return true;
  20.122 +}
  20.123 +
  20.124 +bool 
  20.125 +InterferenceHelperTxDurationTest::RunTests (void)
  20.126 +{
  20.127 +  bool retval = true;
  20.128 +
  20.129 +  // IEEE Std 802.11-2007 Table 18-2 "Example of LENGTH calculations for CCK"
  20.130 +  retval = retval 
  20.131 +    && CheckPayloadDuration (1023, WifiPhy::Get11mbb (), 744)     
  20.132 +    && CheckPayloadDuration (1024, WifiPhy::Get11mbb (), 745)
  20.133 +    && CheckPayloadDuration (1025, WifiPhy::Get11mbb (), 746)
  20.134 +    && CheckPayloadDuration (1026, WifiPhy::Get11mbb (), 747);
  20.135 +
  20.136 +
  20.137 +  // Similar, but we add PLCP preamble and header durations
  20.138 +  // and we test different rates.
  20.139 +  // The payload durations for modes other than 11mbb have been
  20.140 +  // calculated by hand according to  IEEE Std 802.11-2007 18.2.3.5 
  20.141 +  retval = retval 
  20.142 +    && CheckTxDuration (1023, WifiPhy::Get11mbb (), WIFI_PREAMBLE_SHORT, 744 + 96)     
  20.143 +    && CheckTxDuration (1024, WifiPhy::Get11mbb (), WIFI_PREAMBLE_SHORT, 745 + 96)
  20.144 +    && CheckTxDuration (1025, WifiPhy::Get11mbb (), WIFI_PREAMBLE_SHORT, 746 + 96)
  20.145 +    && CheckTxDuration (1026, WifiPhy::Get11mbb (), WIFI_PREAMBLE_SHORT, 747 + 96)
  20.146 +    && CheckTxDuration (1023, WifiPhy::Get11mbb (), WIFI_PREAMBLE_LONG, 744 + 192)     
  20.147 +    && CheckTxDuration (1024, WifiPhy::Get11mbb (), WIFI_PREAMBLE_LONG, 745 + 192)
  20.148 +    && CheckTxDuration (1025, WifiPhy::Get11mbb (), WIFI_PREAMBLE_LONG, 746 + 192)
  20.149 +    && CheckTxDuration (1026, WifiPhy::Get11mbb (), WIFI_PREAMBLE_LONG, 747 + 192)
  20.150 +    && CheckTxDuration (1023, WifiPhy::Get5_5mbb (), WIFI_PREAMBLE_SHORT, 1488 + 96)     
  20.151 +    && CheckTxDuration (1024, WifiPhy::Get5_5mbb (), WIFI_PREAMBLE_SHORT, 1490 + 96)
  20.152 +    && CheckTxDuration (1025, WifiPhy::Get5_5mbb (), WIFI_PREAMBLE_SHORT, 1491 + 96)
  20.153 +    && CheckTxDuration (1026, WifiPhy::Get5_5mbb (), WIFI_PREAMBLE_SHORT, 1493 + 96)
  20.154 +    && CheckTxDuration (1023, WifiPhy::Get5_5mbb (), WIFI_PREAMBLE_LONG, 1488 + 192)     
  20.155 +    && CheckTxDuration (1024, WifiPhy::Get5_5mbb (), WIFI_PREAMBLE_LONG, 1490 + 192)
  20.156 +    && CheckTxDuration (1025, WifiPhy::Get5_5mbb (), WIFI_PREAMBLE_LONG, 1491 + 192)
  20.157 +    && CheckTxDuration (1026, WifiPhy::Get5_5mbb (), WIFI_PREAMBLE_LONG, 1493 + 192)
  20.158 +    && CheckTxDuration (1023, WifiPhy::Get2mbb (), WIFI_PREAMBLE_SHORT, 4092 + 96)     
  20.159 +    && CheckTxDuration (1024, WifiPhy::Get2mbb (), WIFI_PREAMBLE_SHORT, 4096 + 96)
  20.160 +    && CheckTxDuration (1025, WifiPhy::Get2mbb (), WIFI_PREAMBLE_SHORT, 4100 + 96)
  20.161 +    && CheckTxDuration (1026, WifiPhy::Get2mbb (), WIFI_PREAMBLE_SHORT, 4104 + 96)
  20.162 +    && CheckTxDuration (1023, WifiPhy::Get2mbb (), WIFI_PREAMBLE_LONG, 4092 + 192)     
  20.163 +    && CheckTxDuration (1024, WifiPhy::Get2mbb (), WIFI_PREAMBLE_LONG, 4096 + 192)
  20.164 +    && CheckTxDuration (1025, WifiPhy::Get2mbb (), WIFI_PREAMBLE_LONG, 4100 + 192)
  20.165 +    && CheckTxDuration (1026, WifiPhy::Get2mbb (), WIFI_PREAMBLE_LONG, 4104 + 192)      
  20.166 +    && CheckTxDuration (1023, WifiPhy::Get1mbb (), WIFI_PREAMBLE_SHORT, 8184 + 96)     
  20.167 +    && CheckTxDuration (1024, WifiPhy::Get1mbb (), WIFI_PREAMBLE_SHORT, 8192 + 96)
  20.168 +    && CheckTxDuration (1025, WifiPhy::Get1mbb (), WIFI_PREAMBLE_SHORT, 8200 + 96)
  20.169 +    && CheckTxDuration (1026, WifiPhy::Get1mbb (), WIFI_PREAMBLE_SHORT, 8208 + 96)
  20.170 +    && CheckTxDuration (1023, WifiPhy::Get1mbb (), WIFI_PREAMBLE_LONG, 8184 + 192)     
  20.171 +    && CheckTxDuration (1024, WifiPhy::Get1mbb (), WIFI_PREAMBLE_LONG, 8192 + 192)
  20.172 +    && CheckTxDuration (1025, WifiPhy::Get1mbb (), WIFI_PREAMBLE_LONG, 8200 + 192)
  20.173 +    && CheckTxDuration (1026, WifiPhy::Get1mbb (), WIFI_PREAMBLE_LONG, 8208 + 192);
  20.174 +
  20.175 +  // values from http://mailman.isi.edu/pipermail/ns-developers/2009-July/006226.html
  20.176 +  retval = retval && CheckTxDuration (14, WifiPhy::Get1mbb (), WIFI_PREAMBLE_LONG, 304);
  20.177 +
  20.178 +  // values from
  20.179 +  // http://www.oreillynet.com/pub/a/wireless/2003/08/08/wireless_throughput.html
  20.180 +  retval = retval 
  20.181 +    && CheckTxDuration (1536, WifiPhy::Get11mbb (), WIFI_PREAMBLE_LONG, 1310)
  20.182 +    && CheckTxDuration (76, WifiPhy::Get11mbb (), WIFI_PREAMBLE_LONG, 248)
  20.183 +    && CheckTxDuration (14, WifiPhy::Get11mbb (), WIFI_PREAMBLE_LONG, 203)
  20.184 +    && CheckTxDuration (1536, WifiPhy::Get54mba (), WIFI_PREAMBLE_LONG, 248)
  20.185 +    && CheckTxDuration (76, WifiPhy::Get54mba (), WIFI_PREAMBLE_LONG, 32)
  20.186 +    && CheckTxDuration (14, WifiPhy::Get54mba (), WIFI_PREAMBLE_LONG, 24);
  20.187 +
  20.188 +
  20.189 +  return retval;
  20.190 +}
  20.191 +
  20.192 +
  20.193 +} //namespace ns3 
  20.194 +
  20.195 +
  20.196 +#endif /* RUN_SELF_TESTS */
    21.1 --- a/src/devices/wifi/interference-helper.cc	Wed Aug 05 11:28:01 2009 -0400
    21.2 +++ b/src/devices/wifi/interference-helper.cc	Wed Aug 05 14:03:54 2009 -0400
    21.3 @@ -123,8 +123,8 @@
    21.4   ****************************************************************/
    21.5  
    21.6  InterferenceHelper::InterferenceHelper ()
    21.7 -  : m_80211_standard (WIFI_PHY_STANDARD_80211a),
    21.8 -    m_errorRateModel (0)
    21.9 +  : m_maxPacketDuration (Seconds(0)),
   21.10 +    m_errorRateModel (0)  
   21.11  {}
   21.12  InterferenceHelper::~InterferenceHelper ()
   21.13  {
   21.14 @@ -145,6 +145,7 @@
   21.15       duration,
   21.16       rxPowerW);
   21.17  
   21.18 +  m_maxPacketDuration = std::max(duration, m_maxPacketDuration);
   21.19    AppendEvent (event);
   21.20    return event;
   21.21  }
   21.22 @@ -224,57 +225,189 @@
   21.23    return end - now;
   21.24  }
   21.25  
   21.26 -Time
   21.27 -InterferenceHelper::CalculateTxDuration (uint32_t size, WifiMode payloadMode, WifiPreamble preamble) const
   21.28 +WifiMode 
   21.29 +InterferenceHelper::GetPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamble)
   21.30  {
   21.31 -  uint64_t delay = 0;
   21.32 -  switch (m_80211_standard) 
   21.33 -  {
   21.34 +  switch (payloadMode.GetStandard ())
   21.35 +    {
   21.36 +    case WIFI_PHY_STANDARD_holland:
   21.37 +    case WIFI_PHY_STANDARD_80211a:
   21.38 +      // IEEE Std 802.11-2007, 17.3.2
   21.39 +      // actually this is only the first part of the PlcpHeader,
   21.40 +      // because the last 16 bits of the PlcpHeader are using the
   21.41 +      // same mode of the payload
   21.42 +      return WifiPhy::Get6mba ();      
   21.43 +      
   21.44 +    case WIFI_PHY_STANDARD_80211b:
   21.45 +      if (preamble == WIFI_PREAMBLE_LONG)
   21.46 +        {
   21.47 +          // IEEE Std 802.11-2007, sections 15.2.3 and 18.2.2.1 
   21.48 +          return WifiPhy::Get1mbb ();
   21.49 +        }
   21.50 +      else //  WIFI_PREAMBLE_SHORT
   21.51 +        {
   21.52 +          // IEEE Std 802.11-2007, section 18.2.2.2
   21.53 +          return WifiPhy::Get2mbb ();
   21.54 +        }
   21.55 +      
   21.56 +    case WIFI_PHY_STANDARD_80211_10Mhz:
   21.57 +      return WifiPhy::Get3mb10Mhz ();
   21.58 +      
   21.59 +    case WIFI_PHY_STANDARD_80211_5Mhz:
   21.60 +      return WifiPhy::Get1_5mb5Mhz ();
   21.61 +    
   21.62 +    default:
   21.63 +      NS_FATAL_ERROR("unknown standard");
   21.64 +      return WifiMode ();
   21.65 +    }
   21.66 +}
   21.67 +
   21.68 +uint32_t
   21.69 +InterferenceHelper::GetPlcpHeaderDurationMicroSeconds (WifiMode payloadMode, WifiPreamble preamble)
   21.70 +{
   21.71 +    switch (payloadMode.GetStandard ())
   21.72 +    {
   21.73 +    case WIFI_PHY_STANDARD_holland:
   21.74 +    case WIFI_PHY_STANDARD_80211a:
   21.75 +      // IEEE Std 802.11-2007, section 17.3.3 and figure 17-4
   21.76 +      // also section 17.3.2.3, table 17-4
   21.77 +      // We return the duration of the SIGNAL field only, since the
   21.78 +      // SERVICE field (which strictly speaking belongs to the PLCP
   21.79 +      // header, see section 17.3.2 and figure 17-1) is sent using the
   21.80 +      // payload mode.  
   21.81 +      return 4; 
   21.82 +      
   21.83 +    case WIFI_PHY_STANDARD_80211_10Mhz:
   21.84 +      // IEEE Std 802.11-2007, section 17.3.2.3, table 17-4
   21.85 +      return 8;
   21.86 +      
   21.87 +    case WIFI_PHY_STANDARD_80211_5Mhz:
   21.88 +      // IEEE Std 802.11-2007, section 17.3.2.3, table 17-4
   21.89 +      return 16;
   21.90 +
   21.91 +    case WIFI_PHY_STANDARD_80211b:
   21.92 +        if (preamble == WIFI_PREAMBLE_SHORT)
   21.93 +        {
   21.94 +          // IEEE Std 802.11-2007, section 18.2.2.2 and figure 18-2
   21.95 +          return 24;
   21.96 +        }
   21.97 +      else // WIFI_PREAMBLE_LONG
   21.98 +        {
   21.99 +          // IEEE Std 802.11-2007, sections 18.2.2.1 and figure 18-1
  21.100 +          return 48;
  21.101 +        }      
  21.102 +      
  21.103 +    default:
  21.104 +      NS_FATAL_ERROR("unknown standard");
  21.105 +      return 0;
  21.106 +    }
  21.107 +  
  21.108 +}
  21.109 +
  21.110 +uint32_t 
  21.111 +InterferenceHelper::GetPlcpPreambleDurationMicroSeconds (WifiMode payloadMode, WifiPreamble preamble)
  21.112 +{
  21.113 +  switch (payloadMode.GetStandard ())
  21.114 +    {
  21.115 +    case WIFI_PHY_STANDARD_holland:
  21.116 +    case WIFI_PHY_STANDARD_80211a:
  21.117 +      // IEEE Std 802.11-2007, section 17.3.3,  figure 17-4
  21.118 +      // also section 17.3.2.3, table 17-4
  21.119 +      return 16; 
  21.120 +      
  21.121 +    case WIFI_PHY_STANDARD_80211_10Mhz:
  21.122 +      // IEEE Std 802.11-2007, section 17.3.3, table 17-4 
  21.123 +      // also section 17.3.2.3, table 17-4
  21.124 +      return 32;
  21.125 +      
  21.126 +    case WIFI_PHY_STANDARD_80211_5Mhz:
  21.127 +      // IEEE Std 802.11-2007, section 17.3.3
  21.128 +      // also section 17.3.2.3, table 17-4
  21.129 +      return 64;
  21.130 +
  21.131 +    case WIFI_PHY_STANDARD_80211b:
  21.132 +      if (preamble == WIFI_PREAMBLE_SHORT)
  21.133 +        {
  21.134 +          // IEEE Std 802.11-2007, section 18.2.2.2 and figure 18-2
  21.135 +          return 72;
  21.136 +        }
  21.137 +      else // WIFI_PREAMBLE_LONG
  21.138 +        {
  21.139 +          // IEEE Std 802.11-2007, sections 18.2.2.1 and figure 18-1
  21.140 +          return 144;
  21.141 +        }
  21.142 +      
  21.143 +    default:
  21.144 +      NS_FATAL_ERROR("unknown standard");
  21.145 +      return 0;
  21.146 +    }
  21.147 +}
  21.148 +
  21.149 +uint32_t 
  21.150 +InterferenceHelper::GetPayloadDurationMicroSeconds (uint32_t size, WifiMode payloadMode)
  21.151 +{
  21.152 +  NS_LOG_FUNCTION(size << payloadMode);
  21.153 +  switch (payloadMode.GetStandard ())
  21.154 +    {
  21.155      case WIFI_PHY_STANDARD_80211a:
  21.156      case WIFI_PHY_STANDARD_holland:
  21.157 -      delay += m_plcpLongPreambleDelayUs;
  21.158 -      // symbol duration is 4us
  21.159 -      delay += 4;
  21.160 -      delay += lrint (ceil ((size * 8.0 + 16.0 + 6.0) / payloadMode.GetDataRate () / 4e-6) * 4);
  21.161 -      break;
  21.162 +    case WIFI_PHY_STANDARD_80211_10Mhz: 
  21.163 +    case WIFI_PHY_STANDARD_80211_5Mhz: 
  21.164 +      {
  21.165 +        // IEEE Std 802.11-2007, section 17.3.2.3, table 17-4
  21.166 +        // corresponds to T_{SYM} in the table
  21.167 +        uint32_t symbolDurationUs; 
  21.168 +        switch (payloadMode.GetStandard ())
  21.169 +          {       
  21.170 +          case WIFI_PHY_STANDARD_holland:   
  21.171 +          case WIFI_PHY_STANDARD_80211a:
  21.172 +            symbolDurationUs = 4;
  21.173 +            break;
  21.174 +          case WIFI_PHY_STANDARD_80211_10Mhz: 
  21.175 +            symbolDurationUs = 8;
  21.176 +            break;
  21.177 +          case WIFI_PHY_STANDARD_80211_5Mhz: 
  21.178 +            symbolDurationUs = 16;
  21.179 +            break;
  21.180 +          case WIFI_PHY_STANDARD_80211b:
  21.181 +            NS_FATAL_ERROR("can't happen here");
  21.182 +            symbolDurationUs = 0; // quiet compiler
  21.183 +            break;
  21.184 +          default:
  21.185 +            NS_FATAL_ERROR("unknown standard");
  21.186 +            symbolDurationUs = 0; // quiet compiler
  21.187 +            break;
  21.188 +          }
  21.189 +      
  21.190 +        // IEEE Std 802.11-2007, section 17.3.2.2, table 17-3
  21.191 +        // corresponds to N_{DBPS} in the table
  21.192 +        double numDataBitsPerSymbol = payloadMode.GetDataRate ()  * symbolDurationUs / 1e6;
  21.193 +
  21.194 +        // IEEE Std 802.11-2007, section 17.3.5.3, equation (17-11)
  21.195 +        uint32_t numSymbols = lrint (ceil ((16 + size * 8.0 + 6.0)/numDataBitsPerSymbol));
  21.196 +      
  21.197 +        return numSymbols*symbolDurationUs;
  21.198 +      }
  21.199      case WIFI_PHY_STANDARD_80211b:
  21.200 -      delay += m_plcpLongPreambleDelayUs;
  21.201 -      delay += lrint (ceil ((size * 8.0 + 48.0) / payloadMode.GetDataRate () / 4e-6) * 4);
  21.202 -      break;
  21.203 +      // IEEE Std 802.11-2007, section 18.2.3.5
  21.204 +      NS_LOG_LOGIC(" size=" << size
  21.205 +                   << " mode=" << payloadMode 
  21.206 +                   << " rate=" << payloadMode.GetDataRate () );
  21.207 +      return lrint(ceil ((size * 8.0) / (payloadMode.GetDataRate () / 1.0e6)));
  21.208 +
  21.209      default:
  21.210 -     NS_ASSERT (false);
  21.211 -     break;
  21.212 -  }
  21.213 -
  21.214 -  return MicroSeconds (delay);
  21.215 +      NS_FATAL_ERROR("unknown standard");
  21.216 +      return 0;
  21.217 +    }
  21.218  }
  21.219  
  21.220 -void
  21.221 -InterferenceHelper::Configure80211aParameters (void)
  21.222 +Time
  21.223 +InterferenceHelper::CalculateTxDuration (uint32_t size, WifiMode payloadMode, WifiPreamble preamble) 
  21.224  {
  21.225 -  NS_LOG_FUNCTION (this);
  21.226 -  m_80211_standard = WIFI_PHY_STANDARD_80211a;
  21.227 -  m_plcpLongPreambleDelayUs = 16;
  21.228 -  m_plcpShortPreambleDelayUs = 16;
  21.229 -  m_longPlcpHeaderMode = WifiPhy::Get6mba ();
  21.230 -  m_shortPlcpHeaderMode = WifiPhy::Get6mba ();
  21.231 -  m_plcpHeaderLength = 4 + 1 + 12 + 1 + 6;
  21.232 -  /* 4095 bytes at a 6Mb/s rate with a 1/2 coding rate. */
  21.233 -  m_maxPacketDuration = CalculateTxDuration (4095, WifiPhy::Get6mba (), WIFI_PREAMBLE_LONG);
  21.234 -}
  21.235 -
  21.236 -void
  21.237 -InterferenceHelper::Configure80211bParameters (void)
  21.238 -{ 
  21.239 -  NS_LOG_FUNCTION (this);
  21.240 -  m_80211_standard = WIFI_PHY_STANDARD_80211b;
  21.241 -  m_plcpLongPreambleDelayUs = 144;
  21.242 -  m_plcpShortPreambleDelayUs = 144; // fixed preamable for 802.11b
  21.243 -  m_longPlcpHeaderMode = WifiPhy::Get1mbb ();
  21.244 -  m_shortPlcpHeaderMode = WifiPhy::Get1mbb ();
  21.245 -  // PLCP Header: signal 8, service 8, length 16, CRC 16 bits
  21.246 -  m_plcpHeaderLength = 8 + 8 + 16 + 16;
  21.247 -  m_maxPacketDuration = CalculateTxDuration (4095, WifiPhy::Get1mbb (), WIFI_PREAMBLE_LONG);
  21.248 +  uint32_t duration = GetPlcpPreambleDurationMicroSeconds (payloadMode, preamble)     
  21.249 +                      + GetPlcpHeaderDurationMicroSeconds (payloadMode, preamble)  
  21.250 +                      + GetPayloadDurationMicroSeconds (size, payloadMode);
  21.251 +  return MicroSeconds (duration);
  21.252  }
  21.253  
  21.254  void 
  21.255 @@ -367,29 +500,12 @@
  21.256  {  
  21.257    double psr = 1.0; /* Packet Success Rate */
  21.258    NiChanges::iterator j = ni->begin ();
  21.259 -  Time previous = (*j).GetTime ();
  21.260 -  uint64_t plcpPreambleDelayUs;
  21.261 +  Time previous = (*j).GetTime (); 
  21.262    WifiMode payloadMode = event->GetPayloadMode ();
  21.263 -  WifiMode headerMode;
  21.264 -  switch (event->GetPreambleType ()) {
  21.265 -  case WIFI_PREAMBLE_LONG:
  21.266 -    plcpPreambleDelayUs = m_plcpLongPreambleDelayUs;
  21.267 -    headerMode = m_longPlcpHeaderMode;
  21.268 -    break;
  21.269 -  case WIFI_PREAMBLE_SHORT:
  21.270 -    plcpPreambleDelayUs = m_plcpShortPreambleDelayUs;
  21.271 -    headerMode = m_shortPlcpHeaderMode;
  21.272 -    break;
  21.273 -  default:
  21.274 -    NS_ASSERT (false);
  21.275 -    // only to quiet compiler. Really stupid.
  21.276 -    plcpPreambleDelayUs = 0;
  21.277 -    headerMode = m_shortPlcpHeaderMode;
  21.278 -    break;
  21.279 -  }
  21.280 -  Time plcpHeaderStart = (*j).GetTime () + MicroSeconds (plcpPreambleDelayUs);
  21.281 -  Time plcpPayloadStart = plcpHeaderStart + 
  21.282 -    Seconds ((m_plcpHeaderLength + 0.0) / headerMode.GetDataRate ());
  21.283 +  WifiPreamble preamble = event->GetPreambleType ();
  21.284 +  WifiMode headerMode = GetPlcpHeaderMode (payloadMode, preamble);
  21.285 +  Time plcpHeaderStart = (*j).GetTime () + MicroSeconds (GetPlcpPreambleDurationMicroSeconds (payloadMode, preamble));
  21.286 +  Time plcpPayloadStart = plcpHeaderStart + MicroSeconds (GetPlcpHeaderDurationMicroSeconds (payloadMode, preamble));
  21.287    double noiseInterferenceW = (*j).GetDelta ();
  21.288    double powerW = event->GetRxPowerW ();
  21.289  
    22.1 --- a/src/devices/wifi/interference-helper.h	Wed Aug 05 11:28:01 2009 -0400
    22.2 +++ b/src/devices/wifi/interference-helper.h	Wed Aug 05 14:03:54 2009 -0400
    22.3 @@ -69,8 +69,6 @@
    22.4    InterferenceHelper ();
    22.5    ~InterferenceHelper ();
    22.6  
    22.7 -  void Configure80211aParameters (void);
    22.8 -  void Configure80211bParameters (void);
    22.9    void SetNoiseFigure (double value);
   22.10    void SetErrorRateModel (Ptr<ErrorRateModel> rate);
   22.11  
   22.12 @@ -85,7 +83,13 @@
   22.13     *          the requested threshold.
   22.14     */
   22.15    Time GetEnergyDuration (double energyW);
   22.16 -  Time CalculateTxDuration (uint32_t size, WifiMode payloadMode, WifiPreamble preamble) const;
   22.17 +
   22.18 +  
   22.19 +  static WifiMode GetPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamble);
   22.20 +  static uint32_t GetPlcpHeaderDurationMicroSeconds (WifiMode payloadMode, WifiPreamble preamble);
   22.21 +  static uint32_t GetPlcpPreambleDurationMicroSeconds (WifiMode mode, WifiPreamble preamble);
   22.22 +  static uint32_t GetPayloadDurationMicroSeconds (uint32_t size, WifiMode payloadMode);
   22.23 +  static Time CalculateTxDuration (uint32_t size, WifiMode payloadMode, WifiPreamble preamble);
   22.24    Ptr<InterferenceHelper::Event> Add (uint32_t size, WifiMode payloadMode, 
   22.25  				      enum WifiPreamble preamble,
   22.26  				      Time duration, double rxPower);
   22.27 @@ -114,15 +118,9 @@
   22.28    double CalculatePer (Ptr<const Event> event, NiChanges *ni) const;
   22.29    Time GetMaxPacketDuration (void) const;
   22.30  
   22.31 -  uint64_t m_plcpLongPreambleDelayUs;
   22.32 -  uint64_t m_plcpShortPreambleDelayUs;
   22.33 -  WifiMode m_longPlcpHeaderMode;
   22.34 -  WifiMode m_shortPlcpHeaderMode;
   22.35 -  uint32_t m_plcpHeaderLength;
   22.36    Time m_maxPacketDuration;
   22.37    double m_noiseFigure; /**< noise figure (linear) */
   22.38    Events m_events;
   22.39 -  enum WifiPhyStandard m_80211_standard;
   22.40    Ptr<ErrorRateModel> m_errorRateModel;
   22.41  };
   22.42  
    23.1 --- a/src/devices/wifi/jakes-propagation-loss-model.cc	Wed Aug 05 11:28:01 2009 -0400
    23.2 +++ b/src/devices/wifi/jakes-propagation-loss-model.cc	Wed Aug 05 14:03:54 2009 -0400
    23.3 @@ -138,13 +138,15 @@
    23.4      .AddAttribute ("NumberOfRaysPerPath",
    23.5                     "The number of rays to use by default for compute the fading coeficent for a given path (default is 1)",
    23.6                     UintegerValue (1),
    23.7 -		   MakeUintegerAccessor (&JakesPropagationLossModel::m_nRays),
    23.8 +		   MakeUintegerAccessor (&JakesPropagationLossModel::SetNRays,
    23.9 +                                         &JakesPropagationLossModel::GetNRays),
   23.10  		   MakeUintegerChecker<uint8_t> ())
   23.11      .AddAttribute ("NumberOfOscillatorsPerRay",
   23.12                     "The number of oscillators to use by default for compute the coeficent for a given ray of a given "
   23.13                     "path (default is 4)",
   23.14                     UintegerValue (4),
   23.15 -		   MakeUintegerAccessor (&JakesPropagationLossModel::m_nOscillators),
   23.16 +		   MakeUintegerAccessor (&JakesPropagationLossModel::SetNOscillators,
   23.17 +                                         &JakesPropagationLossModel::GetNOscillators),
   23.18  		   MakeUintegerChecker<uint8_t> ())
   23.19      .AddAttribute ("DopplerFreq",
   23.20                     "The doppler frequency in Hz (f_d = v / lambda = v * f / c), the default is 0)",
   23.21 @@ -161,9 +163,10 @@
   23.22  }
   23.23  
   23.24  JakesPropagationLossModel::JakesPropagationLossModel ()
   23.25 -{
   23.26 -  DoConstruct ();
   23.27 -}
   23.28 +  : m_amp (0),
   23.29 +    m_nRays (0),
   23.30 +    m_nOscillators (0)
   23.31 +{}
   23.32  
   23.33  JakesPropagationLossModel::~JakesPropagationLossModel ()
   23.34  {
   23.35 @@ -181,8 +184,16 @@
   23.36  }
   23.37  
   23.38  void
   23.39 -JakesPropagationLossModel::DoConstruct ()
   23.40 +JakesPropagationLossModel::SetNRays (uint8_t nRays)
   23.41  {
   23.42 +  m_nRays = nRays;
   23.43 +}
   23.44 +
   23.45 +void
   23.46 +JakesPropagationLossModel::SetNOscillators (uint8_t nOscillators)
   23.47 +{
   23.48 +  m_nOscillators = nOscillators;
   23.49 +  delete [] m_amp;
   23.50    uint16_t N = 4 * m_nOscillators + 2;
   23.51    m_amp = new ComplexNumber[m_nOscillators + 1];
   23.52    m_amp[0].real = 2.0 * sqrt(2.0 / N) * cos (PI / 4.0);
   23.53 @@ -195,17 +206,17 @@
   23.54      }
   23.55  }
   23.56  
   23.57 -void
   23.58 -JakesPropagationLossModel::SetNRays (uint8_t nRays)
   23.59 +uint8_t 
   23.60 +JakesPropagationLossModel::GetNRays (void) const
   23.61  {
   23.62 -  m_nRays = nRays;
   23.63 +  return m_nRays;
   23.64 +}
   23.65 +uint8_t 
   23.66 +JakesPropagationLossModel::GetNOscillators (void) const
   23.67 +{
   23.68 +  return m_nOscillators;
   23.69  }
   23.70  
   23.71 -void
   23.72 -JakesPropagationLossModel::SetNOscillators (uint8_t nOscillators)
   23.73 -{
   23.74 -  m_nOscillators = nOscillators;
   23.75 -}
   23.76  
   23.77  double 
   23.78  JakesPropagationLossModel::DoCalcRxPower (double txPowerDbm,
    24.1 --- a/src/devices/wifi/jakes-propagation-loss-model.h	Wed Aug 05 11:28:01 2009 -0400
    24.2 +++ b/src/devices/wifi/jakes-propagation-loss-model.h	Wed Aug 05 14:03:54 2009 -0400
    24.3 @@ -96,6 +96,9 @@
    24.4     */
    24.5    void SetNOscillators (uint8_t nOscillators);
    24.6  
    24.7 +  uint8_t GetNRays (void) const;
    24.8 +  uint8_t GetNOscillators (void) const;
    24.9 +
   24.10  private:
   24.11    JakesPropagationLossModel (const JakesPropagationLossModel &o);
   24.12    JakesPropagationLossModel & operator = (const JakesPropagationLossModel &o);
    25.1 --- a/src/devices/wifi/mac-low.cc	Wed Aug 05 11:28:01 2009 -0400
    25.2 +++ b/src/devices/wifi/mac-low.cc	Wed Aug 05 14:03:54 2009 -0400
    25.3 @@ -584,11 +584,11 @@
    25.4          {
    25.5            m_listener->GotAck (rxSnr, txMode);
    25.6          }
    25.7 -    if (m_txParams.HasNextPacket ()) 
    25.8 -      {
    25.9 -        m_waitSifsEvent = Simulator::Schedule (GetSifs (), 
   25.10 -                                               &MacLow::WaitSifsAfterEndTx, this);
   25.11 -      }
   25.12 +      if (m_txParams.HasNextPacket ()) 
   25.13 +        {
   25.14 +          m_waitSifsEvent = Simulator::Schedule (GetSifs (), 
   25.15 +                                                 &MacLow::WaitSifsAfterEndTx, this);
   25.16 +        }
   25.17      } 
   25.18    else if (hdr.IsCtl ()) 
   25.19      {
    26.1 --- a/src/devices/wifi/mgt-headers.cc	Wed Aug 05 11:28:01 2009 -0400
    26.2 +++ b/src/devices/wifi/mgt-headers.cc	Wed Aug 05 14:03:54 2009 -0400
    26.3 @@ -108,7 +108,11 @@
    26.4  {}
    26.5  MgtProbeResponseHeader::~MgtProbeResponseHeader ()
    26.6  {}
    26.7 -
    26.8 +uint64_t
    26.9 +MgtProbeResponseHeader::GetTimestamp()
   26.10 +{
   26.11 +  return m_timestamp;
   26.12 +}
   26.13  Ssid 
   26.14  MgtProbeResponseHeader::GetSsid (void) const
   26.15  {
   26.16 @@ -198,7 +202,7 @@
   26.17  MgtProbeResponseHeader::Deserialize (Buffer::Iterator start)
   26.18  {
   26.19    Buffer::Iterator i = start;
   26.20 -  i.Next (8); // timestamp
   26.21 +  m_timestamp = i.ReadNtohU64();
   26.22    m_beaconInterval = i.ReadNtohU16 ();
   26.23    m_beaconInterval *= 1024;
   26.24    i = m_capability.Deserialize (i);
    27.1 --- a/src/devices/wifi/mgt-headers.h	Wed Aug 05 11:28:01 2009 -0400
    27.2 +++ b/src/devices/wifi/mgt-headers.h	Wed Aug 05 14:03:54 2009 -0400
    27.3 @@ -116,7 +116,7 @@
    27.4    void SetSsid (Ssid ssid);
    27.5    void SetBeaconIntervalUs (uint64_t us);
    27.6    void SetSupportedRates (SupportedRates rates);
    27.7 -
    27.8 +  uint64_t GetTimestamp();
    27.9    static TypeId GetTypeId (void);
   27.10    virtual TypeId GetInstanceTypeId (void) const;
   27.11    virtual void Print (std::ostream &os) const;
   27.12 @@ -125,6 +125,7 @@
   27.13    virtual uint32_t Deserialize (Buffer::Iterator start);
   27.14  
   27.15  private:
   27.16 +  uint64_t m_timestamp;
   27.17    Ssid m_ssid;
   27.18    uint64_t m_beaconInterval;
   27.19    SupportedRates m_rates;
    28.1 --- a/src/devices/wifi/nqap-wifi-mac.cc	Wed Aug 05 11:28:01 2009 -0400
    28.2 +++ b/src/devices/wifi/nqap-wifi-mac.cc	Wed Aug 05 14:03:54 2009 -0400
    28.3 @@ -97,6 +97,7 @@
    28.4    NS_LOG_FUNCTION (this);
    28.5    delete m_rxMiddle;
    28.6    delete m_dcfManager;
    28.7 +  m_low->Dispose ();
    28.8    m_rxMiddle = 0;
    28.9    m_low = 0;
   28.10    m_dcfManager = 0;
    29.1 --- a/src/devices/wifi/nqsta-wifi-mac.cc	Wed Aug 05 11:28:01 2009 -0400
    29.2 +++ b/src/devices/wifi/nqsta-wifi-mac.cc	Wed Aug 05 14:03:54 2009 -0400
    29.3 @@ -128,6 +128,7 @@
    29.4    NS_LOG_FUNCTION (this);
    29.5    delete m_rxMiddle;
    29.6    delete m_dcfManager;
    29.7 +  m_low->Dispose ();
    29.8    m_rxMiddle = 0;
    29.9    m_low = 0;
   29.10    m_dcfManager = 0;
    30.1 --- a/src/devices/wifi/qap-wifi-mac.cc	Wed Aug 05 11:28:01 2009 -0400
    30.2 +++ b/src/devices/wifi/qap-wifi-mac.cc	Wed Aug 05 14:03:54 2009 -0400
    30.3 @@ -119,10 +119,11 @@
    30.4  QapWifiMac::DoDispose ()
    30.5  {
    30.6    delete m_rxMiddle;
    30.7 +  delete m_txMiddle;
    30.8 +  delete m_dcfManager;
    30.9 +  m_low->Dispose ();
   30.10    m_rxMiddle = 0;
   30.11 -  delete m_txMiddle;
   30.12    m_txMiddle = 0;
   30.13 -  delete m_dcfManager;
   30.14    m_dcfManager = 0;
   30.15    m_low = 0;
   30.16    m_phy = 0;
    31.1 --- a/src/devices/wifi/qos-tag.cc	Wed Aug 05 11:28:01 2009 -0400
    31.2 +++ b/src/devices/wifi/qos-tag.cc	Wed Aug 05 14:03:54 2009 -0400
    31.3 @@ -43,7 +43,11 @@
    31.4    return GetTypeId ();
    31.5  }
    31.6  
    31.7 -QosTag::QosTag()
    31.8 +QosTag::QosTag ():
    31.9 +  m_tid (0)
   31.10 +{}
   31.11 +QosTag::QosTag (uint8_t tid):
   31.12 +  m_tid (tid)
   31.13  {}
   31.14  
   31.15  uint32_t 
    32.1 --- a/src/devices/wifi/qos-tag.h	Wed Aug 05 11:28:01 2009 -0400
    32.2 +++ b/src/devices/wifi/qos-tag.h	Wed Aug 05 14:03:54 2009 -0400
    32.3 @@ -33,6 +33,7 @@
    32.4    virtual TypeId GetInstanceTypeId (void) const;
    32.5    
    32.6    QosTag ();
    32.7 +  QosTag (uint8_t tid);
    32.8    virtual void Serialize (TagBuffer i) const;
    32.9    virtual void Deserialize (TagBuffer i);
   32.10    virtual uint32_t GetSerializedSize () const;
    33.1 --- a/src/devices/wifi/qsta-wifi-mac.cc	Wed Aug 05 11:28:01 2009 -0400
    33.2 +++ b/src/devices/wifi/qsta-wifi-mac.cc	Wed Aug 05 14:03:54 2009 -0400
    33.3 @@ -125,6 +125,7 @@
    33.4    delete m_rxMiddle;
    33.5    delete m_txMiddle;
    33.6    delete m_dcfManager;
    33.7 +  m_low->Dispose ();
    33.8    m_rxMiddle = 0;
    33.9    m_txMiddle = 0;
   33.10    m_low = 0;
    34.1 --- a/src/devices/wifi/wifi-mac-header.cc	Wed Aug 05 11:28:01 2009 -0400
    34.2 +++ b/src/devices/wifi/wifi-mac-header.cc	Wed Aug 05 14:03:54 2009 -0400
    34.3 @@ -128,6 +128,18 @@
    34.4    m_ctrlType = TYPE_DATA;
    34.5    m_ctrlSubtype = 0;
    34.6  }
    34.7 +void
    34.8 +WifiMacHeader::SetAction (void)
    34.9 +{
   34.10 + m_ctrlType = TYPE_MGT;
   34.11 + m_ctrlSubtype = 0x0D;
   34.12 +}
   34.13 +void
   34.14 +WifiMacHeader::SetMultihopAction (void)
   34.15 +{
   34.16 + m_ctrlType = TYPE_MGT;
   34.17 + m_ctrlSubtype = 0x0F;
   34.18 +}
   34.19  void 
   34.20  WifiMacHeader::SetType (enum WifiMacType type)
   34.21  {
   34.22 @@ -191,6 +203,15 @@
   34.23    case WIFI_MAC_MGT_DEAUTHENTICATION:
   34.24      m_ctrlType = TYPE_MGT;
   34.25      m_ctrlSubtype = 12;
   34.26 +  case WIFI_MAC_MGT_ACTION:
   34.27 +    m_ctrlType = TYPE_MGT;
   34.28 +    m_ctrlSubtype = 13;
   34.29 +  case WIFI_MAC_MGT_ACTION_NO_ACK:
   34.30 +    m_ctrlType = TYPE_MGT;
   34.31 +    m_ctrlSubtype = 14;
   34.32 +  case WIFI_MAC_MGT_MULTIHOP_ACTION:
   34.33 +    m_ctrlType = TYPE_MGT;
   34.34 +    m_ctrlSubtype = 15;
   34.35      break;
   34.36  
   34.37    case WIFI_MAC_DATA:
   34.38 @@ -397,6 +418,15 @@
   34.39      case 12:
   34.40        return WIFI_MAC_MGT_DEAUTHENTICATION;
   34.41        break;
   34.42 +    case 13:
   34.43 +      return WIFI_MAC_MGT_ACTION;
   34.44 +      break;
   34.45 +    case 14:
   34.46 +      return WIFI_MAC_MGT_ACTION_NO_ACK;
   34.47 +      break;
   34.48 +    case 15:
   34.49 +      return WIFI_MAC_MGT_MULTIHOP_ACTION;
   34.50 +      break;
   34.51  
   34.52      }
   34.53      break;
   34.54 @@ -590,6 +620,16 @@
   34.55  {
   34.56    return (GetType () == WIFI_MAC_MGT_DEAUTHENTICATION)?true:false;
   34.57  }
   34.58 +bool
   34.59 +WifiMacHeader::IsAction (void) const
   34.60 +{
   34.61 +  return (GetType () == WIFI_MAC_MGT_ACTION)?true:false;
   34.62 +}
   34.63 +bool
   34.64 +WifiMacHeader::IsMultihopAction (void) const
   34.65 +{
   34.66 +  return (GetType () == WIFI_MAC_MGT_MULTIHOP_ACTION)?true:false;
   34.67 +}
   34.68  
   34.69  
   34.70  uint16_t 
   34.71 @@ -810,6 +850,9 @@
   34.72      FOO (MGT_PROBE_RESPONSE);
   34.73      FOO (MGT_AUTHENTICATION);
   34.74      FOO (MGT_DEAUTHENTICATION);
   34.75 +    FOO (MGT_ACTION);
   34.76 +    FOO (MGT_ACTION_NO_ACK);
   34.77 +    FOO (MGT_MULTIHOP_ACTION);
   34.78      
   34.79      FOO (DATA);
   34.80      FOO (DATA_CFACK);
   34.81 @@ -895,6 +938,16 @@
   34.82           << ", BSSID=" << m_addr3 << ", FragNumber=" << m_seqFrag
   34.83           << ", SeqNumber=" << m_seqSeq;
   34.84        break;
   34.85 +    case WIFI_MAC_MGT_ACTION:
   34.86 +    case WIFI_MAC_MGT_ACTION_NO_ACK:
   34.87 +      PrintFrameControl (os);
   34.88 +      os << " Duration/ID=" << m_duration << "us"
   34.89 +         << "DA=" << m_addr1 << ", SA=" << m_addr2 << ", BSSID=" << m_addr3
   34.90 +         << ", FragNumber=" << m_seqFrag << ", SeqNumber=" << m_seqSeq;
   34.91 +    case WIFI_MAC_MGT_MULTIHOP_ACTION:
   34.92 +      os << " Duration/ID=" << m_duration << "us"
   34.93 +         << "RA=" << m_addr1 << ", TA=" << m_addr2 << ", DA=" << m_addr3
   34.94 +         << ", FragNumber=" << m_seqFrag << ", SeqNumber=" << m_seqSeq;
   34.95      case WIFI_MAC_DATA:
   34.96        PrintFrameControl (os);
   34.97        os << " Duration/ID=" << m_duration << "us";
   34.98 @@ -916,7 +969,7 @@
   34.99          }
  34.100        else
  34.101          {
  34.102 -          NS_ASSERT (false);
  34.103 +          NS_FATAL_ERROR ("Impossible ToDs and FromDs flags combination");
  34.104          }
  34.105        os << ", FragNumber=" << m_seqFrag
  34.106           << ", SeqNumber=" << m_seqSeq;
    35.1 --- a/src/devices/wifi/wifi-mac-header.h	Wed Aug 05 11:28:01 2009 -0400
    35.2 +++ b/src/devices/wifi/wifi-mac-header.h	Wed Aug 05 14:03:54 2009 -0400
    35.3 @@ -46,6 +46,9 @@
    35.4    WIFI_MAC_MGT_PROBE_RESPONSE,
    35.5    WIFI_MAC_MGT_AUTHENTICATION,
    35.6    WIFI_MAC_MGT_DEAUTHENTICATION,
    35.7 +  WIFI_MAC_MGT_ACTION,
    35.8 +  WIFI_MAC_MGT_ACTION_NO_ACK,
    35.9 +  WIFI_MAC_MGT_MULTIHOP_ACTION,
   35.10  
   35.11    WIFI_MAC_DATA,
   35.12    WIFI_MAC_DATA_CFACK,
   35.13 @@ -98,6 +101,8 @@
   35.14    void SetProbeResp (void);
   35.15    void SetBeacon (void);
   35.16    void SetTypeData (void);
   35.17 +  void SetAction ();
   35.18 +  void SetMultihopAction();
   35.19    void SetDsFrom (void);
   35.20    void SetDsNotFrom (void);
   35.21    void SetDsTo (void);
   35.22 @@ -150,6 +155,8 @@
   35.23    bool IsDisassociation (void) const;
   35.24    bool IsAuthentication (void) const;
   35.25    bool IsDeauthentication (void) const;
   35.26 +  bool IsAction () const;
   35.27 +  bool IsMultihopAction () const;
   35.28    uint16_t GetRawDuration (void) const;
   35.29    Time GetDuration (void) const;
   35.30    uint16_t GetSequenceControl (void) const;
    36.1 --- a/src/devices/wifi/wifi-mac.cc	Wed Aug 05 11:28:01 2009 -0400
    36.2 +++ b/src/devices/wifi/wifi-mac.cc	Wed Aug 05 14:03:54 2009 -0400
    36.3 @@ -117,6 +117,14 @@
    36.4  		   MakeSsidAccessor (&WifiMac::GetSsid,
    36.5  				     &WifiMac::SetSsid),
    36.6  		   MakeSsidChecker ())
    36.7 +    .AddAttribute ("Standard", "The standard chosen configures some MAC-specific constants",
    36.8 +                   EnumValue (WIFI_PHY_STANDARD_80211a),
    36.9 +                   MakeEnumAccessor (&WifiMac::SetStandard),
   36.10 +                   MakeEnumChecker (WIFI_PHY_STANDARD_80211a, "802.11a",
   36.11 +                                    WIFI_PHY_STANDARD_80211b, "802.11b",
   36.12 +                                    WIFI_PHY_STANDARD_80211_10Mhz,"802.11_10Mhz",
   36.13 +                                    WIFI_PHY_STANDARD_80211_5Mhz,"802-11_5Mhz",
   36.14 +                                    WIFI_PHY_STANDARD_holland, "holland"))
   36.15      .AddTraceSource ("MacTx", 
   36.16                       "A packet has been received from higher layers and is being processed in preparation for "
   36.17                       "queueing for transmission.",
   36.18 @@ -200,4 +208,74 @@
   36.19    m_macRxDropTrace (packet);
   36.20  }
   36.21  
   36.22 +void
   36.23 +WifiMac::SetStandard (enum WifiPhyStandard standard)
   36.24 +{
   36.25 +  m_standard = standard;
   36.26 +  switch (standard) {
   36.27 +  case WIFI_PHY_STANDARD_80211a:
   36.28 +    Configure80211a ();
   36.29 +    break;
   36.30 +  case WIFI_PHY_STANDARD_80211b:
   36.31 +    Configure80211b ();
   36.32 +    break;
   36.33 +  case WIFI_PHY_STANDARD_80211_10Mhz: 
   36.34 +    Configure80211_10Mhz ();
   36.35 +    break;
   36.36 +  case WIFI_PHY_STANDARD_80211_5Mhz:
   36.37 +    Configure80211_5Mhz ();
   36.38 +    break;
   36.39 +  case WIFI_PHY_STANDARD_holland:
   36.40 +    Configure80211a ();
   36.41 +    break;
   36.42 +  default:
   36.43 +    NS_ASSERT (false);
   36.44 +    break;
   36.45 +  }
   36.46 +}
   36.47 +
   36.48 +void
   36.49 +WifiMac::Configure80211a (void)
   36.50 +{
   36.51 +  SetSifs(MicroSeconds(16));
   36.52 +  SetSlot(MicroSeconds(9)); 
   36.53 +  SetEifsNoDifs(MicroSeconds(16+44));
   36.54 +  SetPifs(MicroSeconds(16+9));
   36.55 +  SetCtsTimeout(MicroSeconds(16+44+9+GetDefaultMaxPropagationDelay().GetMicroSeconds ()*2));
   36.56 +  SetAckTimeout(MicroSeconds(16+44+9+GetDefaultMaxPropagationDelay().GetMicroSeconds ()*2)); 
   36.57 +}
   36.58 +
   36.59 +void
   36.60 +WifiMac::Configure80211b (void)
   36.61 +{
   36.62 +  SetSifs(MicroSeconds(10));
   36.63 +  SetSlot(MicroSeconds(20));
   36.64 +  SetEifsNoDifs(MicroSeconds(10+304));
   36.65 +  SetPifs(MicroSeconds(10+20));
   36.66 +  SetCtsTimeout(MicroSeconds(10+304+20+GetDefaultMaxPropagationDelay().GetMicroSeconds ()*2));
   36.67 +  SetAckTimeout(MicroSeconds(10+304+20+GetDefaultMaxPropagationDelay().GetMicroSeconds ()*2)); 
   36.68 +}
   36.69 +
   36.70 +void
   36.71 +WifiMac::Configure80211_10Mhz (void)
   36.72 +{
   36.73 +  SetSifs(MicroSeconds(32));
   36.74 +  SetSlot(MicroSeconds(13)); 
   36.75 +  SetEifsNoDifs(MicroSeconds(32+88));
   36.76 +  SetPifs(MicroSeconds(32+13));
   36.77 +  SetCtsTimeout(MicroSeconds(32+88+13+GetDefaultMaxPropagationDelay().GetMicroSeconds ()*2));
   36.78 +  SetAckTimeout(MicroSeconds(32+88+13+GetDefaultMaxPropagationDelay().GetMicroSeconds ()*2)); 
   36.79 +}
   36.80 +
   36.81 +void
   36.82 +WifiMac::Configure80211_5Mhz (void)
   36.83 +{
   36.84 +  SetSifs(MicroSeconds(64));
   36.85 +  SetSlot(MicroSeconds(21));
   36.86 +  SetEifsNoDifs(MicroSeconds(64+176));
   36.87 +  SetPifs(MicroSeconds(64+21));
   36.88 +  SetCtsTimeout(MicroSeconds(64+176+21+GetDefaultMaxPropagationDelay().GetMicroSeconds ()*2));
   36.89 +  SetAckTimeout(MicroSeconds(64+176+21+GetDefaultMaxPropagationDelay().GetMicroSeconds ()*2)); 
   36.90 +}
   36.91 +
   36.92  } // namespace ns3
    37.1 --- a/src/devices/wifi/wifi-mac.h	Wed Aug 05 11:28:01 2009 -0400
    37.2 +++ b/src/devices/wifi/wifi-mac.h	Wed Aug 05 14:03:54 2009 -0400
    37.3 @@ -206,6 +206,10 @@
    37.4     * purposes.
    37.5     */
    37.6    void NotifyRxDrop (Ptr<const Packet> packet);
    37.7 +  /**
    37.8 +   * \param standard the wifi standard to be configured
    37.9 +   */
   37.10 +  void SetStandard (enum WifiPhyStandard standard);
   37.11  
   37.12  private:
   37.13    static Time GetDefaultMaxPropagationDelay (void);
   37.14 @@ -217,6 +221,12 @@
   37.15  
   37.16    Time m_maxPropagationDelay;
   37.17    uint32_t m_maxMsduSize;
   37.18 +  WifiPhyStandard m_standard;
   37.19 +
   37.20 +  void Configure80211a (void);
   37.21 +  void Configure80211b (void);
   37.22 +  void Configure80211_10Mhz (void);
   37.23 +  void Configure80211_5Mhz ();
   37.24  
   37.25    /**
   37.26     * The trace source fired when packets come into the "top" of the device
    38.1 --- a/src/devices/wifi/wifi-mode.cc	Wed Aug 05 11:28:01 2009 -0400
    38.2 +++ b/src/devices/wifi/wifi-mode.cc	Wed Aug 05 14:03:54 2009 -0400
    38.3 @@ -107,6 +107,12 @@
    38.4  {
    38.5    return m_uid;
    38.6  }
    38.7 +enum WifiPhyStandard 
    38.8 +WifiMode::GetStandard () const
    38.9 +{
   38.10 +  struct WifiModeFactory::WifiModeItem *item = WifiModeFactory::GetFactory ()->Get (m_uid);
   38.11 +  return item->standard;
   38.12 +}
   38.13  WifiMode::WifiMode ()
   38.14    : m_uid (0)
   38.15  {}
   38.16 @@ -131,7 +137,8 @@
   38.17  			     bool isMandatory,
   38.18  			     uint32_t bandwidth,
   38.19  			     uint32_t dataRate,
   38.20 -			     uint32_t phyRate)
   38.21 +			     uint32_t phyRate,
   38.22 +                             enum WifiPhyStandard standard)
   38.23  {
   38.24    WifiModeFactory *factory = GetFactory ();
   38.25    uint32_t uid = factory->AllocateUid (uniqueName);
   38.26 @@ -143,6 +150,7 @@
   38.27    item->modulation = WifiMode::BPSK;
   38.28    item->constellationSize = 2;
   38.29    item->isMandatory = isMandatory;
   38.30 +  item->standard = standard;
   38.31    return WifiMode (uid);
   38.32  }
   38.33  WifiMode 
   38.34 @@ -151,7 +159,8 @@
   38.35  			    uint32_t bandwidth,
   38.36  			    uint32_t dataRate,
   38.37  			    uint32_t phyRate,
   38.38 -			    uint8_t constellationSize)
   38.39 +			    uint8_t constellationSize,
   38.40 +                            enum WifiPhyStandard standard)
   38.41  {
   38.42    WifiModeFactory *factory = GetFactory ();
   38.43    uint32_t uid = factory->AllocateUid (uniqueName);
   38.44 @@ -163,6 +172,7 @@
   38.45    item->modulation = WifiMode::QAM;
   38.46    item->constellationSize = constellationSize;
   38.47    item->isMandatory = isMandatory;
   38.48 +  item->standard = standard;
   38.49    return WifiMode (uid);
   38.50  }
   38.51  WifiMode 
   38.52 @@ -170,7 +180,8 @@
   38.53  			     bool isMandatory,
   38.54  			     uint32_t bandwidth,
   38.55  			     uint32_t dataRate,
   38.56 -			     uint32_t phyRate)
   38.57 +			     uint32_t phyRate,
   38.58 +                             enum WifiPhyStandard standard)
   38.59  {
   38.60    WifiModeFactory *factory = GetFactory ();
   38.61    uint32_t uid = factory->AllocateUid (uniqueName);
   38.62 @@ -182,6 +193,7 @@
   38.63    item->modulation = WifiMode::DBPSK;
   38.64    item->constellationSize = 2;
   38.65    item->isMandatory = isMandatory;
   38.66 +  item->standard = standard;
   38.67    return WifiMode (uid);
   38.68  }
   38.69  WifiMode 
   38.70 @@ -189,7 +201,8 @@
   38.71  			     bool isMandatory,
   38.72  			     uint32_t bandwidth,
   38.73  			     uint32_t dataRate,
   38.74 -			     uint32_t phyRate)
   38.75 +			     uint32_t phyRate,
   38.76 +                             enum WifiPhyStandard standard)
   38.77  {
   38.78    WifiModeFactory *factory = GetFactory ();
   38.79    uint32_t uid = factory->AllocateUid (uniqueName);
   38.80 @@ -201,6 +214,7 @@
   38.81    item->modulation = WifiMode::DQPSK;
   38.82    item->constellationSize = 4;
   38.83    item->isMandatory = isMandatory;
   38.84 +  item->standard = standard;
   38.85    return WifiMode (uid);
   38.86  }
   38.87  bool 
    39.1 --- a/src/devices/wifi/wifi-mode.h	Wed Aug 05 11:28:01 2009 -0400
    39.2 +++ b/src/devices/wifi/wifi-mode.h	Wed Aug 05 14:03:54 2009 -0400
    39.3 @@ -25,6 +25,7 @@
    39.4  #include <vector>
    39.5  #include <ostream>
    39.6  #include "ns3/attribute-helper.h"
    39.7 +#include "ns3/wifi-phy-standard.h"
    39.8  
    39.9  namespace ns3 {
   39.10  
   39.11 @@ -101,6 +102,12 @@
   39.12     */
   39.13    uint32_t GetUid (void) const;
   39.14  
   39.15 +  /** 
   39.16 +   * 
   39.17 +   * @return the WifiPhyStandard to which the WifiMode belongs
   39.18 +   */
   39.19 +  enum WifiPhyStandard GetStandard () const;
   39.20 +
   39.21    /**
   39.22     * Create an invalid WifiMode. Calling any method on the
   39.23     * instance created will trigger an assert. This is useful
   39.24 @@ -151,7 +158,8 @@
   39.25  			      bool isMandatory,
   39.26  			      uint32_t bandwidth,
   39.27  			      uint32_t dataRate,
   39.28 -			      uint32_t phyRate);
   39.29 +			      uint32_t phyRate,
   39.30 +                              enum WifiPhyStandard standard);
   39.31    /**
   39.32     * \param uniqueName the name of the associated WifiMode. This name
   39.33     *        must be unique accross _all_ instances.
   39.34 @@ -170,7 +178,8 @@
   39.35  			     uint32_t bandwidth,
   39.36  			     uint32_t dataRate,
   39.37  			     uint32_t phyRate,
   39.38 -			     uint8_t constellationSize);
   39.39 +			     uint8_t constellationSize,
   39.40 +                             enum WifiPhyStandard standard);
   39.41  
   39.42    /**
   39.43     * \param uniqueName the name of the associated WifiMode. This name
   39.44 @@ -188,7 +197,8 @@
   39.45  			      bool isMandatory,
   39.46  			      uint32_t bandwidth,
   39.47  			      uint32_t dataRate,
   39.48 -			      uint32_t phyRate);
   39.49 +			      uint32_t phyRate,
   39.50 +                              enum WifiPhyStandard standard);
   39.51    /**
   39.52     * \param uniqueName the name of the associated WifiMode. This name
   39.53     *        must be unique accross _all_ instances.
   39.54 @@ -205,7 +215,8 @@
   39.55  			      bool isMandatory,
   39.56  			      uint32_t bandwidth,
   39.57  			      uint32_t dataRate,
   39.58 -			      uint32_t phyRate);
   39.59 +                              uint32_t phyRate,
   39.60 +                              enum WifiPhyStandard standard);
   39.61  private:
   39.62    friend class WifiMode;  
   39.63    friend std::istream & operator >> (std::istream &is, WifiMode &mode);
   39.64 @@ -225,6 +236,7 @@
   39.65      enum WifiMode::ModulationType modulation;
   39.66      uint8_t constellationSize;
   39.67      bool isMandatory;
   39.68 +    enum WifiPhyStandard standard;
   39.69    };
   39.70  
   39.71    bool Search (std::string name, WifiMode *mode);
    40.1 --- a/src/devices/wifi/wifi-phy-standard.h	Wed Aug 05 11:28:01 2009 -0400
    40.2 +++ b/src/devices/wifi/wifi-phy-standard.h	Wed Aug 05 14:03:54 2009 -0400
    40.3 @@ -25,6 +25,8 @@
    40.4  enum WifiPhyStandard {
    40.5    WIFI_PHY_STANDARD_80211a,
    40.6    WIFI_PHY_STANDARD_80211b,
    40.7 +  WIFI_PHY_STANDARD_80211_10Mhz,
    40.8 +  WIFI_PHY_STANDARD_80211_5Mhz,
    40.9    WIFI_PHY_STANDARD_holland
   40.10  };
   40.11  
    41.1 --- a/src/devices/wifi/wifi-phy.cc	Wed Aug 05 11:28:01 2009 -0400
    41.2 +++ b/src/devices/wifi/wifi-phy.cc	Wed Aug 05 14:03:54 2009 -0400
    41.3 @@ -98,7 +98,8 @@
    41.4  {
    41.5    static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-6mbs",
    41.6                                                        true,
    41.7 -                                                      20000000, 6000000, 12000000);
    41.8 +                                                      20000000, 6000000, 12000000,
    41.9 +                                                      WIFI_PHY_STANDARD_80211a);
   41.10    return mode;
   41.11  }
   41.12  WifiMode 
   41.13 @@ -106,7 +107,8 @@
   41.14  {
   41.15    static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-9mbs",
   41.16                                                        false,
   41.17 -                                                      20000000, 9000000, 12000000);
   41.18 +                                                      20000000, 9000000, 12000000,
   41.19 +                                                      WIFI_PHY_STANDARD_80211a);
   41.20    return mode;
   41.21  }
   41.22  WifiMode 
   41.23 @@ -114,7 +116,8 @@
   41.24  {
   41.25    static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-12mbs",
   41.26                                                        true,
   41.27 -                                                      20000000, 12000000, 24000000);
   41.28 +                                                      20000000, 12000000, 24000000,
   41.29 +                                                      WIFI_PHY_STANDARD_80211a);
   41.30    return mode;
   41.31  }
   41.32  WifiMode 
   41.33 @@ -122,7 +125,8 @@
   41.34  {
   41.35    static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-18mbs",
   41.36                                                        false,
   41.37 -                                                      20000000, 18000000, 24000000);
   41.38 +                                                      20000000, 18000000, 24000000,
   41.39 +                                                      WIFI_PHY_STANDARD_80211a);
   41.40    return mode;
   41.41  }
   41.42  WifiMode 
   41.43 @@ -130,7 +134,8 @@
   41.44  {
   41.45    static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-24mbs",
   41.46                                                        true,
   41.47 -                                                      20000000, 24000000, 48000000);
   41.48 +                                                      20000000, 24000000, 48000000,
   41.49 +                                                      WIFI_PHY_STANDARD_80211a);
   41.50    return mode;
   41.51  }
   41.52  WifiMode 
   41.53 @@ -138,7 +143,8 @@
   41.54  {
   41.55    static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-36mbs",
   41.56                                                        false,
   41.57 -                                                      20000000, 36000000, 48000000);
   41.58 +                                                      20000000, 36000000, 48000000,
   41.59 +                                                      WIFI_PHY_STANDARD_80211a);
   41.60    return mode;
   41.61  }
   41.62  
   41.63 @@ -147,7 +153,8 @@
   41.64  {
   41.65    static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-48mbs",
   41.66                                                        false,
   41.67 -                                                      20000000, 48000000, 72000000);
   41.68 +                                                      20000000, 48000000, 72000000,
   41.69 +                                                      WIFI_PHY_STANDARD_80211a);
   41.70    return mode;
   41.71  }
   41.72  
   41.73 @@ -156,7 +163,8 @@
   41.74  {
   41.75    static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-54mbs",
   41.76                                                        false,
   41.77 -                                                      20000000, 54000000, 72000000);
   41.78 +                                                      20000000, 54000000, 72000000,
   41.79 +                                                      WIFI_PHY_STANDARD_80211a);
   41.80    return mode;
   41.81  }
   41.82  
   41.83 @@ -213,7 +221,8 @@
   41.84  {
   41.85    static WifiMode mode = WifiModeFactory::CreateDbpsk ("wifib-1mbs",
   41.86                                                        true,
   41.87 -                                                      22000000, 1000000, 1000000);
   41.88 +                                                      22000000, 1000000, 1000000,
   41.89 +                                                      WIFI_PHY_STANDARD_80211b);
   41.90    return mode;
   41.91  }
   41.92  
   41.93 @@ -222,7 +231,8 @@
   41.94  {
   41.95    static WifiMode mode = WifiModeFactory::CreateDqpsk ("wifib-2mbs",
   41.96                                                        true,
   41.97 -                                                      22000000, 2000000, 2000000);
   41.98 +                                                      22000000, 2000000, 2000000,
   41.99 +                                                      WIFI_PHY_STANDARD_80211b);
  41.100    return mode;
  41.101  }
  41.102  
  41.103 @@ -231,7 +241,8 @@
  41.104  {
  41.105    static WifiMode mode = WifiModeFactory::CreateDqpsk ("wifib-5.5mbs",
  41.106                                                        true,
  41.107 -                                                      22000000, 5500000, 5500000);
  41.108 +                                                      22000000, 5500000, 5500000,
  41.109 +                                                      WIFI_PHY_STANDARD_80211b);
  41.110    return mode;
  41.111  }
  41.112  
  41.113 @@ -240,7 +251,168 @@
  41.114  {
  41.115    static WifiMode mode = WifiModeFactory::CreateDqpsk ("wifib-11mbs",
  41.116                                                        true,
  41.117 -                                                      22000000, 11000000, 11000000);
  41.118 +                                                      22000000, 11000000, 11000000,
  41.119 +                                                      WIFI_PHY_STANDARD_80211b);
  41.120 +  return mode;
  41.121 +}
  41.122 +
  41.123 +WifiMode 
  41.124 +WifiPhy::Get3mb10Mhz (void)
  41.125 +{
  41.126 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-3mbs-10Mhz",
  41.127 +                                                      true,
  41.128 +                                                      10000000, 3000000, 6000000,
  41.129 +                                                      WIFI_PHY_STANDARD_80211_10Mhz);
  41.130 +  return mode;
  41.131 +}
  41.132 +
  41.133 +WifiMode 
  41.134 +WifiPhy::Get4_5mb10Mhz (void)
  41.135 +{
  41.136 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-4.5mbs-10Mhz",
  41.137 +                                                      false,
  41.138 +                                                      10000000, 4500000, 6000000,
  41.139 +                                                      WIFI_PHY_STANDARD_80211_10Mhz);
  41.140 +  return mode;
  41.141 +}
  41.142 +
  41.143 +WifiMode 
  41.144 +WifiPhy::Get6mb10Mhz (void)
  41.145 +{
  41.146 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-6mbs-10Mhz",
  41.147 +                                                      true,
  41.148 +                                                      10000000, 6000000, 12000000,
  41.149 +                                                      WIFI_PHY_STANDARD_80211_10Mhz);
  41.150 +  return mode;
  41.151 +}
  41.152 +
  41.153 +WifiMode 
  41.154 +WifiPhy::Get9mb10Mhz (void)
  41.155 +{
  41.156 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-9mbs-10Mhz",
  41.157 +                                                      false,
  41.158 +                                                      10000000, 9000000, 12000000,
  41.159 +                                                      WIFI_PHY_STANDARD_80211_10Mhz);
  41.160 +  return mode;
  41.161 +}
  41.162 +
  41.163 +WifiMode 
  41.164 +WifiPhy::Get12mb10Mhz (void)
  41.165 +{
  41.166 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-12mbs-10Mhz",
  41.167 +                                                      true,
  41.168 +                                                      10000000, 12000000, 24000000,
  41.169 +                                                      WIFI_PHY_STANDARD_80211_10Mhz);
  41.170 +  return mode;
  41.171 +}
  41.172 +
  41.173 +WifiMode 
  41.174 +WifiPhy::Get18mb10Mhz (void)
  41.175 +{
  41.176 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-18mbs-10Mhz",
  41.177 +                                                      false,
  41.178 +                                                      10000000, 18000000, 24000000,
  41.179 +                                                      WIFI_PHY_STANDARD_80211_10Mhz);
  41.180 +  return mode;
  41.181 +}
  41.182 +
  41.183 +WifiMode 
  41.184 +WifiPhy::Get24mb10Mhz (void)
  41.185 +{
  41.186 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-24mbs-10Mhz",
  41.187 +                                                      false,
  41.188 +                                                      10000000, 24000000, 36000000,
  41.189 +                                                      WIFI_PHY_STANDARD_80211_10Mhz);
  41.190 +  return mode;
  41.191 +}
  41.192 +
  41.193 +WifiMode 
  41.194 +WifiPhy::Get27mb10Mhz (void)
  41.195 +{
  41.196 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-27mbs-10Mhz",
  41.197 +                                                      false,
  41.198 +                                                      10000000, 27000000, 36000000,
  41.199 +                                                      WIFI_PHY_STANDARD_80211_10Mhz);
  41.200 +  return mode;
  41.201 +}
  41.202 +
  41.203 +WifiMode 
  41.204 +WifiPhy::Get1_5mb5Mhz (void)
  41.205 +{
  41.206 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-1_5mbs-5Mhz",
  41.207 +                                                      true,
  41.208 +                                                      5000000, 1500000, 3000000,
  41.209 +                                                      WIFI_PHY_STANDARD_80211_5Mhz);
  41.210 +  return mode;
  41.211 +}
  41.212 +
  41.213 +WifiMode 
  41.214 +WifiPhy::Get2_25mb5Mhz (void)
  41.215 +{
  41.216 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-2.25mbs-5Mhz",
  41.217 +                                                      false,
  41.218 +                                                      5000000, 2250000, 3000000,
  41.219 +                                                      WIFI_PHY_STANDARD_80211_5Mhz);
  41.220 +  return mode;
  41.221 +}
  41.222 +
  41.223 +WifiMode 
  41.224 +WifiPhy::Get3mb5Mhz (void)
  41.225 +{
  41.226 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-3mbs-5Mhz",
  41.227 +                                                      true,
  41.228 +                                                      5000000, 3000000, 6000000,
  41.229 +                                                      WIFI_PHY_STANDARD_80211_5Mhz);
  41.230 +  return mode;
  41.231 +}
  41.232 +
  41.233 +WifiMode 
  41.234 +WifiPhy::Get4_5mb5Mhz (void)
  41.235 +{
  41.236 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-4.5mbs-5Mhz",
  41.237 +                                                      false,
  41.238 +                                                      5000000, 4500000, 6000000,
  41.239 +                                                      WIFI_PHY_STANDARD_80211_5Mhz);
  41.240 +  return mode;
  41.241 +}
  41.242 +
  41.243 +WifiMode 
  41.244 +WifiPhy::Get6mb5Mhz (void)
  41.245 +{
  41.246 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-6mbs-5Mhz",
  41.247 +                                                      true,
  41.248 +                                                      5000000, 6000000, 12000000,
  41.249 +                                                      WIFI_PHY_STANDARD_80211_5Mhz);
  41.250 +  return mode;
  41.251 +}
  41.252 +
  41.253 +WifiMode 
  41.254 +WifiPhy::Get9mb5Mhz (void)
  41.255 +{
  41.256 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-9mbs-5Mhz",
  41.257 +                                                      false,
  41.258 +                                                      10000000, 9000000, 12000000,
  41.259 +                                                      WIFI_PHY_STANDARD_80211_5Mhz);
  41.260 +  return mode;
  41.261 +}
  41.262 +
  41.263 +WifiMode 
  41.264 +WifiPhy::Get12mb5Mhz (void)
  41.265 +{
  41.266 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-12mbs-5Mhz",
  41.267 +                                                      false,
  41.268 +                                                      10000000, 12000000, 18000000,
  41.269 +                                                      WIFI_PHY_STANDARD_80211_5Mhz);
  41.270 +  return mode;
  41.271 +}
  41.272 +
  41.273 +WifiMode 
  41.274 +WifiPhy::Get13_5mb5Mhz (void)
  41.275 +{
  41.276 +  static WifiMode mode = WifiModeFactory::CreateBpsk ("wifi-13.5mbs-5Mhz",
  41.277 +                                                      false,
  41.278 +                                                      10000000, 13500000, 18000000,
  41.279 +                                                      WIFI_PHY_STANDARD_80211_5Mhz);
  41.280    return mode;
  41.281  }
  41.282  
  41.283 @@ -265,6 +437,22 @@
  41.284      ns3::WifiPhy::Get2mbb ();
  41.285      ns3::WifiPhy::Get5_5mbb ();
  41.286      ns3::WifiPhy::Get11mbb ();
  41.287 +    ns3::WifiPhy::Get3mb10Mhz ();
  41.288 +    ns3::WifiPhy::Get4_5mb10Mhz ();
  41.289 +    ns3::WifiPhy::Get6mb10Mhz ();
  41.290 +    ns3::WifiPhy::Get9mb10Mhz ();
  41.291 +    ns3::WifiPhy::Get12mb10Mhz ();
  41.292 +    ns3::WifiPhy::Get18mb10Mhz ();
  41.293 +    ns3::WifiPhy::Get24mb10Mhz ();
  41.294 +    ns3::WifiPhy::Get27mb10Mhz ();
  41.295 +    ns3::WifiPhy::Get1_5mb5Mhz ();
  41.296 +    ns3::WifiPhy::Get2_25mb5Mhz ();
  41.297 +    ns3::WifiPhy::Get3mb5Mhz ();
  41.298 +    ns3::WifiPhy::Get4_5mb5Mhz ();
  41.299 +    ns3::WifiPhy::Get6mb5Mhz ();
  41.300 +    ns3::WifiPhy::Get9mb5Mhz ();
  41.301 +    ns3::WifiPhy::Get12mb5Mhz ();
  41.302 +    ns3::WifiPhy::Get13_5mb5Mhz ();
  41.303    }
  41.304  } g_constructor;
  41.305  }
    42.1 --- a/src/devices/wifi/wifi-phy.h	Wed Aug 05 11:28:01 2009 -0400
    42.2 +++ b/src/devices/wifi/wifi-phy.h	Wed Aug 05 14:03:54 2009 -0400
    42.3 @@ -241,7 +241,19 @@
    42.4     *          the requested ber for the specified transmission mode. (W/W)
    42.5     */
    42.6    virtual double CalculateSnr (WifiMode txMode, double ber) const = 0;
    42.7 -
    42.8 +  
    42.9 +  /** 
   42.10 +   * \brief Set channel number. 
   42.11 +   * 
   42.12 +   * Channel center frequency = Channel starting frequency + 5 MHz * (nch - 1)
   42.13 +   *
   42.14 +   * where Starting channel frequency is standard-dependent, see SetStandard()
   42.15 +   * as defined in IEEE 802.11-2007 17.3.8.3.2.
   42.16 +   */ 
   42.17 +  virtual void SetChannelNumber (uint16_t id) = 0;
   42.18 +  /// Return current channel number, see SetChannelNumber()
   42.19 +  virtual uint16_t GetChannelNumber () const = 0;
   42.20 +  
   42.21    virtual Ptr<WifiChannel> GetChannel (void) const = 0;
   42.22  
   42.23    static WifiMode Get6mba (void);
   42.24 @@ -256,6 +268,22 @@
   42.25    static WifiMode Get2mbb (void);
   42.26    static WifiMode Get5_5mbb (void);
   42.27    static WifiMode Get11mbb (void);
   42.28 +  static WifiMode Get3mb10Mhz (void);
   42.29 +  static WifiMode Get4_5mb10Mhz (void);
   42.30 +  static WifiMode Get6mb10Mhz (void);
   42.31 +  static WifiMode Get9mb10Mhz (void);
   42.32 +  static WifiMode Get12mb10Mhz (void);
   42.33 +  static WifiMode Get18mb10Mhz (void);
   42.34 +  static WifiMode Get24mb10Mhz (void);
   42.35 +  static WifiMode Get27mb10Mhz (void);
   42.36 +  static WifiMode Get1_5mb5Mhz (void);
   42.37 +  static WifiMode Get2_25mb5Mhz (void);
   42.38 +  static WifiMode Get3mb5Mhz (void);
   42.39 +  static WifiMode Get4_5mb5Mhz (void);
   42.40 +  static WifiMode Get6mb5Mhz (void);
   42.41 +  static WifiMode Get9mb5Mhz (void);
   42.42 +  static WifiMode Get12mb5Mhz (void);
   42.43 +  static WifiMode Get13_5mb5Mhz (void);
   42.44  
   42.45  
   42.46    /**
    43.1 --- a/src/devices/wifi/wifi-remote-station-manager.cc	Wed Aug 05 11:28:01 2009 -0400
    43.2 +++ b/src/devices/wifi/wifi-remote-station-manager.cc	Wed Aug 05 14:03:54 2009 -0400
    43.3 @@ -433,7 +433,9 @@
    43.4  WifiRemoteStation::WifiRemoteStation ()
    43.5    : m_state (BRAND_NEW),
    43.6      m_ssrc (0),
    43.7 -    m_slrc (0)
    43.8 +    m_slrc (0),
    43.9 +    m_avgSlrcCoefficient(0.9),
   43.10 +    m_avgSlrc (0)
   43.11  {}
   43.12  WifiRemoteStation::~WifiRemoteStation ()
   43.13  {}
   43.14 @@ -557,7 +559,11 @@
   43.15  {
   43.16    return GetControlAnswerMode (dataMode);
   43.17  }
   43.18 -
   43.19 +double
   43.20 +WifiRemoteStation::GetAvgSlrc () const
   43.21 +{
   43.22 +  return m_avgSlrc;
   43.23 +}
   43.24  uint32_t 
   43.25  WifiRemoteStation::GetNSupportedModes (void) const
   43.26  {
   43.27 @@ -712,6 +718,7 @@
   43.28  void 
   43.29  WifiRemoteStation::ReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr)
   43.30  {
   43.31 +  m_avgSlrc = m_avgSlrc * m_avgSlrcCoefficient + (double) m_slrc * (1 - m_avgSlrcCoefficient);
   43.32    m_slrc = 0;
   43.33    DoReportDataOk (ackSnr, ackMode, dataSnr);
   43.34  }
    44.1 --- a/src/devices/wifi/wifi-remote-station-manager.h	Wed Aug 05 11:28:01 2009 -0400
    44.2 +++ b/src/devices/wifi/wifi-remote-station-manager.h	Wed Aug 05 14:03:54 2009 -0400
    44.3 @@ -260,7 +260,10 @@
    44.4     *          handshake.
    44.5     */
    44.6    WifiMode GetAckMode (WifiMode dataMode);
    44.7 -
    44.8 +  /**
    44.9 +   * \return exponentially weighted average SLRC, this is used by Airtime link metric of 802.11s
   44.10 +   */
   44.11 +  double GetAvgSlrc () const;
   44.12  private:
   44.13    virtual Ptr<WifiRemoteStationManager> GetManager (void) const = 0;
   44.14    virtual WifiMode DoGetDataMode (uint32_t size) = 0;
   44.15 @@ -289,6 +292,8 @@
   44.16    SupportedModes m_modes;
   44.17    TracedValue<uint32_t> m_ssrc;
   44.18    TracedValue<uint32_t> m_slrc;
   44.19 +  double m_avgSlrcCoefficient;
   44.20 +  double m_avgSlrc;
   44.21  };
   44.22  
   44.23  } // namespace ns3 
    45.1 --- a/src/devices/wifi/wscript	Wed Aug 05 11:28:01 2009 -0400
    45.2 +++ b/src/devices/wifi/wscript	Wed Aug 05 14:03:54 2009 -0400
    45.3 @@ -21,6 +21,7 @@
    45.4          'error-rate-model.cc',
    45.5          'yans-error-rate-model.cc',
    45.6          'interference-helper.cc',
    45.7 +        'interference-helper-tx-duration-test.cc',
    45.8          'yans-wifi-phy.cc',
    45.9          'yans-wifi-channel.cc',
   45.10          'wifi-mac-header.cc',
   45.11 @@ -105,6 +106,13 @@
   45.12          'msdu-aggregator.h',
   45.13          'amsdu-subframe-header.h',
   45.14          'qos-tag.h',
   45.15 +# Need this for module devices/mesh
   45.16 +        'mgt-headers.h',
   45.17 +        'status-code.h',
   45.18 +        'capability-information.h',
   45.19 +        'dcf-manager.h',
   45.20 +        'mac-rx-middle.h', 
   45.21 +        'mac-low.h',
   45.22          ]
   45.23  
   45.24      if bld.env['ENABLE_GSL']:
    46.1 --- a/src/devices/wifi/yans-error-rate-model.cc	Wed Aug 05 11:28:01 2009 -0400
    46.2 +++ b/src/devices/wifi/yans-error-rate-model.cc	Wed Aug 05 14:03:54 2009 -0400
    46.3 @@ -176,7 +176,7 @@
    46.4  double 
    46.5  YansErrorRateModel::GetChunkSuccessRate (WifiMode mode, double snr, uint32_t nbits) const
    46.6  {
    46.7 -  if (mode == WifiPhy::Get6mba ())
    46.8 +  if (mode == WifiPhy::Get6mba () || mode == WifiPhy::Get3mb10Mhz () || mode == WifiPhy::Get1_5mb5Mhz ())
    46.9      {
   46.10        return GetFecBpskBer (snr, 
   46.11                              nbits,
   46.12 @@ -186,7 +186,7 @@
   46.13                              11 // adFree
   46.14                              );      
   46.15      }
   46.16 -  else if (mode == WifiPhy::Get9mba ())
   46.17 +  else if (mode == WifiPhy::Get9mba () || mode == WifiPhy::Get4_5mb10Mhz () || mode == WifiPhy::Get2_25mb5Mhz ())
   46.18      {
   46.19        return GetFecBpskBer (snr, 
   46.20                              nbits,
   46.21 @@ -196,7 +196,7 @@
   46.22                              8 // adFree
   46.23                              );
   46.24      }
   46.25 -  else if (mode == WifiPhy::Get12mba ())
   46.26 +  else if (mode == WifiPhy::Get12mba () || mode == WifiPhy::Get6mb10Mhz () || mode == WifiPhy::Get3mb5Mhz ())
   46.27      {
   46.28        return GetFecQamBer (snr, 
   46.29                             nbits,
   46.30 @@ -208,7 +208,7 @@
   46.31                             0   // adFreePlusOne
   46.32                             );
   46.33      }
   46.34 -  else if (mode == WifiPhy::Get18mba ())
   46.35 +  else if (mode == WifiPhy::Get18mba () || mode == WifiPhy::Get9mb10Mhz () || mode == WifiPhy::Get4_5mb5Mhz ())
   46.36      {
   46.37        return GetFecQamBer (snr, 
   46.38                             nbits,
   46.39 @@ -220,7 +220,7 @@
   46.40                             31 // adFreePlusOne
   46.41                             );
   46.42      }
   46.43 -  else if (mode == WifiPhy::Get24mba ())
   46.44 +  else if (mode == WifiPhy::Get24mba () || mode == WifiPhy::Get12mb10Mhz () || mode == WifiPhy::Get6mb5Mhz ())
   46.45      {
   46.46        return GetFecQamBer (snr, 
   46.47                             nbits,
   46.48 @@ -232,7 +232,7 @@
   46.49                             0   // adFreePlusOne
   46.50                             );
   46.51      }
   46.52 -  else if (mode == WifiPhy::Get36mba ())
   46.53 +  else if (mode == WifiPhy::Get36mba () || mode == WifiPhy::Get18mb10Mhz () || mode == WifiPhy::Get9mb5Mhz ())
   46.54      {
   46.55        return GetFecQamBer (snr, 
   46.56                             nbits,
   46.57 @@ -244,7 +244,7 @@
   46.58                             31  // adFreePlusOne
   46.59                             );
   46.60      }
   46.61 -  else if (mode == WifiPhy::Get48mba ())
   46.62 +  else if (mode == WifiPhy::Get48mba () || mode == WifiPhy::Get24mb10Mhz () || mode == WifiPhy::Get12mb5Mhz ())
   46.63      {
   46.64        return GetFecQamBer (snr, 
   46.65                             nbits,
   46.66 @@ -256,7 +256,7 @@
   46.67                             16  // adFreePlusOne
   46.68                             );
   46.69      }
   46.70 -  else if (mode == WifiPhy::Get54mba ())
   46.71 +  else if (mode == WifiPhy::Get54mba () || mode == WifiPhy::Get27mb10Mhz () || mode == WifiPhy::Get13_5mb5Mhz ())
   46.72      {
   46.73        return GetFecQamBer (snr, 
   46.74                             nbits,
    47.1 --- a/src/devices/wifi/yans-wifi-channel.cc	Wed Aug 05 11:28:01 2009 -0400
    47.2 +++ b/src/devices/wifi/yans-wifi-channel.cc	Wed Aug 05 14:03:54 2009 -0400
    47.3 @@ -77,10 +77,14 @@
    47.4    Ptr<MobilityModel> senderMobility = sender->GetMobility ()->GetObject<MobilityModel> ();
    47.5    NS_ASSERT (senderMobility != 0);
    47.6    uint32_t j = 0;
    47.7 -  for (PhyList::const_iterator i = m_phyList.begin (); i != m_phyList.end (); i++)
    47.8 -    {
    47.9 +  for (PhyList::const_iterator i = m_phyList.begin (); i != m_phyList.end (); i++, j++)
   47.10 +    { 
   47.11        if (sender != (*i))
   47.12          {
   47.13 +          // For now don't account for inter channel interference
   47.14 +          if ((*i)->GetChannelNumber() != sender->GetChannelNumber())
   47.15 +              continue;
   47.16 +          
   47.17            Ptr<MobilityModel> receiverMobility = (*i)->GetMobility ()->GetObject<MobilityModel> ();
   47.18            Time delay = m_delay->GetDelay (senderMobility, receiverMobility);
   47.19            double rxPowerDbm = m_loss->CalcRxPower (txPowerDbm, senderMobility, receiverMobility);
   47.20 @@ -90,7 +94,6 @@
   47.21            Simulator::Schedule (delay, &YansWifiChannel::Receive, this, 
   47.22                                 j, copy, rxPowerDbm, wifiMode, preamble);
   47.23          }
   47.24 -      j++;
   47.25      }
   47.26  }
   47.27  
    48.1 --- a/src/devices/wifi/yans-wifi-phy.cc	Wed Aug 05 11:28:01 2009 -0400
    48.2 +++ b/src/devices/wifi/yans-wifi-phy.cc	Wed Aug 05 14:03:54 2009 -0400
    48.3 @@ -111,20 +111,26 @@
    48.4                     MakeEnumAccessor (&YansWifiPhy::SetStandard),
    48.5                     MakeEnumChecker (WIFI_PHY_STANDARD_80211a, "802.11a",
    48.6                                      WIFI_PHY_STANDARD_80211b, "802.11b",
    48.7 +                                    WIFI_PHY_STANDARD_80211_10Mhz,"802.11_10Mhz",
    48.8 +                                    WIFI_PHY_STANDARD_80211_5Mhz,"802.11_5Mhz",
    48.9                                      WIFI_PHY_STANDARD_holland, "holland"))
   48.10      .AddAttribute ("State", "The state of the PHY layer",
   48.11                     PointerValue (),
   48.12                     MakePointerAccessor (&YansWifiPhy::m_state),
   48.13                     MakePointerChecker<WifiPhyStateHelper> ())
   48.14 +    .AddAttribute ("ChannelSwitchDelay",
   48.15 +                   "Delay between two short frames transmitted on different frequencies. NOTE: Unused now.",
   48.16 +                   TimeValue (MicroSeconds (250)),
   48.17 +                   MakeTimeAccessor (&YansWifiPhy::m_channelSwitchDelay), 
   48.18 +                   MakeTimeChecker ())
   48.19      ;
   48.20    return tid;
   48.21  }
   48.22  
   48.23  YansWifiPhy::YansWifiPhy ()
   48.24 -  :  m_channelFreqMhz(2437),
   48.25 -     m_endSyncEvent (),
   48.26 -     m_random (0.0, 1.0)
   48.27 -
   48.28 +  :  m_endSyncEvent (),
   48.29 +     m_random (0.0, 1.0),
   48.30 +     m_channelStartingFrequency (0)
   48.31  {
   48.32    NS_LOG_FUNCTION (this);
   48.33    m_state = CreateObject<WifiPhyStateHelper> ();
   48.34 @@ -156,6 +162,12 @@
   48.35    case WIFI_PHY_STANDARD_80211b:
   48.36      Configure80211b ();
   48.37      break;
   48.38 +  case WIFI_PHY_STANDARD_80211_10Mhz: 
   48.39 +    Configure80211_10Mhz ();
   48.40 +    break;
   48.41 +  case WIFI_PHY_STANDARD_80211_5Mhz:
   48.42 +    Configure80211_5Mhz ();
   48.43 +    break; 
   48.44    case WIFI_PHY_STANDARD_holland:
   48.45      ConfigureHolland ();
   48.46      break;
   48.47 @@ -300,6 +312,33 @@
   48.48  {
   48.49    m_channel = channel;
   48.50    m_channel->Add (this);
   48.51 +  m_channelId = 1;      // always start on channel starting frequency (channel 1)
   48.52 +}
   48.53 +
   48.54 +void 
   48.55 +YansWifiPhy::SetChannelNumber (uint16_t nch)
   48.56 +{
   48.57 +  // TODO implement channel switching state machine here
   48.58 +  DoSetChannelNumber (nch);
   48.59 +}
   48.60 +
   48.61 +void
   48.62 +YansWifiPhy::DoSetChannelNumber (uint16_t nch)
   48.63 +{
   48.64 +  NS_LOG_DEBUG("switching channel " << m_channelId << " -> " << nch);
   48.65 +  m_channelId = nch;
   48.66 +}
   48.67 +
   48.68 +uint16_t 
   48.69 +YansWifiPhy::GetChannelNumber() const
   48.70 +{
   48.71 +  return m_channelId;
   48.72 +}
   48.73 +
   48.74 +double
   48.75 +YansWifiPhy::GetChannelFrequencyMhz() const
   48.76 +{
   48.77 +  return m_channelStartingFrequency + 5 * (GetChannelNumber() - 1);
   48.78  }
   48.79  
   48.80  void 
   48.81 @@ -412,7 +451,7 @@
   48.82    NotifyTxBegin (packet);
   48.83    uint32_t dataRate500KbpsUnits = txMode.GetDataRate () / 500000;   
   48.84    bool isShortPreamble = (WIFI_PREAMBLE_SHORT == preamble);
   48.85 -  NotifyPromiscSniffTx (packet, m_channelFreqMhz, dataRate500KbpsUnits, isShortPreamble);
   48.86 +  NotifyPromiscSniffTx (packet, (uint16_t)GetChannelFrequencyMhz(), dataRate500KbpsUnits, isShortPreamble);
   48.87    m_state->SwitchToTx (txDuration, packet, txMode, preamble, txPower);
   48.88    m_channel->Send (this, packet, GetPowerDbm (txPower) + m_txGainDb, txMode, preamble);
   48.89  }
   48.90 @@ -437,7 +476,7 @@
   48.91  YansWifiPhy::Configure80211a (void)
   48.92  {
   48.93    NS_LOG_FUNCTION (this);
   48.94 -  m_interference.Configure80211aParameters ();
   48.95 +  m_channelStartingFrequency = 5e3; // 5.000 GHz 
   48.96    m_modes.push_back (WifiPhy::Get6mba ());
   48.97    m_modes.push_back (WifiPhy::Get9mba ());
   48.98    m_modes.push_back (WifiPhy::Get12mba ());
   48.99 @@ -453,7 +492,7 @@
  48.100  YansWifiPhy::Configure80211b (void)
  48.101  {
  48.102    NS_LOG_FUNCTION (this);
  48.103 -  m_interference.Configure80211bParameters ();
  48.104 +  m_channelStartingFrequency = 2412; // 2.412 GHz 
  48.105    m_modes.push_back (WifiPhy::Get1mbb ());
  48.106    m_modes.push_back (WifiPhy::Get2mbb ());
  48.107    m_modes.push_back (WifiPhy::Get5_5mbb ());
  48.108 @@ -461,10 +500,40 @@
  48.109  }
  48.110  
  48.111  void
  48.112 +YansWifiPhy::Configure80211_10Mhz (void)
  48.113 +{
  48.114 +  NS_LOG_FUNCTION (this);
  48.115 +  m_channelStartingFrequency = 5e3; // 5.000 GHz, suppose 802.11a 
  48.116 +  m_modes.push_back (WifiPhy::Get3mb10Mhz ());
  48.117 +  m_modes.push_back (WifiPhy::Get4_5mb10Mhz ());
  48.118 +  m_modes.push_back (WifiPhy::Get6mb10Mhz ());
  48.119 +  m_modes.push_back (WifiPhy::Get9mb10Mhz ());
  48.120 +  m_modes.push_back (WifiPhy::Get12mb10Mhz ());
  48.121 +  m_modes.push_back (WifiPhy::Get18mb10Mhz ());
  48.122 +  m_modes.push_back (WifiPhy::Get24mb10Mhz ());
  48.123 +  m_modes.push_back (WifiPhy::Get27mb10Mhz  ());
  48.124 +}
  48.125 +
  48.126 +void
  48.127 +YansWifiPhy::Configure80211_5Mhz (void)
  48.128 +{
  48.129 +  NS_LOG_FUNCTION (this); 
  48.130 +  m_channelStartingFrequency = 5e3; // 5.000 GHz, suppose 802.11a
  48.131 +  m_modes.push_back (WifiPhy::Get1_5mb5Mhz ());
  48.132 +  m_modes.push_back (WifiPhy::Get2_25mb5Mhz ());
  48.133 +  m_modes.push_back (WifiPhy::Get3mb5Mhz ());
  48.134 +  m_modes.push_back (WifiPhy::Get4_5mb5Mhz ());
  48.135 +  m_modes.push_back (WifiPhy::Get6mb5Mhz ());
  48.136 +  m_modes.push_back (WifiPhy::Get9mb5Mhz ());
  48.137 +  m_modes.push_back (WifiPhy::Get12mb5Mhz ());
  48.138 +  m_modes.push_back (WifiPhy::Get13_5mb5Mhz  ());
  48.139 +}
  48.140 +
  48.141 +void
  48.142  YansWifiPhy::ConfigureHolland (void)
  48.143  {
  48.144    NS_LOG_FUNCTION (this);
  48.145 -  m_interference.Configure80211aParameters ();
  48.146 +  m_channelStartingFrequency = 5e3; // 5.000 GHz 
  48.147    m_modes.push_back (WifiPhy::Get6mba ());
  48.148    m_modes.push_back (WifiPhy::Get12mba ());
  48.149    m_modes.push_back (WifiPhy::Get18mba ());
  48.150 @@ -588,7 +657,7 @@
  48.151        bool isShortPreamble = (WIFI_PREAMBLE_SHORT == event->GetPreambleType ());  
  48.152        double signalDbm = RatioToDb (event->GetRxPowerW ()) + 30;
  48.153        double noiseDbm = RatioToDb(event->GetRxPowerW() / snrPer.snr) - GetRxNoiseFigure() + 30 ;
  48.154 -      NotifyPromiscSniffRx (packet, m_channelFreqMhz, dataRate500KbpsUnits, isShortPreamble, signalDbm, noiseDbm);
  48.155 +      NotifyPromiscSniffRx (packet, (uint16_t)GetChannelFrequencyMhz(), dataRate500KbpsUnits, isShortPreamble, signalDbm, noiseDbm);
  48.156        m_state->SwitchFromSyncEndOk (packet, snrPer.snr, event->GetPayloadMode (), event->GetPreambleType ());
  48.157      } 
  48.158    else 
    49.1 --- a/src/devices/wifi/yans-wifi-phy.h	Wed Aug 05 11:28:01 2009 -0400
    49.2 +++ b/src/devices/wifi/yans-wifi-phy.h	Wed Aug 05 14:03:54 2009 -0400
    49.3 @@ -69,6 +69,21 @@
    49.4    virtual ~YansWifiPhy ();
    49.5  
    49.6    void SetChannel (Ptr<YansWifiChannel> channel);
    49.7 +  
    49.8 +  /** 
    49.9 +   * \brief Set channel number. 
   49.10 +   * 
   49.11 +   * Channel center frequency = Channel starting frequency + 5 MHz * (nch - 1)
   49.12 +   *
   49.13 +   * where Starting channel frequency is standard-dependent, see SetStandard()
   49.14 +   * as defined in IEEE 802.11-2007 17.3.8.3.2.
   49.15 +   */ 
   49.16 +  void SetChannelNumber (uint16_t id);
   49.17 +  /// Return current channel number, see SetChannelNumber()
   49.18 +  uint16_t GetChannelNumber () const;
   49.19 +  /// Return current center channel frequency in MHz, see SetСhannelNumber()
   49.20 +  double GetChannelFrequencyMhz() const;
   49.21 +  
   49.22    void StartReceivePacket (Ptr<Packet> packet,
   49.23                             double rxPowerDbm,
   49.24                             WifiMode mode,
   49.25 @@ -94,6 +109,8 @@
   49.26    Ptr<ErrorRateModel> GetErrorRateModel (void) const;
   49.27    Ptr<Object> GetDevice (void) const;
   49.28    Ptr<Object> GetMobility (void);
   49.29 +  
   49.30 +  
   49.31  
   49.32  
   49.33    virtual double GetTxPowerStart (void) const;
   49.34 @@ -125,6 +142,8 @@
   49.35    virtual void DoDispose (void);
   49.36    void Configure80211a (void);
   49.37    void Configure80211b (void);
   49.38 +  void Configure80211_10Mhz (void);
   49.39 +  void Configure80211_5Mhz ();
   49.40    void ConfigureHolland (void);
   49.41    double GetEdThresholdW (void) const;
   49.42    double DbmToW (double dbm) const;
   49.43 @@ -133,6 +152,7 @@
   49.44    double RatioToDb (double ratio) const;
   49.45    double GetPowerDbm (uint8_t power) const;
   49.46    void EndSync (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event);
   49.47 +  void DoSetChannelNumber(uint16_t id);
   49.48  
   49.49  private:
   49.50    double   m_edThresholdW;
   49.51 @@ -142,17 +162,20 @@
   49.52    double   m_txPowerBaseDbm;
   49.53    double   m_txPowerEndDbm;
   49.54    uint32_t m_nTxPower;
   49.55 -  uint16_t m_channelFreqMhz;
   49.56  
   49.57    Ptr<YansWifiChannel> m_channel;
   49.58 +  uint16_t m_channelId;
   49.59    Ptr<Object> m_device;
   49.60    Ptr<Object> m_mobility;
   49.61    Modes m_modes;
   49.62    EventId m_endSyncEvent;
   49.63    UniformVariable m_random;
   49.64    WifiPhyStandard m_standard;
   49.65 +  /// Standard-dependent center frequency of 0-th channel, MHz 
   49.66 +  double m_channelStartingFrequency;
   49.67    Ptr<WifiPhyStateHelper> m_state;
   49.68    InterferenceHelper m_interference;
   49.69 +  Time m_channelSwitchDelay;
   49.70  
   49.71  };
   49.72  
    50.1 --- a/src/helper/internet-stack-helper.cc	Wed Aug 05 11:28:01 2009 -0400
    50.2 +++ b/src/helper/internet-stack-helper.cc	Wed Aug 05 14:03:54 2009 -0400
    50.3 @@ -171,6 +171,7 @@
    50.4  
    50.5  std::vector<InternetStackHelper::Trace> InternetStackHelper::m_traces;
    50.6  std::string InternetStackHelper::m_pcapBaseFilename;
    50.7 +bool InternetStackHelper::m_isInitialized = false;
    50.8  
    50.9  InternetStackHelper::InternetStackHelper ()
   50.10  {
   50.11 @@ -178,8 +179,13 @@
   50.12    static Ipv4StaticRoutingHelper staticRouting;
   50.13    static Ipv4GlobalRoutingHelper globalRouting;
   50.14    static Ipv4ListRoutingHelper listRouting;
   50.15 -  listRouting.Add (staticRouting, 0);
   50.16 -  listRouting.Add (globalRouting, -10);
   50.17 +  if (m_isInitialized == false)
   50.18 +    {
   50.19 +      // Only add these once
   50.20 +      listRouting.Add (staticRouting, 0);
   50.21 +      listRouting.Add (globalRouting, -10);
   50.22 +      m_isInitialized = true;
   50.23 +    }
   50.24    SetRoutingHelper (listRouting);
   50.25  }
   50.26  
    51.1 --- a/src/helper/internet-stack-helper.h	Wed Aug 05 11:28:01 2009 -0400
    51.2 +++ b/src/helper/internet-stack-helper.h	Wed Aug 05 14:03:54 2009 -0400
    51.3 @@ -173,6 +173,7 @@
    51.4    static std::string m_pcapBaseFilename;
    51.5    static uint32_t GetNodeIndex (std::string context);
    51.6    static std::vector<Trace> m_traces;
    51.7 +  static bool m_isInitialized;
    51.8  };
    51.9  
   51.10  } // namespace ns3
    52.1 --- a/src/helper/nqos-wifi-mac-helper.h	Wed Aug 05 11:28:01 2009 -0400
    52.2 +++ b/src/helper/nqos-wifi-mac-helper.h	Wed Aug 05 14:03:54 2009 -0400
    52.3 @@ -70,7 +70,6 @@
    52.4                  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
    52.5                  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
    52.6    /**
    52.7 -   * \param type the type of ns3::WifiMac to create.
    52.8     * \param n0 the name of the attribute to set
    52.9     * \param v0 the value of the attribute to set
   52.10     * \param n1 the name of the attribute to set
   52.11 @@ -78,6 +77,7 @@
   52.12     * \param n2 the name of the attribute to set
   52.13     * \param v2 the value of the attribute to set
   52.14     * \param n3 the name of the attribute to set
   52.15 +   * \param v3 the value of the attribute to set
   52.16     */
   52.17    void SetDcaParameters (std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
   52.18                           std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
    53.1 --- a/src/helper/qos-wifi-mac-helper.h	Wed Aug 05 11:28:01 2009 -0400
    53.2 +++ b/src/helper/qos-wifi-mac-helper.h	Wed Aug 05 14:03:54 2009 -0400
    53.3 @@ -74,7 +74,7 @@
    53.4    /**
    53.5     * \param accessClass access class for which we are setting aggregator. Possibilities
    53.6     *  are: AC_BK, AC_BE, AC_VI, AC_VO.
    53.7 -   * \param aggregatorType type of aggregator.
    53.8 +   * \param type the type of ns3::WifiMac to create.
    53.9     * \param n0 the name of the attribute to set
   53.10     * \param v0 the value of the attribute to set
   53.11     * \param n1 the name of the attribute to set
    54.1 --- a/src/internet-stack/arp-l3-protocol.cc	Wed Aug 05 11:28:01 2009 -0400
    54.2 +++ b/src/internet-stack/arp-l3-protocol.cc	Wed Aug 05 14:03:54 2009 -0400
    54.3 @@ -81,12 +81,15 @@
    54.4  void
    54.5  ArpL3Protocol::NotifyNewAggregate ()
    54.6  {
    54.7 -  Ptr<Node>node = this->GetObject<Node> ();
    54.8 -  //verify that it's a valid node and that
    54.9 -  //the node was not set before
   54.10 -  if (node!= 0 && m_node == 0)
   54.11 +  if (m_node == 0)
   54.12      {
   54.13 -      this->SetNode (node);
   54.14 +      Ptr<Node>node = this->GetObject<Node> ();
   54.15 +      //verify that it's a valid node and that
   54.16 +      //the node was not set before
   54.17 +      if (node != 0)
   54.18 +        {
   54.19 +          this->SetNode (node);
   54.20 +        }
   54.21      }
   54.22    Object::NotifyNewAggregate ();
   54.23  }
    55.1 --- a/src/internet-stack/icmpv4-l4-protocol.cc	Wed Aug 05 11:28:01 2009 -0400
    55.2 +++ b/src/internet-stack/icmpv4-l4-protocol.cc	Wed Aug 05 14:03:54 2009 -0400
    55.3 @@ -50,15 +50,20 @@
    55.4  void
    55.5  Icmpv4L4Protocol::NotifyNewAggregate ()
    55.6  {
    55.7 -  bool is_not_initialized = (m_node == 0);
    55.8 -  Ptr<Node>node = this->GetObject<Node> ();
    55.9 -  Ptr<Ipv4L3Protocol> ipv4 = this->GetObject<Ipv4L3Protocol> ();
   55.10 -  if (is_not_initialized && node!= 0 && ipv4 != 0)
   55.11 +  if (m_node == 0)
   55.12      {
   55.13 -      this->SetNode (node);
   55.14 -      ipv4->Insert (this);
   55.15 -      Ptr<Ipv4RawSocketFactoryImpl> rawFactory = CreateObject<Ipv4RawSocketFactoryImpl> ();
   55.16 -      ipv4->AggregateObject (rawFactory);
   55.17 +      Ptr<Node> node = this->GetObject<Node> ();
   55.18 +      if (node != 0)
   55.19 +	{
   55.20 +	  Ptr<Ipv4L3Protocol> ipv4 = this->GetObject<Ipv4L3Protocol> ();
   55.21 +	  if (ipv4 != 0)
   55.22 +	    {
   55.23 +	      this->SetNode (node);
   55.24 +	      ipv4->Insert (this);
   55.25 +	      Ptr<Ipv4RawSocketFactoryImpl> rawFactory = CreateObject<Ipv4RawSocketFactoryImpl> ();
   55.26 +	      ipv4->AggregateObject (rawFactory);
   55.27 +	    }
   55.28 +	}
   55.29      }
   55.30    Object::NotifyNewAggregate ();
   55.31  }
    56.1 --- a/src/internet-stack/ipv4-checksum.cc	Wed Aug 05 11:28:01 2009 -0400
    56.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.3 @@ -1,52 +0,0 @@
    56.4 -/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    56.5 -/*
    56.6 - * Copyright (c) 2005,2006,2007 INRIA
    56.7 - *
    56.8 - * This program is free software; you can redistribute it and/or modify
    56.9 - * it under the terms of the GNU General Public License version 2 as
   56.10 - * published by the Free Software Foundation;
   56.11 - *
   56.12 - * This program is distributed in the hope that it will be useful,
   56.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   56.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   56.15 - * GNU General Public License for more details.
   56.16 - *
   56.17 - * You should have received a copy of the GNU General Public License
   56.18 - * along with this program; if not, write to the Free Software
   56.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   56.20 - *
   56.21 - * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   56.22 - */
   56.23 -#include "ipv4-checksum.h"
   56.24 -
   56.25 -namespace ns3 {
   56.26 -
   56.27 -uint16_t 
   56.28 -Ipv4ChecksumCalculate (uint16_t checksum, uint8_t *buffer, uint16_t size)
   56.29 -{
   56.30 -  /* see RFC 1071 to understand this code. */
   56.31 -  uint32_t sum = checksum;
   56.32 -  uint16_t *data = (uint16_t *) buffer;
   56.33 -  for (uint16_t i = 0; i < (size/2); i++) {
   56.34 -    sum += data[i];
   56.35 -  }
   56.36 -  if ((size % 2) != 0) {
   56.37 -    uint8_t tmpBuf[2];
   56.38 -    tmpBuf[0] = buffer[size-1];
   56.39 -    tmpBuf[1] = 0;
   56.40 -    data = (uint16_t *)tmpBuf;
   56.41 -    sum += *data;
   56.42 -  }
   56.43 -  while (sum >> 16) {
   56.44 -    sum = (sum & 0xffff) + (sum >> 16);
   56.45 -  }
   56.46 -  return sum;
   56.47 -}
   56.48 -
   56.49 -uint16_t 
   56.50 -Ipv4ChecksumComplete (uint16_t checksum)
   56.51 -{
   56.52 -  return ~checksum;
   56.53 -}
   56.54 -
   56.55 -}; //namespace ns3
    57.1 --- a/src/internet-stack/ipv4-checksum.h	Wed Aug 05 11:28:01 2009 -0400
    57.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.3 @@ -1,33 +0,0 @@
    57.4 -/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    57.5 -/*
    57.6 - * Copyright (c) 2005,2006,2007 INRIA
    57.7 - *
    57.8 - * This program is free software; you can redistribute it and/or modify
    57.9 - * it under the terms of the GNU General Public License version 2 as
   57.10 - * published by the Free Software Foundation;
   57.11 - *
   57.12 - * This program is distributed in the hope that it will be useful,
   57.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   57.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   57.15 - * GNU General Public License for more details.
   57.16 - *
   57.17 - * You should have received a copy of the GNU General Public License
   57.18 - * along with this program; if not, write to the Free Software
   57.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   57.20 - *
   57.21 - * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   57.22 - */
   57.23 -#ifndef IPV4_CHECKSUM_H
   57.24 -#define IPV4_CHECKSUM_H
   57.25 -
   57.26 -#include <stdint.h>
   57.27 -
   57.28 -namespace ns3 {
   57.29 -
   57.30 -uint16_t Ipv4ChecksumCalculate (uint16_t checksum, uint8_t *buffer, uint16_t size);
   57.31 -
   57.32 -uint16_t Ipv4ChecksumComplete (uint16_t checksum);
   57.33 -
   57.34 -}; //namespace ns3
   57.35 -
   57.36 -#endif /* IPV4_CHECKSUM_H */
    58.1 --- a/src/internet-stack/ipv4-interface.cc	Wed Aug 05 11:28:01 2009 -0400
    58.2 +++ b/src/internet-stack/ipv4-interface.cc	Wed Aug 05 14:03:54 2009 -0400
    58.3 @@ -178,7 +178,7 @@
    58.4  void
    58.5  Ipv4Interface::Send (Ptr<Packet> p, Ipv4Address dest)
    58.6  {
    58.7 -  NS_LOG_FUNCTION_NOARGS ();
    58.8 +  NS_LOG_FUNCTION (dest << *p);
    58.9    if (!IsUp()) 
   58.10      {
   58.11        return;
    59.1 --- a/src/internet-stack/ipv4-l3-protocol.cc	Wed Aug 05 11:28:01 2009 -0400
    59.2 +++ b/src/internet-stack/ipv4-l3-protocol.cc	Wed Aug 05 14:03:54 2009 -0400
    59.3 @@ -146,12 +146,15 @@
    59.4  void
    59.5  Ipv4L3Protocol::NotifyNewAggregate ()
    59.6  {
    59.7 -  Ptr<Node>node = this->GetObject<Node>();
    59.8 -  // verify that it's a valid node and that
    59.9 -  // the node has not been set before
   59.10 -  if (node!= 0 && m_node == 0)
   59.11 +  if (m_node == 0)
   59.12      {
   59.13 -      this->SetNode (node);
   59.14 +      Ptr<Node>node = this->GetObject<Node>();
   59.15 +      // verify that it's a valid node and that
   59.16 +      // the node has not been set before
   59.17 +      if (node != 0)
   59.18 +        {
   59.19 +          this->SetNode (node);
   59.20 +        }
   59.21      }
   59.22    Object::NotifyNewAggregate ();
   59.23  }
    60.1 --- a/src/internet-stack/nsc-tcp-l4-protocol.cc	Wed Aug 05 11:28:01 2009 -0400
    60.2 +++ b/src/internet-stack/nsc-tcp-l4-protocol.cc	Wed Aug 05 14:03:54 2009 -0400
    60.3 @@ -164,16 +164,21 @@
    60.4  void
    60.5  NscTcpL4Protocol::NotifyNewAggregate ()
    60.6  { 
    60.7 -  bool is_not_initialized = (m_node == 0);
    60.8 -  Ptr<Node>node = this->GetObject<Node> ();
    60.9 -  Ptr<Ipv4L3Protocol> ipv4 = this->GetObject<Ipv4L3Protocol> ();
   60.10 -  if (is_not_initialized && node!= 0 && ipv4 != 0)
   60.11 +  if (m_node == 0)
   60.12      {
   60.13 -      this->SetNode (node);
   60.14 -      ipv4->Insert (this);
   60.15 -      Ptr<NscTcpSocketFactoryImpl> tcpFactory = CreateObject<NscTcpSocketFactoryImpl> ();
   60.16 -      tcpFactory->SetTcp (this);
   60.17 -      node->AggregateObject (tcpFactory);
   60.18 +      Ptr<Node>node = this->GetObject<Node> ();
   60.19 +      if (node != 0)
   60.20 +        {
   60.21 +          Ptr<Ipv4L3Protocol> ipv4 = this->GetObject<Ipv4L3Protocol> ();
   60.22 +          if (ipv4 != 0)
   60.23 +            {
   60.24 +              this->SetNode (node);
   60.25 +              ipv4->Insert (this);
   60.26 +              Ptr<NscTcpSocketFactoryImpl> tcpFactory = CreateObject<NscTcpSocketFactoryImpl> ();
   60.27 +              tcpFactory->SetTcp (this);
   60.28 +              node->AggregateObject (tcpFactory);
   60.29 +            }
   60.30 +        }
   60.31      }
   60.32    Object::NotifyNewAggregate ();
   60.33  }
    61.1 --- a/src/internet-stack/tcp-l4-protocol.cc	Wed Aug 05 11:28:01 2009 -0400
    61.2 +++ b/src/internet-stack/tcp-l4-protocol.cc	Wed Aug 05 14:03:54 2009 -0400
    61.3 @@ -366,16 +366,21 @@
    61.4  void
    61.5  TcpL4Protocol::NotifyNewAggregate ()
    61.6  {
    61.7 -  bool is_not_initialized = (m_node == 0);
    61.8 -  Ptr<Node>node = this->GetObject<Node> ();
    61.9 -  Ptr<Ipv4L3Protocol> ipv4 = this->GetObject<Ipv4L3Protocol> ();
   61.10 -  if (is_not_initialized && node!= 0 && ipv4 != 0)
   61.11 +  if (m_node == 0)
   61.12      {
   61.13 -      this->SetNode (node);
   61.14 -      ipv4->Insert (this);
   61.15 -      Ptr<TcpSocketFactoryImpl> tcpFactory = CreateObject<TcpSocketFactoryImpl> ();
   61.16 -      tcpFactory->SetTcp (this);
   61.17 -      node->AggregateObject (tcpFactory);
   61.18 +      Ptr<Node> node = this->GetObject<Node> ();
   61.19 +      if (node != 0)
   61.20 +        {
   61.21 +          Ptr<Ipv4L3Protocol> ipv4 = this->GetObject<Ipv4L3Protocol> ();
   61.22 +          if (ipv4 != 0)
   61.23 +            {
   61.24 +              this->SetNode (node);
   61.25 +              ipv4->Insert (this);
   61.26 +              Ptr<TcpSocketFactoryImpl> tcpFactory = CreateObject<TcpSocketFactoryImpl> ();
   61.27 +              tcpFactory->SetTcp (this);
   61.28 +              node->AggregateObject (tcpFactory);
   61.29 +            }
   61.30 +        }
   61.31      }
   61.32    Object::NotifyNewAggregate ();
   61.33  }
    62.1 --- a/src/internet-stack/udp-l4-protocol.cc	Wed Aug 05 11:28:01 2009 -0400
    62.2 +++ b/src/internet-stack/udp-l4-protocol.cc	Wed Aug 05 14:03:54 2009 -0400
    62.3 @@ -77,16 +77,21 @@
    62.4  void
    62.5  UdpL4Protocol::NotifyNewAggregate ()
    62.6  {  
    62.7 -  bool is_not_initialized = (m_node == 0);
    62.8 -  Ptr<Node>node = this->GetObject<Node> ();
    62.9 -  Ptr<Ipv4L3Protocol> ipv4 = this->GetObject<Ipv4L3Protocol> ();
   62.10 -  if (is_not_initialized && node!= 0 && ipv4 != 0)
   62.11 +  if (m_node == 0)
   62.12      {
   62.13 -      this->SetNode (node);
   62.14 -      ipv4->Insert (this);
   62.15 -      Ptr<UdpSocketFactoryImpl> udpFactory = CreateObject<UdpSocketFactoryImpl> ();
   62.16 -      udpFactory->SetUdp (this);
   62.17 -      node->AggregateObject (udpFactory);
   62.18 +      Ptr<Node> node = this->GetObject<Node> ();
   62.19 +      if (node != 0)
   62.20 +        {
   62.21 +          Ptr<Ipv4L3Protocol> ipv4 = this->GetObject<Ipv4L3Protocol> ();
   62.22 +          if (ipv4 != 0)
   62.23 +            {
   62.24 +              this->SetNode (node);
   62.25 +              ipv4->Insert (this);
   62.26 +              Ptr<UdpSocketFactoryImpl> udpFactory = CreateObject<UdpSocketFactoryImpl> ();
   62.27 +              udpFactory->SetUdp (this);
   62.28 +              node->AggregateObject (udpFactory);
   62.29 +            }
   62.30 +        }
   62.31      }
   62.32    Object::NotifyNewAggregate ();
   62.33  }
    63.1 --- a/src/internet-stack/wscript	Wed Aug 05 11:28:01 2009 -0400
    63.2 +++ b/src/internet-stack/wscript	Wed Aug 05 14:03:54 2009 -0400
    63.3 @@ -78,7 +78,6 @@
    63.4          'ipv4-l4-protocol.cc',
    63.5          'udp-header.cc',
    63.6          'tcp-header.cc',
    63.7 -        'ipv4-checksum.cc',
    63.8          'ipv4-interface.cc',
    63.9          'ipv4-l3-protocol.cc',
   63.10          'ipv4-end-point.cc',
    64.1 --- a/src/node/ipv4-routing-protocol.h	Wed Aug 05 11:28:01 2009 -0400
    64.2 +++ b/src/node/ipv4-routing-protocol.h	Wed Aug 05 14:03:54 2009 -0400
    64.3 @@ -34,10 +34,13 @@
    64.4  
    64.5  /**
    64.6   * \ingroup node 
    64.7 - * \defgroup ipv4Routing Ipv4 Routing
    64.8 - *
    64.9 - * Abstract base class for Ipv4 routing protocols.  Defines two
   64.10 - * virtual functions for packet routing and forwarding.  The first, 
   64.11 + * \defgroup ipv4Routing Ipv4RoutingProtocol 
   64.12 + */
   64.13 +/**
   64.14 + * \ingroup ipv4Routing
   64.15 + * \brief Abstract base class for IPv4 routing protocols. 
   64.16 + * 
   64.17 + * Defines two virtual functions for packet routing and forwarding.  The first, 
   64.18   * RouteOutput(), is used for locally originated packets, and the second,
   64.19   * RouteInput(), is used for forwarding and/or delivering received packets. 
   64.20   * Also defines the signatures of four callbacks used in RouteInput().
    65.1 --- a/src/routing/list-routing/ipv4-list-routing.h	Wed Aug 05 11:28:01 2009 -0400
    65.2 +++ b/src/routing/list-routing/ipv4-list-routing.h	Wed Aug 05 14:03:54 2009 -0400
    65.3 @@ -25,7 +25,11 @@
    65.4  namespace ns3 {
    65.5  
    65.6  /**
    65.7 - * \ingroup ipv4Routing 
    65.8 + * \ingroup routing 
    65.9 + * \defgroup ipv4ListRouting Ipv4 List Routing
   65.10 + */
   65.11 +/**
   65.12 + * \ingroup ipv4ListRouting
   65.13   *
   65.14   * This class is a specialization of Ipv4RoutingProtocol that allows 
   65.15   * other instances of Ipv4RoutingProtocol to be inserted in a 
    66.1 --- a/src/routing/static-routing/ipv4-routing-table-entry.h	Wed Aug 05 11:28:01 2009 -0400
    66.2 +++ b/src/routing/static-routing/ipv4-routing-table-entry.h	Wed Aug 05 14:03:54 2009 -0400
    66.3 @@ -29,7 +29,7 @@
    66.4  namespace ns3 {
    66.5  
    66.6  /**
    66.7 - * \ingroup ipv4Routing
    66.8 + * \ingroup routing
    66.9   *
   66.10   * A record of an IPv4 routing table entry for Ipv4GlobalRouting and 
   66.11   * Ipv4StaticRouting.  This is not a reference counted object.
   66.12 @@ -155,7 +155,7 @@
   66.13  std::ostream& operator<< (std::ostream& os, Ipv4RoutingTableEntry const& route);
   66.14  
   66.15  /**
   66.16 - * \ingroup ipv4Routing
   66.17 + * \ingroup routing
   66.18   *
   66.19   * \brief A record of an IPv4 multicast route for Ipv4GlobalRouting and Ipv4StaticRouting
   66.20   */
    67.1 --- a/src/routing/static-routing/ipv4-static-routing.h	Wed Aug 05 11:28:01 2009 -0400
    67.2 +++ b/src/routing/static-routing/ipv4-static-routing.h	Wed Aug 05 14:03:54 2009 -0400
    67.3 @@ -43,7 +43,11 @@
    67.4  class Node;
    67.5  
    67.6  /**
    67.7 - * \ingroup ipv4Routing
    67.8 + * \ingroup routing
    67.9 + * \defgroup ipv4StaticRouting Ipv4StaticRouting
   67.10 + */
   67.11 +/**
   67.12 + * \ingroup ipv4StaticRouting
   67.13   * 
   67.14   * \brief Static routing protocol for IP version 4 stacks.
   67.15   *
    68.1 --- a/utils/bench-simulator.cc	Wed Aug 05 11:28:01 2009 -0400
    68.2 +++ b/utils/bench-simulator.cc	Wed Aug 05 14:03:54 2009 -0400
    68.3 @@ -33,6 +33,7 @@
    68.4  class Bench 
    68.5  {
    68.6  public:
    68.7 +  Bench ();
    68.8    void ReadDistribution (std::istream &istream);
    68.9    void SetTotal (uint32_t total);
   68.10    void RunBench (void);
   68.11 @@ -44,6 +45,11 @@
   68.12    uint32_t m_total;
   68.13  };
   68.14  
   68.15 +Bench::Bench ()
   68.16 +  : m_n (0),
   68.17 +    m_total (0)
   68.18 +{}
   68.19 +
   68.20  void 
   68.21  Bench::SetTotal (uint32_t total)
   68.22  {