Build a GSM Network with OpenBSC OsmoBTS OsmoTRX and USRP B210 on a Single PC
This document assumes that you have basic knowledge of the GSM network architecture(MSC, BTS, Abis, Um, etc.), Linux terminal and USRP UHD driver.
- Intel Core i5-6500 CPU, 8 GB RAM, 64 GB HDD, Ethernet Connection, USB 3.0 Port
- Ubuntu 16.04.4 Desktop 64-bit
- USRP B210, Two GSM Antennas
As for our GSM network, USRP B210, OsmoTRX and OsmoBTS consist the BTS(Base Transceiver Station),
OpenBSC running as OsmoNITB (Network In The Box) implements a minimal subset of the BSC, MSC, SMSC and HLR.
OsmoTRX is a software-defined radio transceiver that implements the Layer 1 physical layer of a BTS.
It is the bridge between the RF hardware(USRP B210 in our case) and the OsmoBTS.
OsmoBTS is a software implementation of a GSM BTS.
OsmoBTS is modular and has support for multiple back-ends.
A back-end talks to a specific L1/PHY implementation of the respective BTS hardware.
In our case, OsmoBTS(osmo-bts-trx) talks to the OsmoTRX radio transceiver running on USRP B210.
OpenBSC started as a BSC (Base Station Controller) side implementation of the A-bis protocol,
It can run either as OsmoBSC, exposing an A interface towards an external MSC,
or as OsmoNITB (Network In The Box), whert implements a minimal subset of the BSC, MSC, SMSC and HLR.
As our GSM network runs on a single PC, OpenBSC runs here as OsmoNITB.
It talks to OsmoBTS through Abis/IP.
USRP B210 is a SDR(Software Define Radio) kit from Ettus.
It transforms the digital signal on our computer into real world radio signal.
Osmocom recommands that you should use your distribution’s package management system for installing stuff.
As we will tinker with the source code later, so OpenBSC is built with
As for OsmoBTS and OsmoTRX, you should install them from the Osmocom repository.
Will come to that later.
Set up our working directory as non-root user
mkdir ~/Projects cd ~/Projects
First install these dependencies:
sudo apt install libdbi-dev libdbd-sqlite3 libortp-dev build-essential libtool autoconf autoconf-archive automake git-core pkg-config libtalloc-dev libpcsclite-dev libpcap-dev
Then, build these projects bellow from source, following the Build from Source guide.
For each project
git clone git://git.osmocom.org/[project name] cd [project name] autoreconf -fi ./configure make make check sudo make install sudo ldconfig -i
In case of any missing dependency,
./configure will tell you.
Note: For openbsc, you have to run
cd openbsc/openbsc instead of
As I have said earlier, installing from the Osmocom repository is preferred if you have no special excuse.
sudo su wget http://download.opensuse.org/repositories/network:/osmocom:/latest/xUbuntu_16.04/Release.key apt-key add Release.key rm Release.key echo "deb http://download.opensuse.org/repositories/network:/osmocom:/latest/xUbuntu_16.04/ ./" > /etc/apt/sources.list.d/osmocom-latest.list exit sudo apt-get update sudo apt-get install osmo-bts-trx
If you should build it from source, make sure adding
The other building process are the same with the above.
OsmoTRX & UHD
I had no luck building OsmoTRX from source, neither with UHD from Ettus PPA, nor UHD built from source.
Past experiences tell me that the installation of UHD is very tricky.
At last, I just install UHD and OsmoTRX from the Ubuntu repository.
sudo apt-get install osmo-trx libuhd-dev uhd-host
Almost each Osmocom program has the configuration examples. Just look for ‘doc/examples/’.
If you have built OpenBSC from source
mkdir ~/.osmocom/ cp ~/Projects/openbsc/openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg ~/.osmocom/
No need to change the openbsc.cfg file here.
If you have built OsmoBTS from source
cp ~/Projects/osmo-bts/doc/examples/calypso/osmo-bts.cfg ~/.osmocom/
osmotrx legacy-setbsic from
OsmoTRX can be configured with a variety of options on the command line. In most cases, the default settings will suffice.
Open a shell and start OpenBSC
sudo osmo-nitb -c ~/.osmocom/openbsc.cfg
Open a shell and start OsmoBTS
sudo osmo-bts-trx -c ~/.osmocom/osmo-bts.cfg
Open a shell and start OsmoTRX
Search ‘Available networks’ from your phone, and you should seen
Test PLMN 1-1 2G among local networks.