Added 2013-07-03: libwireless Class documentation, and “Code documentation” section below.
The wireless package contains components for physical- and link-layer simulation of wireless systems, with an emphasis on error correction codes. It was developed as part of spinal code research. Components include:
- Error correcting codes: spinal codes, raptor, LT, LDPC, strider, turbo.
- Mappers/Demappers: linear mapping, gray mapping.
- Channels: AWGN, BSC, MIMO, model of Rayleigh channel.
- Packet generators: random, random+CRC.
- Statistics collection: BER (Bit Error Rate), PER (Packet Error Rate).
- Simulation loop ready for parallel execution, supports rateless codes.
- Efficient database (based on Berkeley DB) to collect experiment results.
The package has the following dependencies: SWIG, git, python header files, GNU autotools, libtool, a C++ compiler (e.g., g++), Boost (for strider linear algebra), numpy, and IT++. On Ubuntu 12.04 these can be installed via:
sudo apt-get install swig git python-dev autoconf libtool g++ libboost-dev python-numpy-dev libitpp-dev
Note that on Ubuntu, IT++ is in the universe software repository, so they might require enabling universe repositories. Note that SWIG version 2.0.7 and up are required. Earlier versions have bugs that prevent swig from successfully compiling the binding code. If downloading latest swig source code, note that libpcre is required, e.g.:
sudo apt-get install libpcre3-dev
Obtaining the code
The code is hosted on github: https://github.com/yonch/wireless. To get a copy:
git clone git://github.com/yonch/wireless.git
Enter the directory
Deploy the autotools build system
Configure the package. The build requires CPPFLAGS with the location of IT++ include files (in Ubuntu 12.04 for example, /usr/include). To separate build objects from the source tree, the package is configured from within a different directory (called release, below). The package could be installed to the default system paths (by omitting –prefix), but the example below installs to the user’s home directory.
mkdir release cd release CPPFLAGS="-I/usr/include -DNDEBUG" CXXFLAGS="-O3" ../configure --prefix=$HOME -C
Or, make a debug release
mkdir debug cd debug CPPFLAGS="-I/usr/include -DDEBUG" CXXFLAGS="-O1 -g" ../configure --prefix=$HOME -C
Make the package and install:
make -j8 make -j8 install
Setting up the environment
In case the library was installed into a custom directory (like the user’s home directory), the following paths enable the package to be found.
export WIRELESS_SIM_PREFIX=$HOME export C_INCLUDE_PATH=$WIRELESS_SIM_PREFIX/include:$C_INCLUDE_PATH export CPLUS_INCLUDE_PATH=$WIRELESS_SIM_PREFIX/include:$CPLUS_INCLUDE_PATH export LIBRARY_PATH=$WIRELESS_SIM_PREFIX/lib:$LIBRARY_PATH export LD_LIBRARY_PATH=$WIRELESS_SIM_PREFIX/lib:$LD_LIBRARY_PATH export PYTHONPATH=$PYTHONPATH:$WIRELESS_SIM_PREFIX/lib/python2.7/site-packages:$WIRELESS_SIM_PREFIX/lib/python
By adding these to ~/.bashrc or the like, these paths can be configured automatically.
The sanity test runs simulation with many of the package’s components:
python >>> import wireless.simulator.SanityTest
See the code documentation online, organized by the function of components. The following list is organized by the sequence of operations to simulate a packet:
- Packet generators produce test messages
- A link layer protocol tells the simulator how many symbols to transmit
- Error correction codes encode the message into integers
- Mapper transform the integers to symbols. Symbols can be represented as complex numbers, floating point numbers, or fixed point numbers.
- Channels add noise to symbols and simulate fading.
- (optional) A demapper takes in noisy symbols and infers the likelihood of individual mapped bits
- A decoder infers the original message. The decoder can be a subclass of ILLRDecoder (if its input is likelihoods) or IDecoder (if its input is raw symbols).
- A detector decides whether the decode was successful. On decode failure, the link layer protocol can decide to transmit more symbols and try decoding again.
- Statistics objects collect information about the decode: whether it succeeded, how many bit errors it had, etc.
- The Simulator class orchestrates packet simulation from start to end. Factories make different components, to make the simulator modular.
These might also help:
- The file python/simulator/SanityTest.py contains multiple experiment specifications.
- For spinal codes, a python implementation (without puncturing) is in python/codes/spinal/reference. The file test/codes/spinal/EncoderDecoderTests.py doesn’t work out of the box, but contains the basic recipe to make spinal encoders/decoders (to complement information in SpinalFactory.py
For more information, please leave a comment or contact the author (yonch at mit dot edu). This guide will be expanded according to user requests as time allows. — Jonathan