MAC层协议(例如WiFi/Wlan,Zigbee,蓝牙和以太网)在物联网应用中至关重要。WiFi/WLAN是家庭自动化,智能农业,办公自动化和工业物联网中最常用的无线解决方案之一。对于IoT设备中的控制器而言,与可用的WiFi网络并通过安全频道有效通信数据包非常重要。WiFi尽管范围有限,但提供了令人难以置信的带宽,因此即使是像实时流媒体这样的应用程序,也可以轻松地通过WiFi网络托管。基于WiFi的IoT应用程序需要完成一件事,无论它们是否需要大带宽:WiFi嗅探。
在网络工程、无线嗅探器是一个network analyzer designed to capture packet data on the wireless network. In embedded applications, a dedicated WiFi Sniffer is rarely required to monitor a WiFi network. However, some functionalities of a WiFi Sniffer are often needed to be built within IoT devices. One such functionality is the identification of available WiFi networks and the ability to connect with an available WiFi channel. In this article, we will examine precisely what a WiFi Sniffer is? Why is it required in a wireless network? How is WiFi sniffing used in embedded applications? How can WiFi sniffing be implemented in MicroPython ports?
什么是wifi嗅探器?
A WiFi Sniffer is a passive listening device that captures WiFi network frames of a particular WiFi channel in the air. A Sniffer only listens for WiFi network packets of a specific bandwidth within their range of listening capacity. Currently, WiFi networks use only two bandwidths – 2.4 GHz and 5 GHz. The latest WiFi version, i.e., WiFi 6E, uses an additional 6 GHz bandwidth.
专门部署的专用WiFi嗅探器监视无线网络共享与接入点和站设备之间充当通信介质相同的频道,并继续捕获无线框架以监视和记录有关无线流量的信息。WiFi嗅探器捕获了WiFi接入点和在同一频道上充当WiFi站的设备之间传达的所有帧,但不会处理帧或对网络响应。仅在那些物联网应用程序中需要专用的WiFi嗅探器,在这种物联网应用程序中,必须在网络中经常传达网络的无线连接或大型带宽数据,例如在视频流或高度活跃的大型传感器网络的情况下。
wifi sniffer的应用
WiFi sniffing is used to scan devices within a wireless network. It also sets up connection procedures between station devices and WiFi access points. During network deployment, WiFi sniffing is often used to verify the frame’s correctness and ensure that frames are transmitted in the air. The protocol is also used to confirm the compatibility of devices with the WiFi network. WiFi sniffing is often used for network validation and pre-certification of WiFi-enabled devices. Last but not least, WiFi sniffing is also used for troubleshooting WiFi networks and station devices within the network.
wifi sniffer的类型
There are two types of WiFi Sniffers: software-based and dedicated. The software-based WiFi Sniffers are software applications or built-in features within an application designed for WiFi sniffing. The software driver needs to be installed on a WiFi adaptor to perform sniffing. WiFi sniffing software could often be incompatible with the intended hardware platform. A dedicated WiFi Sniffer is a WiFi adaptor with WiFi sniffing capability built into its software or firmware.
在嵌入式微控制器中使用WiFi嗅探器
微控制器通常在充当成熟的WiFi嗅探器方面没有太多能力。但是,通常对启用WiFi的微控制器进行编程以执行WiFi嗅探的某些功能。这包括识别WiFi访问点,并连接一旦连接在同一网络上的其他站设备。通过Internet与WiFi网络进行通信的用于数据通信的功能也是WiFi嗅探功能。与WiFi网络重置和重新连接的功能是另一个WiFi嗅探功能。
WiFi sniffing in MicroPython ports
Most of the MicroPython ports have on-board or on-chip WiFi. These microcontrollers are already WiFi adaptors that can connect with a WiFi network as both a station device and an access point. Fortunately, the network module of MicroPython has been developed to connect and communicate with a WiFi network. The WLAN class from the network module can scan the MAC address of all the devices connected to the WiFi network. The same class configures the port as a WiFi access point or a station device.
WiFi嗅探的微部脚本
You can upload the following MicroPython script to any WiFi-enabled MicroPython port. The script scans available WiFi networks and lists devices’ MAC addresses in the range.
The code
The code begins with importing the WLAN class from the WiFi module. Next, the ubinascii module is imported to enable the conversion of binary data into ASCII form. A function scan_wifi is defined in which the MAC address, WiFi packet, and control bit of the packet is retrieved. The control bit is used to identify the type of MAC address. If the MAC address is valid, it is printed to the console. An object of the WLAN class is instantiated in the code, and the scan_wifi function is called a callback function as soon as a management packet is received in the promiscuous mode. The promiscuous mode of on-port WiFi is enabled by calling wlan.promiscuous() method. The promiscuous mode ensures that every transmitted data packet is received and read by the WiFi adaptor.
You may also like:
提交以下:Featured,精选贡献,科技文章
与本文有关的问题?
Ask and discuss onElectro-Tech-online.com和edaboard.com论坛。
告诉我们你的想法!!
You must be登录to post a comment.