Installing OpenWRT: Alix 2d2

In order to test CSMA/ECA in real hardware, we have successfully replaced the firmware running in Broadcom BCM4318 wireless network interfaces (WNICs) with a modified OpenFWWF firmware, as we commented before.

CSMA/CA vs a CSMA/ECA implementation

CSMA/CA vs a CSMA/ECA implementation

The figure above shows the result of a throughput evaluation derived from those tests. The Bd = 7 means that CSMA/ECA’s deterministic backoff waits for slot 7 (8 slots, counting the slot 0) before attempting transmission.

The problem with this setup is the lack of mobility or reconfiguration. STA1 and STA2 are two PCs and are very cumbersome to move and test different scenarios. Furthermore, to accurately appreciate the gains of CSMA/ECA the experiment should be composed of more contenders.

 

Size matters

To that end we have purchased two PC Engines Alix 2d2. This mini computers can be thought at Raspberry Pi on steroids.

Alix 2d2 with Pigtail to WNIC

Alix 2d2 with Pigtail to WNIC

The image above shows one of our two Alix 2d2 computers with a 4 GB Compact Flash (upper right corner) and a Broadcom BCM 4318 WNIC (at the center) which we (very roughly) connected a pigtail cable to an antenna adapter. This is to be fixed soon when new pigtail cables arrive.

With this type of device we are able to create new testing scenarios for CSMA/ECA, although at the moment we started the tests with only two to replicate the results obtained with the PCs.

Installing OpenWRT

It was recommend to use OpenWRT instead of Ubuntu for the following reasons:

  • Really compact image.
  • It is fairly easy to add new software with the built-in toolchain.
  • Everything is kept at the RAM flash.
  • Underlying Linux-esque filesystem.

So, through the following bullets the process for installing OpenWRT with b43 Linux driver and Iperf utility is explained.

Prerequisites:

You can build the OpenWRT on a recent Ubuntu PC. For instance, this process was all executed in an Ubuntu 13.04 computer with 4 cores. The following packages are needed:

  • build-essential
  • libncurses-dev
  • libz-dev
  • gawk
  • flex
  • gcc-multilib
  • subversion

All can be acquired by issuing the following command from the Terminal: $: apt-get install <the packages you need>.

The configuration and compilation:

Now that you have all the packages you need, let’s start the process.

  1. Create a directory anywhere you want and name it codebase, issuing: mkdir codebase
  2. Download OpenWRT into this directory (using version 33669):
    1. $: cd codebase
    2. $: svn co -r 33669 svn://svn.openwrt.org/openwrt/branches/backfire
    3. NOTE 030517: they are using Git now: https://dev.openwrt.org/wiki/GetSource
  3. Add Iperf by exploding this package into the codebase directory.
    1. $: cd backfire
    2. $: tar zxf iperf-openwrt.tar.gz
  4. Inside the backfire directory, you now must have the following subfolders and files:
    1. package/iperf
    2. package/uclib++
    3. dl/iperf-2.0.5.tar.gz
    4. dl/uClibc-0.9.30.1.tar.bz2
  5. Configure OpenWRT issuing the following commands:
    1. $: cd backfire
    2. $: make menuconfig
  6. The last command will take you to a graphical menu, where you may select the configuration options by navigating with the keyboard arrows. Here is where you add b43 and other packages like Iperf. Now, let’s configure the installation by enabling/disabling the following packages.
    1. Select Target System x86
    2. Select Subtarget Generic
    3. Select Target Profile PCEngines Alix
    4. Check that: Base system > busybox > Configuration > Login/Password Management Utilities > login, is enabled.
    5. Check: Network > IP, is enabled.
    6. Check: Network > iperf, is enabled.
    7. Check: Kernel modules > Filesystems > kmod-fs-ext4, is enabled.
    8. Check: Kernel modules > Wireless Drivers > kmod-b43, is enabled.
    9. Check: Kernel modules > Wireless Drivers > kmod-b43 > Configuration > Enable debug, is enabled.
    10. Check: Kernel modules > Wireless Drivers > kmod-mac80211 > Configuration > Export mac80211…DebugFS, is enabled.
    11. Check: Kernel modules > Wireless Drivers > kmod-b43legacy, is enabled.
  7. Save the configuration, exit, determine the number of cores of your system and build.
    1. For determining the cores of your system: $: nproc
    2. The output of the command above represents the number of cores in your system, and the argument for the make command: $ make -j <number of cores>.
  8. Apply the dma patch and recompile everything:
    1. $: cd backfire/build_dir/linux-x86_generic/compat-wireless-2011-12-01
    2. $: patch -p0 < /path/to/b43-dma.patch
    3. $: cd ../../../ (going back to backfire directory).
    4. $: make -j <number of cores>.
  9. After the compilation, you will end up with bin/x86/openwrt-x86-generic-combined-ext2.img.gz. Unzip it to get the .img file.
    1. $: gunzip /path/to/openwrt-x86-generic-combined-ext2.img.gz

Uploading the image to the Alix’s CompactFlash:

To write to this kind of memory cards you will need a CompactFlash reader. It is like a SD or Memory Stick reader. Connect it to the computer, format it (FAT32 suffices) and copy the image, bit-by-bit by issuing the following:

  1. $: dmesg (check the /dev/sdg port mapped to the just connected CompactFlash reader. It should be some of the bottom messages if you just connected the reader.)
  2. $: dd if=/path/to/openwrt-x86-generic-combined-ext2.img of=/dev/sdg

Regarding the dmesg command: I have tried to configure the of (output file) as /dev/sdgXX, where XX is a number assigned to a specific USB port. Nevertheless, it did not work. Therefore, I recommend disconnecting other USB devices except the reader and use /dev/sdg (or other dmesg derived location like /dev/disk) as of.

 What’s next?

You’re done. Now, connect the CompactFlash to the Alix, power it on and connect to it through one of the Ethernet interfaces (the one having 192.168.1.1 as the default IP address) via Telnet (e.g.: $: telnet 192.168.1.1).

It is recommended to set a SSH password for the root user. Read a little by about it before connecting for the first time.

Thanks to Francesco Gringoli, involved in the OpenFWWF project for such detailed set of instructions.

Regards.

L!

Posted under: OpenFWWF, OpenWRT

Leave a Reply