Main Content

wlanMACFrameConfig

Configure WLAN MAC frame

Description

The wlanMACFrameConfig object configures an IEEE® 802.11™ medium access control (MAC) frame.

Creation

Description

cfgMAC = wlanMACFrameConfig creates a WLAN MAC frame configuration object with default property values.

cfgMAC = wlanMACFrameConfig(Name=Value) sets properties of cfgMAC using one or more name-value arguments.

At run time, a function that calls this object validates settings for properties relevant to its operation.

example

Properties

expand all

Type of frame, specified as one of these values.

  • "Beacon" — Beacon frame

  • "RTS" — Request to send (RTS) frame

  • "CTS" — Clear to send (CTS) frame

  • "ACK" — Acknowledgment (Ack) frame

  • "Block Ack" — Block Ack frame

  • "CF-End" — Contention Free-End (CF-End) frame (since R2024b)

  • "Trigger" — Trigger frame

  • "Data" — Data frame

  • "Null" — Null frame

  • "QoS Data" — Quality of service (QoS) data frame

  • "QoS Null" — QoS null frame

Data Types: char | string

Format of the frame, specified as "Non-HT", "HT-Mixed", "VHT", "HE-SU", "HE-EXT-SU", or "EHT-SU" depending on the FrameType property value.

  • When FrameType is "QoS Data", you can specify any of the available options.

  • When FrameType is "QoS Null", you can specify only "Non-HT" or "HT-Mixed".

Dependencies

To enable this property, both of these conditions must occur.

  • The FrameType property must be "QoS Data" or "QoS Null".

  • The Decoded property must be 0.

Data Types: char | string

Frame is directed to a distributed system (DS), specified as a numeric or logical 1 (true) or 0 (false). To indicate that the frame is directed from a non-access point (non-AP) station to a DS, set this property to 1 (true).

Data Types: logical

Frame is exiting a DS, specified as a numeric or logical 1 (true) or 0 (false). To indicate that the frame is directed from a DS to a non-AP station, set this property to 1 (true).

Data Types: logical

Retransmitted frame, specified as a numeric or logical 1 (true) or 0 (false). To indicate that the frame is a retransmission, set this property to 1 (true).

Data Types: logical

Power management mode, specified as a numeric or logical 1 (true) or 0 (false). To indicate that the sender is in power-saving mode, set this property to 1 (true).

Data Types: logical

More data indication, specified as a numeric or logical 1 (true) or 0 (false). To indicate that the sender has more frames to send, set this property to 1 (true).

Data Types: logical

Protected frame indication, specified as a numeric or logical 1 (true) or 0 (false). To indicate that the frame is protected with a cryptographic encapsulation algorithm, set this property to 1 (true).

Dependencies

This property applies only when the Decoded property is 1 (true).

Data Types: logical

Frame includes the high-throughput (HT) control field, specified as a numeric or logical 1 (true) or 0 (false). To indicate that the HT control field is included in the MAC header, set this property to 1 (true)

Data Types: logical

Amount of time, in microseconds, for which the channel is reserved after frame transmission ends, specified as an integer in the interval [0, 215 – 1].

Data Types: double

Receiver address, specified as a 12-element character vector or a string scalar representing a six-octet hexadecimal value. The default value, "FFFFFFFFFFFF", is a broadcast address.

Data Types: char | string

Transmitter address, specified as a 12-element character vector or a string scalar representing a six-octet hexadecimal value.

Data Types: char | string

Basic service set identifier (BSSID), destination address (DA), or source address (SA), specified as a 12-element character vector or a string scalar representing a six-octet hexadecimal value.

  • When the ToDS and FromDS properties are 0 (false), this property represents a BSSID.

  • When the ToDS property is 1 (true) and the FromDS property is 0 (false), this property represents a DA.

  • When the ToDS property is 0 (false) and the FromDS property is 1 (true), this property represents an SA.

Data Types: char | string

