Get MANIAC Ready

In order to become MANIAC Ready there are 2 major checkpoints that must be completed and they are the following:
  1. Operating System compliance
  2. MANIAC Package compliance
It should be noted that there is no officially required OS for the MANIAC Challenge so we have provided a set of General Instructions for teams that wish to use a different distribution of linux than what we have suggested.






Operating System installation: [Back to top]

Prior to the MANIAC Package software installation, each node should be set-up with a Linux distribution with a compliance tested kernel. Although participants are free to choose any distribution, it is recommended that participants use a distribution that the MANIAC package has been tested on. Specific instructions and notes can be found for the recommended operating systems below:

  1. Slackware 10.2
  2. Ubuntu 6.06.1 (Dapper Drake)
  3. Ubuntu 7.04 (Feisty Fawn)
  4. General
In addition, General Instructions are included for those that want to try other distributions. Please let us know about successes and failures with these and other distributions so we can let others know. Stay tuned for additional distribution notes as they become available.


  1. Slackware 10.2

    The API has been tested on Slackware 10.2 and found to work following the General Instructions. For our testing, we used kernel version 2.6.16.35. During installation be sure to include iptables in addition to typical installation pieces.

    • Download and burn CDs of the .iso image files from http://slackware.mirrors.tds.net/pub/slackware/slackware-10.2-iso/. You will need slackware-10.2-install-d1.iso and slackware-10.2-install-d2.iso only.

    • There are several forums online to guide you through a Slackware installation. Some of them are:
      - slackwarehelp.org/
      - linuxforums.org
      - A good guide used by us is available at: bitbenderforums.com

    • A few notes about installation:

      1. Slackware 10.2 CD comprises many kernel images but initially you will install kernel 2.4.13 (bare.i image)

      2. If your hard disk is not partitioned, you can use any partitioning software such as Partition Magic or other third-party partition software. We STRONGLY recommend that you backup your existing data before attempting to partition your hard disk. Also, if you are a beginner to Linux we recommend that you only create two partitions for Linux (root and swap).

      3. When prompted for which packages to install, choose a 'full' installation unless you know what you are doing.

      4. When prompted to install a kernel image, please select the same kernel image (most IDE disks will use bare.i image) you booted from.

      5. When prompted to select startup services to run (such as BIND, BSD Inetd daemon etc.) please make sure you check rc.ip_forward option.

    back up




  2. Ubuntu 6.06.1 (Dapper Drake)

    The Dapperest of Drakes was also tested extensively during the API development process. Things we found to work well with a couple small modifications. The instructions include:

    • Install a normal install of the OS. Make sure your networking card is working before going forward.

    • Add the basic development packages ("build-essential" and "make"). To do this, start the Add/Remove application and go to the Advanced section (button at the bottom left). Find the "build-essential" and "make" packages and install them. This will install the needed libraries, compilers, and so on.

    • Follow the general directions for installing OLSR.

    • Follow the general directions for installing the netfilter modules, as well, EXCEPT the installation wants to put the library files into the /usr/local/lib directory not the typical /usr/lib (like the rest of the Ubuntu libraries). To combat this, you can change where things are installed by giving ./configure some options (see the ./configure --help for information on that) or you can edit the /etc/ld.so.conf file and add the directory where the linker looks for libraries. To do this just add a line /usr/local/lib to the file; create the file if necessary. After each install run ldconfig as root and it will update everything.

    • Download the MANIAC API as described.

      - If things fail to compile on first try and the compiler complains about not being able to find the ifreq struct, edit the rawethernet.h file and add #include <linux/if.h> prior to the other <linux/if_*> statements. This should fix this error.

    back up




  3. Ubuntu 7.04 (Feisty Fawn)

    Things were tested on Fawn and the installation went the same as the Ubunut 6.06 installation. However, problems were encountered keeping the wireless card configured correctly; it would change to infrastructure mode from ad hoc mode randomly. This makes it difficult to work with, so it was ditched in favor of the earlier version of Ubuntu. We did not have the time (or energy) to explore this problem. If you know what the issue (and solution) are please let us know. The Fawn does have some cooler utilities than the Drake.

    back up




  4. General Instructions

    • Required: kernel version 2.6.14 or later (required by one of the netfilter libraries)

      • If the above step of installing Slackware 10.2 is a success, your next step is to build and install a new kernel version (2.6.16)

      • Download the kernel source file (linux-2.6.16.35.tar.gz) from www.kernel.org/pub/linux/kernel/v2.6/

      • Unzip and untar the file in /usr/src

      • Again, there are several forums online to guide you through kernel build and install. A good guide which was used by us is available at: digitalhermit.com

      • A few notes about kernel building:
        • The configuration process of the kernel is the most strenuous process. During the configuration process, it is convenient to compile the file system in the kernel itself rather than as a module.

        • Also, please ensure that netfilter support is enabled in the kernel, i.e. "CONFIG_NETFILTER = y"

        • Slackware 10.2 is distributed with LILO as its default boot loader.

        • A functional .config file is included here. Note that this file has been configured to work with a Dell Inspiron 5100. You may use it as a reference to configure your own system but it is *not guaranteed* that it will provide support for all your existing hardware.


    • Install OLSR

    • Check for iptables installed - this usually included with most Linux distributions these days, so you probably have it.

    • Install libnfnetlink

      - further instructions at the Netfilter home page

    • Install libnetfilter_queue

      - further instructions at the Netfilter home page

    • Download the MANIAC API

    • - Download the tarball and extract to wherever you want

      - Inside the tarball you will find a Makefile, a handful of .h files, a docs directory, a userSpace.cpp file and a static library (maniac_api_lib.a).

      - The documentation for the API is /docs/latex/refman.pdf. This file will give you the overview of what methods and files are available to you. The basic idea is to edit userSpace.cpp and insert your forwarding code, run make (no parameters), and run the resulting maniac binary. You must be root to run the maniac binary.

    back up









