Tuesday, September 15, 2020

End of Wi-Fi Driver developers?

 Sounds cheesy, do read on? Wi-Fi industry has progressed a lot in the last decade, it now offers multi-gigabit data rates (11ac/11ax or 11ad/11ay), up to a kilometer range (11ah), 6GHz band (6E), faster connection, and roams times, high-speed mobility, enhanced security, etc. and many more to come. And with this increasing greed for more data rates (it all started with the introduction of 11ac), the role of Wi-Fi device driver developers also has changed a lot, or rather IMHO came to an end in the traditional sense, see the underlined words below for the replacement jobs :-).

We can broadly divide the WLAN Chips into two categories High performance and Low-Power and unlike earlier days where SoftMAC (LMAC in the chip) architecture was prevalent, most of the chipsets now moved to the Full mac architecture with UMAC and LMAC within the chip with some split between Firmware and Hardware. This is applicable to both types of chipsets (Performance needs more hardware offloads, power also needs more HW offloads but in a different sense). And in some industries like IoT or ultra-low power variants, TCP/IP (likes of LWIP) and wpa_supplicant is also embedded in the chip.

Only small companies who don't have money or resources or time to do these things in the chip, go for the SoftMAC approach, but that percentage is less and the number of companies actively developing WLAN chips is reduced drastically, most involve in buying a certified chip and developing applications on top of it (This phenomenon even affects such companies see the last couple of paragraphs).

The functionality of the Wi-Fi device driver is now limited to configuring the chip settings (sending commands from user space applications to the chip) and interfacing with the TCP/IP stack, in terms of the skill needed it is equivalent to Ethernet driver skills or even less. as most of the proven concepts (Rings, NAPI, (G/T/L)SO, etc) from the Ethernet drivers are taken to Wi-Fi to achieve gigabit rates. Even though it is a driver for a Wi-Fi chipset we should be calling them Ethernet driver developers. In contrast, see my old guide to starting Linux Wi-Fi driver development for SoftMAC drivers it's becoming obsolete now.

Some companies working in the north of 10Gig went a step ahead and removed the kernel from the picture completely (from Wi-Fi PoV, it still needs a KNI module in the kernel) by using frameworks like DPDK (from Linux Foundation) where the driver resides in the user-space directly talking to the hardware (using hugetlbfs). To compete with that even the traditional Linux networking guys had to come up with XDP which uses eBPF to on-load some tasks to user-space (packet filtering decisions etc.) to avoid loading on the kernel unnecessarily by dropping packets early in the cycle (even this wasn't enough, so some have offloaded eBPF processing to the HW itself to avoid packets coming up the CPU itself). The skills needed for these user mode driver developers are completely different from developing traditional device drivers.

I have mostly focused on Linux systems but the same holds true for windows WDI driver developers, but it never had much functionality in the software like mac80211 in Linux anyway so not that much of a problem.

This trend affects a very lucrative and niche area of Wi-Fi device drivers jobs. Compared to earlier, where a good amount of WLAN protocol know-how is needed and values aren't the case anymore. That is not to say that the amount of skill has reduced, the data path is still critical but its mostly proven with the Ethernet chipsets as they pioneer the OS and Driver areas with huge demands from 40/100/400 Gig rates. So, the amount of new stuff to do in the Wi-Fi drivers without the Wi-Fi involved is low and hence need fewer people to do.

Overall, for those developers who want to get their hands on WLAN features and protocols have to move to the firmware domain that needs a different set of skills and needs serious re-skilling and also the job market is quite different for firmware developers as the attrition rate in the domain is quite low as most of the work there is specialized in a closed ecosystem. And then there is a problem of licensing and customizing the firmware as most companies keep the firmware proprietary and as a USP, which is another topic entirely affecting a myriad of companies that rely on selling SW around a proven Wi-Fi chip).

Note: There is still plenty in the wpa_supplicant/hostapd but driver developers are closer to FW and very few companies do these things proprietary way most stick to opensource software.

So, if you are a Wi-Fi driver developer interested in doing Wi-Fi work (like me), it's time to rethink your career options.

I know this is a bit controversial and it is just my point of view with spending more than a decade in this industry and was part of this transition, so, please do share your thoughts and experiences, I would love to hear more.