SA or BSSID, specified as one of these values.

  • A 12-element character vector or a string scalar representing a six-octet hexadecimal value when you set the MSDUAggregation and MPDUAggregation properties to 0 (false).

  • A 12-element character vector or string scalar, an N-by-12 character array, or a string array of length N when you set this combination of property values.

    N is the number of MSDUs to be aggregated.

    If you specify this property as an N-by-12 character array, or a string array of length N, the kth element contains the SA for the kth MSDU.

    If you specify this property as a 12-element character vector or string scalar, the object uses this address for all MSDUs.

Dependencies

To enable this property, set either of these combinations of property values.

Data Types: char | string

Frame sequence number, specified as an integer in the interval [0, 4095].

  • When the MPDUAggregation property is 1 (true), this property represents the sequence number of the first MAC protocol data unit (MPDU). The sequence numbers for subsequent MPDUs increase in increments of one.

  • When the FrameType property is "Block Ack", this property represents the starting sequence number.

Data Types: double

Traffic identifier representing user priority, specified as an integer in the interval [0, 7].

Data Types: double

Ack policy, specified as "No Ack", "Normal Ack/Implicit Block Ack Request", "No explicit acknowledgment/PSMP Ack/HTP Ack", or "Block Ack".

Data Types: string | char

HT control field of the MAC header, specified as an eight-element character vector or a string scalar representing a four-octet hexadecimal value. The leftmost byte in HTControl must be the most significant byte.

Data Types: string | char

Form aggregated MAC service data units (A-MSDUs) using MSDU aggregation, specified as a numeric or logical 1 (true) or 0 (false).

When you set this property to 1 (true), the MAC frame returned on calling wlanMACFrameConfig in the wlanMACFrame function contains A-MSDUs instead of MSDUs.

Dependencies

To enable this property, set the FrameType property to "QoS Data".

Data Types: logical

Form aggregated MAC protocol data units (A-MPDUs) using MPDU aggregation, specified as a numeric or logical 1 (true) or 0 ( false). To indicate that the MAC frame initialized by wlanMACMFrameConfig contains A-MPDUs instead of MPDUs, set this property to 1 (true).

When you set the FrameType to "QoS Data" and FrameFormat to "VHT", "HE-SU", "HE-EXT-SU", or "EHT-SU" the MAC frame returned on calling wlanMACFrameConfig in wlanMACFrame contains A-MPDUs instead of MPDUs.

Dependencies

To enable this property, these conditions must occur.

  • The FrameType property must be "QoS Data".

  • The FrameFormat property must be "HT-Mixed".

  • The Decoded property must be 0.

This property is applicable only for frame generation and does not apply in the decoded configuration.

Data Types: logical

DA or mesh DA of A-MSDU subframes, specified as one of these values.

  • A 12-element character vector or a string scalar representing a six-octet hexadecimal value when you set the MSDUAggregation property to 0 (false).

  • A 12-element character vector or string scalar, an N-by-12 character array, or a string array of length N when you set the MSDUAggregation property to 1 (true). N is the number of MSDUs to be aggregated.

    • If you specify this property as an N-by-12 character array, or a string array of length N, the kth element contains the DA or mesh DA for the kth MSDU

    • If you specify this property as a 12-element character vector or string scalar, the object uses this address for all MSDUs.

Data Types: char | string

SA or mesh SA of A-MSDU subframes, specified as one of these values.

  • A 12-element character vector or a string scalar representing a six-octet hexadecimal value when you set the MSDUAggregation property to 0 (false).

  • A 12-element character vector or string scalar, an N-by-12 character array, or a string array of length N when you set the MSDUAggregation property to 1 (true). N is the number of MSDUs to be aggregated.

    • If you specify this property as an N-by-12 character array, or a string array of length N, the kth element contains the SA or mesh SA for the kth MSDU

    • If you specify this property as a 12-element character vector or string scalar, the object uses this address for all MSDUs.

Data Types: char | string

Minimum spacing between the start of MPDUs, specified as an integer in the interval [0, 7]. For more information, see Table 9.163 in [1].

Dependencies

This property does not apply when the Decoded property is 1.

Data Types: double

