AlgoInsight

Free lesson · Computer Networking

Wifi And Wireless Networking

Easy10 min readnetworkingcomputer-networkstcp-ip

Same Problems, Harder Medium

Wi-Fi solves the same fundamental problems as Ethernet - delivering frames between devices on a local network using MAC addresses - but over a radically different physical medium. Instead of dedicated copper cables carrying electrical signals, Wi-Fi uses radio waves traveling through the air. This difference in medium creates a cascade of engineering challenges that make wireless networking fundamentally more complex, less reliable, and less predictable than wired Ethernet.

Understanding Wi-Fi matters because wireless is how most end users connect to networks. Your phone, your laptop at a coffee shop, IoT devices throughout a building - all are wireless clients. And yet the applications running on these devices were often designed with the assumption of a reliable, low-latency wired connection. The gap between wireless reality and wired assumptions is a source of real-world bugs, performance problems, and user complaints that software engineers must account for.

Wi-Fi is standardized by the IEEE under the 802.11 family of standards. The "Wi-Fi" brand name is managed by the Wi-Fi Alliance, an industry consortium that certifies products for interoperability. When someone says "Wi-Fi 6," they are referring to the marketing name for IEEE 802.11ax.

The 802.11 Standards - A Brief History

The 802.11 standard has evolved through multiple generations, each increasing speed, range, or reliability:

Standard Wi-Fi Generation Year Max Speed Frequency Key Innovation
802.11b - 1999 11 Mbps 2.4 GHz First widely adopted Wi-Fi
802.11a - 1999 54 Mbps 5 GHz Higher speed, less interference
802.11g - 2003 54 Mbps 2.4 GHz Combined 802.11b compatibility with 802.11a speed
802.11n Wi-Fi 4 2009 600 Mbps 2.4/5 GHz MIMO (multiple antennas)
802.11ac Wi-Fi 5 2014 6.9 Gbps 5 GHz Wider channels, more spatial streams
802.11ax Wi-Fi 6/6E 2020 9.6 Gbps 2.4/5/6 GHz OFDMA, better efficiency in crowded environments
802.11be Wi-Fi 7 2024 46 Gbps 2.4/5/6 GHz Multi-link operation, 320 MHz channels

The speeds listed are theoretical maximums under ideal conditions. Real-world throughput is typically 30-50% of the theoretical maximum due to overhead, interference, distance, and environmental factors. A Wi-Fi 6 access point advertising 9.6 Gbps will deliver perhaps 1-2 Gbps of actual throughput to a single client under good conditions - still fast, but a far cry from the headline number.

Frequency Bands

Wi-Fi operates in unlicensed radio frequency bands - meaning anyone can use them without a government license, but also meaning the airwaves are shared with other users and devices:

2.4 GHz band: Longer range, better wall penetration, but only three non-overlapping channels (1, 6, 11) and heavy interference from microwaves, Bluetooth devices, baby monitors, and neighboring Wi-Fi networks. In a dense apartment building, the 2.4 GHz band is often unusable due to dozens of competing networks.

5 GHz band: Shorter range, more channels (up to 25 non-overlapping channels in the US), and less interference from household devices. The trade-off is reduced wall penetration - 5 GHz signals are absorbed more by walls and obstacles.

6 GHz band (Wi-Fi 6E and Wi-Fi 7): The newest band, with the most available spectrum (up to 59 non-overlapping 20 MHz channels in the US). Offers the best performance and least interference but with the shortest range. Requires Wi-Fi 6E or newer devices.

The general rule: 2.4 GHz for range, 5 GHz for speed, 6 GHz for maximum performance in close range. Modern access points support all three bands simultaneously and automatically steer clients to the best available band.

How Wi-Fi Differs from Wired Ethernet

Several fundamental differences between wireless and wired networking affect reliability, performance, and application design:

Shared Medium

With wired Ethernet, each device has a dedicated cable to the switch - a private communication path. With Wi-Fi, all devices within range share the same radio channel. This is like the old hub problem - multiple devices transmitting simultaneously will interfere with each other. Wi-Fi manages this using CSMA/CA (explained below), but it means wireless bandwidth is always shared, never dedicated.