Wi-Fi 6E: 6GHz Spectrum


802.11ax has been code-named Wi-Fi6 and its usage in the 6GHz band which has been opened by FCC (and others following the suite) has been code-named Wi-Fi 6E :).Let us discuss the details of the channels and rules along with how we coordinate with incumbent services meeting the I/N ratio of -6dB to avoid interference to the incumbents.

6GHz spectrum (Wi-Fi6E: 5.925-7.125 GHz) is already in use by incumbent services, so, the unlicensed operation in this band is divided into two categories based on power usage derived from UNII-3 rules, with additional protection offered by AFC (Automated Frequency coordination). See below power limits (#8)

6GHz power limits

A: 5.925-6.425 GHz (UNII-5) and 6.525-6.875 GHz (UNII-7) = 850MHz of Spectrum + (Standard power + AFC (or) Low power-Indoor + No-AFC)

  Incumbent Services: Fixed services, like PTP Microware links and FS (Fixed Satellite) Receivers which tend to be directed. 

As these services are fixed, we don't need to use a dynamic scheme like DFS in UNII-2A, instead simply knowing the range of their operation a.k.a. 'contours', should suffice to stay away from them.

AFC is nothing but a simple database (Maintained by AFC Registrars and AFC Operators) to determine the contours of incumbents and make sure unlicensed elements do not disturb them (enforced by AFC masters which control AFC Clients) (#3). FCC databases show 47,695 call signs in the 6GHz, so, operators need to define the contours of their links and publish them to masters viz AFC. Below picture summarizes this (#7)

No alt text provided for this image

At the bottom of the below pic, you can see available channels in green generated using AFC, that's a lot of free channels, though only 1X160MHz channel, that's SFO :-). (Using FCC and COALS database (#7) and using the RLAN Group propagation model (#8))

No alt text provided for this image

data

B: 6.425-6.525 GHz (UNII-6) and 6.875-7.125 GHz (UNII-8) = 350MHz of Spectrum + Low power-Indoor + No-AFC

  Incumbent Services: Mobile Services: Broadcast Auxiliary Service, Cable Television Relay Service, etc. 

  Even though these are dynamic but are more actively present using DFS is unsuitable (it's mainly for avoiding interference with intermittent signals like radars), hence a reduced power is proposed instead (at this power levels they don't interfere with incumbents) (#6)

Summary: This gives us a total of 7X160MHz channels in the US and 3X160MHz in Europe (only UNII-5) (#5), which is quite a big win for Wi-Fi.

What do you think about gaining a 1.2GHz of the new spectrum? How can this be used by new applications using 11ax/wifi6E, please share your thoughts?

References:

  1. https://www.fcc.gov/document/chairman-pai-proposes-new-6-ghz-band-rules-unleash-unlicensed-use
  2. https://wifinowglobal.com/news-and-blog/wi-fi-in-6-ghz-tech-giants-posit-new-scheme-for-protection-of-6-ghz-incumbents/
  3. https://ecfsapi.fcc.gov/file/1080236093470/Ex%20Parte%20(Aug.%202%202018)%20(FINAL).pdf
  4. https://docs.fcc.gov/public/attachments/DOC-354364A1.pdf
  5. http://www.cdot.in/cdotweb/assets/docs/events/gbmls19/WiFi_6_and_beyond(Dorothy).pdf (Slides #22/23)
  6. https://ecfsapi.fcc.gov/file/108080219920074/WFA%20Ex%20Parte%20Letter.pdf
  7. https://ecfsapi.fcc.gov/file/100302586574/2019-10-01%20OET%20AFC%20Demo%20Ex%20Parte.pdf
  8. https://docs.fcc.gov/public/attachments/DOC-363490A1.pdf
  9. https://ecfsapi.fcc.gov/file/10216633127609/6%20GHz%20RLAN%20Group%20Comments%20(Feb%2015%202019).pdf pages 43-44

Friday, July 11, 2014

802.11 n and ac Transmit Beamforming: Crash Course

Theory


Beamforming: Form the beam in the direction of destination. Simple, isn't it? Well for starters that's the aim, but we have lot of obstacles in the path, read the mathematics part and you will "its not that simple after all." :-).

Traditional antenna, radiates omnidirectionally meaning everywhere, but for some use cases we need to focus on specific areas/directions, like when there are multiple destinations we want to make sure the one with whom we are speaking gets the best SNR.

For 11n, this was simpley a SNR improvement technique, but for 11ac with the introduction of MU-MIMO we need to communicate with multiple users simultaneously without any cross-interference. So the need for beamforming is more in 11ac.

Generally we use this in cases where the No of antennae are more than the no of spatial streams like 4X2, 8X4 etc.

Beamforming gains are expected to be approximately 3 dB in the transmitted direction. In practice, this gain will typically be one step up in data rates (increasing one MCS number) for a mid-range transmission.

Beamforming is achieved by combining elements in a phased array in such a way that signals at particular angles experience constructive interference while others experience destructive interference


Basic Mathematics


Lets take a look at how do we arrive at those angles, and lets try to keep the mathematics simple and not delve in the gory details.

MIMO communication can be modeled as below

Yk = HkXk + n

X ==> Vector of Tx signal using Ntx antennae [ x1 x2 …xNtx]
Y ==> Vector of Rx signal using Nrx antennae [y1 y2 …yNrx]
H ==> Channel Matrxix Ntx X Nrx.
k  ==> Subarrier
n  ==> Constant Noise in the Channel

Now in order to make sure transmitted signal is steered towards the receiver, we have to tune the transmit signal in such way that we control the phase and amplitude so that the resulting signal will be received by that particular receiver with good SNR.

In mathematical form, we need to calculate the matrix Qk referred as steering matrix, such that Yk is optimized.

Yk = HkQkXk + n

Qk has values known as weights to control phase and amplitude for all Transmit Antennae for that particular subcarrier k.

X is the beamformer
Y is the beamformee

Still with me? Lets do the same for MU-MIMO,

Yku = HkuQkuXku + n

u==> user, specific beamformee.

Qku has values known as weights to control phase and amplitude for all Transmit Antennae for that particular subcarrier k and for that particular beamformee u.


Types 

Explicit Feedback


Qk is formed based on the Feedback from the receiver. So Y will send some training data known as sounding data, based on which X estimates the channel characteristics and derives Qk.

This sounding known as NDP (Null Data packet) sounding uses a special packet with Length 0 as the name indicates.

Here channel need not be reciprocal, as feedback is given based on NDP (from beamformer-beamformee) which is same direction as data packet.

Implicit Feedback


Beamformer X chooses Qk, and adjusts it based on the feedback of beamformee Y.There is not extra data being sent by beamformer, it only prepares the feedback based on the normal data signal from beamformee.

But as the feedback is based on the channel characteristics from Y to X, based on which X decides Qk for X to Y, so this only works when the channel is reciprocal.

Uncompressed


The feedback sent by beamformee comprises of entire beamforming feedback matrices, known commonly as Vk based on which Qk is derived.

Compressed

The feedback sent by beamformee comprises of angles instead of the full matrix which will be decompressed in to full matrix Vk at beamformer.

To understand how we derive Qk from Vk we need to understand SVD (Singular Value Decomposition) which is complex matrix factorization technique outside the scope of this article.

For 11ac only compressed beamforming technique is allowed.

That's the most we can go without getting our hands dirty with some advanced mathematics (SVD, matrices) etc. Hope this throws some light on inner details of beamforming.

References:

1) IEEE specs
2) Wikipedia.

Revision Info:


1) Fixed the definitions of explicit and implicit beamforming: Thanks to Ashok Bandi.

Friday, March 21, 2014

Finding and Installing the right device driver for your HW in Linux

The biggest problem making any hardware work is finding the right driver, how many of us spent days trying different driver packages and finally nothing works, especially in windows!

Because i get lots of queries in this area, here's a tutorial to find the right driver for your WiFi card, of course in Linux. 

The below procedure is automated and happens when you insert a device, creating a network interface ready to use (Will explain this in another article). 

But, for some reason if that's happening, this procedure helps us to find the kernel version which/from which that HW is supported.

Steps:

1) Insert the device :-)

