Main Content

Configure Uplink and Downlink Traffic at 802.11ax Access Point

WLAN Toolbox™ features enable you to configure uplink and downlink application traffic at an 802.11ax™ access point. Using this example, you can:

  • Create and configure a three-node 802.11ax network consisting of one access point (AP) and two stations (STAs).

  • Model uplink voice traffic and downlink video traffic.

  • Visualize the statistics retrieved in the statistics MAT-file.

For information about different statistics captured in a WLAN system-level simulation, see Statistics Captured in WLAN System-Level Simulation.

Configure Uplink and Downlink Traffic at 802.11ax Access Point and Visualize Statistics

To access the helper files that this example uses, add the mlWLANSystemSimulation folder to the MATLAB path.


Set the simulation time in milliseconds.

simulationTime = 0.02*1e3;

Specify the total number of nodes (APs and STAs) in the network. This example uses one AP and two STAs.

numNodes = 3;

Specify the x-, y-, and z-coordinates of the WLAN nodes in the Cartesian coordinate system. This example considers the first node as the AP and the next two nodes as the STAs.

nodePositions = [10 0 0; 20 0 0; 5 5 0];

Specify the names of the WLAN nodes in the network.

nodeNames = ["Node1", "Node2", "Node3"];

Load the default configuration for the WLAN nodes.


Copy the default configuration for all of the nodes.

nodeConfig = repmat(wlanNodeConfig,1,numNodes);

Initialize the node position of the AP and STAs.

for index = 1:1:numNodes
    nodeConfig(index).NodeName = nodeNames(index);
    nodeConfig(index).NodePosition = nodePositions(index,:);

Load the default application traffic configuration for the nodes.


Initialize the nodes with uplink and downlink traffic configuration by copying the default configuration.

trafficConfig = repmat(wlanTrafficConfig,1,2);

Configure the uplink voice traffic at the first AP from the first STA. The first structure in the nodeConfig array represents the AP configuration, whereas the second and third structures represent the first and second STAs configurations, respectively.

trafficConfig(1).SourceNode = nodeConfig(2).NodeName;      % STA node name
trafficConfig(1).DestinationNode = nodeConfig(1).NodeName; % AP node name
trafficConfig(1).AccessCategory = 3;                       % Best Effort (0), Background (1), Video (2), and Voice (3)

Configure the downlink video traffic at the first AP to the second STA.

trafficConfig(2).SourceNode = nodeConfig(1).NodeName;      % AP node name
trafficConfig(2).DestinationNode = nodeConfig(3).NodeName; % STA node name
trafficConfig(2).AccessCategory = 2;

Create a WLAN network by using the hCreateWLANNodes helper function. The example configures each node with the preceding physical layer (PHY), medium access control (MAC), and application traffic configuration.

wlanNodes = hCreateWLANNodes(nodeConfig,trafficConfig);

Initialize the visualization parameters.

visualizationInfo = struct;
visualizationInfo.Nodes = wlanNodes;

Retrieve and view the statistics by using the hWLANStatsLogger helper object.

statsLogger = hWLANStatsLogger(visualizationInfo);

Simulate the wireless network by using the hWirelessNetworkSimulator helper object.

networkSimulator = hWirelessNetworkSimulator(wlanNodes);         % Object that handles network simulation

Run all of the nodes in the network for the specified simulation time.


To display the statistics, enable the displayStatsInUITable workspace variable.

displayStatsInUITable = true;

Display the statistics by using the getStatistics object function. For information about these statistics, see Statistics Captured in WLAN System-Level Simulation.

statistics = getStatistics(statsLogger,displayStatsInUITable);
Statistics table for band 2.4 and channel number 6
statisticsTable=157×3 table
                                  Node1       Node2     Node3
                                _________    _______    _____

    Frequency                       2.437      2.437    2.437
    ActiveOperationInFreq               1          1        1
    AppTxAC_BE                          0          0        0
    AppTxAC_BK                          0          0        0
    AppTxAC_VI                       1000          0        0
    AppTxAC_VO                          0       1000        0
    AppTxBytes                    1.5e+06    1.5e+06        0
    AppRxAC_BE                          0          0        0
    AppRxAC_BK                          0          0        0
    AppRxAC_VI                          0          0        2
    AppRxAC_VO                         91          0        0
    AppRxBytes                  1.365e+05          0     3000
    AppTxOverflow                     742        653        0
    AppAvgPacketLatency             10070          0      428
    AppAvgPacketLatencyAC_BE            0          0        0
    AppAvgPacketLatencyAC_BK            0          0        0

Visualize network statistics such as throughput, packet loss ratio, and latencies at each node by using the hPlotNetworkStats helper function.


Figure contains 3 axes objects. Axes object 1 with title Throughput at Each Transmitter contains an object of type bar. Axes object 2 with title Packet-loss at Each Transmitter contains an object of type bar. Axes object 3 with title Average Packet Latency at Each Receiver contains an object of type bar.

At the end of the simulation, remove the mlWLANSystemSimulation folder from the path.


Related Topics