WiFi协议学习笔记
sharetechnote学习链接
WLAN概览
WLAN (Wireless Local Area Network) 的部署示意图
wifi协议层
物理层将数字信号转为雷达信号,不同的标准使用不同的频段,802.11a: Operates in the 5 GHz band with a focus on high speed over short distances. 802.11b: Operates in the 2.4 GHz band, offering longer range but slower speed.
MAC层控制不同设备接入同一个WLAN,类似交警,关键技术:CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)。
Internet Protocol (IP) 层,告诉数据要去哪,类似GPS。
物理层框架
WLAN用的是调制技术有两个,一个是比较老的DSSS,一个是OFDM。direct-sequence spread spectrum,DSSS),简称直扩(DS),把’0’ '1’字符扩展成11Bit位的01字符串,提升抗干扰能力。OFDM(Orthogonal Frequency Division Multiplexing)即正交频分复用技术,其子载波分布的频段如下:
其中,向上的箭头表示该子载波的相位或符号为正(通常表示为 +1 或类似的正值),向下的箭头表示该子载波的相位或符号为负(通常表示为 -1 或类似的负值)。
报文的其余内容如下:
Preamble and Header
用于同步,信号检测和均衡化。The header contains important control information, such as the rate at which the data is transmitted and the length of the payload.
Payload
紧随header。Majority part of the PHY payload is a MAC frame that can include user data, network management information, or control messages. The size of the payload varies depending on the type of frame and the specific requirements of the data being sent.
这里面包含了真正有效的数据。
以802.11a为例,其结构图如下
各部分的说明:
PLCP Header: This is located at the beginning of PHY frame and it is made up of two parts - PLCP Preamble and Signal.
PLCP Preamble: This is the Physical Layer Convergence Protocol preamble. It’s used for synchronization and consists of 12 symbols that help the receiver to lock onto the signal and understand the modulation and coding schemes being used.
Signal: It’s a part of the PLCP header and it carries the information as follows
Rate (4 bits): Indicates the data rate at which the packet is transmitted.
Reserved (1 bit): A reserved bit for future use or to maintain compatibility.
Length (12 bits): Specifies the length of the PSDU (PLCP Service Data Unit), which is the actual data payload.
Parity (1 bit): A bit to check the correctness of the header.
Tail (6 bits): These are extra bits used to flush the convolutional decoder within the receiver.
Data: This is the actual payload that carries the user data. It’s divided into:
Service (16 bits): Used for various service functions within the PHY layer.
Payload: This is the variable-length field that carries the MAC frame
Tail (6 bits): Similar to the tail bits in the PLCP header, these are used to clear out the decoder.
Pad: Padding bits are used to ensure that the data payload is an integer number of symbols. The length of the pad varies depending on the size of the payload.
其余的协议
见此链接
MAC层
Preamble提供同步信息和信号检测。
Header保证frame的顺利解码。
PSDU (Physical Service Data Unit)包含了最主要的数据。
Tail:错误检测和处理。
Pad:保证frame对齐。
具体的各个部分拆解
见这个链接
协议概览
AP不停发送Beacon 说自己在。设备可以通过主动或者被动方式来与之建立连接。
DCF
Distributed Coordination Function技术主要基于CSMA/CA, Backoff and various IFS(Inter Frame Space).
这个算法的意思是,src和dest通信时,告诉别的设别别来打扰。
CSMA/CA是一种多路访问协议,用于协调多个设备在共享无线信道上进行通信。它的基本思想是,在发送数据之前,设备会先检测信道是否空闲(Carrier Sense),如果信道忙碌,设备将等待一段随机时间后再次尝试发送。这个等待时间的随机性有助于避免多个设备同时发送数据导致碰撞。
退避算法(Backoff Algorithm)是一种在网络通信或并发系统中,当出现冲突、失败或过载时,通过等待一段时间后再尝试重新进行操作的策略。该算法的关键思想是:遇到问题时,不是立即重试,而是等待一段时间,且等待的时间长度逐渐增加。
NAV(Network Alloction Vector),is a period during which a station should not transmit anything.Carrier Sensing is a process that a WLAN station physically measure(sense) the energy level in a medium (channel) to figure out whether there is any communication already being done by other stations
PCF
Point Coordination Function。这个分发策略是不常用的
OFDMA
Orthogonal Frequency Division Multiple Access
OFDM(Orthogonal Frequency Division Multiplexing)和OFDMA
Trigger is a mechanism by which an AP can notify or request various information for station, or most importantly transmit the scheduling information to stations.
BeamForming
beamforming学习链接
if you want to have a specific shape of beam you need to put those multiple antenna in a specific distances between them ==> BeamForming
if you want to point the team toward a specific direction, you need to transmit the signal through each of the antenna elements with certain amount of phase difference. ==> BeamSteering
BeamForming Function or Mapping Function or Spatial Filter
Security
WEP :第一个安全协议
WPA :WiFi Protected Access