wlanMACFrameConfig
Configure WLAN MAC frame
Description
The wlanMACFrameConfig
object configures an IEEE®
802.11™ medium access control (MAC) frame.
Creation
Description
creates a WLAN
MAC frame configuration object with default property values.cfgMAC
= wlanMACFrameConfig
sets properties of cfgMAC
= wlanMACFrameConfig(Name=Value
)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.
Properties
FrameType
— Type of frame
"Beacon"
(default) | "RTS"
| "CTS"
| "ACK"
| "Block Ack"
| "CF-End"
| "Trigger"
| "Data"
| "Null"
| "QoS Data"
| "QoS Null"
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
FrameFormat
— Format of frame
"Non-HT"
(default) | "HT-Mixed"
| "VHT"
| "HE-SU"
| "HE-EXT-SU"
| "EHT-SU"
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.
Data Types: char
| string
ToDS
— Frame is directed to DS
false
or 0
(default) | true
or 1
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
FromDS
— Frame is exiting DS
true
or 1
(default) | false
or 0
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
Retransmission
— Retransmitted frame
false
or 0
(default) | true
or 1
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
PowerManagement
— Power management mode
false
or 0
(default) | true
or 1
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
MoreData
— More data indication
false
or 0
(default) | true
or 1
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
ProtectedFrame
— Protected frame indication
false
or 0
(default) | true
or 1
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
HTControlPresent
— Frame includes HT control field
false
or 0
(default) | true
or 1
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
Duration
— Amount of time for which channel is reserved
0
(default) | integer in the interval [0, 215 – 1]
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
Address1
— Receiver address
"FFFFFFFFFFFF"
(default) | 12-element character vector | string scalar
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
Address2
— Transmitter address
"00123456789B"
(default) | 12-element character vector | string scalar
Transmitter address, specified as a 12-element character vector or a string scalar representing a six-octet hexadecimal value.
Data Types: char
| string
Address3
— BSSID, DA, or SA
"00123456789B"
(default) | 12-element character vector | string scalar
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.
Data Types: char
| string
Address4
— SA or BSSID
"00123456789B"
(default) | 12-element character vector | character array | string scalar | string array
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
andMPDUAggregation
properties to0
(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.
Either of the
MSDUAggregation
orMPDUAggregation
properties to1
(true
).The
IsMeshFrame
property to1
(true
).The
FrameType
property to"QoS Data"
.The
ToDS
property to0
(false
).The
FromDS
property to1
(true
).The
AddressExtensionMode
property to1
.
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.
Set the
FrameType
property to"QoS Data"
or"QoS Null"
and theToDS
andFromDS
properties to1
(true
).Set the
IsMeshFrame
property to1
(true
), theFrameType
property to"QoS Data"
, theToDS
property to0
(false
), theFromDS
property to1
(true
), and theAddressExtensionMode
property to1
.
Data Types: char
| string
SequenceNumber
— Frame sequence number
0
(default) | integer in the interval [0, 4095]
Frame sequence number, specified as an integer in the interval [0, 4095].
When the
MPDUAggregation
property is1
(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
TID
— Traffic identifier representing user priority
0
(default) | integer in the interval [0, 7]
Traffic identifier representing user priority, specified as an integer in the interval [0, 7].
Data Types: double
AckPolicy
— Ack policy
"No Ack"
(default) | "Normal Ack/Implicit Block Ack Request"
| "No explicit acknowledgment/PSMP Ack/HTP Ack"
| "Block Ack"
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
HTControl
— HT control field of MAC header
"00000000"
(default) | eight-element character vector | string scalar
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
MSDUAggregation
— Form A-MSDUs using MSDU aggregation
false
or 0
(default) | true
or 1
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
MPDUAggregation
— Form A-MPDUs using MPDU aggregation
false
or 0
(default) | true
or 1
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 be0
.
This property is applicable only for frame generation and does not apply in the decoded configuration.
Data Types: logical
AMSDUDestinationAddress
— DA or mesh DA of A-MSDU subframes
"00123456789A"
(default) | 12-element character vector | character array | string scalar | string array
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 to0
(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 to1
(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
AMSDUSourceAddress
— SA or mesh SA of A-MSDU subframes
"00123456789B"
(default) | 12-element character vector | character array | string scalar | string array
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 to0
(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 to1
(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
MinimumMPDUStartSpacing
— Minimum spacing between start of MPDUs
0
(default) | integer in the interval [0, 7]
BlockAckBitmap
— Block ack bitmap
"FFFFFFFFFFFFFFFF"
(default) | character vector | string scalar
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
MinTriggerProcessTime
— Minimum time required to process trigger frame
0
(default) | 8
| 16
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
EOSP
— End of current service period indication
false
or 0
(default) | true
or 1
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
IsMeshFrame
— Mesh frame indication
false
or 0
(default) | true
or 1
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
SleepMode
— Peer-specific mesh power management mode
"Light"
(default) | "Deep"
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
ReceiveServicePeriodInitiated
— Mesh peer service initiation indication
false
or 0
(default) | true
or 1
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
MeshTTL
— Mesh TTL value
31
(default) | integer in the interval [0, 255] | vector of integers in the interval [0, 255]
Mesh time-to-live (TTL) value, specified as one of these values.
An integer in the interval [0, 255] when you set the
MSDUAggregation
andMPDUAggregation
properties to0
(false
).An integer or vector of integers in the interval [0, 255] when you set the
MSDUAggregation
orMPDUAggregation
property to1
(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
MeshSequenceNumber
— Mesh sequence number
0
(default) | integer in the interval [0, 232–1] | vector of integers in the interval [0, 232–1]
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
andMPDUAggregation
properties to0
(false
).An integer or vector of integers in the interval [0, 232 – 1] when you set the
MSDUAggregation
orMPDUAggregation
property to1
(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
AddressExtensionMode
— Number of additional address fields
0
(default) | 1
| 2
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
Address5
— DA
"00123456789A"
(default) | 12-element character vector | character array | string scalar | string array
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
andMPDUAggregation
properties to0
(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
orMPDUAggregation
property to1
(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:
Set the
FrameType
property to"QoS Data"
.Set the
AddressExtensionMode
property to2
.Set the
IsMeshFrame
property to1
(true
).
Data Types: char
| string
Address6
— SA
"00123456789B"
(default) | 12-element character vector | character array | string scalar | string array
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
andMPDUAggregation
properties to0
(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
orMPDUAggregation
property to1
(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:
Set the
FrameType
property to"QoS Data"
.Set the
AddressExtensionMode
property to2
.Set the
IsMeshFrame
property to1
(true
).
Data Types: char
| string
ManagementConfig
— Management frame-body configuration
wlanMACManagementConfig
object
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"
.
TriggerConfig
— Trigger frame-body configuration
wlanMACTriggerConfig
object
Trigger frame-body configuration object, specified as a wlanMACTriggerConfig
object.
Dependencies
To enable this property, set the FrameType
property to "Trigger"
.
TriggerType
— Trigger frame type
"Basic"
| "MU-BAR"
| "MU-RTS"
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
HasMeshControl
— Mesh Control field indication
0
| 1
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
Decoded
— Decoded MPDU indication
0
| 1
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
Generate a Beacon MAC Frame With Power Saving Mode
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 Basic MAC Trigger Frame
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 R2019bR2024b: Generate and decode CF-End control frames
You can now generate and decode Contention Free-End (CF-End) control frames. To use this
feature, specify the FrameType
property as "CF-End"
.
See Also
Functions
Objects
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)