2) Depending on the BUS interface it uses, issue the command "lsusb/lspci", check for the device in the list. 
For Eg: Lets take a belkin WiFi adapter.

# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 413c:2107 Dell Computer Corp.
Bus 001 Device 004: ID 04ca:0061 Lite-On Technology Corp.
Bus 001 Device 028: ID 050d:615a Belkin Components F7D4101 / F9L1101 802.11abgn Wireless Adapter [Broadcom BCM4323]

If it is not appearing in this list, check dmesg for any errors. If not pray to god. (This will probably be another article :-))

Make a note of the ID, in this case 050d:615a the first part is Vendor ID representing the maker of the chipset, second part identifies the chipset itself the Product ID.

We will use these ID's to find the right driver for this chipset.

3)  As discussed in earlier articles the depmod comes to our aid, it creates a mapping file called "modules.alias" which has the mapping information of ID to driver.

Refer depmod and modules.alias (go to DETAILS section).

Now we will check the file modules.alias in all kernel version to check for any supported driver for this chipset.

grep -irn "v050dp615a" /lib/modules/<kernel version>/modules.alias

Note: Append "v" before vendor ID and "p" before product ID. 

4) Ff no results are found, best thing is to check for latest vanilla kernel and do a binary search from there, generally if its not supported in latest it will be not supported, unless its an old HW for which support was removed in latest.