Block ack bitmap, specified as a character vector or a string scalar containing 16, 64, 128, or 256 elements representing an 8, 32, 64, or 128 octet hexadecimal values, respectively. Bit-0 in the least significant octet corresponds to the MPDU with the starting sequence number.

Dependencies

This property applies only when you set the FrameType property to "Block Ack".

Data Types: char | string

Minimum time required to process a trigger frame, specified as 0, 8, or 16. Units are in microseconds.

Dependencies

This property applies only for frame generation and does not apply when the Decoded property is 1.

Data Types: double

End of current service period indication, specified as a numeric or logical 1 (true) or 0 ( false). To indicate the end of the current service period, set this property to 1 (true).

Dependencies

To enable this property, set the FrameType property to "QoS Data" or "QoS Null".

Data Types: logical

Mesh frame indication, specified as a numeric or logical 1 (true) or 0 ( false). To indicate that the frame originates from a mesh station in a mesh BSS, set this property to 1 (true).

Dependencies

To enable this property, set the FrameType property to "QoS Data" or "QoS Null".

Data Types: logical

Peer-specific mesh power management mode, specified as "Light" or "Deep".

Dependencies

To enable this property, set the PowerManagement and IsMeshFrame properties to 1 (true).

Data Types: logical

Mesh peer service initiation indication, specified as a numeric or logical 1 (true) or 0 (false). To initiate the mesh peer service period, set this property to 1 (true). For more information about the mesh peer service period, see section 14.14.9 of [1].

Dependencies

To enable this property, set the IsMeshFrame property to 1 (true).

Data Types: logical

Mesh time-to-live (TTL) value, specified as one of these values.

  • An integer in the interval [0, 255] when you set the MSDUAggregation and MPDUAggregation properties to 0 (false).

  • An integer or vector of integers in the interval [0, 255] when you set the MSDUAggregation or MPDUAggregation property to 1 (true).

    • If you specify this property as a vector, the kth element contains the mesh TTL value for the kth MSDU. The length of this vector must equal the number of MSDUs to be aggregated.

    • If you specify this property as a scalar, the object uses this value for all MSDUs.

Dependencies

To enable this property, set the IsMeshFrame property to 1 (true).

Data Types: double

Mesh sequence number that the source mesh station assigns to MSDUs, specified as one of these values.

  • An integer in the interval [0, 232 – 1] when you set the MSDUAggregation and MPDUAggregation properties to 0 (false).

  • An integer or vector of integers in the interval [0, 232 – 1] when you set the MSDUAggregation or MPDUAggregation property to 1 (true).

    • If you specify this property as a vector, the kth element contains the mesh sequence number for the kth MSDU. The length of this vector must equal the number of MSDUs to be aggregated.

    • If you specify this property as a scalar, the specified value represents the sequence number of the first MSDU and the object increases this value by one for each subsequent MSDU.

Dependencies

To enable this property, set the IsMeshFrame property to 1 (true).

Data Types: double

Number of additional address fields to include in the Mesh Control field, specified as 0, 1, or 2.

Dependencies

To enable this property, set the FrameType property to "QoS Data".

Data Types: double

DA, specified as one of these values.

  • A 12-element character vector or a string scalar representing a six-octet hexadecimal value when you set the MSDUAggregation and MPDUAggregation properties to 0 (false).

  • A 12-element character vector or string scalar, an N-by-12 character array, or a string array of length N when you set the MSDUAggregation or MPDUAggregation property to 1 (true). N is the number of MSDUs to be aggregated.

    • If you specify this property as an N-by-12 character array, or a string array of length N, the kth element contains the DA for the kth MSDU

    • If you specify this property as a 12-element character vector or string scalar, the object uses this address for all MSDUs.

Dependencies

To enable this property:

Data Types: char | string

SA, specified as one of these values.

  • A 12-element character vector or a string scalar representing a six-octet hexadecimal value when you set the MSDUAggregation and MPDUAggregation properties to 0 (false).

  • A 12-element character vector or string scalar, an N-by-12 character array, or a string array of length N when you set the MSDUAggregation or MPDUAggregation property to 1 (true). N is the number of MSDUs to be aggregated.

    • If you specify this property as an N-by-12 character array, or a string array of length N, the kth element contains the SA for the kth MSDU

    • If you specify this property as a 12-element character vector or string scalar, the object uses this address for all MSDUs.

