Commit 9f3364f0 authored by Florian Kaltenberger's avatar Florian Kaltenberger
Browse files

moving project SPECTRA to extras

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7400 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 847a4203
This diff is collapsed.
########################################
#
# SPECTRA DEMO INSTALLATION AND RUN
#
#
#
# Rui Costa <ferreira@eurecom.fr>
#
# v1.13 (15 Oct 2014)
#
########################################
########################################
1. REQUIREMENTS
To properly run the demo these are the main pieces of software
that are required:
- OPENAIR4G (checkout the main trunk from the EURECOM SVN).
- ODTONE (Open 802.21 protocol from ITAveiro git server).
- Boost C++ Libraries are requested by ODTONE (v1.48 or higher)
- REST Toolkit (Codename "Casablanca")
- Adequate shell/bash start-up scripts for both eNB and UE.
BEFORE attempting any installation YOU MUST check your system for
any required software that these components require, as for
instance, a compatible GCC/G++ compiler, build tools, etc.
NOTES BEFORE INSTALLATION:
N1. Installation SHOULD NOT be done as ROOT. IF and WHEN super
user permissions are required you will be prompted for them.
N2. You MUST have a valid EURECOM SVN-enabled account for the
Openair4G code.
N3. For ODTONE software, you MUST have installed the ITAveiro
SSL/TLS certificates available at their webserver.
N4. You MUST have Internet access in order to properly build and
deploy the software, as some of the software is fetched online.
########################################
2. BUILD & INSTALL
2.1. PREPARATION
Start by creating a folder on a non-root directory, preferably
your home folder. Copy the <spectra_demo_prepare.sh> script into
the newly created folder, henceforth referred to as
<spectra_root_folder>.
2.2. INSTALLATION
There are two ways of processing the installation:
- If you already have performed a checkout of the OpenAir svn.
(Aimed at single installations for OAI developers.)
- If you only have the demonstration source code & scripts.
(To allow easier deployment over several machines, just copy
the demo's source folder, including the prepare and install
scripts to which ever machine you need and let the scripts do
the work for you)
2.2.1 From the OPENAIR SVN
Go to the folder:
<openair_root_folder>/trunk/targets/PROJECTS/SPECTRA/DEMO_SPECTRA
and run the installation script with the node type to install:
# ./spectra_demo_install.sh -oai_svn <node_type>
2.2.2 From the demo's source code and scripts.
Go to the <spectra_root_folder> and run:
# ./spectra_demo_install.sh -full <node_type>
If the previous step has been well performed, you should now have
a local working copy of the OpenAir SVN on your local machine, along
with additional code required for the demo.
2.3. CRM
This component of the demo MUST be compiled and installed separately.
Check <spectra_root_folder>/CRM/ for more details.
There is a google app that must be running in the google cloud,
and it's url configured in the source code. The local client is based
on the C++ REST framework codenamed "Casablanca".
Furthermore you need to compile the local client components
(CRMClient and CRMMain).
In the CRM client you will find a folder <tosend> which includes some
basic scripts that populate the google app database, and show how to
interact with it.
2.4. TVWS Sensing Measurements
There is a server and client for simulating the TVWS measurements and
run the cognitive algorithm to activate the required actions on the
LTE link. (this is the goal of the demo)
Copy the client & server located at <spectra_root_folder>/clientSensing/
into the ENB2 startup folder (<openair_root_folder>/targets/PROJECTS/SPECTRA)
2.5. TROUBLESHOOTING
If for some reason the installation does not run as expected, check
for permission-related issues or missing software packages.
Otherwise, try to install the components one by one, as defined in
the installation scripts.
(see <spectra_demo_prepare.sh> and <spectra_demo_install.sh> for
compilation and configuration details).
The preparation script will automatically call the installation
script, but in case it does not, run it manually, it is located at:
<spectra_root_folder>/openair4G/targets/PROJECTS/SPECTRA/
NOTE: During installation we apply a patch to ODTONE, due to the
lack of a definition for LTE links and their attributes.
However, as new versions are released the patch may need to
be adapted. Therefore, be aware of compilation issues
originating from the compilation of the ODTONE core functions.
########################################
3. CONFIGURATION
You MUST make sure that the configuration of your physical and
logical interfaces matches with your Open Air and ODTONE
configuration files. Take all parameters into account while
checking the configuration files and launch scripts, located in:
<spectra_root_folder>/openair4G/targets/PROJECTS/SPECTRA/
<spectra_root_folder>/ODTONE/dist/
3.1 Base Configuration
This is the network configuration on the config files:
UE1
eth0 (192.168.13.2) - oai0 (10.0.0.2) (LTE emulated link)
ENB1
eth0 (192.168.12.122) internet access gw (192.168.12.100)
eth1 (192.168.13.1) - oai0 (10.0.0.1) (LTE emulated link)
eth2 (192.168.14.3) (Internal Relay Connection)
UE2
eth0 (192.168.14.4) (Internal Relay Connection)
eth1 (192.168.15.5) - oai0 (10.0.2.3) (LTE emulated link)
ENB2
eth0 (192.168.15.6) - oai0 (10.0.2.4) (LTE emulated link)
########################################
4. RUNNING THE DEMO
1. We advise you to turn off the network manager service in order
for the startup script configuration to be effective and final.
This can be achieved by executing:
# sudo service network-manager stop
2. (On all machines) Go to OpenAir Launch folder:
<spectra_root_folder>/openair4G/targets/PROJECTS/SPECTRA/
3. Launch the eNB1 on eNB1 machine:
# sudo ./start_enb.bash
Wait for eNB1 to reach stand by mode.
4. Launch the UE1 on UE1 machine:
# sudo ./start_ue.bash
5. Launch the eNB2 on eNB2 machine:
# sudo ./start_enb.bash
Wait for eNB2 to reach stand by mode.
6. Launch the UE2 on UE2 machine:
# sudo ./start_ue.bash
7. Any other modules will be launched automatically
if present. (CRM client, TVWS sensing, MIHF, MIH Users, etc.)
Enjoy the demo!
################################################################################
CHANGELOG
v0.99 (03/09/2014)
- First <spectra_demo_prepare.sh> script and <README> file.
v1.00 (04/09/2014)
- Added compartmentalization for each sw component
- Added full installation procedure from scratch
- Fetching sw from repositories, compilation & installation
- Revisioned output
v1.01 (05/09/2014)
- Added OpenAir conf files <spectra_demo_src/openair_conf>
- Added MIHF Users <spectra_demo_src/mih_users>
- Reduced printed output
v1.02 (08/09/2014)
- Bug correcting on installation and configuration paths & scripts
- Patched Open Air script <targets/PROJECTS/SPECTRA/build_all.sh>
v1.03 (09/09/2014)
- Patched MIHF to support LTE link based on previous code
- Added <spectra_demo_src/mihf/>
with patch files: <link.hpp> <bin_query.hpp>
- Revisioned <spectra_demo_prepare.sh>
v1.04 (11/09/2014)
- Corrected MIHF patch bugs
- Added patch file <archive.hpp>
- Corrected path and filename bugs on <spectra_demo_prepare.sh>
v1.05 (15/09/2014)
- Corrected MIHF patch bugs
- Added a number of patch files
- Adjusted patch execution on <spectra_demo_prepare.sh>
v1.06 (17/09/2014)
- Working demo 1 eNB 1 UE
- Modified configuration files for UE and eNB
- Substituted overwrite of files into a Git patch for SPECTRA
v1.07 (19/09/2014)
- Expanded demo to 4 machines:
- 2 real: ue1, eNB1
- 2 virtual: eNB2, ue2 (both hosted by eNB1)
v1.08 (23/09/2014)
- Included CRM client and TVWS sensing modules.
v1.09 (24/09/2014)
- Final Demo setup ready.
v1.10 (29/09/2014)
- Updated RRC code for OpenAir.
- Code commit to OpenAir SVN trunk.
v1.11 (01/10/2014)
- Restructure of source code tree and installation files to
include the full demo (2 eNB and 2 ue)
- Splitted prepare and install scripts.
- Added colour coded steps and error stoppage on install script.
v1.12 (13/10/2014)
- Added bug fixes on launch and install scripts
- Added final version to openair svn
- Reworked README file.
v1.13 (15/10/2014)
- Polishing of the demo
- Added bug fixes on launch scripts for enb1
- Added feature to put measurements on CRM from enb1
- Changed readable output of received measurement reports on enb2
- Added more informative output on the sensingClient (TVWS)
- Demonstration now stops at end of MIH_Link_Actions.confirm
message on MIH_User of enb2
- Added info on sensing client and CRM
- Reworked README file.
################################################################################ EOF
#!/bin/bash
########################################
#
# SPECTRA DEMO INSTALLATION AND RUN
#
#
#
SCRIPT_VERSION="v1.12"
DATE="13 Oct 2014"
AUTHOR="Rui Costa"
EMAIL="ferreira@eurecom.fr"
########################################
OWN_TAG=$0
INSTALL_PATH=$PWD
OPENAIR_PATH=$INSTALL_PATH/openair4G
ODTONE_PATH=$INSTALL_PATH/ODTONE
BOOST_PATH=$INSTALL_PATH/boost_1_49_0
SPECTRA_SRC_PATH=$INSTALL_PATH/spectra_demo_src
NODE_TYPE=NONE
INSTALL_TYPE=NONE
########################################################################################### UTILS
function util_echo {
# return value passed in $1 (usually $?)
# return value = 0 - OK - Light green
if [ $1 -eq 0 ] ; then
echo -e "\e[92m\e[1m[$OWN_TAG]\e[0m $2"
# return value != 0 - ERROR
else
# return value -gt 255 - WARNING - Light Yellow
if [ $1 -gt 255 ] ; then
echo -e "\e[93m\e[1m[$OWN_TAG]\e[0m $2"
else
# return value 1 to 255 - ERROR - Light RED
echo -e "\e[91m\e[1m[$OWN_TAG]\e[0m $2"
exit
fi
fi
}
########################################################################################### BOOST C++
function fetch_boost {
cd $INSTALL_PATH
util_echo $? "-------------------------------------------------"
util_echo $? "BOOST C++ Library ..."
# Although new versions of boost exist, when compiling ODTONE he asks for v1.49.0
# (we humour it so to not have linkage problems later)
wget --trust-server-names "http://downloads.sourceforge.net/project/boost/boost/1.49.0/boost_1_49_0.tar.gz?r=&ts=1412338583&use_mirror=optimate"
util_echo $? "Fetched BOOST C++ Library ..."
sleep 2
tar -xzf boost_1_49_0.tar.gz
util_echo $? "Extracted BOOST C++ Library ..."
}
function build_boost {
cd $BOOST_PATH
util_echo $? "-------------------------------------------------"
util_echo $? "BOOST C++ Library ..."
sleep 2
# Configuring Boost
./bootstrap.sh
util_echo $? "Bootstrapped BOOST C++ Library ..."
sleep 2
# Compiling Boost (pthread link flag is vital)
./b2 --with-date_time --with-thread linkflags=-lpthread
util_echo $? "Built BOOST C++ Library ..."
}
########################################################################################### ODTONE
function fetch_odtone {
cd $INSTALL_PATH
util_echo $? "-------------------------------------------------"
util_echo $? "ODTONE ..."
sleep 2
# Getting newest version of Odtone
git clone https://github.com/ATNoG/ODTONE.git
util_echo $? "Checked Out ODTONE from ITAveiro GIT..."
cd $ODTONE_PATH
git submodule update --init
util_echo $? "Updated ODTONE submodules..."
}
function build_odtone {
cd $ODTONE_PATH
util_echo $? "-------------------------------------------------"
util_echo $? "ODTONE ..."
# /***** REPLACED WITH Git spectra PATCH
#
# Establishing the pointer to a local compilation of boost instead of the usual in /usr/local/src/
#touch boost-build.jam
#echo "boost-build $BOOST_PATH/tools/build/v2 ;" > boost-build.jam
# Copying our new MIH Users
#cp -r $SPECTRA_SRC_PATH/mih_users/* $ODTONE_PATH/app/
# we MUST patch these files! ODTONE by default has no knowledge of LTE links
# this overwrite of files ensures that full LTE link parameters exist.
# A better way of paching the files should be implemented later!!
#cp -r $SPECTRA_SRC_PATH/mihf/link.hpp $ODTONE_PATH/inc/odtone/mih/types/
#cp -r $SPECTRA_SRC_PATH/mihf/archive.hpp $ODTONE_PATH/inc/odtone/mih/detail/
#cp -r $SPECTRA_SRC_PATH/mihf/address.hpp $ODTONE_PATH/inc/odtone/mih/types/
#cp -r $SPECTRA_SRC_PATH/mihf/bin_query.hpp $ODTONE_PATH/inc/odtone/mih/types/
#cp -r $SPECTRA_SRC_PATH/mihf/CMakeLists.txt $ODTONE_PATH/lib/odtone/
#cp -r $SPECTRA_SRC_PATH/mihf/conf.cpp $ODTONE_PATH/lib/odtone/
#cp -r $SPECTRA_SRC_PATH/mihf/conf.hpp $ODTONE_PATH/inc/odtone/
#cp -r $SPECTRA_SRC_PATH/mihf/Jamfile $ODTONE_PATH/lib/odtone/
#cp -r $SPECTRA_SRC_PATH/mihf/command_service.cpp $ODTONE_PATH/src/mihf/
#cp -r $SPECTRA_SRC_PATH/mihf/dst_transaction.cpp $ODTONE_PATH/src/mihf/
#cp -r $SPECTRA_SRC_PATH/mihf/event_service.cpp $ODTONE_PATH/src/mihf/
#cp -r $SPECTRA_SRC_PATH/mihf/link_book.cpp $ODTONE_PATH/src/mihf/
#cp -r $SPECTRA_SRC_PATH/mihf/main.cpp $ODTONE_PATH/src/mihf/
#cp -r $SPECTRA_SRC_PATH/mihf/service_access_controller.cpp $ODTONE_PATH/src/mihf/
#cp -r $SPECTRA_SRC_PATH/mihf/service_management.cpp $ODTONE_PATH/src/mihf/
#cp -r $SPECTRA_SRC_PATH/mihf/src_transaction.cpp $ODTONE_PATH/src/mihf/
#cp -r $SPECTRA_SRC_PATH/mihf/transaction_pool.cpp $ODTONE_PATH/src/mihf/
#
# *****/
# Applying SPECTRA patch to ODTONE source code
git apply --check --stat $SPECTRA_SRC_PATH/common/mihf_src/0001-SPECTRA-patch-for-ODTONE-v0.1.patch
util_echo $? "Checking if SPECTRA patch can be aplied..."
git apply $SPECTRA_SRC_PATH/common/mihf_src/0001-SPECTRA-patch-for-ODTONE-v0.1.patch
util_echo $? "Applying SPECTRA patch to ODTONE..."
# Changing hostname on the boost build
sed -i "s%nikaia%$USER%g" $ODTONE_PATH/boost-build.jam
util_echo $? "Modifying boost-build.jam..."
# Compiling Odtone core
$BOOST_PATH/b2 linkflags=-lpthread
util_echo $? "Compiled ODTONE..."
# Copying lte_test_user for this node
rm -rf $ODTONE_PATH/app/lte_test_user
cp -r $SPECTRA_SRC_PATH/$NODE_TYPE/mih_user/* $ODTONE_PATH/app/
util_echo $? "Installed ODTONE mih user for: $NODE_TYPE..."
# Compiling lte_test_user
$BOOST_PATH/b2 app/lte_test_user/ linkflags=-lpthread linkflags=-lrt
util_echo $? "Compiled ODTONE apps..."
# Copying odtone confs
cp $SPECTRA_SRC_PATH/$NODE_TYPE/mih_conf/*.conf $ODTONE_PATH/dist/
util_echo $? "Installed ODTONE configuration files for: $NODE_TYPE..."
}
########################################################################################### OPENAIR
function fetch_openair {
mkdir $OPENAIR_PATH
cd $INSTALL_PATH
util_echo $? "-------------------------------------------------"
util_echo $? "OPENAIR EURECOM ..."
sleep 2
svn co http://svn.eurecom.fr/openair/openair4G/trunk $OPENAIR_PATH
util_echo $? "Checked Out openair4G/trunk from EURECOM SVN..."
}
function build_openair {
cd $OPENAIR_PATH
util_echo $? "-------------------------------------------------"
util_echo $? "OPENAIR ..."
sleep 2
# Putting in place pre-made scripts for the build of openair
cp $SPECTRA_SRC_PATH/common/openair_scripts/* $OPENAIR_PATH/targets/PROJECTS/SPECTRA/
util_echo $? "Installed OpenAir common build scripts ..."
# Putting in place pre-made scripts for the conf of openair
cp $SPECTRA_SRC_PATH/$NODE_TYPE/oai_conf/* $OPENAIR_PATH/targets/PROJECTS/SPECTRA/
util_echo $? "Installed OpenAir startup scripts and conf for $NODE_TYPE..."
cd $OPENAIR_PATH/targets/PROJECTS/SPECTRA/
# Updating the path location of ODTONE and BOOST on the script, according to the local machine.
sed -i "s%path_to_boost_folder%$BOOST_PATH%g" env_802dot21.bash
util_echo $? " Fixed BOOST path in env_802dot21.bash... $BOOST_PATH"
sed -i "s%path_to_odtone_folder%$ODTONE_PATH%g" env_802dot21.bash
util_echo $? " Fixed ODTONE path in env_802dot21.bash... $ODTONE_PATH"
if [ $NODE_TYPE == "enb2" ] ; then
sed -i "s%enb_lte_user%enb2_lte_user%g" env_802dot21.bash
util_echo $? " Fixed exec name (enb2_lte_user) for $NODE_TYPE..."
# sed -i "s%ENB_MIH_USER_CONF_FILE=enb_lte_user.conf%ENB_MIH_USER_CONF_FILE=enb2_lte_user.conf%g" env_802dot21.bash
util_echo $? " Fixed conf name (enb2_lte_user.conf) for path $NODE_TYPE..."
fi
if [ $NODE_TYPE == "ue2" ] ; then
sed -i "s%ue_lte_user%ue2_user%g" env_802dot21.bash
util_echo $? " Fixed exec name (enb2_lte_user) for $NODE_TYPE..."
util_echo $? " Fixed conf name (enb2_lte_user.conf) for path $NODE_TYPE..."
fi
# executing the (re)build of all components
# superuser necessary for installing the ITTY tool of openair
./build_all.bash
util_echo $? "Finished OpenAir build..."
}
########################################################################################### PRINT_HELP
function print_help {
util_echo 333 " -------------------------------------------------"
util_echo 333 " USAGE: "
util_echo 333 " $ $OWN_TAG <install_type> <node_type>"
util_echo 333 " "
util_echo 333 " <install_type>"
util_echo 333 " -full If you start from scratch"
util_echo 333 " -oai_svn If you got this script after"
util_echo 333 " checking out the Openair SVN"
util_echo 333 " <node_type>"
util_echo 333 " -ue1 For installing ue1 files"
util_echo 333 " -ue2 For installing ue2 files"
util_echo 333 " -enb1 For installing eNB1 files"
util_echo 333 " -enb2 For installing eNB2 files"
util_echo 333 " "
util_echo 333 " -------------------------------------------------"
util_echo 333 " "
exit
}
########################################################################################### MAIN
clear
# Testing Args
if [ $# -ne 2 ]; then
util_echo 333 " Incorrect Number of Arguments!!"
print_help
fi
if [ $1 == "-full" ]; then
INSTALL_TYPE=FULL
fi
if [ $1 == "-oai_svn" ]; then
INSTALL_TYPE=OAISVN
fi
if [ $2 == "-ue1" ]; then
NODE_TYPE=ue1
fi
if [ $2 == "-ue2" ]; then
NODE_TYPE=ue2
fi
if [ $2 == "-enb1" ]; then
NODE_TYPE=enb1
fi
if [ $2 == "-enb2" ]; then
NODE_TYPE=enb2
fi
if [ $INSTALL_TYPE == "NONE" ]; then
util_echo 333 " Incorrect Arguments (type of installation) !!"
print_help
fi
if [ $NODE_TYPE == "NONE" ]; then
util_echo 333 " Incorrect Arguments (type of node) !!"
print_help
fi
# Starting...
util_echo $? " -------------------------------------------------"
util_echo $? " SPECTRA DEMO "
util_echo $? " Installation Script"
util_echo $? " "
util_echo $? " $SCRIPT_VERSION $DATE"
util_echo $? " "
util_echo $? " Author: $AUTHOR <$EMAIL> "
util_echo $? " -------------------------------------------------"
util_echo 333 " Performing installation type: $INSTALL_TYPE for $NODE_TYPE"
sleep 3
util_echo $? " -------------------------------------------------"
util_echo $? " >> Fetching sources"
util_echo $? " -------------------------------------------------"
if [ $INSTALL_TYPE == "OAISVN" ]; then
INSTALL_PATH=$PWD/../../../../
OPENAIR_PATH=$PWD/../../../
ODTONE_PATH=$INSTALL_PATH/ODTONE
BOOST_PATH=$INSTALL_PATH/boost_1_49_0
SPECTRA_SRC_PATH=$PWD/spectra_demo_src
else
fetch_openair
fi
fetch_odtone
fetch_boost
sleep 1
util_echo $? " -------------------------------------------------"
util_echo $? " >> Building"
util_echo $? " -------------------------------------------------"
sleep 2
build_boost
build_odtone
build_openair
util_echo 333 " Open Air Configuration files at:"
util_echo 333 " $OPENAIR_PATH/targets/PROJECTS/SPECTRA/"
util_echo 333 " "
util_echo 333 " ODTONE Configuration files at:"
util_echo 333 " $ODTONE_PATH/dist/"
util_echo $? " "
util_echo $? " "
util_echo $? " -------------------------------------------------"
util_echo $? " SPECTRA DEMO preparation script ... finished!"
util_echo $? " -------------------------------------------------"
cd $INSTALL_PATH
exit 0
########################################################################################### EOF
#!/bin/bash
########################################
#
# SPECTRA DEMO PREPARATION
#
#
#
SCRIPT_VERSION="v1.12"
DATE="13 Oct 2014"
AUTHOR="Rui Costa"
EMAIL="ferreira@eurecom.fr"
########################################
OWN_TAG=$0
INSTALL_PATH=$PWD
OPENAIR_PATH=$INSTALL_PATH/openair4G
ODTONE_PATH=$INSTALL_PATH/ODTONE
BOOST_PATH=$INSTALL_PATH/boost_1_49_0
SPECTRA_SRC_PATH=$INSTALL_PATH/spectra_demo_src
SPECTRA_OAI_PATH=$OPENAIR_PATH/targets/PROJECTS/SPECTRA/
########################################################################################### UTILS
function util_echo {
# return value passed in $1 (usually $?)
# return value = 0 - OK - Light green
if [ $1 -eq 0 ] ; then
echo -e "\e[92m\e[1m[$OWN_TAG]\e[0m $2"
# return value != 0 - ERROR
else
# return value -gt 255 - WARNING - Light Yellow
if [ $1 -gt 255 ] ; then
echo -e "\e[93m\e[1m[$OWN_TAG]\e[0m $2"
else
# return value 1 to 255 - ERROR - Light RED
echo -e "\e[91m\e[1m[$OWN_TAG]\e[0m $2"
exit
fi
fi
}
########################################################################################### OPENAIR
function fetch_openair {
mkdir $OPENAIR_PATH