The problem here is to access the modules.alias (which will be in the kernel installation directory, generally /lib/modules) we need a compiled kernel, so it might take time if the latest kernel is not already compiled and installed.

(Any scripts are welcome here).

5) If you find a driver, just do a modprobe -v <driver name>. 

Eg: 

alias usb:v0B05p1761d*dc*dsc*dp*ic*isc*ip*in* rt2800usb
modprobe rt2800usb.

If still the driver is not found, probably that chipset is not supported in Linux, is that even possible? Linux has a very good support for supporting different HW's.

Don't worry we still have ways to make it work. NDISWrapper comes to the rescue. We can use NDIS wrapper in below scenarios (from #4)


  1. No open source driver provided in the Ubuntu repositories.
  2. The driver provided by default in Ubuntu is not working out.
  3. The proprietary driver provided by the card vendor is not working out.
  4. Test ndiswrapper performance versus alternative driver(s).
  5. Test hardware failure for your card.


NDIS Wrapper:

NDIS is similar to mac80211 in Windows, all the network drivers Ethernet, wireless, Bluetooth use this layer which implements the entire WDM driver model and make life easier for windows network device driver developers.

This functionality is ported to linux, where we can take any NDIS based windows driver (any windows network driver) and make it work in linux.

(Detailed discussion in another article, lets not deviate here. For those of you cant wait, see #5 for some basic idea on how it works, summary here.)


  • NDISwrapper is composed of two main parts, 

    • Command line tool used at installation time 
    • Windows subsystem used when an application calls the Wi-Fi subsystem.

  • "compile" a couple or more of Windows files, and the NDISwrapper's version of Windows DDK into a Linux Kernel Module. This is done with a tool named "ndiswrapper". 

  •  A Linux application can then send request to this Linux driver that automatically does the needed adaptations to call its—now—internal Windows driver and DDK.


Please follow the below steps, to install the windows driver in linux.



  1. wget <Link to the windows driver binaries, *.sys, *.inf>
  2. cd <Directory>
  3. ndiswrapper -i <INF file name>
    • This command will install the windows driver in Linux through the ndiswrapper utility.
  4. ndiswrapper -l
    • check the list of windows driver installed using ndis wrapper.
  5. Install the ndiswrapper Linux driver if not already installed (Distro Specific installation/ download from source).

    1. depmod -a
      • rebuild the modules database, so that next step will work.
    2. modprobe ndiswrapper
      • Load the ndiswrapper driver
    3. Steps from #1 for reference. 



Now download this file to your desktop:http://downloads.sourceforge.net/project/ndiswrapper/stable/ndiswrapper-1.59.tar.gz Right-click it and select 'Extract Here.' Then do:
cd ~/Desktop/ndiswrapper-1.59
make
sudo make install
sudo modprobe ndiswrapper

Note: Even the though the example is related to a wifi device driver, but the same procedure can be applied to any device driver.

Happy Device Driving!

References: 

1) http://askubuntu.com/questions/394159/belkin-n600-usb-wireless-adapter-on-ubuntu-12-04 

