Introduction

In 1997 the IEEE adopted IEEE Std. 802.11-1997, the first wireless LAN (WLAN) standard. This standard defines the media access control (MAC) and physical (PHY) layers for a LAN with wireless connectivity. It addresses local area networking where the connected devices communicate over the air to other devices that are within close proximity to each other.

The IEEE 802.11 Wireless LAN Architecture

The 802.11 architecture is comprised of several components and services that interact to provide station mobility transparent to the higher layers of the network stack.

Wireless LAN Station
The station (STA) is the most basic component of the wireless network. A station is any device that contains the functionality of the 802.11 protocol, that being MAC, PHY, and a connection to the wireless media. Figure 1 shows the model map for IEEE 802.11 standards.

Figure 1 - IEEE 802.11 standards mapped to the OSI reference model.

IEEE 802.11 standards mapped to the OSI reference model.

Basic Service Set (BSS)
802.11 defines the Basic Service Set (BSS) as the basic building block of an 802.11 wireless LAN. The BSS consists of a group of any number of stations.

802.11 Media Access Control (MAC)

The 802.11 MAC layer provides functionality to allow reliable data delivery for the upper layers over the wireless PHY media. The data delivery itself is based on an asynchronous, best-effort, connectionless delivery of MAC layer data. There is no guarantee that the frames will be delivered successfully.

The 802.11 MAC provides a controlled access method to the shared wireless media called Carrier-Sense Multiple Access with Collision Avoidance (CSMA/CA). CSMA/CA is similar to the collision detection access method deployed by 802.3 Ethernet LANs.

The third function of the 802.11 MAC is to protect the data being delivered by providing security and privacy services. Security is provided by the authentication services and by Wireless Equivalent Privacy (WEP), which is an encryption service for data delivered on the WLAN.

802.11 MAC Frame Format

To meet the challenges posed by a wireless data link, the MAC was forced to adopt several unique features including the use of four address fields. Not all frames use all the address fields, and the values assigned to the address fields may change depending on the type of MAC frame being transmitted. Figure 2  shows the generic 802.11 MAC frame.  Fields are transmitted from left to right.

Figure 2. Generic 802.11 MAC frame

In this project, we only deal with one data frame type data and three control frame types RTS, CTS and ACK, as discussed bellow.

Data

Data frames carry higher-level protocol data in the frame body. Figure 3 shows a generic data frame. Depending on the particular type of data frame, some of the fields in the figure may not be used. We are dealing with Data frame with frame subtype 0000.  

Figure 3. Generic data frame

Note the maximum body length specified by IEEE 802.11 is 2312 bytes. To reduce schematic and layout work and simplify testing, we make the assumption that all body is 16 bytes in length, which, however, does not loss the generality to demonstrate the function of MAC.

Request to Send (RTS)

RTS frames are used to gain control of the medium for the transmission of "large" frames, in which "large" is defined by the RTS threshold in the network card driver. Access to the medium can be reserved only for unicast frames; broadcast and multicast frames are simply transmitted. The format of the RTS frame is shown in Figure 4. Like all control frames, the RTS frame is all header. No data is transmitted in the body, and the FCS immediately follows the header. In the Frame Control field, The frame subtype is set to 1011 to indicate an RTS frame. Address 1 is set as Receiver Address, which is the address of the station that is the intended recipient of the large frame. Address 2 is set as Transmitter Address, the address of the sender of the RTS frame.

Figure 4. RTS frame

Clear to Send (CTS)

The CTS frame, whose format is shown in Figure 5, has two purposes. Initially, CTS frames were used only to answer RTS frames, and were never generated without a preceding RTS. CTS frames were later adopted for use by the 802.11g protection mechanism to avoid interfering with older stations. Frame Control, Duration and Address 1 make up the MAC header of a CTS frame. The frame subtype is set to 1100 to indicate a CTS frame and Address 1 is set as Receiver Address.

Figure 5. CTS frame

Acknowledgment (ACK)

ACK frames are used to send the positive acknowledgments required by the MAC and are used with any data transmission, including plain transmissions, frames preceded by an RTS/CTS handshake, and fragmented frames (see Figure 6). Frame Control, Duration and Address 1 make up the MAC header of a ACK frame. The frame subtype is set to 1101 to indicate an ACK frame and Address 1 is set as Receiver Address.

Figure 6. ACK frame