# Wifi Overview

* Uses 802.11 standard

### To DS / From DS

* To DS is FROM client TO AP
* From DS is FROM AP TO client

```
FROM DS 
AP ----------------> CLIENT
MAC Addresses: BSSID, SOURCE, DST

TO DS
AP <---------------- CLIENT
MAC Addresses: BSSID, SOURCE DST
```

### Common Packet Types

* Association Request - Request to join a WLAN -> subtype of 0
* Authentication Request - Request authentication to WLAN -> subtype of 11
* Probe Request -> STA looking for known WLANs (How "Connect Automatically works) -> subtype 4
* Deauthentication request -> Disconnect Request -> subtype 12
* Beacon Frame -> AP beacon to advertise ssid and AP capabilities -> subtype 8

### Linux Monitor Mode configuration

* `iw` creates and manages wireless interfaces
* `ip` configures and ip and the up or down state

```
iw dev wlan0 interface add wlan0mon type monitor 
ip link set wlan0mon up 
iw dev wlan0mon set channel 1 
iw dev wlan0mon info

# to delete interface 
iw dev wlan0mon del
```

### Airmon-ng Monitor Mode configuration

* use the shell script with aircrack-ng
* Does not deal with deleting interfaces

```
# see detected interfaces
airmon-ng

# place in monitor mode 
airmon-ng start wlan0 

# delete interfaces
iw dev wlan0 del
```

### Types of WIFI networks

* IEEE 802.11b or 802.11g -> 20MHz channels at 2.4 GHz
* IEEE 802.11a -> 20MHz channels at 5 GHz
* IEEE 802.11n -> 20MHz or 40MHz channels at 2.4 GHz or 5 GHz
* IEEE 802.11ac -> 20MHz, 40MHz, 60MHz, 80MHz, 160MHz channels at 5 GHz
* IEEE 802.11ax -> 20MHz, 40MHz, 60MHz, 80MHz, 160MHz channels at 2.4 GHz or 5GHz

### Controlling Channel and Width

```
iw dev wlan0mon info | grep type
    type monitor
iw dev wlan0mon set channel 1 
iw dev wlan0mon set channel 132
iw dev wlan0mon info | grep channel
    channel 132 (5660 MHz), width: 20 MHz (no HT), center1: 5660 MHz
    
iw dev wlan0mon set channel 132 HT40+
iw dev wlan0mon info | grep channel 
    channel 132 (5660 MHz), width: 20 MHz (no HT), center1: 5670 MHz
iw dev wlan0man set channel HT40-
    channel 132 (5660 MHz), width: 20 MHz (no HT), center1: 5650 MHz
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.ice-wzl.xyz/wifi-bluetooth-zigbee-sdr-smartcards/wifi-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
