Main Content

Simulate a Multiband 802.11ax Network

This example shows how to create, configure, and simulate an IEEE® 802.11ax™ (Wi-Fi 6) network operating in the 2.4 GHz and 5 GHz band.

Using this example, you can:

  1. Create and configure an 802.11ax network consisting of a multiband access point (AP) and four stations (STAs).

  2. Configure the multiband AP to operate in the 2.4 GHz and 5 GHz bands.

  3. Associate the STAs with the AP and add full buffer downlink (DL) application traffic between them.

  4. Simulate the multiband band 802.11ax network.

The example simulates this scenario.

wlan_dualband_scenario.png

STA1 and STA 2 are associated with the multiband AP in the 2.4 GHz band. STA3 and STA4 are associated with the multiband AP in the 5 GHz band. The multiband AP transmits DL application traffic to STA1 and STA4.

Check if the Communications Toolbox™ Wireless Network Simulation Library support package is installed. If the support package is not installed, MATLAB® returns an error with a link to download and install the support package.

wirelessnetworkSupportPackageCheck;

Set the seed for the random number generator to 1. The seed value controls the pattern of random number generation. The random number generated by the seed value impacts several processes within the simulation including backoff counter selection at the MAC layer and predicting packet reception success at the physical layer. To improve the accuracy of your simulation results, after running the simulation, you can change the seed value, run the simulation again, and average the results over multiple simulations.

rng(1,"combRecursive");

Specify the simulation time in seconds.

simulationTime = 0.5;

Initialize the wireless network simulator.

networkSimulator = wirelessNetworkSimulator.init;

Configure the multiband AP to operate in the 2.4 GHz and 5 GHz bands.

accessPointCfg1 = wlanDeviceConfig(Mode="AP",BandAndChannel=[2.4 11]);
accessPointCfg2 = wlanDeviceConfig(Mode="AP",BandAndChannel=[5 36]);

Create a multiband AP from the specified configuration by using the wlanNode object.

accessPoint = wlanNode(Position=[0 0 0],DeviceConfig=[accessPointCfg1,accessPointCfg2]);

Configure STA1 and STA2 to operate in the 2.4 GHz band. Configure STA3 and STA4 to operate in the 5 GHz band.

stationCfg1 = wlanDeviceConfig(Mode="STA",BandAndChannel=[2.4 11]);
stationCfg2 = wlanDeviceConfig(Mode="STA",BandAndChannel=[5 36]);

Create STA1, STA2, STA3, and STA4 from the specified configuration.

stations1 = wlanNode(Position=[10 0 0; 0 10 0],DeviceConfig=stationCfg1);  % STA1 and STA2 on 2.4 GHz band
stations2 = wlanNode(Position=[0 0 10; 10 10 0],DeviceConfig=stationCfg2); % STA3 and STA4 on 5 GHz band

Associate STAs with the AP and add full buffer application traffic between them.

associateStations(accessPoint,[stations1(1),stations2(2)],FullBufferTraffic="DL");

Add nodes to the wireless network simulator.

addNodes(networkSimulator,[accessPoint,stations1,stations2]);

Run the network simulation for the specified simulation time.

run(networkSimulator,simulationTime);

At each node, the simulation captures the statistics by using the statistics object function. The stats variable captures the application statistics, MAC layer statistics, physical layer statistics, and mesh forwarding statistics for each node. For more information about these statistics, see the WLAN System-Level Simulation Statistics topic.

stats = statistics([accessPoint,stations1,stations2])
stats=1×5 struct array with fields:
    Name
    ID
    App
    MAC
    PHY
    Mesh

See Also

Functions

Objects

Related Topics