Dependencies

To enable this property:

Data Types: char | string

Management frame-body configuration, specified as a wlanMACManagementConfig object. This property applies only to management frames. This property specifies the fields and information elements (IEs) present within the frame body of the management frame.

Dependencies

To enable this property, set the FrameType property to "Beacon".

Trigger frame-body configuration object, specified as a wlanMACTriggerConfig object.

Dependencies

To enable this property, set the FrameType property to "Trigger".

This property is read-only.

Trigger frame type, returned as one of these values.

  • "Basic" — Basic trigger frame

  • "MU-BAR" — Multi-user block ack request (MU-BAR) frame

  • "MU-RTS" — Multi-user request to send (MU-RTS) frame

Dependencies

To enable this property, set the FrameType property to "Trigger".

Data Types: char | string

This property is read-only.

Mesh control field indication, returned as a logical 0 or 1. When the frame body contains a Mesh Control field, the object returns this property as 1.

Data Types: logical

This property is read-only.

Decoded MPDU indication, returned as a logical 1 or 0. When the wlanMPDUDecode function creates this object as an output of the MPDU decoding process, this property is 1. Otherwise, this property is 0.

Data Types: logical

Examples

collapse all

Create a WLAN MAC frame configuration object, specifying a beacon MAC frame.

cfgMAC = wlanMACFrameConfig(FrameType="Beacon");

Enable the power saving mode and display the result.

cfgMAC.PowerManagement = true;
disp(cfgMAC)
  wlanMACFrameConfig with properties:

           FrameType: 'Beacon'
                ToDS: 0
              FromDS: 1
      Retransmission: 0
     PowerManagement: 1
            MoreData: 0
            Duration: 0
            Address1: 'FFFFFFFFFFFF'
            Address2: '00123456789B'
            Address3: '00123456789B'
      SequenceNumber: 0
    ManagementConfig: [1x1 wlanMACManagementConfig]

   Read-only properties:
             Decoded: 0

Generate the beacon frame.

beaconFrame = wlanMACFrame(cfgMAC);

Create a basic MAC trigger frame to carry information for two users.

Create a MAC trigger frame-body configuration object, specifying a channel bandwidth of 40 MHz.

cfgTrigger = wlanMACTriggerConfig(ChannelBandwidth="CBW40");

Create configuration objects for the User Info fields of the trigger frame.

cfgUser1 = wlanMACTriggerUserConfig(AID12=1, ...
    RUSize=242,RUIndex=1);
cfgUser2 = wlanMACTriggerUserConfig(AID12=2, ...
    RUSize=242,RUIndex=2);

Add the User Info fields to the trigger frame.

cfgTrigger = addUserInfo(cfgTrigger,cfgUser1);
cfgTrigger = addUserInfo(cfgTrigger,cfgUser2);

Configure the trigger frame by creating a MAC frame-body configuration object, specifying the frame type and the trigger frame-body configuration.

cfgMAC = wlanMACFrameConfig(FrameType="Trigger", ...
    TriggerConfig=cfgTrigger);

Specify a non-HT PHY configuration by creating a default non-HT configuration object.

cfgPHY = wlanNonHTConfig;

Create the MAC trigger frame and display its length.

[frame,frameLength] = wlanMACFrame(cfgMAC,cfgPHY);
disp(frameLength)
    40

References

[1] IEEE Std 802.11-2020 (Revision of IEEE Std 802.11-2016). “Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications.” IEEE Standard for Information Technology — Telecommunications and Information Exchange between Systems — Local and Metropolitan Area Networks — Specific Requirements.

[2] IEEE Std 802.11ax™-2021 (Amendment to IEEE Std 802.11-2020). “Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications. Amendment 1: Enhancements for High Efficiency WLAN.” IEEE Standard for Information Technology — Telecommunications and Information Exchange between Systems. Local and Metropolitan Area Networks — Specific Requirements.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2019b

expand all