Introducción

Amplifying the previous article, with the creation of a virtual GSM base station, it is possible to develop another proof of concept using the software OsmocomBB. With a phone with Calypso processor, such as the Motorola C115, C123, C140, C155 or V171, it is possible to create a physical GSM base station, with a limited functionality, only circuit-based operations such as sending and receiving text messages. This network can be connected to other physical devices by configuring the corresponding SIM card.️

In the branch steve-m/trx_rebased of OsmocomBB, a special firmware is being developed for mobile phones with Calypso processor that allows using this as a transceiver, along with an application called transceiver which will control this firmware making a bridge between the transceiver and OsmoBTS.️

Warning️

The electromagnetic spectrum is regulated in Spain through the Ley 11/2022, de 28 de junio, General de Telecomunicaciones. Article 85 mentions that the electromagnetic spectrum is a public domain asset, whose ownership and administration correspond to the State. The organization of the radioelectromagnetic spectrum is regulated through the CNAF (National Frequency Allocation Table), Orden ETD/1449/2021, de 16 de diciembre, por la que se aprueba el Cuadro Nacional de Atribución de Frecuencias.

In this CNAF, note UN-41 indicates that the frequency bands 880-915 MHz and 925-960 MHz are reserved for terrestrial systems capable of providing electronic communication services. The Real Decreto 123/2017, de 24 de febrero, por el que se aprueba el Reglamento sobre el uso del dominio público radioeléctrico in its first additional provision of title IX chapter II indicates the frequency bands with a limitation on the number of enabling titles for the use of public domain electromagnetic spectrum to be granted, including the band 880 to 915 and 925 to 960 MHz in section c).

This indicates the prohibition of emitting in that band without having the corresponding concession from the Ministry for Digital Transformation and Public Function, which is currently attributed to the main telecommunications companies. Therefore, this article will remain in a theoretical framework, without developing the necessary modifications in the code or the procedure for connecting the phone to the computer to enable the transmission of a GSM base station.️

Installation of the software️

OsmoMSC, OsmoBSC, OsmoSTP, OsmoHLR, OsmoMGW and OsmoBTS can be installed directly from the Debian repository or compiled and installed from source as observed in the previous article. In contrast, OsmocomBB, being an experimental software, needs to be compiled from source. The project directories to compile will be located in the ~/osmocom directory.️

We will use the main branch of OsmocomBB, so we will compile the project following the instructions in the previous article. For compiling the TRX firmware for Calypso mobiles and the transceiver, we will have to compile the steve-m/trx_rebased branch of the project in the osmocom-bb-trx directory.️ Habilitaremos the --enable-transceiver option to allow compilation of the transceiver application.️

mkdir ~/osmocom
cd ~/osmocom

Installation of components from the repository️

sudo apt install osmo-msc osmo-bsc osmo-stp osmo-hlr osmo-mgw osmo-bts

Installation of OsmocomBB from source code

Dependencies for compilation of️

libosmocore (dependency of osmocom-bb)

sudo apt install build-essential libtool libtalloc-dev libsctp-dev shtool autoconf automake git-core pkg-config make gcc gnutls-dev python3-minimal libusb-1.0-0-dev libmnl-dev liburing-dev libpcsclite-dev

libosmo-dsp (dependency of osmocom-bb branch trx_rebased)

sudo apt install libfftw3-dev

osmocom-bb

sudo apt install libtool shtool automake autoconf git-core pkg-config make gcc gcc-arm-none-eabi

Compilation and installation️

osmocom-bb

libosmocore (dependency)
git clone https://gitea.osmocom.org/osmocom/libosmocore.git
cd libosmocore/
autoreconf -i
./configure
make -j16
sudo make install
sudo ldconfig -i
cd ..
libosmo-gprs (dependency)
git clone https://gitea.osmocom.org/osmocom/libosmo-gprs.git
cd libosmo-gprs/
autoreconf -i
./configure
make -j16
sudo make install
sudo ldconfig -i
cd ..
libosmo-dsp (dependency branch trx_rebased)
git clone https://gitea.osmocom.org/sdr/libosmo-dsp.git
cd libosmo-dsp/
autoreconf -i
./configure
make -j16
sudo make install
sudo ldconfig -i
cd ..
osmocom-bb (branch trx_rebased)
git clone https://gitea.osmocom.org/phone-side/osmocom-bb.git -b steve-m/trx_rebased osmocom-bb-trx
cd osmocom-bb-trx
cd src
make HOST_CONFARGS=--enable-transceiver CROSS_TOOL_PREFIX=arm-none-eabi-
cd ../..