MANIAC Package installation: [Back to top]

To ensure that devices from different teams are able to communicate with one another, teams need to install an ad hoc routing protocol (OLSR) and a custom-built API that provides a basic structure to manipulate traffic. Since the MANIAC API uses Netfilter, kernel version 2.6.14 (or later) is needed. We strongly recommend ver.2.6.16.35 which we used for development and testing purposes.

  1. OLSR
  2. Netfilter
  3. MANIAC API

  1. Installation of OLSR [DOWNLOAD NOW]
  2. Optimized Link State Routing (OLSR) protocol is a proactive routing protocol for MANETs. There are many different implementations of OLSR for Linux but for the competition we will be using a modified version of the one developed by the folks at Naval Research Laboratory (NRL). We have modified the OLSR code such that it provides the connectivity information at each node as seen by OLSR along with the drop rate for that link. The following steps are to be performed to install OLSR on a notebook.

    • Untar the gzip file to create a sub-directory maniac_olsr.

    • cd to the unix sub-directory within maniac_olsr and compile the OLSR source code by executing the following instructions: make -f Makefile.linux

    • After the compilation is done, copy the OLSR binary, nrlolsrd, just created to /usr/local/bin to enable you to run the daemon from any directory.

    • Read the readme.help file in /{installed-directory}/nrlolsr to familiarize yourself with the different command options available to execute the OLSR daemon.

    back up


  3. Installation of Netfilter
  4. Netfilter is a software-suite that allows you to perform different actions such as to drop, re-route or mangle packets in userspace. It provides different hooks into the kernel for enabling such actions. The MANIAC API is dependent on having Netfilter installed and configured for the running kernel. The following packages are required by the MANIAC API:

    • iptables - these are standard with any distribution and should be installed. Please make sure that iptables is installed by typing iptables -V. This should return the current version of iptables installed on your machine.

    • libnfnetlink
      - From www.netfilter.org, download the library package, libnfnetlink-0.0.25.tar.bz2.
      - Unzip and untar the file to create a libnfnetlink-0.0.25 folder.
      - Configure the package by running:
      ./configure
      - We now compile and install the library package by executing the following commands:
      make
      make install

    • libnetfilter_queue
      - From www.netfilter.org, download the library package, libnetfilter_queue-0.0.13.tar.bz2.
      - Unzip and untar the file to create a libnetfilter_queue-0.0.13 folder.
      - cd to libnetfilter_queue-0.0.13 and configure the package by running ./configure.
      - We now compile and install the library package by executing the following commands:
      make
      make install

    • Setup of iptables
      iptables must be configured to send specific traffic to userspace where the MANIAC software can process it. Traffic must be sent to the netfilter queue via the NFQUEUE chain. This must be specified with an iptables rule. For instance, if we wanted to send all TCP traffic on the INPUT chain to the MANIAC code via NFQUEUE, we would specify:
      iptables -A INPUT -p tcp -j NFQUEUE

      NOTE: for uknown reasons, some distributions do not pick up packets correctly unless the rule is specified for the FORWARD chain.

      ** Once the rule is specified, traffic that cannot be sent to a listener is dropped. So, without running the MANIAC code, you should notice that all specified traffic is dropped by the rule.

      ** Reference the iptables documentation for help in adding/deleting/modifying rules and appropriate syntax.

    • For any problems with installation, please check the user and developer forums on http://lists.netfilter.org/

    back up


  5. Installation of the MANIAC API [DOWNLOAD NOW]
  6. The MANIAC API allows teams to manipulate packets and enables them to implement their own cooperation-aware strategies. Further, it also assists in the interoperability of different participant solutions on a common network platform.

    • Unzip and untar the files into any working directory. We recommend that you do it in /usr/src/maniac-v1.0.

    • Compile the MANIAC code to test your installation. Type:
      make clean
      make all
      If this compiles correctly, your linux setup should be ready to run the MANIAC code.

    • The MANIAC executable can now be run to harvest the traffic gathered by the iptables rule. In the MANIAC directory, run "out". Packets can now be handled in the "userSpace.cpp" file (see software documentation)

    back up