Table of Contents
Installation
Pre-Compiled Debian Packages
Make sure you have appropriate package repository configured.
Configure Apt Repository
To begin we'll need to add the Orbit apt repository to the list of sources that our console will pull packages from. This is done by running the following two commands.
Note: It is assumed that you have root access and can run these commands as root if needed
The first installs the orbit repositories gpg-key into the consoles key-ring.
wget -qO - http://packages.orbit-lab.org/downloads/orbitapt.gpg.key | sudo apt-key add -
Next we download the source list for the repository.
wget -qO /etc/apt/sources.list.d/orbit.list http://packages.orbit-lab.org/downloads/orbit-precise.list
Once we have these changes in place, we need to update the repository list via
apt-get update
Configure OML apt Repository
OML libraries are required to proceed with the installation. They are installed automatically once the repositories list have been added correctly.
Note: It is assumed that you have root access and can run these commands as root if needed
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 wget -qO- http://download.opensuse.org/repositories/home:/cdwertmann:/oml/xUbuntu_10.04/Release.key | sudo apt-key add - #Ubuntu 12.04 wget -qO- http://download.opensuse.org/repositories/home:/cdwertmann:/oml/xUbuntu_12.04/Release.key | sudo apt-key add -
Once we have these changes in place, we need to update the repository list via:
sudo apt-get update
The MF host protocol stack is installed with:
sudo apt-get install mfclient
This will install the following components:
- mfstack binary: user level implementation of the MobilityFirst client network stack
- mfstack configuration files: sample configuration file for the network protocol stack installed under /etc/mfstack/.
- libmfapi: c/c++ api library for MobilityFirst based applications
- jmfapi: java api library for MobilityFirst based applications. The library is provided as a jar file called jmfapi-1.0-SNAPSHOT.jar which is installed under /usr/lib/mfjava/
- libgnrs: c/c++ gnrs library for DMap
- jgnrs: java gnrs library for DMap. The library is provided as a jar file called jgnrs-1.0-SNAPSHOT.jar which is installed under /usr/lib/mfjava/
Compiling From Source
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 openssl libssl-dev libpopt-dev
1.2. Download MobilityFirst Sources
Git: The development versions of the prototype components can be checked out from the MobilityFirst git repository host on orbit-lab:
git clone ssh://username@external2.orbit-lab.org/common/git/mf
Note: cloning the git repository requires setting your ssh agent to use your orbit-lab key pair.
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/ ./ #Ubuntu 14.04 deb http://download.opensuse.org/repositories/devel:/tools:/mytestbed:/stable/xUbuntu_14.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 - #Ubuntu 14.04 curl http://download.opensuse.org/repositories/home:/cdwertmann:/oml/xUbuntu_14.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).