Ettus USRP B2xx family » History » Revision 18
Revision 17 (Anonymous, 02/19/2016 10:47 PM) → Revision 18/26 (Anonymous, 02/19/2016 10:48 PM)
This page will describe how to install and configure [[OpenBSC]], OpenBSC, Osmo-BTS, Osmo-TRX, Osmo-PCU and [[OpenGGSN]] 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:* '''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. '''2. Installing dependencies:* dependencies:''' <pre> {{{ 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 </pre> }}} Create a folder, where all the projects files will be stored: <pre> {{{ mkdir osmocom cd osmocom </pre> *Get }}} '''Get Opencore AMR:* AMR:''' <pre> {{{ 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 .. </pre> *Get ORTP:_ }}} '''Get ORTP:'' Note: 0.24.2 is not working with [[OpenBSC]]! OpenBSC! <pre> {{{ 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 .. </pre> *Get }}} '''Get libosmocore (master):* (master):''' <pre> {{{ git clone git://git.osmocom.org/libosmocore.git cd libosmocore autoreconf -fi ./configure make make install ldconfig cd .. </pre> *Get }}} '''Get libosmo-abis (master)* (master)''' <pre> {{{ git clone git://git.osmocom.org/libosmo-abis.git cd libosmo-abis autoreconf -fi ./configure make make install ldconfig cd .. </pre> *Get }}} '''Get libosmo-netif (master):* (master):''' <pre> {{{ git clone git://git.osmocom.org/libosmo-netif.git cd libosmo-netif autoreconf -fi ./configure make make install ldconfig cd .. </pre> *Get [[OpenGGSN]]:* }}} <pre> '''Get OpenGGSN:''' {{{ git clone git://git.osmocom.org/openggsn.git cd openggsn autoreconf -i ./configure --prefix=/usr/local make make install ldconfig cd .. </pre> *Get }}} '''Get libosmo-sccp (master):* (master):''' <pre> {{{ git clone git://git.osmocom.org/libosmo-sccp.git cd libosmo-sccp autoreconf -fi ./configure make make install ldconfig cd .. </pre> *Get [[OpenBSC]] (master):* }}} <pre> '''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 ../.. </pre> *Get }}} '''Get Osmo-BTS (201509-fairwaves-rebase):* (201509-fairwaves-rebase):''' <pre> {{{ 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 .. </pre> *Get }}} '''Get Osmo-PCU (master):* (master):''' <pre> {{{ git clone git://git.osmocom.org/osmo-pcu.git cd osmo-pcu autoreconf -fi ./configure make make install ldconfig cd .. </pre> *Get }}} '''Get Osmo-TRX (master):* (master):''' <pre> {{{ git clone git://git.osmocom.org/osmo-trx.git cd osmo-trx ./autogen.sh ./configure make make install ldconfig cd .. </pre> *Get }}} '''Get mISDN kernel and user space:* space:''' Note: if you see "configure: error: kernel build tree does not exist" then you need to install kernel headers. <pre> {{{ 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 </pre> }}} To auto-load the mISDN kernel modules do: <pre> {{{ cd /etc/modules-load.d/ cat > misdn-modules.conf mISDN_core mISDN_dsp mISDN_l1loop nchannel=30 interfaces=2 </pre> }}} Hit Ctrl+C <pre> {{{ chmod 644 misdn-modules.conf cd / </pre> *Install }}} '''Install Asterisk (ver 1.8 !):* !):''' On Ubuntu 14.04 there is no version 1.8 Asterisk anymore, to get it, do the following: <pre> {{{ 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 </pre> }}} Otherwise the Asterisk channel driver (chan_lcr) will not compile. *Get '''Get LCR (master):* (master):''' <pre> {{{ 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 .. </pre> }}} Configure the LCR interfaces: <pre> {{{ 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 </pre> }}} Hit Ctrl+C Add the following two lines to the bottom of options.conf: <pre> {{{ nano /usr/etc/lcr/options.conf socketuser asterisk socketgroup asterisk </pre> *Configuration }}} '''Configuration of Asterisk:* 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: <pre> {{{ sudo service asterisk restart </pre> *Configuring }}} '''Configuring the GGSN:* 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]], '''Configuring OpenBSC, Osmo-SGSN, Osmo-PCU* Osmo-PCU''' Please use the attached examle config files at the bottom fo this page. *Starting '''Starting the services* 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: <pre> {{{ ggsn </pre> }}} Start LCR: <pre> {{{ lcr fork </pre> }}} Open a new terminal and start the SGSN (with the sample config file provided): <pre> {{{ sudo osmo-sgsn -c sgsn.conf </pre> }}} Open a new terminal and start the BSC (with the sample config file provided): <pre> {{{ sudo osmo-nitb -C -c openbsc.conf -T -P -m </pre> }}} Open a new terminal and start Osmo-TRX: <pre> {{{ sudo osmo-trx </pre> }}} Open a new terminal and start Osmo-BTS (with the sample config file provided): <pre> {{{ sudo osmobts-trx -c osmo-bts.cfg </pre> }}} Open a new terminal and start Osmo-PCU (with the sample config file provided): <pre> {{{ sudo osmo-pcu -c osmo-pcu.cfg </pre> *Setting }}} '''Setting up NAT for GPRS:* 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: <pre> {{{ ifconfig </pre> }}} 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". <pre> {{{ 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 </pre> }}}