The 802.11 MAC Sublayer Protocol
Introduction
Wireless Local Area Networks (WLANs) operate under the IEEE 802.11 standard, commonly known as WiFi. Unlike traditional wired LANs, WLANs utilize radio waves at high frequencies to establish connections between devices. WLAN users have the flexibility to move within the network's coverage area.
Within the OSI network model, the MAC sublayer of 802.11 serves as the physical layer, governing the logical link control sublayer and other higher levels. Its primary function is to define the frame formats and encapsulate data for transmission
MAC Sublayer frame of IEEE 802.11
The IEEE 802.11 standard outlines the structure of a wireless LAN frame at the MAC Sublayer.
- The first field, known as "Frame Control," comprises eleven subfields within two bytes. This field serves to convey essential frame control information.
- Following the Frame Control field is the "Duration" field, spanning two bytes, indicating the duration required for the frame and its acknowledgment on the channel.
- The address fields consist of the source address, destination address, and, where applicable, the BSSID (Basic Service Set Identifier). Each address field is six bytes long.
- The "Sequence Control" field, occupying two bytes, stores frame sequence numbers.
- Higher-level data is encapsulated within the "Data" field, which can vary in size. However, the maximum size of the data field is 2312 bytes.
- Error detection is facilitated by the "FCS" (Frame Check Sequence) field, which is four bytes long and is responsible for identifying errors in the frame.
Avoidance of Collisions by 802.11 MAC Sublayer
In wireless networks, the 802.11 MAC sublayer employs the Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) protocol to mitigate collisions. Unlike collision detection, which is ineffective in wireless environments, CSMA/CA operates as follows:
- When a station has a frame ready to transmit, it first senses the channel to determine if it's busy or idle.
- If the channel is idle, the station waits for a specified Inter-Frame Gap (IFG) before transmitting the frame.
- Once transmitted, the station waits for an acknowledgment (ACK) from the recipient. If the ACK is received within a specified time, the transmission is considered successful.
- If the channel is busy, the station defers its transmission and retries after a random back-off period.
- If no acknowledgment is received within a certain time frame or if collisions occur, the algorithm resets, and the station retries the transmission.
This protocol helps reduce the likelihood of collisions in wireless networks by allowing stations to sense the medium before transmitting and implementing back-off mechanisms to alleviate congestion.
The 802.11 MAC Sublayer's Coordination Features
Before transmission, the IEEE 802.11 MAC Sublayer utilizes two coordination functions to prevent collisions.
• One of its key responsibilities is the Distributed Coordination Function (DCF). • It is utilized in both Infrastructure BSS (Basic Service Set) and Independent BSS within wireless communication networks. This function is essential for distributed contention-based channel access and is a necessary component of CSMA/CA. • The Point Coordination Function (PCF) consists of three primary parts: msdt_li1, msdt_li2, and msdt_li3.
Regarding the Protocol Stack and Architecture of 802.16 Channels, data is scheduled to be transmitted from the base station to the subscriber through downlink channels.
Data Link Controls
The Data Link Layer provides the Data Link Control function to guarantee trustworthy data transport via the physical media. Data can only be sent by a single gadget at a time in half-duplex mode. At the link's end, concurrent data transmission from both devices results in information loss from collisions. Devices coordinate through the Data Link Layer to avoid these kinds of collisions.
The data connection layer provides three functions.
- Line discipline
- Flow Control
- Error Control
Line Discipline
Line discipline, which controls data transfer, is a component of the data link layer that allows cooperation across link systems. It chooses when to transfer data and what kind of device is best.
Developing Line Discipline may be done in two ways.
- ENQ/ACK
- Poll/choice
END/ACK.
The term END/ACK stands for Enquiry/Acknowledgment. It is employed when a special connection exists between two devices, and the intended recipient is the only device that can get the transmission. This is used when the wrong recipient is absent on the link.
In the END/ACK are the coordinates of the device that started the transmission and the recipient's state of readiness.
How End/Acceptance Works
The transmitter transmits an Enquiry (ENQ) frame to see if the receiver can receive the data.
In response, the recipient may provide an affirmative acknowledgement (ACK) to show that it is prepared to receive the transmission or a negative acknowledgement (NACK) to show that it cannot be accepted.
The responses that were given by the receiver are included below.
- If the ENQ is answered positively, the sender will proceed with the data transfer, concluding with transmitting an EOT (END-of-transfer) frame.
- If the ENQ is answered negatively, the sender terminates the connection and reopens the transmission later.
- The ENQ frame is deemed to have failed to transmit if the sender does not hear back from the recipient, whether positive or negative. Consequently, before opting to give up, the sender makes three attempts to create a connection.
Poll/Select
A primary station and several subsidiary stations in network topology can function together using the Poll/Select mechanism of the line discipline.
Polling and Selection Process Operation
- The primary device serves as the path for all communication, even when the intended receiver is a secondary device, due to one transmission line that links it to several secondary machines.
- One device controls the communication link, while the other follows its instructions.
- The main device, which grants entry to the communication channel, can be used to identify the initiation of a session.
- When a gadget asks another device if it has any data to send, it is known as polling.
- Selecting refers to preparing the secondary device to accept data from the original one.
Select
When the primary device has data to send, it uses the chosen mode.
Select (SEL) frames are sent by the primary device to the secondary device to start data transfer. Along with serving as a notice of the impending transmission, this frame contains the address of the targeted secondary device.
The secondary device confirms that it is ready after receiving the SEL frame.
The initial device sends two or more data frames to the specified secondary device if the latter is ready to accept the data. The secondary device acknowledges receipt of the data by sending a message following the transfer.
Poll
The primary device uses the Poll mode to get data from the secondary device.
When it wants to receive information, the primary device asks all linked devices whether they have any to send.
The first secondary device gets challenged for data by the primary poll. It signifies that there is no data available if it returns a NACK. The second backup device is next in line for the main poll.
It suggests it has data to send if it answers with an ACK. According to the protocol in utilization, the secondary device can send several consecutive frames, or it may be needed to broadcast an ACK before transmitting each frame.
Flow Control
A series of actions designed to notify the sender of the maximum data amount that may be sent while avoiding receiver overload.
The receiving device has limited speed and memory; therefore, before it reaches its limits, it must be able to alert the transmitting device to temporarily cease the communication.
A buffer is crucial because it gives the information that has to be processed a place to be stored.
For controlling the flow of information, two methods have been developed:
- Stop-and-wait
- Sliding window
Stop-and-wait
The sender uses the stop-and-wait strategy, which requires it to wait for a response before transmitting the next frame.
After getting an acknowledgement, the sender transmits another frame. Repeating this sending and receiving process continues until the sender sends the EOT (End of transmission) frame.
Advantages of implementing the stop-and-wait protocol's
This simple strategy, known as stop-and-wait, ensures that every frame is confirmed and confirmed before transmitting the next one.
Limitation with the stop-and-wait approach.
The stop-and-wait method is inefficient because every frame needs to travel the whole distance to the receiver, and an acknowledgement needs to travel back before the next frame is delivered. It follows that the entire link traversal time is used by each delivered and retrieved frame.
Sliding Window
- Using the Sliding Window flow control approach, a sender can transmit numerous frames before getting a response.
- Sliding Windows Control makes transmitting numerous consecutive frames possible, facilitating effective channel usage.
- An ACK can recognize several frames.
- The sliding window concept uses virtual containers on the sender and recipient sides.
- The window, which can store frames at both ends, establishes the maximum number of frames that can be sent before the acknowledgement.
- It is feasible to acknowledge frames even if they are not filled in.
- Since the window's frames have a value modulo-n, which goes from 0 to n-1, they are numbered.
- For example, the series of frames is 0 through 7 and then repeats if n = 8.
- It is possible to send up to n-1 frames before getting a response since the number n-1 represents the window size.
- The next frame the receiver wants to get is included in the ACK, along with its number. The receiver will send an ACK with the number 5 if, for example, it wishes to acknowledge the sequence of frames that contains frame number 4. When the sender receives the ACK with the number 5, it indicates that frames 0 through 4 have been successfully received.
Sender Window
- For the first transmission, the sender window has n-1 frames. The left window boundary moves inward during frame transmission, resulting in a reduction in window size. The remaining number of frames in the sender window will be w-3, for example, if the window size is w and three frames are transmitted.
- The sender window's increase upon acknowledgement shows the number of recognized frames.
- Let us take a scenario where a 7-size window was delivered with frames 0 through 4, and no acknowledgement was received. Only two frames, 5 and 6, are in the sender window.
- The sender window spans the following four frames if an ACK with the number 4 shows up, indicating that frames 0 through 3 arrived undamaged. Therefore, the six frames that make up the sender window are 5, 6, 7, 0, 1, and 2.
Receiver Window
- At the start of transmission, the receiver window has n-1 frames rather than n frames.
- The window gets smaller once the replacement frame arrives.
- The number of frames that can be acknowledged before an ACK message is transmitted is indicated by the size of the receiver window, not the number of frames that have been received.
- For example, if three frames arrive and the window size is indicated as "w," the number of accessible places in the window would be (w-3).
- When the acknowledgement is sent, the receiver window grows by a number equal to the acknowledged frames.
- The recipient window has seven frames, assuming a window size of 7. The boundary changes from 0 to 1, resulting in a decreased window size of six as soon as one frame is received. After two spaces remain after frames 0 through 4 have been communicated, the window size keeps getting smaller as frames are received. At that point, an acknowledgement has to be issued.
Error Control
Identifying errors and then retransmitting the data is known as error control.
Different Classes of Error Control
The ARQ protocol uses the stop-and-wait technique.
One approach is stop-and-wait ARQ, ensuring that missing or broken frames are transmitted again.
This method's fundamental principle is that before sending the subsequent frame, the sender will wait for the previous one to be acknowledged.
Four requirements are necessary for the retransmission to take place.
- Until the acknowledgement arrives, the sender holds onto a copy of the most recent frame. If the sender receives the frame incorrectly, they might send the data again due to this replication.
- The data and ACK frames are uniquely identifiable using an alternating numbering scheme of 0 and 1. The data 0 frame has arrived, and when the data 1 frame acknowledges its arrival, it verifies that it has arrived correctly and anticipates receiving the data 1.
- The receiver delivers an unnumbered NAK frame if there is a transmission error in the final frame. The sender replies with the data after getting this frame.
- Using a timer, the system assumes that a frame disappeared during transmission and will retransmit it if no acknowledgement is received within the specified time limit.
When it comes to retransmission, there are two scenarios to consider:
If the receiver detects a broken or incorrect frame, it sends a Negative Acknowledgement (NAK) frame. For instance, after sending the data 0 frame, if the receiver acknowledges it with an ACK 1 frame, indicating successful reception, the sender proceeds to transmit the data 1 frame. Subsequently, upon receiving an undamaged data 1 packet, the recipient sends an ACK 0, signaling readiness for the next frame containing data 0. However, if the receiver encounters errors and returns a NAK frame, the sender is obliged to resend the data 0 frame.
Upon sending a frame, the sender initiates a timer and awaits acknowledgment. Occasionally, due to various factors, the frame might not reach the recipient, resulting in a lack of acknowledgment, whether positive or negative. In such cases, the sender waits for the timer to expire. Upon timeout, the sender promptly resends the most recent frame.
ARQ with Sliding Window
The technique known as Sliding Window ARQ is used to keep error control during continuous transmission.
Three attributes are employed to facilitate retransmission.
- In this case, the sender has to hold on to all of the frames they sent until they receive back.
- For example, the sender needs to keep onto replicas of frames 3 and 4 until they have been effectively obtained if frames 0 through 4 have been delivered and the acknowledgement for frame 2 is the last one received.
- In some situations, the receiver may send an ACK or a NAK. The sender is notified that an NAK frame has corrupted the data received. Numbering of the ACK and NAK frames is necessary to identify a frame since the sliding window operates as a continuous transmission method. A number indicates which frame the receiver expects to receive next in the ACK frame, while a number indicates which frame is damaged in the NAK frame.
To manage lost confirmations, the sliding window ARQ protocol has a timer. The sender begins with a timer and waits for a response before transmitting the next n-1 frames if no acknowledgement is received after n-1 frames have been sent. The sender will retrieve one or more frames depending on the protocol if the timeout expires.
Sliding window ARQ uses a few different techniques.
If an adequate acknowledgement is not obtained, the Go-Back-N ARQ protocol entails sending all subsequent frames again after a lost or damaged frame.
Retransmission can have one of three possible results.
- The receiver sends a NAK frame when it receives a damaged frame.
Three frames were transmitted, and the figure indicates that the third had an error. Frames 0 and 1 had been correctly received, as verified by ACK 2. Nonetheless, a NAK 2 frame was transmitted when the receiver saw a mistake in frame 2. Frame 3, which was sent following the damaged frame, was thus also returned. Thus, frames 2 and 3 had to be resent by the sender.
- Data frames are sent using sliding window protocols one after the other. The receiver receives subsequent frames out of sequence if a frame is lost. To fix this problem, the receiver sends an NAK for the missing frame after determining which was skipped by looking up each frame's sequence number.
- After that, the transmitting device delivers the missing frame and all subsequent frames again. Senders are not required to wait for acknowledgement to transmit frames up to the window limit. When the window capacity is reached—if the acknowledgement is lost—the sender's timer starts to count. Retransmitting the frame since the last ACK occurs if the acknowledgement is not received in the allotted period.
ARQ with Selective-Reject feature
- Regarding performance, the Go-Back-n ARQ strategy is less effective than the Selective-Reject ARQ method.
- Only frames that have received a negative acknowledgement (NAK) are eligible for the retransmission procedure under this method.
- Till the erroneous frame is accurately obtained, all defective frames are stored in the receiver's storage buffer.
- The receiver must have the appropriate logic to reinsert the frames in the right order.
- The search strategy employed by the sender needs to choose only the intended frame that has to be resent.