Project

General

Profile

Actions

Ettus USRP B2xx family » History » Revision 19

« Previous | Revision 19/26 (diff) | Next »
laforge, 02/27/2016 08:44 PM


{{include(disclaimer-user-content)}}

This page will describe how to install and configure OpenBSC, Osmo-BTS, Osmo-TRX, Osmo-PCU and OpenGGSN to create an opensource 2G/GSM network with your Ettus USRP B200/B210 SDR hardware.

This page in under development, please stay tuned.

Pre-Req:

The following guide is created on Ubuntu 14.14.03 LTS 64bit with kernel 3.19.0-26-lowlatency

1. Installing the UHD driver stack for Ettus USRP SDRs:

http://files.ettus.com/manual/page_install.html#install_linux_ourbins

2. Installing dependencies:

apt-get install libdbi0-dev libdbd-sqlite3 build-essential libtool autoconf automake git-core pkg-config libssl-dev libpcsclite-dev libusb-1.0 libncurses5-dev libgsm1-dev libpcap-dev libc-ares-dev libtalloc-dev libsctp-dev

Create a folder, where all the projects files will be stored:

mkdir osmocom
cd osmocom

Get Opencore AMR:

wget http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz
tar xvzf opencore-amr-0.1.3.tar.gz
cd opencore-amr-0.1.3
./configure
make
make install
ldconfig
cd ..

*Get ORTP:_

Note: 0.24.2 is not working with OpenBSC!

wget http://download.savannah.gnu.org/releases/linphone/ortp/sources/ortp-0.22.0.tar.gz
tar xvzf ortp-0.22.0.tar.gz
cd ortp-0.22.0
./configure
make
make install
ldconfig
cd ..

Get libosmocore (master):

git clone git://git.osmocom.org/libosmocore.git
cd libosmocore
autoreconf -fi
./configure
make
make install
ldconfig
cd ..

Get libosmo-abis (master)
git clone git://git.osmocom.org/libosmo-abis.git
cd libosmo-abis
autoreconf -fi
./configure
make
make install
ldconfig
cd ..

Get libosmo-netif (master):
git clone git://git.osmocom.org/libosmo-netif.git
cd libosmo-netif
autoreconf -fi
./configure
make
make install
ldconfig
cd ..

Get OpenGGSN:
git clone git://git.osmocom.org/openggsn.git
cd openggsn
autoreconf -i
./configure --prefix=/usr/local
make
make install
ldconfig
cd ..

Get libosmo-sccp (master):
git clone git://git.osmocom.org/libosmo-sccp.git
cd libosmo-sccp
autoreconf -fi
./configure
make
make install
ldconfig
cd ..

Get OpenBSC (master):
git clone git://git.osmocom.org/openbsc.git
cd openbsc/openbsc
autoreconf -fi
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./configure
make
make install
ldconfig
cd ../..

Get Osmo-BTS (201509-fairwaves-rebase):
git clone git://git.osmocom.org/osmo-bts.git
cd osmo-bts
git checkout 201509-fairwaves-rebase
autoreconf -fi
./configure --enable-trx
make
make install
ldconfig
cd ..

Get Osmo-PCU (master):
git clone git://git.osmocom.org/osmo-pcu.git
cd osmo-pcu
autoreconf -fi
./configure
make
make install
ldconfig
cd .. 

Get Osmo-TRX (master):
git clone git://git.osmocom.org/osmo-trx.git
cd osmo-trx
./autogen.sh
./configure
make
make install
ldconfig
cd .. 

Get mISDN kernel and user space:

Note: if you see "configure: error: kernel build tree does not exist" then you need to install kernel headers.

git clone git://git.misdn.eu/mISDN.git
cd mISDN
./configure 
cp mISDN.cfg.default standalone/mISDN.cfg
make modules
make modules_install
ldconfig
cd ..

git clone git://git.misdn.eu/mISDNuser.git
cd mISDNuser
make
./configure
make
sudo make install
ldconfig
cd ..

depmod –a
modprobe mISDN_core
modprobe mISDN_dsp
modprobe mISDN_l1loop nchannel=30 interfaces=2

To auto-load the mISDN kernel modules do:

cd /etc/modules-load.d/
 cat > misdn-modules.conf
 mISDN_core
 mISDN_dsp
 mISDN_l1loop nchannel=30 interfaces=2

Hit Ctrl+C
chmod 644 misdn-modules.conf
cd /

Install Asterisk (ver 1.8 !):

On Ubuntu 14.04 there is no version 1.8 Asterisk anymore, to get it, do the following:

