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.

wlanMSDULengths

Calculate MSDU lengths

Syntax

msduLengths = wlanMSDULengths(frameLength,macConfig)
msduLengths = wlanMSDULengths(frameLength,macConfig,phyConfig)

Description

example

msduLengths = wlanMSDULengths(frameLength,macConfig) returns a vector, msduLengths, of MAC service data unit (MSDU) lengths for MAC frame length frameLength and configuration macConfig. The function calculates the MSDU lengths by removing the overhead of MAC headers, frame check sequence (FCS), and subframe overheads (if applicable).

example

msduLengths = wlanMSDULengths(frameLength,macConfig,phyConfig) returns MSDU lengths for the specified physical layer (PHY) format configuration object phyConfig. Use this syntax to return MSDU lengths for aggregated MAC protocol data units (A-MPDUs).

Examples

collapse all

Generate a QoS Data frame of length 2000 octets.

Create a MAC frame configuration object.

macConfig = wlanMACFrameConfig('FrameType','QoS Data');

Calculate the MSDU lengths required to generate a 2000 octet QoS data frame.

msduLen = wlanMSDULengths(2000,macConfig)
msduLen = 1970

Create a random payload of the obtained MSDU length.

msdu = randi([0 255],1,msduLen);

Generate the 2000 octet QoS data frame.

[macFrame, frameLength] = wlanMACFrame(msdu,macConfig);
frameLength
frameLength = 2000

Generate an HT format A-MPDU frame of length 5000 octets.

Create a MAC frame configuration object.

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

Create a PHY configuration object.

phyConfig = wlanHTConfig('MCS',4);  

Calculate the MSDU lengths required to generate a 5000 octets A-MPDU frame.

msduLen = wlanMSDULengths(5000,macConfig,phyConfig)
msduLen = 1×3

        2302        2302         294

Create MSDUs with random data using the obtained MSDU length vector.

 numMSDUs = numel(msduLen);
 msduList = cell(1,numMSDUs);
  for i = 1:numMSDUs
      msduList{i} = randi([0 255],1,msduLen(i));
  end

Generate a 5000 octets A-MPDU frame.

[macFrame, frameLength] = wlanMACFrame(msduList,macConfig,phyConfig);
frameLength
frameLength = 5000

Input Arguments

collapse all

Total length of the MAC frame (MPDU or A-MPDU length), specified as a positive integer in the interval [28, 6500631]. For a VHT-format or HE-format frame, this length is the A-MPDU pre-EOF padding (APEP) length. For other formats, it is the PSDU length. The maximum value depends on the MAC and PHY configuration.

Note

APEP length is always a multiple of four octets due to final subframe padding. If you do not specify frameLength as a multiple of four octets for a VHT or HE frame, the function rounds it to the nearest multiple of four.

Data Types: double

MAC frame configuration, specified as a wlanMACFrameConfig object. This object defines the type of MAC frame and its applicable properties.

PHY format configuration object, specified as an object of type wlanHTConfig, wlanVHTConfig, or wlanHESUConfig. 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 this value to

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

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

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

Output Arguments

collapse all

MSDU lengths for a given MAC frame length and configuration, returned as a vector of integers. Each element corresponds to the length of the MSDU. The number of elements in vector corresponds to the number of MSDUs.

Data Types: double

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