Half-Duplex

Most Wi-Fi operates in half-duplex mode - a device can either send or receive at any given moment, but not both simultaneously. This is because the radio transmitter and receiver share the same antenna and frequency band, and the transmitted signal would overwhelm the much weaker received signal. This effectively halves the usable bandwidth compared to full-duplex wired Ethernet. A 1 Gbps Wi-Fi link provides roughly 500 Mbps of effective throughput because the device splits its time between sending and receiving.

Variable Signal Quality

A wired connection has consistent, predictable performance. A wireless connection varies depending on distance from the access point, physical obstacles (walls, furniture, people), interference from other devices, and even weather conditions for outdoor deployments. A device that gets 500 Mbps sitting next to the access point might get 50 Mbps from two rooms away. Applications must be designed to handle this variability - graceful degradation, adaptive bitrate streaming, and retry logic become essential.

Hidden Node Problem

In wired Ethernet, every device can hear every other device on the same collision domain (which made CSMA/CD work). In wireless, Device A might be able to hear the access point but not Device B, even though Device B is also connected to the same access point. A and B are "hidden" from each other. If A and B transmit simultaneously, their signals collide at the access point - but neither A nor B can detect the collision because they cannot hear each other. This is called the hidden node problem and it is one reason why Wi-Fi uses CSMA/CA (with acknowledgments) instead of CSMA/CD.

graph TB
    subgraph WiredVsWireless["Wired vs Wireless Comparison"]
        direction LR

        subgraph Wired["Wired Ethernet"]
            WE1["Dedicated cable per device"]
            WE2["Full-duplex"]
            WE3["Consistent speed"]
            WE4["No interference"]
            WE5["Collision-free<br/>(switched)"]
        end

        subgraph Wireless["Wi-Fi"]
            WI1["Shared radio channel"]
            WI2["Half-duplex"]
            WI3["Variable speed<br/>(distance-dependent)"]
            WI4["Interference from<br/>other devices"]
            WI5["Collision possible<br/>(hidden nodes)"]
        end
    end

    style WE1 fill:#4f46e5,stroke:#4338ca,color:#fff
    style WE2 fill:#4f46e5,stroke:#4338ca,color:#fff
    style WE3 fill:#4f46e5,stroke:#4338ca,color:#fff
    style WE4 fill:#4f46e5,stroke:#4338ca,color:#fff
    style WE5 fill:#4f46e5,stroke:#4338ca,color:#fff
    style WI1 fill:#a78bfa,stroke:#8b5cf6,color:#fff
    style WI2 fill:#a78bfa,stroke:#8b5cf6,color:#fff
    style WI3 fill:#a78bfa,stroke:#8b5cf6,color:#fff
    style WI4 fill:#a78bfa,stroke:#8b5cf6,color:#fff
    style WI5 fill:#a78bfa,stroke:#8b5cf6,color:#fff
This diagram compares wired Ethernet and Wi-Fi side by side. Wired Ethernet provides a dedicated cable per device, full-duplex communication, consistent speed, no interference, and collision-free operation with switches. Wi-Fi shares a radio channel among all devices, operates in half-duplex, has variable speed depending on distance and obstacles, experiences interference from other devices, and can have collisions due to the hidden node problem.

CSMA/CA - Collision Avoidance for Wireless

Wireless networks cannot use CSMA/CD (collision detection) because a wireless device cannot reliably detect collisions while transmitting - its own transmitted signal drowns out any colliding signal. Instead, Wi-Fi uses CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance):

  1. Carrier Sense: The device listens to the channel. If it is busy (another device is transmitting), it waits.
  2. Random Backoff: Even after the channel becomes free, the device waits a random amount of time before transmitting. This randomization reduces the chance of two devices transmitting at the same instant after both waited for the same busy transmission to finish.
  3. Transmit: The device sends its frame.
  4. Acknowledgment: The receiving device (typically the access point) sends an ACK frame back. If the sender does not receive an ACK within a timeout period, it assumes a collision or signal loss occurred and retransmits the frame after another random backoff.

