Wiki

Clone wiki

mobilityfirst / Host_Protocol_Stack_Installation

The following instructions provide detail on how to install the MobilityFirst Host Protocol Stack in two different environments: Linux and Android.

1. Linux

1.1. Required Packages

The implementation has been tested on Ubuntu 10.04, 12.04 and 13.04, but it should work on basically any linux distribution. These are the required packages (for Ubuntu).

sudo apt-get update
sudo apt-get -y install git-core libpcap0.8-dev

1.2. Download MobilityFirst Sources

Git: The development versions of the prototype components can be checked out from the MobilityFirst git repository on BitBucket:

git clone https://username@bitbucket.org/nkiran/mobilityfirst.git

Set and export path of top-level folder to an env. variable 'MF_HOME'

export MF_HOME=/home/username/mobilityfirst

1.3. Install Optional OML Client Libraries

This is required for optionally running OML-based statistics reporting for logging traffic and resource statistics to a backend OML database. The libraries can be obtained and installed from the OML repository at Opensuse.org using the following steps. Refer to installation instructions at the OML project website site for additional details and troubleshooting.

First, append the following line to /etc/apt/sources.list, choosing the one appropriate for your Ubuntu version:

#Ubuntu 10.04
deb http://download.opensuse.org/repositories/home:/cdwertmann:/oml/xUbuntu_10.04/ ./

#Ubuntu 12.04
deb http://download.opensuse.org/repositories/home:/cdwertmann:/oml/xUbuntu_12.04/ ./

You also need to add the repository key before the actual download (requires curl or similar):

#Ubuntu 10.04
curl http://download.opensuse.org/repositories/home:/cdwertmann:/oml/xUbuntu_10.04/Release.key | sudo apt-key add -

#Ubuntu 12.04
curl http://download.opensuse.org/repositories/home:/cdwertmann:/oml/xUbuntu_12.04/Release.key | sudo apt-key add -

Now download and install the OML client packages:

sudo apt-get update
sudo apt-get -y install liboml2 liboml2-dev

1.4. Compiling the Host Protocol Stack

After deciding whether to include OML in the created executable compile the Host Protocol Stack:

cd $MF_HOME/hoststack/src

#With OML
make

#Without OML
make NO-OML=1

1.5. Installing the Host Protocol Stack (optional)

Install the compiled application running (from the same folder as before):

#With OML
sudo make install

#Without OML
sudo make NO-OML=1 install

2. Android

2.1. Required Packages

The implementation should compatible with any ARM based device. To check out the MobilityFirst code git is required.

sudo apt-get update
sudo apt-get -y install git-core

Download the latest ndk distribution from the Android Developer website and make sure to add the folder containing the kit to the environment PATH variable:

export PATH=$PATH:/path/to/ndk/

Download the Android Developer Tools from the Android Developer website. Only the adb executable is necessary for the installation process.

Enable the read/write permissions on the root and system folders of your Android device. To do so you have two options, install the application [ES File Explorer])https://play.google.com/store/apps/details?id=com.estrongs.android.pop) from the Play Store and use its root explorer function to change permissions or you can run the following commands:

$ adb shell
$ su
$ mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system

(Replace /dev/block/mtdblock3 & /system with appropriate device path and mount point, as obtained from cat /proc/mounts)

Finally, to run the Host Protocol Stack the Android device will need to be rooted.

2.2. Download MobilityFirst Sources

Git: The development versions of the prototype components can be checked out from the MobilityFirst git repository on BitBucket:

git clone https://username@bitbucket.org/nkiran/mobilityfirst.git

Set and export path of top-level folder to an env. variable 'MF_HOME'

export MF_HOME=/home/username/mobilityfirst

2.3. Compiling the Host Protocol Stack

To run the compiling script provided, is necessary to add the ndk-build command contained in the ndk package to the system PATH variable.

PATH=$PATH:/path/to/NDK/folder

Compile the Host Protocol Stack:

cd $MF_HOME/hoststack/android/
./compile

2.4. Installing the Host Protocol Stack (optional)

Install the compiled libraries and executable found in the generated bin folder. To install the libraries is necessary to have write permissions on the Android root and system folders.

    adb push libpcap.so /system/lib/
    adb push libgnustl_shared.so /system/lib/
    adb shell mkdir /data/mfdemo/
    adb push mfandroidstack /data/mfdemo/


    ALERT: do not push the libcrypto.so library found in the bin folder; it is necessary for compiling the stack but if pushed in the system (replacing the one available) it might break some system features (e.g. wifi).

Updated