Showing posts with label wlan architecture. Show all posts
Showing posts with label wlan architecture. Show all posts

Saturday, February 9, 2013

What is OFDM?: Simplified..

Lets take a look at the technology that literally commanding all and any form of wireless communications OFDM without requiring any prior electronics knowledge.

Orthogonal Frequency Division Multiplexing is the most sought modulation technique in today's cutting edge wireless either it be 802.11 (WLAN), 802.16(WiMax), 3GPP 36 series (LTE)..

Single Carrier Modulation:

In the traditional communications we make use of a single Tx antenna and a single Rx Antenna. All the incoming data is modulated using a single carrier and sent OTA, at the Rx side its is  demodulated and data after removing the carrier is given out.

Multi-Carrier Modulation:

FDM: 

But in order to gain high throughput a new scheme is introduced. Where in we divide the channel in to different sub channels and assign a carrier to each sub-channel for modulation known as sub-carrier and finally multiplex all the carriers+data and send using the single Tx Antenna.
But in order to avoid interference (inter-symbol interference) we use a guard spacing between the sub channels causing in bandwidth wastage.

OFDM: 

In order to save the wastage and use it effectively we choose the sub-channels and sub-carriers such that they are orthogonal to each other meaning they don't interfere with each other. So we can skip the guard spacing between the sub-channels and save bandwidth.



FDM Vs. OFDM


Truly speaking it should be termed as FDMO, as you will see why just in a moment. lets understand each word in detail in the acronym.

Frequency Division (FD):

Instead of modulating all data with one carrier, divide the bandwidth in to equally separated sub-channels and assign a carrier to each sub-channel called sub-carrier.

Multiplexing (M):

As we have multiple sub-carriers but a single Tx antenna we need to map all the sub-carriers rather we need to multiplex all of them and send OTA. We make use Parallel to Serial converter for this.

Orthogonality(O):

We all know from the high school maths that orthogonality means "product of slopes = -1" meaning one signal will not overlap with the other.

In a similar context in the time domain a sub channel is represents as a rectangle which in a frequency domain converts to a "sinc" wave, now if we multiplex the "sinc" waves of all sub carriers sub channels it will look something like the below.

Now at the Rx side we can decode this wave because of the orthogonality, see the "arrows" they represent the frequency at which impact of all other sub carriers is zero, so we get to Rx only that particular sub-carrier we are interested in.


*2: By using an IFFT for modulation we implicitly chose the spacing of the subcarriers in such a way that at the frequency where we evaluate the received signal (indicated as arrows) all other signals are zero.



Advantages:

  1. Saves bandwidth
  2. Carries more no of data than a conventional carrier.


Disadvantages:
  1. Highly depends on the orthogonality achieved, need a good sync on Tx and Rx and also no multipath effect.
  2. High PAPR: Peak to Average Power Ratio.
The reason for high PAPR is that, as we use many sub-carriers with same bandwidth, the sum of peak power of all the sub-carriers varies instantaneously.
OFDM exhibits peaks whose power strongly exceeds the mean  power: the signal is said to have a high PAPR. This prevents use of high-efficiency amplification devices (High Power Amplifiers, HPA), which can cause nonlinearities reuslting in in-band distortion and increases Out-Of-Band  Radiation (OOBR), inter Symbol Interference and a high Bit-Error-Rate (BER).

Mitigations

1. 

a) Pilot: Instead of using all the sub-carriers/channels for data, use some selected sub carriers to send with zero-data so that the Rx can tune itself with the Tx. These are kind of training subcarriers.

b)  Cyclic Prefix (CP): In order to overcome the MultiPath effect, OFDM implements a clever technique of CP where in we first need to find the "Doppler Spread" of the multipath channel and then copy that amount of time from the data signal from the last to the first. So that even if that signal undergoes the multipath fading, we still have the data intact only the copied part is lost.


Doppler Spread: The amount of delay induced by the multipath channel to the 1st signal causing to overlap with the 2nd singal leading to infamous inter symbol interference. 


2.  There are many methods but below are famous ones
  • Clipping and Filtering
  • Peak Windowing


References:

  1. History behind OFDM
  2. Orthogonality in OFDM
  3. Why High PAR 

  4. PAPR Reduction Techniques



Note: All the pictures here are taken from the references and some additional resources. The author do not claim any copy right.

Thursday, January 17, 2013

Wireless LAN and Linux Together



With the advent of opensource the development time has come down hugely and the quality has improved quickly. For all those involved with WLAN/Wi-Fi and Opensource lets take a look at the wlan architecture in linux based on opensource mac80211 framework.

Block diagram explaining linux WLAN architecture. Please see below for details.


User-Space:


Configuration: wpa_supplicant and hostapd:


All the applications which interact directly with the user lie here. They can a GUI/CLI based ones for eg. network manager in ubuntu/fedora distributions are UI based ones, but the core part are the CLI based ones eg. wpa_supplicant for controlling the STA part of it and hostapd for controlling the AP part.

Both are configuration file based along with their cli versions (wpa_cli, hostapd_cli) to send commands on the fly.

They support different features like SME, MLME, Security, Wifi-Direct (P2P),  AP and STA configurations.


Tools:

We also have tools to send commands to the driver directly to set some parameters such as channel, bandwidth, some custom commands etc.

The Bridge: User and Kernel


Now how the various applications in userspace communicate to the core entities in the kernel? Well, we have different approaches but all are based on different socket interfaces.


  1. WExt ==> Generic Wireless Extensions: IOCTL Interface
  2. NL80211==> Netlink Sockets
  3. HostAP,==> Raw Packet Sockets
  4. Chipset specific:

  •               Atheros==> IOCTL Interface 
  •               Prism,IPW etc.


Kernel Space


Configuration and UMAC


For opensource world the framework in kernel for WLAN is mac80211, it separates itself in to 2 kernel modules


  • cfg80211.ko: Which handles all the configuration, user space interaction
  • mac80211.ko: Protocol: Upper MAC , driver interaction.


Most of the features and management is handled by the mac80211 module with the help of lower MAC.

Lower MAC Drivers


Lowe MAC drivers act as a bridge between the UMAC and the chipset (Firmware and HW). They do all the device initialization, registration with OS, Bug Registration, Interrupts registration etc through the services provided by the linux kernel.

A well written driver follows these conventions


  • Maintains a OS Independent Layer: Easy portability to different OSes.
  • Maintains a UMAC Independent Layer: Easpy portability to different UMAC's: Proprietary, opensource, 3rd party etc.
  • Bus Abstraction Layer: Maintains compatibility across different Physical Buses like PCI, PCIe, AHB, SDIO etc.


Chipset: Firmware and HW


The full 802.11 protocol functionality is implemented here.

The firmware which probably runs on a separate processor/micro-controller configures and controls the hardware and also interacts with the host(The driver) through a messaging interface specific to the chipset (control path)

The Data path generally involves a DMA controller in the HW which takes care of generating interrupts to the host processor and transferring packets to and from the Host to the HW queues.


References:


  1. wpa_supplicant_hostapd_devel_doc
  2. For details on these click userspace_configurations.
  3. wpa_supplicant