The key difference from CSMA/CD is that CSMA/CA tries to avoid collisions (through random backoff and optional RTS/CTS handshaking) rather than detecting them after they happen. This avoidance approach is less efficient than detection - the random backoffs and ACK overhead reduce throughput - but it is the best available solution for a medium where collision detection is physically impossible.

RTS/CTS - Solving the Hidden Node Problem

An optional mechanism called RTS/CTS (Request to Send / Clear to Send) addresses the hidden node problem:

  1. Before transmitting data, the sender transmits a short RTS frame to the access point.
  2. The access point responds with a CTS frame, which is heard by all devices within range of the access point (including hidden nodes).
  3. The CTS effectively reserves the channel - all devices that hear it defer their transmissions for the specified duration.
  4. The sender transmits its data, confident that hidden nodes will not interfere.

RTS/CTS adds overhead (two extra frames per transmission), so it is typically used only for large frames where the cost of a collision (retransmitting a large frame) outweighs the cost of the RTS/CTS handshake. Small frames are transmitted directly without RTS/CTS, accepting the small risk of collision.

Access Points, SSIDs, and Network Architecture

A wireless access point (AP) is the bridge between the wireless and wired worlds. It connects to the wired Ethernet network (usually to a switch) and provides Wi-Fi connectivity to wireless clients. The AP handles the translation between 802.11 wireless frames and 802.3 Ethernet frames, managing the complexity of the wireless medium while presenting a standard Ethernet interface to the wired network.

An SSID (Service Set Identifier) is the network name you see when scanning for Wi-Fi networks. Each SSID identifies a specific wireless network. A single access point can broadcast multiple SSIDs - for example, "CorpNet" for employees (mapped to VLAN 10) and "GuestNet" for visitors (mapped to VLAN 20). This maps directly to the VLAN concept from the previous topic.

In enterprise environments, dozens or hundreds of access points are deployed across a building or campus, all broadcasting the same SSID. A wireless controller manages all the APs centrally, handling configuration, channel assignment (to minimize interference between adjacent APs), power levels, client load balancing, and seamless roaming as a user walks from one AP's coverage area to another.

graph TB
    subgraph Enterprise["Enterprise Wireless Architecture"]
        CTRL["Wireless<br/>Controller"]
        SW["Core Switch"]
        CTRL --- SW

        AP1["AP 1<br/>Floor 1 East<br/>Ch 1 / 36"]
        AP2["AP 2<br/>Floor 1 West<br/>Ch 6 / 44"]
        AP3["AP 3<br/>Floor 2 East<br/>Ch 11 / 52"]

        SW --- AP1
        SW --- AP2
        SW --- AP3

        C1["Laptop"] -.->|"Wi-Fi"| AP1
        C2["Phone"] -.->|"Wi-Fi"| AP2
        C3["Tablet"] -.->|"Roaming..."| AP3
    end

    style CTRL fill:#4f46e5,stroke:#4338ca,color:#fff
    style SW fill:#7c3aed,stroke:#6d28d9,color:#fff
    style AP1 fill:#8b5cf6,stroke:#7c3aed,color:#fff
    style AP2 fill:#8b5cf6,stroke:#7c3aed,color:#fff
    style AP3 fill:#8b5cf6,stroke:#7c3aed,color:#fff
This diagram shows an enterprise wireless architecture. A wireless controller connects to a core switch. Three access points connect to the core switch via Ethernet cables. Each access point covers a different area of the building with different Wi-Fi channels to avoid interference: AP 1 on Floor 1 East uses channels 1 and 36, AP 2 on Floor 1 West uses channels 6 and 44, and AP 3 on Floor 2 East uses channels 11 and 52. Wireless clients like laptops, phones, and tablets connect to the nearest AP, and the controller manages seamless roaming as clients move between APs.

Wireless Security - WPA2 and WPA3

Unlike wired Ethernet where physical access to the cable is required to join the network, Wi-Fi signals travel through the air and can be intercepted by anyone within range. Wireless security protocols encrypt traffic between the client and the access point to prevent eavesdropping.

The evolution of Wi-Fi security:

WEP (Wired Equivalent Privacy): The original Wi-Fi security protocol. Fundamentally broken - it uses a static encryption key and a flawed implementation of the RC4 cipher. WEP can be cracked in minutes with freely available tools. Never use WEP.

