Author: Sreekrishnan Venkateswaran
Today, there is no way to talk about computers and networks without considering Linux and wireless network technology. In this article, Sreekrishnan Venkateswaran explains the wireless networking through WLAN, Bluetooth, GPRS, GSM, and IRDA with Linux perspective. He uses a variety of different wireless devices and corresponding kernel layers, and user space tools to demonstrate how they work under Linux.
Wireless technology, such as WiReless Local Area Network, Bluetooth, GPRS (General Packet Radio Service), GSM (GLobal System for Mobile Communications), and IRDA (Infrared Data) providing services in different environments. Although WLAN supports higher speed and longer propagation distances than Bluetooth, it also requires more costs and consumes greater power. Although GPRS is slower than Bluetooth and WLANs, it can be used for mobile technology. Although they differ, or other reasons, devices with multiple wireless functions can use them. For example, according to the positioning input of the GPS module, the device can transparently switch the network from the GPRS on the road to a cheaper WLAN in the Internet cafe. The mobile phone can communicate with the arrhythmia monitor via Bluetooth. When the patient is getting a certain limit, the alert can be sent to the doctor via GSM.
Currently, wireless technology has been widely used in the form of PCMCIA, Compact Flash (CF) card, or for USB devices. Most computer systems include embedded devices, with PCMCIA, CF or USB interfaces, even without built-in support for wireless technology, can also be used immediately. This article analyzes some examples of wireless devices, and studies the Linux implementation, bus technology, and various agreements of the device driver.
First, by tracking the code stream of the WLAN sample card, you will learn how the WLAN device works under Linux, and you can also see how several Bluetooth devices are connected to the Linux Bluetooth stack and other kernel. Next, you will learn how to make GPRS and GSM devices work under Linux. The article finally analyzed IRDA support on Linux and briefly introduced performance issues related to wireless network devices.
Note: The kernel data structure and file names involved herein are used in the current Linux version. The root of the file name is relative to the Linux kernel source tree.
Linux 802.11 WLAN
Another choice other than wired LANs is generally used in the same building as another choice other than wired LANs. WLAN communicates with a radio broadcast band using ISM (Industrial, Scientific, Medical). WLAN's 802.11a standard uses 5 GHz band, supported maximum speeds of 54 Mbps, while 802.11b and 802.11g standards use 2.4 GHz band, which supports maximum 11 Mbps and 54 Mbps speed.
WLAN is similar to a wired Ethernet, which allocate a Mac (Media Access Control) address from the same address pool, and is a network device layer that appears in an Ethernet device. For example, the ARP (Address Resolution Protocol table is filled with WLAN MAC addresses and Ethernet MAC addresses.
However, WLANs are very different from the link layer in the link layer. For example, 802.11 standard uses conflict avoidance (CSMA / CA) instead of conflict detection (CSMA / CD) of Wired Ethernet. Moreover, unlike the Ethernet frame, the WLAN frame is confirmed. Due to the blur boundary between the WLAN workstation, the WLAN link layer has protocols that clear a region before transfer. For security considerations, WLAN's Wired Equivalent Privacy (WEP) encryption mechanism provides the same security level as wired network. WEP combines 40 bits or 104 bit keys with random 24-bit initial vector combination to add decryption data. WLAN supports two communication modes: AD HOC mode is used for communication between the small group workstations without having to use the access point in a short time of communication, and all communication of the Infrastructure mode must pass through the access point. The access point is periodically broadcast a service set identifier (SSID), and the SSID is used to distinguish a WLAN network to other networks.
Most available WLAN cards are based on INTERSIL PRISM or LUCENT HERMES chipset. Compaq, Nokia, Linksys, and D-Link cards use the Prism chipset, while Lucent OrinoCo card and Apple Airport use the Hermes chipset.
Linux WLAN support
Linux WLAN support consists of a WLAN API implementation and a WLAN device driver. I will study them in turn.
There are two Linux projects to define a general WLAN API, and provide tools for user space applications to configure parameters and access information from the WLAN device driver. Wireless Extensions project provides a common Linux user space interface for different wireless network cards. The tool for this project includes iWconfig configured parameters (such as WLAN drivers and SSIDs). As part of the Wireless Extensions project, Linux-WLAN projects also supports tools for interacting from user space with WLAN device drivers. Unlike Wireless Extensions-based tools, these tools use syntax similar to SNMP (Simple Network Management Protocol) MIB (Management Information Base), which reflects the IEEE 802.11 specification.
Continue to discuss the device driver, and the Linux device drivers that support popular WLAN cards include:
ORINOCO WLAN driver: It is part of the Linux kernel source code that supports Hermes-based cards and INTERSIL PRISM cards. The ORINOCO_CS module provides PCMCIA card service support for PCMCIA and CF cards.
Linux-WLAN-NG driver for Linux-WLAN project: Supports a variety of PRISM chip-based cards. This driver supports Linux-WLAN API and partially supports Wireless Extensions.
Host AP Device Driver: Supports the AP mode of the PRISM chipset that allows the WLAN host to function as an access point.
Linux Symbol Spectrum Device Driver: Supports Symbol PCMCIA card. Unlike the PCMCIA card, the Symbol CF card lacks the board firmware, which relies on the device driver to download the firmware. A separate version of the driver is suitable for CF cards. Intel reassacks the Symbol PCMCIA card to the Intel Pro / Wireless card, and Socket communicates the Symbol CF card.
ATMEL USB WLAN driver: Many USB WLAN devices are supported using the Atmel chipset. Intersil Prism2 WLAN CF Card
I will discuss INTERSIL PRISM2 802.11b WLAN CF card to show how it works with Linux PCMCIA, network equipment and protocol.
The Linux PCMCIA / CF layer is driven by the PCMCIA host controller, different card client drivers, user mode programs, which helps hot background process and kernel card services that interact with each part of the above and services. Central composition. The PCMCIA controller connects the card to the system bus and maps the card to the host I / O and memory window, and causes the interrupts generated by the card to the free processor interrupt line. The CF card is smaller, but is compatible with PCMCIA and is often applied to handheld devices. The PCMCIA / CF card has two storage spaces: attribute memory and common memory (Common Memory). The property stores like CARD Information Structure (CIS) to save configuration registration and descriptor information. The Linux card service core interacts with the host controller device driver, card device driver, and user mode Cardmgr background process. It calls the event handler routine that calls the card driver when some events (such as card insertion, card shift, and low power) occurs. Although the card service transmits information from the card's CIS to CardMgr, CardMgr will transfer the resource allocation policy defined in the user space (/etc/pcmcia/config.opts) to allocate memory windows and interrupt levels to the card service. View Drivers / PCMCIA / DS.C can learn the kernel code interact with CardMgr, check /etc/pcmcia/config.OPTS to understand the user's space resource allocation strategy.
Insert Intersil WLAN CF card, the card service calls the PCMCIA event handler of the ORINOCO_CS module. Card service parses the CIS tuple (tuples) in the card properties memory and transmits the information to the CARDMGR, which will load the appropriate device driver from the / etc / pcmcia / config file (see Listing 1). Since the ManfID tuple in the CIS in the card matches the entry in / etc / pcmcia / config, Cardmgr binds the card with the Orinoco_CS driver. The device entry in Listing 1 specifies that the ORINOCO_CS driver consists of three core modules: orinoco, orinoco_cs, and hanmes. In addition, the CardMGR performs script / etc / wireless / wireless when the device belongs to the wireless (Wireless), when the device is started and stopped. This script uses the WLAN tool and utility to configure device driver parameters, such as WEP keywords, and SSID. It can also start network protocols on WLANs, such as DHCP (Dynamic Host Configuration Protocol, dynamic host configuration communication protocol). The example in Listing 1 uses the Wireless Extensions tool to perform device configuration.
Note: The exact location of the PCMCIA configuration file depends on the Linux distribution used.
Listing 1. PCMCIA device entry for Intersil WLAN CF card
card "Intersil PRISM2 11 Mbps Wireless Adapter" manfid 0x0156, 0x0002 bind "orinoco_cs" device "orinoco_cs" class "wireless" module "orinoco", "orinoco_cs", "hermes" with / etc / pcmcia / wireless and / etc / pcmcia / Wireless.opts scripts are configured to configure parameters such as WEP keywords and SSID.
Listing 2. Configuring WLAN-specific parameters
Iwconfig Ethx ETHX ETHX ETHX ETHX AAAA-AAAA-AA [1] Key BBBB-BBB-BB [2] Key CCCC-CCCC-CC [3] Key DDDD-DDDD-DD [4]: SET 64-BIT WEP KEYS AND ESSID in the driver iwconfig ethX: Display WLAN parameters iwpriv: Get nongeneric, driver-specific parameters iwlist: List Information and statistics from an interface iwspy: Read quality of link for a set of addresses / proc / net / wireless: Wireless statistics from the Device Driver
When inserted into the card, the ORINOCO_CS is like a traditional network device driver, calls Register_netDev to get the ETHX network interface name assigned to the WLAN interface. It also registers an interrupt generated by an interrupt service routine to serve the service to send and receive wireless data. The interrupt handler is part of the ORINOCO module and interacts with Linux network stacks. Linux network stack uses the primary data structure that is a SK_BUFF structure (defined in include / Linux / Skbuff.h, which includes control information about an memory block attached to it). SK_Buffs provides valid buffer processing and stream control mechanisms for all network layers. The network device driver executes a dev_alloc_skb and a SKB_PUT to populate one SK_BUF with IP data, then transfer this SK_BUF to the TCP / IP stack by calling Netif_Rx. The ORINOCO interrupt service routine populates SK_Buffs from the data received from the WLAN and transmits it to the IP stack via Netif_Rx.
The Linux TCP / IP application can run on the network interface provided by the INTERSIL WLAN CF card in the previously ticked.
About author
Sreekrishnan Venkateswaran has a master's degree in computer science in Campl, Campl, India. He started working for IBM India since February 1996. His interest includes designing equipment drivers and network protocols. able to pass
S_krishna@in.ibm.com Contact Sreekrishnan.
Full article:
IBM DeveloperWorks China website