2) http://www.cyberciti.biz/faq/linux-ndiswrapper-wpa_supplicant-howto/

3) http://sourceforge.net/apps/mediawiki/ndiswrapper/index.php?title=Main_Page

4) https://help.ubuntu.com/community/WifiDocs/Driver/Ndiswrapper 

5) http://en.wikipedia.org/wiki/NDISwrapper#Use

Thursday, January 23, 2014

Building Linux Kernel Modules Faster: Internal and external


*For Newbie Linux Kernel and Device Driver developers*.

Most repetitive activity for Kernel and Device Driver developers. is building modules they work on and installing them. So lets discuss few tricks to build them faster way.

Traditionally, when we change a source code of a module, we need to 


a) Build the entire kernel again
make; make module;make modules_install;make install
(optionally using "-jN" option to make)
b) reboot and use the new modules.

But we can avoid reboot by 

a) Build the entire kernel again
b) Remove the old module 
c) Insert the new module.

Building the kernel itself is a time consuming process, especially when we just want to update code specific to our module. So for that we make use linux kernel's support and procedures for building external modules  i.e., modules which are not present in the kernel tree for modules in the kernel tree. Sounds Confusing?

Lets say we have written a new module and wanted to compile it, then we write a makefile which invokes the kernel makefile with below option:

make modules M=<Dir_of_new_Module>

But to compile a internal module (module which is present in the kernel tree) we use the same trick, except the makefile is already present. Just follow the below procedure

Procedure: 

  1. make silentoldconfig  (Optional)
    • whenever Kconfig is changed., For other cases like make and make modules (without M=) this is run by kernel makefile itself.
  2. make modules M=<path_to_dir>
  3. make modules_install M=<path_to_dir>
  4. Remove the old module and Re-Insert the new one.

Still interested of know-how, see the steps in detail:

Details:


1) Whenever we change Kconfig, .config will be updated and we need to tell the kernel makefile to use the new .config instead of using old one.This does that.

2) This uses the makefile in the module sub directory and compiles the files w.r.t #1 .config options.

3) This will install the compiled modules in to the install path /lib/modules//`uname -r`/kernel/ (or) /lib/module/`uname -r`/extra/ depending on whether the module is internal/external. In our case its always extra as we are using "M=" option for building modules. We can add some prefix (extra folder name under the above paths).

Also it used the depmod utility (through a wrapper shell script: scripts/depmod.sh) to generate the below files which will later be used by modprobe.


  • /lib/modules/`uname -r`/modules.alias
  • /lib/modules/`uname -r`/modules.alias.bin
  • /lib/modules/`uname -r`/modules.builtin
  • /lib/modules/`uname -r`/modules.builtin.bin
  • /lib/modules/`uname -r`/modules.ccwmap
  • /lib/modules/`uname -r`/modules.dep
  • /lib/modules/`uname -r`/modules.dep.bin
  • /lib/modules/`uname -r`/modules.devname
  • /lib/modules/`uname -r`/modules.ieee1394map
  • /lib/modules/`uname -r`/modules.inputmap
  • /lib/modules/`uname -r`/modules.isapnpmap
  • /lib/modules/`uname -r`/modules.ofmap
  • /lib/modules/`uname -r`/modules.order
  • /lib/modules/`uname -r`/modules.pcimap
  • /lib/modules/`uname -r`/modules.seriomap
  • /lib/modules/`uname -r`/modules.softdep
  • /lib/modules/`uname -r`/modules.symbols
  • /lib/modules/`uname -r`/modules.symbols.bin
  • /lib/modules/`uname -r`/modules.usbmap

Lets discuss the important ones below: 
  • /lib/modules/`uname -r`/modules.dep
    • Depmod is a utility which will use the "System.map" and try to work out the dependencies between the modules and create a file called "modules.dep", used by modprobe to insert (insmod) the modules in proper order.
    • /lib/modules/`uname -r`/modules.order and /lib/modules/`uname -r`/modules.symbols will be used in that process.
  • /lib/modules/`uname -r`/modules.alias
    • It identifies the HW devices each device driver supports and writes to a file "module.alias" using which the linux kernel device model can insert the driver along with its dependencies (using modprobe and modules.dep) when it  enumerates a new HW device using PCI/USB ..
  • /lib/modules/`uname -r`/modules.builtin
    • This gives a list of modules which are staically linked to the kernel forming part of vmlinuz.
  • /lib/modules/`uname -r`/modules.<BUS>map
    • These files will the known drivers for devices and give informtion regarding the device like vendorid, subsystemid, deviceclass etc.
    • This is used to create module.alias
