1. 程式人生 > >WLAN 知識整理 - 01 MSDU 和 A-MSDU

WLAN 知識整理 - 01 MSDU 和 A-MSDU

What's MSDU

        MSDU is the data payload that contains the IP packet plus some LLC data.  

        Management and control frames do not have an MSDU payload, and therefore their final destination is never the distribution system (DS). Management and control exist only at the MAC sublayer and therefore have no need to be translated by the integration service (IS) and never are delivered to the distribution system service (DSS).

01-1 MSDU.jpg

        The 802.11-2007 standard states that the maximum size of the MSDU is 2,304 bytes. The maximum frame body size is determined by the maximum MSDU size (2,304 octets) plus any overhead from encryption.

One of the differences between 802.3 Ethernet and 802.11 wireless frames is the frame size. 802.3 frames have a maximum size of 1,518 bytes with a maximum data payload of 1,500 bytes. If the 802.3 frames are 802.1Q tagged for VLANs and user priority, the maximum size of the 802.3 frame is 1,522 bytes with data payload of 1,504 bytes. As you have just learned, 802.11 frames are capable of transporting frames with a MSDU payload of 2,304 bytes of  upper-layer data. This means that as the data moves between the wireless and the wired network, the access point may receive a data frame that is too large for the wired network. This is rarely a problem thanks to the TCP/IP protocol suite. TCP/IP, the most common communications protocol used on networks, typically has an IP maximum transmission unit (MTU) size of 1,500 bytes. IP packets are usually 1,500 bytes based on the MTUs. When the IP packets are passed down to 802.11, even though the maximum size of the MSDU is 2,304 bytes, the size will be limited to the 1,500 bytes of the IP packets.

        The WEP initialization vector (IV) adds 4 octets, and the integrity check value (ICV) also adds 4 octets. When WEP is enabled, the entire size of the body inside an 802.11 data frame is expanded by 8 bytes to a maximum of 2312 bytes. In other words, WEP encryption adds 8 bytes of overhead to the frame body of an 802.11 data frame.

        When TKIP is enabled, the entire size of the frame body inside an 802.11 data frame is expanded by 20 bytes to a maximum of 2,324 bytes. In other words, TKIP encryption adds 20 bytes of overhead to an 802.11 MPDU.

        The overhead that results from CCMP encryption includes the CCMP header (8 bytes) and the MIC (8 bytes). When CCMP is enabled, the entire size of the frame body inside an MPDU is expanded by 16 bytes to a maximum of 2,320 bytes. In other words, CCMP encryption adds 16 bytes of overhead to an 802.11 data frame.

01-3 MSDU Framebody.jpg


MSDU Fragment 

        802.11 stations can be configured with a fragmentation threshold. If the fragmentation threshold is set at 300 bytes, any MSDU larger than 300 bytes will be fragmented. Let’s take a look at how a station using a 300-byte fragmentation threshold (the minimum is 256 bytes) will fragment and sequence a 1,200-byte MSDU.

The first fragment to be transmitted will be fragment #0, and the More Fragments bit in the Frame Control field will be set to 1. The More Fragments bit will stay set to 1 until the last fragment, at which time it will change to 0, indicating that there are no more fragments. The fragment number will increment by 1, starting at 0, until the last frame. The sequence number will remain unchanged throughout the fragment burst. Notice that the unencrypted MPDU, which includes the MAC header, frame body, and CRC, must not exceed the fragmentation threshold. Fragmentation does not take into account frame body expansion due to encryption; thus encrypted fragments may exceed the fragmentation threshold size. Since the unencrypted MPDU cannot exceed the fragmentation threshold, the size of the header and CRC must be taken into account when deciding how much of the original MSDU can be placed into the frame body of a fragment. In this case, we’re using a 24-byte non-QoS header (all header fields except address 4) and a 4-byte CRC. Since 300 – 28 = 272, the first four data fragments will carry 272 bytes of the original 1200-byte MSDU.

01-2 MSDU Fragment.jpg


What's A-MSDU

        Frame aggregation allows multiple smaller MSDUs to be grouped together into a single frame, reducing the amount of overhead that would have been necessary for each individual frame. A-MSDU is an aggregation process that combines multiple MSDUs within a single MPDU

        The 802.11n-2009 HT amendment defines a frame aggregation method called Aggregate MAC Service Data Unit (A-MSDU). An 802.11n station using this method of aggregation can have a frame body with a maximum A-MSDU size (3839 or 7935 bytes, depending upon the STA's capability), plus any overhead from encryption. 

        With A-MSDU, two or more MSDUs are placed in an MPDU, and a single MAC and PHY layer header is added to the group of MSDUs. If encryption is enabled, then all the MSDUs are encrypted together as a single payload. There are some restrictions for aggregating multiple MSDUs into a single MPDU. The MPDU can only contain MSDUs where the DA and SA values map to the same RA and TA values. All of the MSDUs must also have the same priority value(QoS).

01-4 A-MSDU.jpg


Comparation

01-5 Compare.jpg