Main Content

wlanNode

WLAN node

Since R2023a

Download Required: To use wlanNode, first download the Communications Toolbox Wireless Network Simulation Library add-on.

Description

Use the wlanNode object to create and configure a WLAN node.

Creation

Description

example

nodeObj = wlanNode creates a default WLAN node object.

example

nodeObj = wlanNode(Name=Value) sets properties of the WLAN node object using one or more optional name-value arguments. You can also use this syntax to create an array of WLAN node objects by setting the value of the Position property.

Properties

expand all

Node name, specified as a character vector, string scalar, string array, or cell array of character vectors. The default format of this value is "NodeN", where N is the node identifier specified by the ID property.

When you create an array of wlanNode objects by specifying the Position property, you can name each node in the array at once by specifying the Name as a string array or cell array of character vectors. If the length of the Name array is greater than the number of nodes, the extra names do not apply. If the length of the Name array is less than the number of nodes, the extra nodes get default names.

Data Types: char | string

Position in 3-D Cartesian coordinates, specified as a numeric N-by-3 matrix, where N is the number of nodes. By specifying a matrix with N greater than one, you can create a 1-by-N array of wlanNode objects.

Specify this value in meters. This value specifies the positions of the nodes in Cartesian x-, y-, and z-coordinates.

Data Types: double

MAC frame abstraction, specified as 0 (false) or 1 (true). Set this property to true to make the MAC frame abstract. An abstract MAC frame means that the node does not generate MAC frame bits.

Note

You can set this property only when you create the object. After creation, the property is read-only.

Data Types: logical

PHY abstraction method, specified as "tgax-evaluation-methodology", "tgax-mac-calibration", or "none".

  • The value "tgax-evaluation-methodology" corresponds to the abstraction method detailed in Appendix 1 ofIEEE® 802.11™-14/0571r12 [1].

  • The value "tgax-mac-calibration" corresponds to the abstraction method detailed in IEEE 802.11-14/0980r16 [2].

  • The value "none" corresponds to full physical layer processing.

For more information, see PHY Abstraction.

Note

You can set this property only when you create the object. After creation, the property is read-only.

Data Types: char | string

Device configuration, specified as a wlanDeviceConfig object, or as a vector of wlanDeviceConfig objects when you want to specify settings for multiple devices in the same node. To specify settings for multiple devices in one node, you must set the Mode property of each object in the vector to "AP" or "mesh".

Note

You can set this property only when you create the object. After creation, the property is read-only.

This property is read-only.

Node identifier, returned as an integer. This value specifies a unique identifier for the node in the simulation.

Note

This property is read-only.

Data Types: double

Object Functions

associateStationsAssociate stations to WLAN node
addTrafficSourceAdd data traffic source to WLAN node
addMeshPathAdd mesh path to WLAN node
updateUpdate configuration of WLAN node
statisticsStatistics of WLAN node

Examples

collapse all

This example shows how to simulate a wireless local area network (WLAN) by using WLAN Toolbox™ with the Communications Toolbox™ Wireless Network Simulation Library.

Using this example, you:

  1. Create and configure a WLAN with an access point (AP) node and a station (STA) node.

  2. Add application traffic from the AP node to the STA node.

  3. Simulate the WLAN and retrieve the statistics of the AP node and the STA node.

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;

Create a wireless network simulator.

networksimulator = wirelessNetworkSimulator.init();

Create a wlanDeviceConfig object, setting the mode to "AP". Use this configuration to create a WLAN node, specifying its name and position.

deviceCfg = wlanDeviceConfig(Mode="AP");
apNode = wlanNode(Name="AP",Position=[0 10 0],DeviceConfig=deviceCfg);

Create a WLAN node with the default device configuration. Confirm that the default mode is STA.

staNode = wlanNode(Name="STA",Position=[5 0 0]);
disp(staNode.DeviceConfig.Mode)
STA

Associate the STA node with the AP node.

associateStations(apNode,staNode);

Create a networkTrafficOnOff object to generate an On-Off application traffic pattern. Specify the data rate in kilobits per second and the packet size in bytes. Enable packet generation to generate an application packet with a payload.

traffic = networkTrafficOnOff(DataRate=100,PacketSize=10,GeneratePacket=true);

Add application traffic from the AP node to the STA node.

addTrafficSource(apNode,traffic,DestinationNode=staNode);

Add the AP node and STA node to the wireless network simulator.

addNodes(networksimulator,{apNode,staNode});

Set the simulation time in seconds and run the simulation.

simulationTime = 0.05;
run(networksimulator,simulationTime);
Custom channel model is not added. Using free space path loss (fspl) model as the default channel model.

Get and display the physical layer (PHY) statistics that correspond to the AP node and STA node.

apStats = statistics(apNode);
staStats = statistics(staNode);
disp(apStats.PHY)
         TransmittedPackets: 126
    TransmittedPayloadBytes: 4095
            ReceivedPackets: 125
       ReceivedPayloadBytes: 1750
             DroppedPackets: 0
disp(staStats.PHY)
         TransmittedPackets: 125
    TransmittedPayloadBytes: 1750
            ReceivedPackets: 126
       ReceivedPayloadBytes: 4095
             DroppedPackets: 0

More About

expand all

References

[1] IEEE 802.11-14/0571r12, TGax Evaluation Methodology.

[2] IEEE 802.11-14/0980r16, TGax Simulation Scenarios.

Version History

Introduced in R2023a