Wiki

Clone wiki

gnrs / Building GNRS on Ubuntu 10.10

This Page is Deprecated

This page is no longer updated and may not reflect the latest changes/requirements to the code. Please refer to Building GNRS on Ubuntu for the latest instructions.


Build Instructions

This page documents how to build and run the GNRS prototype code once you've obtained it from the MobilityFirst SVN repository.

Download Ubuntu 10.10

Grab yourself a copy of Ubuntu from their releases site. I used the server installation with no services selected, so I'll assume you're working from that. If you use the desktop version or have any additional packages auto-installed, you may not need some steps listed below.

I installed Ubuntu on a VirtualBox virtual machine (hosted on Ubuntu 12.04). You can choose the VM software of your choice, and I'll assume that they all work about he same for the purposes of these instructions. Caveats/details for specific VMs should be listed at the bottom.

Update to the latest versions

Be sure to update your installation to the latest repository versions of the software. Also install the necessary components to build/run GNRS and its dependencies. As of the time of this writing, the kernel version was 2.6.35-32.

# Update userspace packages
sudo apt-get update && sudo apt-get upgrade
# Install new kernel/source
sudo apt-get dist-upgrade
# Reboot after the new kernel is installed
sudo shutdown -r now

Packaged Dependencies

Ubuntu 10.10

# Install required packages provided by repositories
sudo apt-get install subversion git build-essential mysql-server-5.1 mysql-client-5.1 libmysqlclient-dev libmysqlcppconn-dev libboost-dev libboost-filesystem-dev libboost-thread-dev libboost-system-dev libboost-regex-dev linux-headers-$(uname -r)

Ubuntu 12.04

# Install required packages provided by repositories
sudo apt-get install subversion git build-essential mysql-server-5.5 mysql-client-5.5 libmysqlclient-dev libmysqlcppconn-dev libboost-dev libboost-filesystem-dev libboost-thread-dev libboost-system-dev libboost-regex-dev linux-headers-$(uname -r)

Manual Dependencies

Some of the GNRS dependencies are not included in the Ubuntu package repositories and need to be installed manually.

libconfig 1.4.8

libconfig is a tool for parsing configuration files. The version as of this writing is 1.4.8, and can be downloaded as a source GZipped tarball.

cd /tmp/
wget http://www.hyperrealm.com/libconfig/libconfig-1.4.8.tar.gz
tar -zxvf libconfig-1.4.8.tar.gz
./configure
make
sudo make install

Berkeley DB 5.2

Download, compile, and install the latest version of the Berkeley DB embedded database code in the 5.2 branch. Unfortunately, you need to create free Oracle account in order to access the software. Once you have it, then place the GZipped tarball in your home directory.

tar -zxvf db-5.2.42.tar.gz
cd db-5.2.42/build_unix
../dist/configure --prefix=/usr/local -enable-cxx -enable-stl
make
sudo make install

Configure MySQL DB

We need to create the GNRS database and tables used to store the network locator mappings, TTL values, and link weights. To do this you can either enter the commands below manually or put them into a text file and feed them into the mysql client via standard in.

create user 'gnrs-user' identified by 'gnrs-password';
create database mf_gnrs;
use mf_gnrs;
CREATE TABLE global_guid_locators_map (guid CHAR(32) NOT NULL PRIMARY KEY, locators TEXT NOT NULL, TTLs TEXT NOT NULL, weights TEXT NOT NULL, INDEX guid_index USING BTREE (guid));
CREATE TABLE local_guid_locators_map (guid CHAR(32) NOT NULL PRIMARY KEY, locators TEXT NOT NULL, TTLs TEXT NOT NULL, weights TEXT NOT NULL, INDEX guid_index USING BTREE (guid));
GRANT SELECT, INSERT, UPDATE, DELETE ON mf_gnrs.* TO 'gnrs-user'@'localhost' identified by 'gnrs-password';
quit;

Download Click!

Download the latest sources of Click! into your user's home directory. I'll assume you put it in /home/username/click. Be sure to check-out the version 2.0 branch, as master doesn't seem to build against the 2.6 kernel source in Ubuntu.

git clone git://github.com/kohler/click.git
cd click
git checkout v2.0-release

Get the GNRS source

Check out the latest GNRS code from the MobilityFirst SVN repository if you haven't done so already. At the time of writing, you need a MobilityFirst account in order to get the code. You may also check-out the code from the BitBucket Git repository, but we can't guarantee that it's stable.

git clone https://username@bitbucket.org/romoore/gnrs.git

Compile and Install the GNRS code

We need to build and install the GNRS client/server binaries. Optionally we should build the linux kernel module that will introduce artificial delays for outbound packets, if we want to emulate large networks for testing or evaluation purposes.

GNRS Server Daemons

We need to build the server process first. This will automatically build its dependencies contained in the other directories.

cd gnrs/src/server
make clean all
# Copy the daemon binaries to /usr/local
sudo cp gnrsd /usr/local/bin/
sudo cp lnrsd /usr/local/bin/
# Copy the configuration file to /etc/gnrs
sudo mkdir -p /etc/gnrs
sudo cp gnrsd.conf /etc/gnrs/
sudo cp servers.lst /etc/gnrs/

GNRS Clients

First let's build the "old client".

cd src/client/
make clean all
sudo cp gnrs-client /usr/local/bin/
sudo cp gbench /usr/local/bin/
sudo cp client.conf /etc/gnrs/

Now let's build the "new client".

cd src/client-new/
make clean all
sudo cp gbench /usr/local/bin/gbench-new
# Only copy the config file if you didn't do so above
sudo cp client.conf /etc/gnrs/

Kernel Delay Module

Finally, we'll build and install the kernel delay module so we can introduce artificial delays for our outbound GNRS packets. This wiki assumes you cloned Click! into "$HOME"/click.

cd gnrs/src/tools/delay_module/
cp *.[ch]* ~/click/elements/local/
sudo cp delayModTest.click /etc/gnrs/
sudo cp delayModTest.conf /etc/gnrs/
cd ~/click/
./configure --enable-fixincludes --enable-local --with-linux=/usr/src/linux-headers-$(uname -r) --with-linux-map=/boot/System.map-$(uname -r)
make clean
make elemlist
make 
sudo make -i install
sudo click-install -u /etc/gnrs/delayModTest.click
sudo cp /etc/gnrs/delayModTest.conf /click/delayMod/config
# Verify things went well by checking syslog
cat /var/log/syslog | grep GNRS

Caveats

Below should be a list of known issues/problems related to specific VM software or OS installations that differ from the main installation instructions.

Updated