diff --git a/src/wave/helper/wifi-80211p-helper.cc b/src/wave/helper/wifi-80211p-helper.cc index 5026aab9e..2fd561b76 100644 --- a/src/wave/helper/wifi-80211p-helper.cc +++ b/src/wave/helper/wifi-80211p-helper.cc @@ -63,6 +63,19 @@ Wifi80211pHelper::SetStandard (enum WifiStandard standard) } } +// NS_DEPRECATED_3_32 +void +Wifi80211pHelper::SetStandard (enum WifiPhyStandard standard) +{ + if ((standard == WIFI_PHY_STANDARD_80211a) || (standard == WIFI_PHY_STANDARD_80211_10MHZ)) + { + WifiHelper::SetStandard (WIFI_STANDARD_80211p); + } + else + { + NS_FATAL_ERROR ("802.11p only use 802.11 standard with 10MHz or 20MHz"); + } +} void Wifi80211pHelper::EnableLogComponents (void) diff --git a/src/wave/helper/wifi-80211p-helper.h b/src/wave/helper/wifi-80211p-helper.h index 6c1ec7df0..728b097e7 100644 --- a/src/wave/helper/wifi-80211p-helper.h +++ b/src/wave/helper/wifi-80211p-helper.h @@ -24,6 +24,7 @@ #ifndef WIFI_802_11P_HELPER_H #define WIFI_802_11P_HELPER_H #include "ns3/wifi-helper.h" +#include "ns3/deprecated.h" namespace ns3 { @@ -59,6 +60,16 @@ public: */ virtual void SetStandard (enum WifiStandard standard); + /** + * \param standard the phy standard to configure during installation + * + * Users can only configure 802.11p with 10MHz or 5 MHz channel bandwidth. + * The default 802.11p standard uses 10MHz. + * \deprecated This method will go away in a future release of ns-3. + */ + NS_DEPRECATED_3_32 + virtual void SetStandard (WifiPhyStandard standard); + /** * \param phy the PHY helper to create PHY objects * \param macHelper the MAC helper to create MAC objects diff --git a/src/wifi/helper/wifi-helper.cc b/src/wifi/helper/wifi-helper.cc index 1c9de54bc..028c74d1d 100644 --- a/src/wifi/helper/wifi-helper.cc +++ b/src/wifi/helper/wifi-helper.cc @@ -749,6 +749,40 @@ WifiHelper::SetStandard (WifiStandard standard) m_standard = standard; } +// NS_DEPRECATED_3_32 +void +WifiHelper::SetStandard (WifiPhyStandard standard) +{ + switch (standard) + { + case WIFI_PHY_STANDARD_80211a: + m_standard = WIFI_STANDARD_80211a; + return; + case WIFI_PHY_STANDARD_80211b: + m_standard = WIFI_STANDARD_80211b; + return; + case WIFI_PHY_STANDARD_80211g: + m_standard = WIFI_STANDARD_80211g; + return; + case WIFI_PHY_STANDARD_holland: + m_standard = WIFI_STANDARD_holland; + return; + // remove the next value from WifiPhyStandard when deprecation ends + case WIFI_PHY_STANDARD_80211n_2_4GHZ: + m_standard = WIFI_STANDARD_80211n_2_4GHZ; + return; + // remove the next value from WifiPhyStandard when deprecation ends + case WIFI_PHY_STANDARD_80211n_5GHZ: + m_standard = WIFI_STANDARD_80211n_5GHZ; + return; + case WIFI_PHY_STANDARD_80211ac: + m_standard = WIFI_STANDARD_80211ac; + return; + default: + NS_FATAL_ERROR ("Unsupported value of WifiPhyStandard"); + } +} + void WifiHelper::SetSelectQueueCallback (SelectQueueCallback f) { diff --git a/src/wifi/helper/wifi-helper.h b/src/wifi/helper/wifi-helper.h index 5f6624719..a5d6568bc 100644 --- a/src/wifi/helper/wifi-helper.h +++ b/src/wifi/helper/wifi-helper.h @@ -26,6 +26,7 @@ #include "ns3/trace-helper.h" #include "ns3/wifi-phy.h" #include "ns3/qos-utils.h" +#include "ns3/deprecated.h" #include "wifi-mac-helper.h" #include @@ -498,6 +499,33 @@ public: */ virtual void SetStandard (WifiStandard standard); + /** + * \param standard the PHY standard to configure during installation + * + * This method sets standards-compliant defaults for WifiMac + * parameters such as SIFS time, slot time, timeout values, etc., + * based on the standard selected. It results in + * WifiMac::ConfigureStandard(standard) being called on each + * installed MAC object. + * + * The default standard of 802.11a will be applied if SetStandard() + * is not called. + * + * Note that WifiMac::ConfigureStandard () will overwrite certain + * defaults in the attribute system, so if a user wants to manipulate + * any default values affected by ConfigureStandard() while using this + * helper, the user should use a post-install configuration such as + * Config::Set() on any objects that this helper creates, such as: + * \code + * Config::Set ("/NodeList/0/DeviceList/0/$ns3::WifiNetDevice/Mac/Slot", TimeValue (MicroSeconds (slot))); + * \endcode + * \deprecated This method will go away in future release of ns-3. + * + * \sa Config::Set + */ + NS_DEPRECATED_3_32 + virtual void SetStandard (WifiPhyStandard standard); + /** * Helper to enable all WifiNetDevice log components with one statement */ diff --git a/src/wifi/model/wifi-standards.h b/src/wifi/model/wifi-standards.h index ab9d8eeb4..d82b8396b 100644 --- a/src/wifi/model/wifi-standards.h +++ b/src/wifi/model/wifi-standards.h @@ -38,6 +38,12 @@ enum WifiPhyStandard WIFI_PHY_STANDARD_80211b, /** ERP-OFDM PHY (Clause 19, Section 19.5) */ WIFI_PHY_STANDARD_80211g, + /** OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth) */ + /** this value is NS_DEPRECATED_3_32 */ + WIFI_PHY_STANDARD_80211_10MHZ, + /** OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth) */ + /** this value is NS_DEPRECATED_3_32 */ + WIFI_PHY_STANDARD_80211_5MHZ, /** OFDM PHY (Clause 17 - amendment for 10 MHz and 5 MHz channels) */ WIFI_PHY_STANDARD_80211p, /** This is intended to be the configuration used in this paper: @@ -46,6 +52,12 @@ enum WifiPhyStandard * ACM MOBICOM, 2001. */ WIFI_PHY_STANDARD_holland, + /** HT PHY for the 2.4 GHz band (clause 20) */ + /** this value is NS_DEPRECATED_3_32 */ + WIFI_PHY_STANDARD_80211n_2_4GHZ, + /** HT PHY for the 5 GHz band (clause 20) */ + /** this value is NS_DEPRECATED_3_32 */ + WIFI_PHY_STANDARD_80211n_5GHZ, /** HT PHY (clause 20) */ WIFI_PHY_STANDARD_80211n, /** VHT PHY (clause 22) */