4) Now that we have all the necessary files, use below commands "-v" is for verbose and "-r" is for using rmmod. By default it used insmod.
  •     modprobe -v -r 
  •     modprobe -v 
Installing depmod and modprobe: Install the "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/" package with your distro specific instructions.


Common Caveats:


1) If you are not seeing the changes in the new module: 

Probably you are re-inserting the old modules add "-v" to the modprobe and check the timestamps in the path from where modprobe is insmod-ing the module and your module in the kernel tree.  
Running "make modules_install" again should do, if all else fails then try copying manually.

2) If you are seeing a warning about module version check, while inserting the module: 

Probably you are using the above procedure for two dependent modules, like changing a function in cfg80211 and using that one in mac80211. 
Its better to use a directory which hold the directory of both of these, in the above case use "make modules  modules_install M=net/". For more details read Module Versioning Section in R#3.


References:

1) Linux kernel Makefile :-) 
2) Building External Modules
3) Kernel Docs: Building Linux kernel

Friday, August 16, 2013

Introduction to Ambient BackScatter, How it works?

In spite of many technological advances in wireless communications, whats the most annoying thing we face....battery drain, in fact more advanced technologies suck more battery !! For that reason for wireless devices like sensors, mobiles, swiping machines, all need a lot of maintenance...don't worry there is a way around ABS (ABC as they like to call it), Engineers from university of washington developed a prototype and demonstrated some applications.


BackScatter is an old technology used in RFID, but Ambient BackScatter differs from RFID in many ways (See below), main USP of ABS is, it Enables wireless devices with Power and Communications Medium without requiring batteries.....amazing isn't it..?? Its works on simple (Really!!) 2 principles 


1) It gets powered on using the ambient RF signals around
2) It transmits/receives signals by reflect/absorbing ambient RF signals around


The ambient RF signals discussed were TV Signals. 

It Uses 

  • FM0 Coding (Data decoded by detecting change in transitions as 0 or 1)
  • Carrier Sensing
  • Own Network Stack (Similar Frame format as Ethernet)
  • ACK based Protocol 


Now some more technical details from the official paper submitted


What is Backscattering?
At a high level, backscattering is achieved by changing the impedance of an antenna in the presence of an incident signal. Intuitively, when a wave encounters a boundary between two media that have different impedances/densities, the wave is reflected back 
 Energy Detection?
We show that one can perform energy detection by leveraging the property of the analog comparator, in the absence of a nearby backscattering transmitter, the comparator typically outputs either a constant sequence of ones or a constant sequence of zeros. A nearby transmission, on the other hand, results in changes that are greater than the comparator’s  threshold and therefore bit transitions at the comparator’s output. 
Since the transmitted bits have an equal number of ones and zeros (due to FM0 encoding), the comparator outputs the same number of ones and zeros. Thus comparing the number of ones and zeros allows the receiver to distinguish between the presence and absence of a backscatter transmission

How it is different from RFID?


Ambient backscatter differs from RFID-style backscatter in threekey respects.  
  • Firstly, it takes advantage of existing RF signals so it does not require the deployment of a special-purpose power infrastructure—like an RFID reader—to transmit a high-power (1W) signal to nearby devices 
  • Second, and related, it has a very small environmental footprint because no additional energy is consumed beyond that which is already in the air.
  • Finally, ambient backscatter provides device-to-device communication. This is unlike traditional RFID systems in which tags must talk exclusively to an RFID reader and are unable to even sense the transmissions of other nearby tags



References: 


http://www.theengineer.co.uk/channels/design-engineering/news/ambient-backscatter-promises-battery-free-communications/1016925.article 


Wednesday, August 14, 2013

Why are some of the MCS combinations invalid in 11ac?