Configuration files️

The configuration files of the applications will be saved in the directory ~/osmocom/config. The files of the programs OsmoMSC, OsmoBSC, OsmoSTP, OsmoHLR, OsmoMGW will remain with the same content as the previous article.️

mkdir ~/osmocom/config

osmo-bts.cfg

We took the configuration file from example. We modified the value band with the value 900. We added the lines gsmtap-remote-host 127.0.0.1 and gsmtap-sapi enable-all below the one of band in the section of bts to be able to monitor the traffic of the network through UDP port 4729.️

!
! OsmoBTS configuration example for CalypsoBTS
! https://osmocom.org/projects/baseband/wiki/CalypsoBTS
!!
!
log stderr
 logging color 1
 logging print category-hex 0
 logging print category 1
 logging timestamp 0
 logging print file basename last
 logging print level 1
 logging level rsl notice
 logging level oml notice
 logging level rll notice
 logging level rr notice
 logging level meas error
 logging level pag error
 logging level l1c error
 logging level l1p error
 logging level dsp error
 logging level abis error
!
line vty
 no login
!
phy 0
 instance 0
 osmotrx ip local 127.0.0.1
 osmotrx ip remote 127.0.0.1
 osmotrx legacy-setbsic
 osmotrx fn-advance 20
 osmotrx rts-advance 5
bts 0
 oml remote-ip 127.0.0.1
 ipa unit-id 6969 0
 band 900
 gsmtap-remote-host 127.0.0.1
 gsmtap-sapi enable-all
 trx 0
  phy 0 instance 0
  nominal-tx-power 23

Starting the base station with tmux.️

The deployment of the applications will be done using the terminal multiplexer tmux, which will create a window called Osmocom with the applications and their logs. It will also create another window called OsmoCTL with the vty interfaces to interact with the applications through the console. For all the applications, we specify the configuration file with the -c argument.️

The program osmocon located in the directory ~/osmocom/osmocom-bb/src/host/osmocon loads on the Motorola C140 mobile phone -c c140xor connected via serial port -p /dev/ttyUSB0 the firmware trx.highram.bin located in the directory ~/osmocom/osmocom-bb-trx/src/target/firmware/board/compal_e86.️

Later, the mobile must synchronize the clock with an existing base station using the local program transceiver located in the directory osmocom-bb-trx/src/host/layer23/src/transceiver with ARFCN -a 1 before starting the base station.️

tmux new-session -d -s Osmocom

tmux new-window -a -t Osmocom -n HLR 'osmo-hlr -c ~/osmocom/config/osmo-hlr.cfg'
tmux new-window -a -t Osmocom -n STP 'osmo-stp -c ~/osmocom/config/osmo-stp.cfg'
tmux new-window -a -t Osmocom -n MGW 'osmo-mgw -c ~/osmocom/config/osmo-mgw.cfg'
tmux new-window -a -t Osmocom -n MSC 'osmo-msc -c ~/osmocom/config/osmo-msc.cfg'
tmux new-window -a -t Osmocom -n BSC 'osmo-bsc -c ~/osmocom/config/osmo-bsc.cfg'
tmux new-window -a -t Osmocom -n APP 'sudo ~/osmocom/osmocom-bb/src/host/osmocon/osmocon -p /dev/ttyUSB0 -m c140xor -c ~/osmocom/osmocom-bb-trx/src/target/firmware/board/compal_e86/trx.highram.bin'
tmux new-window -a -t Osmocom -n TRX 'sudo osmocom-bb-trx/src/host/layer23/src/transceiver/transceiver -a 1'
tmux new-window -a -t Osmocom -n BTS 'osmo-bts-trx -c ~/osmocom/config/osmo-bts-trx-calypso.cfg'

tmux new-session -d -s OsmoCTL

tmux new-window -a -t OsmoCTL -n HLR 'telnet 127.0.0.1 4258'
tmux new-window -a -t OsmoCTL -n STP 'telnet 127.0.0.1 4239'
tmux new-window -a -t OsmoCTL -n MGW 'telnet 127.0.0.1 4243'
tmux new-window -a -t OsmoCTL -n MSC 'telnet 127.0.0.1 4254'
tmux new-window -a -t OsmoCTL -n BSC 'telnet 127.0.0.1 4242'
tmux new-window -a -t OsmoCTL -n BTS 'telnet 127.0.0.1 4241'

tmux attach-session -t Osmocom
tmux attach-session -t OsmoCTL

Conclusion️

In this article the theoretical deployment of the base station CalypsoBTS has been observed using the software OsmocomBB and a mobile phone based on the Calypso processor.️