WiFi starts from scratch-Basic Content

Source: Internet
Author: User
Tags wpa supplicant

I started to learn about wifi. At present, I only know a little about the names and concepts of WiFi, And I know almost nothing about its implementation and related standards. So I can think of it as learning from scratch. The old age is easy to forget, so it is forced to record.


I. Several WiFi modes:

The most common use of wifi is as a WiFi hotspot, so that other users can connect to build a LAN or WAN wirelessly. At this time, WiFi is also used as the AP mode, that is, the master mode in the term. For WiFi mode, you can directly view the help of the iwconfig command, mainly including the following:Ad-hoc,Managed
,
Master,Repeater,Secondary,Monitor.

The information in iwconfig help is as follows:

Mode setthe operating mode of the device, which depends on the Net-

Work topology. The mode can beAd-hoc(Network composed of only
One cell and without Access Point ),Managed(Node connects to
Network composed of random access points, with roaming ),Master
(The node is the synchronisation master or acts as an access
Point ),Repeater(The node forwards packets between other wire-
Less nodes ),Secondary(The node acts as a backup Mas-
TER/repeater ),Monitor(The node is not associated with any cell
And passively monitor all packets on the frequency) or auto.

Focus on ad-hoc (point-to-point) mode: ad-hoc mode is similar to the previous direct connection twisted pair. It is a P2P connection, so it cannot communicate with other networks. Generally, wireless terminal devices such as PMP, PSP, and DMA use the ad-hoc mode.

Ad hoc network is a special wireless mobile network. The status of all nodes in the network is equal, and no central control node is required. Nodes in the network not only have the functions required by ordinary mobile terminals, but also have the packet forwarding capability. Compared with ordinary mobile networks and fixed networks, it has the following features:

(1) There is no strict control center for the Ad hoc network. All nodes have equal status, that is, a peer-to-peer network. Nodes can join or leave the network at any time. Faults at any node do not affect the operation of the entire network and have a strong anti-destruction capability.

(2) network deployment or expansion does not depend on any preset network facilities. Nodes use hierarchical protocols and distributed algorithms to coordinate their behavior. After the node is started, it can quickly and automatically form an independent network.

(3) When a node needs to communicate with a node out of its coverage, it needs multi-hop transmission from the intermediate node. Unlike multiple hops in a fixed network, multi-hop routes in an ad hoc network are completed by common network nodes, rather than by dedicated routing devices. (4) Ad Hoc networks are dynamic networks. The network nodes can be moved everywhere, and can be started or shut down at any time, which will change the network topology at any time. These features make the Ad Hoc network architecture, network organization, protocol design, and other aspects have a significant difference with the ordinary cellular mobile communication network and fixed communication network. From <Wikipedia>

Similar to the concept of self-networking in ZigBee, if WiFi needs to be set to automatic networking, it needs to be set to this mode.


2. How to construct a softap:

To implement a complete set of soft AP, three parts are required: AP Driver (usually provided in firmware mode), Wireless AP access and authorization, and WiFi dialing.

In Linux systems, Wireless AP access and authorization are mainly implemented using the open-source hostpad project, while the WiFi dialing part mainly uses the open-source wpa_supplicant, the driver depends on the system and the wireless chip. For more information about Linux drivers, see
Http://hostap.epitest.fi/project host ap-Linux driver for prism2/2.5/3, through the combination of the three to understand the entire implementation process.


1) hostapd introduction:

The official website address of the open-source project hostapd is http://hostap.epitest.fi/hostapd/. its introduction is very straightforward. It is mainly used for wireless access points (AP) and authorization servers (Authentication servers:

Hostapd is a user space daemon for Access Point and Authentication servers. It implements IEEE 802.11 Access Point management, IEEE 802.1x/WPA/wpa2/EAP authenticators, radius client, EAP server, and radius
Authentication Server. The current version supports Linux (host AP, madwifi, mac80211-based drivers) and FreeBSD (net80211 ).

Hostapd is designed to be a "daemon" program that runs in the background and acts as the backend component controlling authentication. hostapd supports separate frontend programs and an example text-based
Frontend, hostapd_cli, is wrongly ded with hostapd.


The following is the working model of hostapd:


Hostapd modules



Ii) wpa_supplicant introduction:

Wpa_supplicant is a WPA supplicant for Linux, BSD, Mac OS X, and windows with support for WPA and wpa2 (IEEE 802.11i/RSN ). it is suitable for both desktop/laptop computers and embedded systems. supplicant
Is the IEEE 802.1x/WPA component that is used in the client stations. It implements key negotiation with a WPA authenticator and it controls the roaming and IEEE 802.11 authentication/Association of the WLAN driver.

Wpa_supplicant is designed to be a "daemon" program that runs in the background and acts as the backend component controlling the wireless connection. wpa_supplicant supports separate frontend programs and
A text-based frontend (wpa_cli) and a GUI (wpa_gui) are encoded with wpa_supplicant.

Wpa_supplicant uses a flexible build configuration that can be used to select which features are supported ded. this allows minimal code size (from CA. 50 kb binary for WPA/WPA2-Personal and 130 kb binary for WPA/WPA2-Enterprise
Without debugging code to 450 KB with most features and full debugging support; these example sizes are from a build for x86 target ).


The following is the working model of wpa_supplicant:


Wpa_supplicant modules


The basic architecture of the two models is very similar.


Iii. Next plan:

With a conceptual understanding, you need to build your own softap on Linux and learn how to use these open-source tools.

In addition, you need to focus on the configuration of the hostapd. conf file.



Iv. References:

1. Wireless LAN resources for Linux

Http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Wireless.html


2. Summary of 801.11 protocol-related documents

Http://wireless.kernel.org/en/developers/Documentation/mac80211


3. hostapd configuration file example:

Http://hostap.epitest.fi/gitweb/gitweb.cgi? P = hostap. Git; A = blob_plain; F = hostapd/hostapd. conf


4. Developers 'documentation for wpa_supplicant and hostapd

Http://hostap.epitest.fi/wpa_supplicant/devel/


5. Use hostapd for Wireless AP in Linux

Http://ihacklog.com/post/use-hostapd-to-setup-wireless-access-point-under-linux.html

6. hostapd Linux documentation page

Http://wireless.kernel.org/en/users/Documentation/hostapd

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.