WPA (Wi-Fi Protected Access): A transitional improvement that used TKIP (Temporal Key Integrity Protocol) to dynamically change encryption keys. Better than WEP but still has known vulnerabilities. Deprecated.

WPA2: The current standard for most networks. Uses AES encryption via the CCMP protocol. WPA2-Personal uses a pre-shared key (the Wi-Fi password). WPA2-Enterprise uses 802.1X authentication with a RADIUS server, providing individual credentials per user - more secure and allowing user-level access control. WPA2 remains reasonably secure when used with a strong password, though it is vulnerable to offline dictionary attacks against captured handshakes.

WPA3: The newest standard, addressing WPA2's weaknesses. Key improvements include SAE (Simultaneous Authentication of Equals), which replaces the WPA2 handshake with a protocol resistant to offline dictionary attacks, and forward secrecy, which ensures that if the password is eventually compromised, previously captured traffic cannot be decrypted. WPA3 is required on all devices certified after July 2020 but adoption is still gradually spreading through enterprise networks.

Why Wireless Complexity Matters for Software Engineers

As a software engineer, you may never configure an access point or choose a Wi-Fi channel. But understanding the constraints of wireless networking affects how you design applications:

Connection drops are normal. Wi-Fi clients lose connectivity during roaming between access points, during channel switches, and during interference events. Applications must handle brief connection drops gracefully - reconnect automatically, retry failed requests, and avoid holding long-lived connections that assume continuous connectivity.

Latency is higher and more variable. Wired Ethernet latency is typically under 1 ms. Wi-Fi latency is typically 2-10 ms under good conditions, but can spike to 50-100+ ms during congestion, retransmissions, or poor signal conditions. Real-time applications (video calls, gaming, collaborative editing) must buffer and tolerate this variability.

Bandwidth is shared and variable. In a conference room with 30 people all on the same access point watching a video presentation, the available bandwidth per person drops dramatically. Applications should adapt - lower video quality, compress assets more aggressively, defer non-critical data transfers.

Interview: Wi-Fi specifics are rarely asked directly in System Design interviews. But wireless constraints are assumed whenever the design involves mobile clients:

"Design a mobile messaging app." - Wireless unreliability means the app must handle offline mode, queue messages locally, synchronize when connectivity returns, and use push notifications rather than long polling (which wastes the shared wireless medium).

"How would you optimize a mobile app for poor network conditions?" - Understanding that wireless is half-duplex, shared, and variable leads to concrete answers: request batching (fewer round trips), progressive loading (show partial content quickly), aggressive caching (minimize network requests), and adaptive quality (lower resolution images and video on slow connections).

The key insight is that mobile equals wireless, and wireless means unreliable, variable, and shared - design accordingly.

What Comes Next

This module has covered the Physical and Data Link layers - from the electrical signals on copper cables to the MAC addresses and switching logic that deliver frames on a local network. The next module moves up to Layer 3: The Network Layer, where IP addresses, subnetting, and routing enable communication across networks, not just within them. This is where local networking becomes global networking.

Exercise: Starter: Check how many Wi-Fi networks your device can see right now. On each network, note whether it is 2.4 GHz or 5 GHz (your Wi-Fi scanner may show this). Count how many networks share the same channel. Can you see any interference patterns that would explain slow Wi-Fi performance?

Intermediate: Research the difference between WPA2-Personal and WPA2-Enterprise. In WPA2-Personal, what happens when an employee who knows the Wi-Fi password leaves the company? In WPA2-Enterprise with 802.1X, how is this situation handled differently? Why do most companies above a certain size use Enterprise mode?

Advanced: Research Wi-Fi 6 (802.11ax) OFDMA (Orthogonal Frequency-Division Multiple Access). How does OFDMA allow an access point to communicate with multiple clients simultaneously, and why is this a significant improvement over previous Wi-Fi generations in high-density environments like stadiums, conference centers, and university lecture halls? Compare OFDMA with the multi-user MIMO (MU-MIMO) approach used in Wi-Fi 5 - what are the trade-offs?

Back to Computer Networking