Some notes on WiFi and the wireless subsystem on Linux


Categories: Linux Networks Sysadmin

It’s been quite sometime since I posted anything proper on the internet, but recently I was reading about how WiFi is deployed in enterprise and the wireless subsystem in the Linux kernel. So I thought it would be nice to have a self note about it in form of a short blogpost.

Table of contents

Wireless communication

A WNIC can operate in two ways:

In the infrastructure mode there are two types of Service sets:

A note about SSID, BSSID and ESSID

How our machines connect to our WNICs

+-----------+   +--------+   +------+  +-----------+
| userspace +-->+ kernel +-->+ WNIC +-->external AP|
+-----------+   +--------+   +------+  +-----------+

Most of the info here on will be Linux specific.

It’s important to understand there are 2 paths in which userspace communicates with the kernel when we’re talking about WiFi:


WNICs can be of two types based on management of MLME(MAC Sublayer Management Entity) :

If the WNICs wants to talk to the kernel then it has to use the cfg80211 interface.


NOTE: MLME (MAC Sublayer Management Entity) MLME is the management entity where the Physical layer (PHY) MAC state machines reside.



Additional Jargons:

About Multiple interfaces

Multiple interfaces can be used to run something like a station on wlan0 and an AP on wlan1 (depending on the HW). Otherwise we can also have the connection coming on a eth0 and the AP on wlan0.

You can use linux virtual networking devices like bridge to pass the internet over.

Some random commands

$ sudo iw dev wlp2s0 scan | less
$ sudo iwlist wlp2s0 scanning

Useful Links: