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.

addpath(genpath(fullfile(pwd,'mlWLANSystemSimulation')));

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];

Load the default configuration for the WLAN nodes.

load('wlanNodeConfig.mat');

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).NodePosition = nodePositions(index,:);
end

Load the default application traffic configuration for the nodes.

load('wlanTrafficConfig.mat');

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. Node ID 1 represents the AP, whereas node IDs 2 and 3 represent the first and second STAs, respectively.

trafficConfig(1).SourceNode = 2;                       % STA node ID
trafficConfig(1).DestinationNode = 1;                  % AP node ID
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 = 1;                       % AP node ID
trafficConfig(2).DestinationNode = 3;                  % STA node ID
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 hStatsLogger helper object.

statsLogger = hStatsLogger(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.

run(networkSimulator,simulationTime);

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=113×3 table
                                  Node1       Node2     Node3
                                _________    _______    _____

    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 
    AppAvgPacketLatencyAC_VI            0          0     428 
      ⋮

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

hPlotNetworkStats(statistics,wlanNodes);

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.

rmpath(genpath(fullfile(pwd,'mlWLANSystemSimulation')));

Related Topics