Main Content

Simulate an 802.11ax Network with Abstracted PHY and Calculate MAC Throughput

This example shows how to create, configure, and simulate an IEEE® 802.11ax™ (Wi-Fi 6) network with a full or abstracted model of medium access control (MAC) and the physical layer (PHY). At the transmitter and receiver, modeling full MAC processing involves complete MAC frame generation at the MAC layer. Similarly, modeling full PHY processing involves complete waveform transmission and reception through a fading channel. When you simulate large networks, full MAC and PHY processing is computationally expensive. In an abstracted MAC, the node does not generate or decode any frames at the MAC layer. Similarly, in an abstracted PHY, the node does not generate or decode any waveforms at the PHY. MAC and PHY abstraction enable you to minimize the complexity and duration of the system-level simulations.

Using this example, you can:

  1. Create and configure a two-node 802.11ax network consisting of one access point (AP) and one station (STA).

  2. Associate the STA with the AP and add full buffer uplink (UL) and downlink (DL) application traffic.

  3. Configure the AP and STA to implement full MAC and an abstracted PHY.

  4. Simulate the 802.11ax network and measure MAC throughput

The example simulates this scenario.

wlan_ap_sta_scenario.png

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 affects several processes within the simulation, including backoff counter selection at the MAC layer and packet repetition success prediction at the PHY. 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.3;

Initialize the wireless network simulator.

networkSimulator = wirelessNetworkSimulator.init;

Specify the number of nodes in the network. Specify the positions of the nodes as a vector. Each row of the vector specifies the x-, y-, and z- Cartesian coordinates of a node, starting from the first node. Units are in meters.

numNodes = 2;
nodePositions = [0 0 0;20 20 20];

The MACFrameAbstraction and PHYAbstractionMethod properties of the wlanNode object enable you to configure MAC and PHY layer abstraction. The valid values for these properties are:

  • MACFrameAbstractiontrue (default) or false. The default value of this property enables you to use abstracted MAC. To use the full MAC, set this property to false.

  • PHYAbstractionMethod"tgax-evaluation-methodology" (default), "tgax-mac-calibration", or "none". To use the abstracted PHY, set this property to "tgax-evaluation-methodology" or "tgax-mac-calibration". If you set this property to "tgax-evaluation-methodology", the PHY estimates the performance of a link with the TGax channel model by using an effective signal-to-interference-plus-noise-ratio (SINR) mapping. If you set this property to "tgax-mac-calibration", the PHY assumes a packet failure due to interference without actually calculating the link performance. To use the full PHY, set this property to "none".

MACFrameAbstraction = false;
PHYAbstractionMethod = "tgax-mac-calibration";

Set the configuration parameters of the AP and the STA by using the wlanDeviceConfig object.

accessPointCfg = wlanDeviceConfig(Mode="AP",MCS=2,TransmitPower=15);    % AP device configuration
stationCfg = wlanDeviceConfig(Mode="STA",MCS=2,TransmitPower=15);       % STA device configuration

Create an AP and a STA from the specified configuration by using the wlanNode object.

accessPointStats = wlanNode(Name="AP", ...
    Position=nodePositions(1,:), ...
    DeviceConfig=accessPointCfg, ...
    PHYAbstractionMethod=PHYAbstractionMethod, ...
    MACFrameAbstraction=MACFrameAbstraction);

station = wlanNode(Name=["STA"], ...
    Position=nodePositions(2,:), ...
    DeviceConfig=stationCfg, ...
    PHYAbstractionMethod=PHYAbstractionMethod, ...
    MACFrameAbstraction=MACFrameAbstraction);

Create an 802.11ax network consisting of an AP and a STA.

nodes = [accessPointStats station];

Associate the STA with the AP and add full buffer DL and UL application traffic.

associateStations(accessPointStats,station,FullBufferTraffic="on");

Add nodes to the wireless network simulator.

addNodes(networkSimulator,nodes);

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.

accessPointStats = statistics(accessPointStats)
accessPointStats = struct with fields:
    Name: "AP"
      ID: 1
     App: [1x1 struct]
     MAC: [1x1 struct]
     PHY: [1x1 struct]
    Mesh: [1x1 struct]

stationStats = statistics(station)
stationStats = struct with fields:
    Name: "STA"
      ID: 2
     App: [1x1 struct]
     MAC: [1x1 struct]
     PHY: [1x1 struct]
    Mesh: [1x1 struct]

Calculate the MAC throughput at the AP and STA by using the TransmittedPayloadBytes value present in the MAC structure of the AP statistics.

accessPointThroughput = (accessPointStats(1).MAC.TransmittedPayloadBytes*8)/simulationTime
accessPointThroughput = 9000000
stationThroughput = (stationStats(1).MAC.TransmittedPayloadBytes*8)/simulationTime
stationThroughput = 10800000

See Also

Functions

Objects

Related Topics