wget http://launchpadlibrarian.net/153943558/asterisk-modules_1.8.13.1~dfsg-3ubuntu3_amd64.deb
wget http://launchpadlibrarian.net/153943773/asterisk-config_1.8.13.1~dfsg-3ubuntu3_all.deb
wget http://launchpadlibrarian.net/153943772/asterisk-dev_1.8.13.1~dfsg-3ubuntu3_all.deb
wget http://launchpadlibrarian.net/153943557/asterisk_1.8.13.1~dfsg-3ubuntu3_amd64.deb
wget http://launchpadlibrarian.net/107480639/asterisk-core-sounds-en-gsm_1.4.22-1_all.deb
wget http://launchpadlibrarian.net/58272892/asterisk-moh-opsound-gsm_2.03-1_all.deb
dpkg -i *.deb
apt-get -f install

Otherwise the Asterisk channel driver (chan_lcr) will not compile.

Get LCR (master):

git clone git://git.misdn.eu/lcr.git/
cd lcr
autoreconf -fi
./configure --with-gsm-bs --with-misdn --with-asterisk
make
make install
cp chan_lcr.so /usr/lib/asterisk/modules/
ldconfig
cd ..

Configure the LCR interfaces:

cat > /usr/etc/lcr/interface.conf 
[GSM]
gsm-bs
tones no
earlyb no
bridge ast

[ast]
remote asterisk
context from-lcr
earlyb no
tones yes
bridge GSM

Hit Ctrl+C

Add the following two lines to the bottom of options.conf:

nano /usr/etc/lcr/options.conf

socketuser asterisk
socketgroup asterisk

Configuration of Asterisk:

You can find an attached configuration file called "extensions.conf". Please put that file and overwrite the original configuration at /etc/asterisk/exetensions.conf

Then restart asterisk:

sudo service asterisk restart

Configuring the GGSN:

Use the example configuration file called "ggsn.conf" and put it to /etc/ggsn.conf

The traffic from the UEs (mobiles, USB modems etc) are terminated on a TUN interface with the IP address: 10.0.0.1
The UEs are going to get an address from this range: 10.0.0.2 - 10.0.0.254
The GGSN will listen on 127.0.0.5. In this example all the services (BSC, GGSN, SGSN, PCU etc.) are running on the same computer.

Configuring OpenBSC, Osmo-SGSN, Osmo-PCU

Please use the attached examle config files at the bottom fo this page.

Starting the services

Please note that in this example we are going to need quite a few terminals to be open, because except for LCR, GGSN and Asterisk, we are going to run the services in foreground.

Start the GGSN:

ggsn

Start LCR:

lcr fork

Open a new terminal and start the SGSN (with the sample config file provided):

sudo osmo-sgsn -c sgsn.conf

Open a new terminal and start the BSC (with the sample config file provided):

sudo osmo-nitb -C -c openbsc.conf -T -P -m

Open a new terminal and start Osmo-TRX:

sudo osmo-trx

Open a new terminal and start Osmo-BTS (with the sample config file provided):

sudo osmobts-trx -c osmo-bts.cfg

Open a new terminal and start Osmo-PCU (with the sample config file provided):

sudo osmo-pcu -c osmo-pcu.cfg

Setting up NAT for GPRS:

In order for the UEs to be able to "see" the internet, we need to enable network address translation (NAT).

First determine which network interface is connected to the internet with:

ifconfig

After you know the interface name (for example: eth0 or eth1 or em1 etc.), run the following commands.

Note that in the second command you need to use your interface name instead of "em1".

sudo echo 1 > /proc/sys/net/ipv4/ip_forward
sudo iptables -A POSTROUTING -s 10.0.0.0/24 -t nat -o em1 -j MASQUERADE
Files (6)
ggsn.conf ggsn.conf 529 Bytes GGSN config file, put it to /etc/ggsn.conf , 09/23/2015 04:07 PM
extensions.conf extensions.conf 1.5 KB Asterisk config file, put it to /etc/asterisk/extensions.conf , 09/23/2015 04:08 PM
osmo-pcu.cfg osmo-pcu.cfg 1.04 KB Example Osmo-PCU config file , 09/23/2015 04:09 PM
sgsn.conf sgsn.conf 1.12 KB Example Osmo-SGSN config file , 09/23/2015 04:09 PM
openbsc.conf openbsc.conf 3.98 KB Example OpenBSC config file , 09/23/2015 04:09 PM
osmo-bts.cfg osmo-bts.cfg 593 Bytes Example OsmoBTS config file laforge, 04/12/2017 01:09 PM

Updated by laforge about 8 years ago · 19 revisions

Add picture from clipboard (Maximum size: 48.8 MB)