Wireless networks have become an integral part of our lives, enabling communication between devices without the use of physical cables. However, behind the apparent simplicity of the connection lies a complex mechanism that coordinates data transmission over the air, where there is no central controller, as in wired networks.
The key element of this architecture is the data link layer of the OSI model, which in the IEEE 802.11 standards is divided into two sublayers: logical link control (LLC) and medium access control (MAC). MAC sublayer takes on the main work of organizing the airwaves, preventing collisions and ensuring packet delivery.
Understanding how this mechanism works is essential for properly diagnosing connection speed and stability issues. Unlike wired Ethernet, where devices can transmit data virtually simultaneously, Wi-Fi requires strict discipline, which is ensured by MAC protocol.
The main task of the MAC sublayer in wireless networks
The main function of the sublevel MAC (Media Access Control) The purpose of this technology is to manage access of multiple devices to a shared radio environment. Since radio waves propagate in all directions, simultaneous data transmission by multiple clients would result in signal interference and loss of information, which is known as a collision.
To solve this problem, the carrier sense multiple access with collision avoidance method is used, or CSMA/CAUnlike wired networks, where collisions are detected after the fact, Wi-Fi systems attempt to prevent them even before transmission begins.
⚠️ Caution: In conditions of strong electromagnetic noise or in the presence of a large number of neighboring networks, the CSMA/CA algorithm can significantly reduce the actual channel throughput, increasing latency.
The MAC sublayer is also responsible for structuring the frame, adding the necessary headers and checksums. This allows the receiving party to understand who the data is addressed to and verify its integrity upon receipt.
CSMA/CA mechanism and collision avoidance
Algorithm CSMA/CA is the foundation of wireless network stability. Before transmitting, any device, whether a smartphone or a router, must "listen" to the airwaves. If the channel is busy, the device waits a random amount of time to avoid synchronous startup with other clients.
This process involves the use of time intervals and acknowledgment mechanisms. If a device does not receive confirmation of successful frame receipt, it initiates an exponential backoff procedure, increasing the wait time before retrying.
It is important to distinguish between virtual and physical listening of a channel:
- 📡 Physical listening analyzes the signal level at the antenna, determining whether the frequency is occupied.
- 💻 Virtual listening uses information from frame headers about the duration of the upcoming broadcast, reserving the airtime.
- ⏱️ SIFS and DIFS intervals regulate access priority for different types of traffic.
- 🔄 Random backoff prevents repeated collisions under high load.
This approach ensures that even in densely populated areas with dozens of networks, devices will be able to find a window to transmit their data, albeit with some delay.
802.11 Frame Structure and Addressing
The MAC sublayer creates a special data container known as a frame. The Wi-Fi frame structure is significantly more complex than that of wired Ethernet, as it must support mobility and roaming.
The frame header contains up to four addressing fields. This is necessary for operation in access point and bridge modes, where it is necessary to distinguish between the sender's address, the recipient's address, the current access point, and the distribution system.
The main components of the frame include:
- 🏷️ A frame control field that defines the message type and subtype.
- 📍 Addressing fields (Address 1-4) for routing within the BSS.
- 🔢 Sequence field for controlling the order of fragments.
- 🛡️ Checksum field (FCS) for error checking.
It is thanks to this structure that the network knows where to deliver the packet, even if the client moves between access points, keeping the connection active.
Data fragmentation and collection
In a wireless environment, signal quality can fluctuate dramatically due to obstacles or interference. To prevent large amounts of data from siloing the airwaves for long periods of time or being completely lost due to errors, the MAC sublayer uses fragmentation.
Large data packets are broken into smaller fragments, which are transmitted sequentially. Each fragment must be acknowledged with a separate ACK frame. If an acknowledgment is not received, only the lost fragment is retransmitted, not the entire original packet.
| Parameter | Description | Impact on the network |
|---|---|---|
| Fragment size | Limit of package size before splitting | Smaller size improves reliability but increases overhead |
| RTS threshold | Frame size to enable redundancy | Reduces collisions for large files, but adds latency |
| Beacon Interval | Service beacon frequency | Affects network detection speed and power saving |
| DTIM Period | Buffered data delivery interval | Determines how often sleeping devices should wake up. |
Adjusting the fragmentation threshold and RTS (Request to Send) is a subtle optimization tool. In stable networks with a good signal, these mechanisms can be disabled or set to higher values to improve speed.
Why does fragmentation reduce speed under ideal conditions?
With a perfect signal, the overhead of the headers of each small fragment and waiting for ACKs eats up the useful bandwidth that could be used to transmit one large frame.
Customer energy management
Mobile devices operate on batteries, and constant radio activity quickly drains the battery. The MAC sublayer implements power-saving mechanisms, allowing devices to enter sleep mode.
In this mode, the client turns off the receiver and periodically wakes up to check for data in the access point's buffer. The access point accumulates traffic and reports its presence in beacon frames.
⚠️ Warning: Aggressive power saving settings on client devices may result in increased latency and connection drops when actively using VoIP or online gaming.
There are various power saving classes, including U-APSD, which allow the device to sleep longer, waking only on a schedule or event. This is critical for IoT devices such as smart home sensors.
Security and access management
In addition to data delivery, the MAC sublayer is responsible for primary connection security. It implements authentication and association processes, without which the device cannot transmit useful traffic.
It is at this level that encryption protocols operate. WPA2 And WPA3After a successful handshake (4-way handshake), the MAC sublayer manages encryption keys for each frame.
The main stages of connecting a client:
- 🔍 Scanning channels and searching for networks (Probe Request/Response).
- 🤝 Authentication and access rights verification.
- 🔑 Association and negotiation of connection parameters.
- 🔐 Exchange encryption keys and start secure transmission.
If a device fails MAC verification, it will physically be unable to send a single byte of data to the network, even if it knows the Wi-Fi password but uses the wrong encryption method.
☑️ Wi-Fi Security Check
The Impact of MAC Settings on Network Performance
MAC sublayer parameters are often hidden deep within router settings, but changing them can dramatically impact network performance. For example, enabling collision protection features for older devices can slow down modern devices.
Some manufacturers implement proprietary protocol extensions, such as Turbo Cell or AirTime Fairness. These technologies attempt to intelligently manage transmission queues, prioritizing devices with a strong signal or important traffic.
⚠️ Please note: Router settings interfaces are constantly being updated. Menu item names may differ from those described in the instructions, so always consult the latest documentation from your equipment manufacturer.
Understanding the principles of the MAC layer allows you to accurately diagnose the causes of instability rather than guesswork. If you see numerous retransmissions in the logs, the problem often lies in the media access or interference settings.
What happens if you disable the ACK mechanism?
Without ACK acknowledgements, the sender won't know whether the frame has reached the recipient. This will lead to a flood of lost data, as upper-layer protocols (TCP) will start massively requesting retransmissions, effectively paralyzing the network.
What is the difference between BSS and ESS at MAC layer?
A BSS (Basic Service Set) is a single access point and its connected clients. An ESS (Extended Service Set) is a group of access points with a single network name (SSID), allowing clients to roam between them, coordinated by the MAC sublayer.
Why is Wi-Fi speed always lower than the standard's rated speed?
The nominal rate is the symbol rate transmitted over the air. The actual rate is lower due to overhead for frame headers, service intervals (SIFS/DIFS), ACK latency, and collision avoidance mechanisms.
Can the MAC sublayer operate without LLC?
In the context of the 802.11 standard, the MAC sublayer cannot function independently of LLC, as LLC provides the interface to the network layer (IP). MAC is responsible for the medium, while LLC is responsible for the logical connection to higher-level software.