This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

wlanMACFrame

Generate WLAN MAC frame (MPDU or A-MPDU)

Syntax

[frame,frameLength] = wlanMACFrame(macConfig)
[frame,frameLength] = wlanMACFrame(payload,macConfig)
[frame,frameLength] = wlanMACFrame(payload,macConfig,phyConfig)

Description

example

[frame,frameLength] = wlanMACFrame(macConfig) generates a WLAN medium access control (MAC) frame, frame, for the input MAC frame format configuration, macConfig. The generated MAC frame is a MAC protocol data unit (MPDU) or aggregated MPDU (A-MPDU).

example

[frame,frameLength] = wlanMACFrame(payload,macConfig) generates a WLAN MAC frame containing the input MAC service data unit (MSDU) payload. For the MAC frame to contain the payload, the Frametype property of macConfig must be set to 'Data' or 'QoS Data'. Otherwise, payload is ignored.

example

[frame,frameLength] = wlanMACFrame(payload,macConfig,phyConfig) generates a WLAN MAC frame for the specified physical layer (PHY) format configuration, phyConfig. Use this syntax to generate aggregated frames.

Examples

collapse all

Create a wlanMACFrameConfig object for an RTS frame, then generate the RTS MAC frame.

macConfig = wlanMACFrameConfig('FrameType','RTS');
[macFrame,frameLength] = wlanMACFrame(macConfig)
macFrame = 20x2 char array
    'B4'
    '00'
    '00'
    '00'
    'FF'
    'FF'
    'FF'
    'FF'
    'FF'
    'FF'
    '00'
    '12'
    '34'
    '56'
    '78'
    '9B'
    'A7'
    '9A'
    '5B'
    '28'

frameLength = 20

Generate a quality of service (QoS) WLAN MAC frame with a specified payload.

macConfig = wlanMACFrameConfig('FrameType','QoS Data');
[macFrame,frameLength] = wlanMACFrame('00576000103afffe80',macConfig)
macFrame = 39x2 char array
    '88'
    '02'
    '00'
    '00'
    'FF'
    'FF'
    'FF'
    'FF'
    'FF'
    'FF'
    '00'
    '12'
    '34'
    '56'
    '78'
    '9B'
    '00'
    '12'
    '34'
    '56'
    '78'
    '9B'
    '00'
    '00'
    '20'
    '00'
    '00'
    '57'
    '60'
    '00'
    '10'
    '3A'
    'FF'
    'FE'
    '80'
    '8E'
    '2A'
    '43'
    '13'

frameLength = 39

Create MAC and physical layer (PHY) configuration objects, which are required to generate a High-Throughput (HT)-format aggregated MAC protocol data unit (A-MPDU).

macConfig = wlanMACFrameConfig('FrameType','QoS Data','FrameFormat','HT-Mixed', ...
                                       'MPDUAggregation',true);
phyConfig = wlanHTConfig('MCS',4);

Generate an HT-format A-MPDU containing the specified MAC service data unit (MSDU) payloads.

[macFrame,frameLength] = wlanMACFrame({'00576000103afffe80', ...
                                    '020000fffe00001ff0', ...
                                    '002c0b0fffe000001f'},macConfig,phyConfig);

Display the frame length.

frameLength
frameLength = 131

Create a wlanMACManagementConfig configuration object, specifying the SSID as 'demo SSID'.

mgmtConfig = wlanMACManagementConfig('SSID','demo SSID');

Create a wlanMACFrameConfig configuration object, specifying the management frame-body configuration object as mgmtConfig and a beacon MAC frame.

macConfig = wlanMACFrameConfig('FrameType','Beacon','ManagementConfig',mgmtConfig);

Generate the beacon MAC frame with the specified SSID.

[macFrame,frameLength] = wlanMACFrame(macConfig);

Display the frame length.

frameLength
frameLength = 56

Input Arguments

collapse all

MAC frame configuration object, specified as a wlanMACFrameConfig object. This object defines the type of MAC frame and its applicable properties. For more information, see wlanMACFrameConfig Properties.

One or more MSDUs, specified as a character vector, string, vector, or cell array. The value you specify depends on whether the frame is aggregated.

  • For nonaggregated frames, specify payload as a single MSDU. You can specify payload as a character vector or string of octets represented in hexadecimal format.or as a numeric vector of octets in decimal format.

  • For aggregated frames, specify payload as multiple MSDUs. You can specify payload as a cell array of character vectors, a string array, or a cell array of numeric vectors. Each element of the specified cell array or string array represents an MSDU.

Data Types: double | uint8 | char | string | cell

PHY format configuration object, specified as an object of type wlanHESUConfig, wlanVHTConfig, or wlanHTConfig. The PHY format configuration object must be compatible with the frame format specified in macConfig. If macConfig.FrameFormat is 'HE-SU' or 'HE-EXT-SU', then phyConfig must be specified as a wlanHESUConfig object. If macConfig.FrameFormat is 'VHT', then phyConfig must be specified as a wlanVHTConfig object. If macConfig.FrameFormat is 'HT-Mixed', then phyConfig must be specified as a wlanHTConfig object. Specify phyConfig to

  • ensure that the frame does not exceed the transmission time limit;

  • add end of frame (EOF) padding in VHT or HE format frames; and

  • maintain minimum start spacing between MPDUs in an A-MPDU.

Output Arguments

collapse all

Generated MPDU or A-MPDU MAC frame, returned as a character array where each row is the hexadecimal representation of an octet.

Length of the generated MAC frame, returned as scalar double in octets. For VHT-format and HE-frormat A-MPDUs, frameLength is the A-MPDU pre-EOF padding (APEP length), which is less than or equal to the length of frame. In all other cases, frameLength is the physical layer service data unit (PSDU) length.

References

[1] 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. URL: https://ieeexplore.ieee.org/document/7786995/

[2] IEEE P802.11ax™/D3.1. “Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications. Amendment 6: 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™.

Introduced in R2018b