Main Content

Simulate an 802.11ax Hybrid Mesh Network

This example shows how to create, configure, and simulate an IEEE® 802.11ax™ hybrid mesh network.

Using this example, you can:

  1. Create and configure an 802.11ax hybrid mesh network consisting of three mesh access points (APs) and three stations (STAs).

  2. Configure the mesh APs to operate in the 2.4 GHz and 6 GHz bands.

  3. Associate the STAs with the mesh APs.

  4. Generate, configure, and add on-off application traffic between an AP and a STA.

  5. Add mesh paths to route the application traffic from the source to the destination.

  6. Simulate the 802.11ax hybrid mesh network.

The example simulates this scenario.


STA1, STA2, and STA3 are associated with mesh AP1, mesh AP2, and mesh AP3, respectively. Mesh AP1, mesh AP2, and mesh AP3 together consitute the mesh network. For the mesh network, STA1, STA2, and STA3 are nonmesh nodes. Mesh AP1 is the source that generates and transmits the application traffic to STA3 through the intermediate relay nodes mesh AP2 and mesh AP3.

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.


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.


Specify the simulation time in seconds.

simulationTime = 0.5;

Initialize the wireless network simulator.

networkSimulator = wirelessNetworkSimulator.init;

Configure the mesh APs such that the AP mode operates in the 2.4 GHz band and the mesh mode operates in the 6 GHz band.

accessPointCfg = wlanDeviceConfig(Mode="AP",BandAndChannel=[2.4 11]);
meshCfg = wlanDeviceConfig(Mode="mesh",BandAndChannel=[6 1]);

Create three mesh APs from the specified configuration by using the wlanNode object.

meshAPs = wlanNode(Name=["Mesh AP1" "Mesh AP2" "Mesh AP3"], ...
    Position=[0 10 0; 0 5 0; 0 0 0], ...
    DeviceConfig=[accessPointCfg meshCfg]);

Configure the STAs to operate in the 2.4 GHz band.

stationsCfg = wlanDeviceConfig(Mode="STA",BandAndChannel=[2.4 11]);

Create three STAs from the specified configuration by using the wlanNode object.

stations = wlanNode(Name=["STA1" "STA2" "STA3"],Position=[0 0 10; 10 5 0; 10 0 0],DeviceConfig=stationsCfg);

Associate STA1 with mesh AP1, STA2 with mesh AP2, and STA3 with mesh AP3.


Generate an on-off application traffic pattern by using the networkTrafficOnOff object. Add the application traffic source from mesh AP1 to STA3 by using the addTrafficSource object function.

Alternatively, you can configure full buffer application traffic between the AP and STA by specifying the FullBufferTraffic input of the associateStations object function.

trafficSource = networkTrafficOnOff(DataRate=1e5);

Add mesh paths to propagate application traffic from mesh AP1 (source) to STA3 (destination). The application traffic flows from mesh AP1 to STA3 through the intermediate relay nodes mesh AP2 and mesh AP3.

addMeshPath(meshAPs(1),stations(3),meshAPs(3)); % Mesh path from mesh AP1 to STA3 (non-mesh node)
addMeshPath(meshAPs(1),meshAPs(3),meshAPs(2));  % Mesh path from mesh AP1 to mesh AP3 through mesh AP2
addMeshPath(meshAPs(2),meshAPs(3));             % Mesh path from mesh AP2 to mesh AP3

Add nodes to the wireless network simulator.

addNodes(networkSimulator,[meshAPs, stations]);

Run the network simulation for the specified simulation time.

Custom channel model is not added. Using free space path loss (fspl) model as the default channel model.

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([meshAPs, stations])
stats=1×6 struct array with fields:

See Also



Related Topics