11ac boosts the WLAN rates tremendously in to the gigabit range, but it also introduces a slight problematic area which is not really focused in 11n (because its not much of a problem) "the no of BCC encoders."


In 802.11 there are 2 types of convolutional codes (FEC) defined,

 
  • BCC (binary convolutional code)
    • Encodes the data as per the coding rate, if multiple encoders are used demultiplexes the scrambled bits among NES (number of BCC encoders for the Data field) BCC encoders, in a round robin manner
    • Punctures the Encoded output to achieve higher coding rate, by puncturing we mean we decrease the no of output bits (the denominator of the coding rate) there by resulting in an higher coding rate.
        

                   "Higher  rates are derived from it by employing 'puncturing.' Puncturing is a procedure for omitting some of the encoded bits in the transmitter (thus reducing the number of transmitted bits and increasing the coding rate) and inserting a dummy “zero” metric into the convolutional decoder on the receive side in place of the omitted bits. Decoding by the Viterbi algorithm is recommended."


  • LDPC (low-density parity check code.)
    • High performance error-correcting codes, lets us discuss these some other time.
Note: The same MCS table shall be used for both BCC and LDPC coded transmissions.


Lets take a look at both 11N and 11AC with regard to BCC encoding and MCS Rates Validity.


11N:

The rules of BCC encoder in 11N are:

  1. A single BCC encoder can support up to 300 Mbps of data rate at most, after that for every 300 Mbps step we need to use an additional encoder.
  2. NES values were chosen to yield an integer number of punctured blocks for each BCC encoder per OFDM symbol.
  3. The number of BCC encoders is not limited

So if we observe the MCS's 21, 22, 23 they all use 2 BCC encoders as the Tx Rate is > 300 Mbps. When using multiple BCC encoders the encoder parser demultiplexes the scrambled bits among NES (number of BCC encoders for the Data field) BCC encoders, in a round robin manner. 

802.11ac data flow from higher-level protocols to symbols
Process of Convolutional Coding: Multiple BCC Encoders

So the total number of bits must be multiple of no of encoders, else there will be some extra bits left at the end of the distribution.

For Eg: In case of 
optional 40 MHz, NSS = 3, EQM

MCS 21: 64QAM-2/3-1944-1296-2 Encoders

The total number of coded bits 1944 are split across   648 blocks of BCC encoders with 3 bit length, each block yields 2 bits resulting in 1296 Data bits/sub carrier.

11AC:


The rules for BCC encoder in 11AC are:
  1. The maximum data rate per BCC encoder is 600Mbps
  2. The number of BCC encoders for a particular combination of MCS, Nsts and BW is determined by the short GI data rate and the same number of encoders are used for the corresponding normal GI rate
  3. The number of BCC encoders is not limited
  4. NES values were chosen to yield an integer number of punctured blocks for each BCC encoder per OFDM symbol.

As shown in the 11N example, lets take the case of 

mandatory 20 MHz, NSS = 1, 


MCS-8: 256QAM-3/4-416-312


Here the total no of coded bits 416 should be split across 104 blocks BCC encoders with 4 bit length each block yielding 3 data bits resulting in 312 data bits/sub carrier.


MCS-9: 256QAM-5/6-416-??

Here the total no of coded bits 416 cannot be split across a interger number of encoders violating the above rule #4, hence this MCS combination is invalid.


mandatory 20 MHz, NSS = 3, 


MCS-9: 256QAM-5/6-1248-1040


1248/6 = 208 Blocks of 6 bits each yielding 5 bits output resulting in 1040 data bits, which is valid.

Similarly we can do for other MCS holes (Missing MCS rates which are thrown because they are considered invalid).


Conclusion:


So if we convert the above example in to a mathematical forumala...it sumps as below


The reminder of the division of Total no of coded bits/denominator of coding rate (the length of each convolutional code block) should be 0.


         "For BCC encoding, some of the MCS-NSS combinations are excluded from the MCS table to avoid additional padding symbols. Allowed MCSs are selected such that the number of coded bits in each OFDM symbol contains an integer number of punctured blocks from all encoders, i.e., mathematically every allowed MCS-NSS satisfies:"
Condition for a MCS to be valid: For definitions refer the IEEE spec

References:


1) IEEE 802.11ac-draft 5.0
2) IEEE 802.11-2012

