|
|
| 151 |
prepared the YansWifiPhyHelper by telling it which channel it is connected to. |
151 |
prepared the YansWifiPhyHelper by telling it which channel it is connected to. |
| 152 |
The Phy objects are created in the next step. |
152 |
The Phy objects are created in the next step. |
| 153 |
|
153 |
|
| 154 |
802.11n/ac PHY layer can use either either long (800 ns) or short (400 ns) OFDM guard intervals. To configure this parameter, the following line of code could be used (in this example, it enables the support of a short guard interval):: |
|
|
| 155 |
|
| 156 |
wifiPhyHelper.Set ("ShortGuardEnabled", BooleanValue(true)); |
| 157 |
|
| 158 |
802.11ax PHY layer can use either either 3200 ns, 1600 ns or 800 ns OFDM guard intervals. To configure this parameter, the following line of code could be used (in this example, it enables the support of 1600 ns guard interval):: |
| 159 |
|
| 160 |
wifiPhyHelper.Set ("GuardInterval", TimeValue(NanoSeconds (1600))); |
| 161 |
|
| 162 |
In order to enable 802.11n/ac/ax MIMO, the number of antennas as well as the number of supported spatial streams need to be configured. |
154 |
In order to enable 802.11n/ac/ax MIMO, the number of antennas as well as the number of supported spatial streams need to be configured. |
| 163 |
For example, this code enables MIMO with 2 antennas and 2 spatial streams:: |
155 |
For example, this code enables MIMO with 2 antennas and 2 spatial streams:: |
| 164 |
|
156 |
|
|
|
| 173 |
wifiPhyHelper.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2)); |
165 |
wifiPhyHelper.Set ("MaxSupportedTxSpatialStreams", UintegerValue (2)); |
| 174 |
wifiPhyHelper.Set ("MaxSupportedRxSpatialStreams", UintegerValue (1)); |
166 |
wifiPhyHelper.Set ("MaxSupportedRxSpatialStreams", UintegerValue (1)); |
| 175 |
|
167 |
|
| 176 |
Furthermore, 802.11n provides an optional mode (GreenField mode) to reduce preamble durations and which is only compatible with 802.11n devices. This mode is enabled as follows:: |
|
|
| 177 |
|
| 178 |
wifiPhyHelper.Set ("GreenfieldEnabled",BooleanValue(true)); |
| 179 |
|
| 180 |
802.11n PHY layer can support both 20 (default) or 40 MHz channel width, and 802.11ac/ax PHY layer can use either 20, 40, 80 (default) or 160 MHz channel width. See below for further documentation on setting the frequency, channel width, and channel number. |
168 |
802.11n PHY layer can support both 20 (default) or 40 MHz channel width, and 802.11ac/ax PHY layer can use either 20, 40, 80 (default) or 160 MHz channel width. See below for further documentation on setting the frequency, channel width, and channel number. |
| 181 |
|
169 |
|
| 182 |
:: |
170 |
:: |
| 183 |
|
171 |
|
| 184 |
WifiHelper wifi; |
172 |
WifiHelper wifi; |
| 185 |
wifi.SetStandard (WIFI_PHY_STANDARD_80211ac); |
173 |
wifi.SetStandard (WIFI_PHY_STANDARD_80211ac); |
| 186 |
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", |
174 |
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", |
| 187 |
"DataMode", StringValue ("VhtMcs9"), |
175 |
"DataMode", StringValue ("VhtMcs9"), |
| 188 |
"ControlMode", StringValue ("VhtMcs0")); |
176 |
"ControlMode", StringValue ("VhtMcs0")); |
| 189 |
|
177 |
|
| 190 |
//Install PHY and MAC |
178 |
//Install PHY and MAC |
|
|
| 254 |
``WifiHelper::SetStandard ()`` is a method to set various parameters |
242 |
``WifiHelper::SetStandard ()`` is a method to set various parameters |
| 255 |
in the Mac and Phy to standard values and some reasonable defaults. |
243 |
in the Mac and Phy to standard values and some reasonable defaults. |
| 256 |
For example, ``SetStandard (WIFI_PHY_STANDARD_80211a)`` will set the |
244 |
For example, ``SetStandard (WIFI_PHY_STANDARD_80211a)`` will set the |
| 257 |
WifiPhy to Channel 36 in the 5 GHz band, among other settings. |
245 |
WifiPhy to Channel 36 in the 5 GHz band, among other settings appropriate |
|
|
246 |
for 802.11a. |
| 258 |
|
247 |
|
| 259 |
The following values for WifiPhyStandard are defined in |
248 |
The following values for WifiPhyStandard are defined in |
| 260 |
``src/wifi/model/wifi-phy-standard.h``: |
249 |
``src/wifi/model/wifi-phy-standard.h``: |
|
|
| 751 |
deviate from the default behavior; the example scripts show how to do some of |
740 |
deviate from the default behavior; the example scripts show how to do some of |
| 752 |
this reconfiguration. |
741 |
this reconfiguration. |
| 753 |
|
742 |
|
|
|
743 |
HT configuration |
| 744 |
================ |
| 745 |
|
| 746 |
HT is an acronym for High Throughput, a term synonymous with the IEEE 802.11n |
| 747 |
standard. Once the ``ns3::WifiHelper::Install`` has been called and the |
| 748 |
user sets the standard to a variant that supports HT capabilities (802.11n, |
| 749 |
802.11ac, or 802.11ax), an HT configuration object will automatically be |
| 750 |
created for the device. The configuration object is used to store and |
| 751 |
manage HT-specific attributes. |
| 752 |
|
| 753 |
802.11n/ac PHY layer can use either either long (800 ns) or short (400 ns) OFDM guard intervals. To configure this parameter for a given device, the following lines of code could be used (in this example, it enables the support of a short guard interval for the first station):: |
| 754 |
|
| 755 |
Ptr<NetDevice> nd = wifiStaDevices.Get (0); |
| 756 |
Ptr<WifiNetDevice> wnd = nd->GetObject<WifiNetDevice> (); |
| 757 |
Ptr<HtConfiguration> htConfiguration = wnd->GetHtConfiguration (); |
| 758 |
htConfiguration->SetShortGuardIntervalSupported (true); |
| 759 |
|
| 760 |
It is also possible to configure HT-specific attributes using ``Config::Set``. |
| 761 |
The following line of code enables the support of a short guard interval for all stations: |
| 762 |
|
| 763 |
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (true)); |
| 764 |
|
| 765 |
Furthermore, 802.11n provides an optional mode (Greenfield mode) to reduce preamble durations and which is only compatible with 802.11n devices. This mode is enabled as follows:: |
| 766 |
|
| 767 |
htConfiguration->SetGreenfieldSupported (true); |
| 768 |
|
| 769 |
VHT configuration |
| 770 |
================= |
| 771 |
|
| 772 |
IEEE 802.11ac devices are also known as supporting Very High Throughput (VHT). Once the ``ns3::WifiHelper::Install`` has been called and either the 802.11ac |
| 773 |
or 802.11ax 5 GHz standards are configured, a VHT configuration object will be |
| 774 |
automatically created to manage VHT-specific attributes. |
| 775 |
|
| 776 |
As of ns-3.29, however, there are no VHT-specific configuration items to |
| 777 |
manage; therefore, this object is a placeholder for future growth. |
| 778 |
|
| 779 |
HE configuration |
| 780 |
================ |
| 781 |
|
| 782 |
IEEE 802.11ax is also known as High Efficiency (HE). Once the ``ns3::WifiHelper::Install`` has been called and IEEE 802.11ax configured as the standard, an |
| 783 |
HE configuration object will automatically be created to manage HE-specific |
| 784 |
attributes for 802.11ax devices. |
| 785 |
|
| 786 |
802.11ax PHY layer can use either either 3200 ns, 1600 ns or 800 ns OFDM guard intervals. To configure this parameter, the following line of code could be used (in this example, it enables the support of 1600 ns guard interval), such as in this example code snippet:: |
| 787 |
|
| 788 |
Ptr<NetDevice> nd = wifiStaDevices.Get (0); |
| 789 |
Ptr<WifiNetDevice> wnd = nd->GetObject<WifiNetDevice> (); |
| 790 |
Ptr<HeConfiguration> heConfiguration = wnd->GetHeConfiguration (); |
| 791 |
heConfiguration->SetGuardInterval (NanoSeconds (1600)); |
| 792 |
|
| 754 |
Mobility configuration |
793 |
Mobility configuration |
| 755 |
====================== |
794 |
====================== |
| 756 |
|
795 |
|