Thursday, August 8, 2013

802.11 AC Primer: Whats all the fuzz about?

802.11ac is the upcoming big standard with tremendous increase in the data rates and throughput if properly utilized. Lets take a Brief/Raw look at the all the new features and how they help to achieve greater data rates and spectrum utilization.


PHY Features
  • 256 QAM
    • Very high order modulation scheme which increases the spectral efficiency only when used with beamforming technology, as high order modulation schemes are susceptible to noise and interference.
    • Compared to 11n 64QAM, spectrum efficiency improves by 33% 
    • Require about 30dB increase in SNR and coverage area is reduced (beam forming can solve this)
  • Sub-carriers
    • The maximum subcarriers that can be used with OFDM in WLAN is 64/20MHz, as of now 11ac uses this limit most efficiently, the next standard will run out the this limit, its time to increase it to 128/20MHz #IEEE :-)
      • 11a/11g ==> 52
      • 11n        ==> 57
      • 11ac      ==> ~59
  • 80 MHz
  • 160MHz
  • 80+80 MHz
    • Single continuous 160MHz and 2 discrete 80MHz can also be combined as 160MHz channel, increases the throuhgput but not the spctral efficiency.
  • 8 Spatial Streams
    • Sounds high, yeah for a single user it doesn't make sense, but with Multi User MIMO we can exploit this to increase the overall spectrum efficiency.
  • MU-MIMO
    • Instead of using all the Antennae for a single user (Even though some of them are not really used for some MCSes) we can use each antenna for a single user (max up to 4) and serve all of them in parallel.  This poses few issues like how do we identify each STA? What about group frames? How can a STA for which the data is not destined can ignore the frames? 
    • The answer to these questions is the additional features introduced in MAC as explained below. 
  • AES-256
  • GMAC and GCMP
    • Present in 11n in most of the enterprise AP's, now its official along with few other extra algorithms.

MAC Features


PHY ID's (Included in the VHT SIG field) 


Basic motivation is determine if the packet is not destined for you at the earliest possible stage (PHY instead of MAC) and go to micro sleep. (Most likely the case when MU-MIMO is in use)


GroupID


"An AP determines the possible combinations of STAs that can be addressed by an MU PPDU by assigning
STAs to groups and to specific user positions within those groups. (through a new GroupID management Frame).
So after decoding the TXVECTOR the STA can decided whether the frame is for itself (or) not."


Note: Group ID 0 is reserved for transmissions to AP and Group ID 63 is reserved for downlink SU transmissions

Partial AID: The partial AID is a non-unique identifier of a STA and is 9 bits conveyed in the TXVECTOR To identify whther the transmissions are destined to a STA/not, used in conjunction with GroupID.


PHY Power-saving with PHY ID's



TXOP Sharing 

In the TXOP won for a particular AC, we can also send frames destined for others AC's to other STA's as well.
"This mode only applies to an AP that supports DL-MU-MIMO. 
The AC associated with the EDCAF that gains an EDCA TXOP becomes the primary AC. TXOP sharing is allowed when primary AC traffic is transmitted in a VHT MU PPDU and resources permit traffic from secondary ACs to be included, targeting up to four STAs."


TXOP power save


Sounds weird but is a good feature. Basically in a TXOP for MU-MIMO, if the frame is not destined for the STA it can doze off for that TXOP duration.

"If the AP allows non-AP VHT STAs to enter Doze state during a TXOP, then a non-AP VHT STA that is in VHT TXOP power save mode may enter the Doze state till the end of that TXOP when one of the following
conditions is met:
— On receipt of a VHT MU PPDU, the STA determines that it is not a member of the group indicated by the RXVECTOR parameter GROUP_ID. 
— On receipt of an SU PPDU, the STA determines that the RXVECTOR parameter PARTIAL_AID is neither equal to 0 nor does it match the STA’s partial AID. 
— The STA finds that the PARTIAL_AID in the RXVECTOR matches its partial AID but the RA in the MAC header of the corresponding frame that is received correctly does not match the MAC address of the STA."
 References:

    1. IEEE Discussions: Spectrum Efficiency 
    2. IEEE Discussion: PHY Powersave
    3. 802.11ac-draft 5.0