GSM with Osmocom Part 3: Introduction to Osmo Software & Virtual BTS

Basic GSM Architecture

So this series of posts will focus on using Osmocom software to create a GSM network, so let’s get some Osmocom software installed, and talk about how we run and configure each network element / node.

Osmocom Packages

For this tutorial series I’ll be using Ubuntu 18.04 and trying where possible to use packages from Repos instead of compiling from source.

This will get the Osmocom key added to your package manager and the Osmocom sources in apt ready for us to install.

wget https://download.opensuse.org/repositories/network:/osmocom:/latest/Debian_10/Release.key
apt-key add Release.key && rm Release.key
echo "deb https://download.opensuse.org/repositories/network:/osmocom:/latest/xUbuntu_18.04/ ./" > /etc/apt/sources.list.d/osmocom-latest.list
apt-get update

Osmo-BTS-Virtual

To get started we’ll install a virtual BTS. This virtual BTS won’t simulate the Um (air) interface, but it will simulate the Abis interface towards the BSC so we can configure this virtual BTS in our BSC.

Installation is pretty straightforward:

apt-get install osmo-bts-virtual

By default Osmocom software runs as a daemon in systemctl, we’ll disable and stop this behaviour for now so we can better understand it running in the foreground:

systemctl stop osmo-bts-virtual
systemctl disable osmo-bts-virtual

Osmo Config – Text Files

If you have a look in /etc/osmocom/ you’ll see .cfg files that contain our config in text files.

But that’s not the only way (or even the recommended way) that we’ll put together the config for Osmocom software, but we’ll get started by editing the config file manually.

We’ll start by setting a Unit ID of the BTS and setting the IP of the BSC.

cd /etc/osmocom/
vi osmo-bts-virtual.cfg

We’ll edit the oml remote-ip to point to the IP of the server that will run our BSC, if you’re planning on running the BTS and BSC on the same machine you can leave it as localhost (127.0.0.1).

Next up we’ll set the Unit-ID of the BTS, this identifies the BTS inside the BSC,

I’ll set it to unit-id 4242 by changing ipa unit-id 4242 0

Finally we’ll change the logging config to show everything by changing it to:

log stderr
 logging filter all 1
!

So that’s it in terms of config for our virtual BTS through text files, so we’ll save the file and try starting up osmo-bts-virtual.

osmo-bts-virtual -c osmo-bts-virtual.cfg

You should get a result similar to this:

[email protected]:/etc/osmocom# osmo-bts-virtual -c osmo-bts-virtual.cfg
 ((*))
   |
  / \ OsmoBTS
<0010> telnet_interface.c:104 Available via telnet 127.0.0.1 4241
<0012> input/ipaccess.c:901 enabling ipaccess BTS mode, OML connecting to 127.0.0.1:3002
<000d> abis.c:142 Signalling link down
<0001> bts.c:292 Shutting down BTS 0, Reason Abis close
Shutdown timer expired

[email protected]:/etc/osmocom#

So what are we seeing here?

Well Osmo-BTS-Virtual is trying to bring up it’s Abis interface but it’s not getting a connection to the the BSC (We haven’t set one up yet). No connection to a BSC means the BTS won’t go on the air as it doesn’t have any processing for itself, so it eventually times out and shuts down.

In the next post we’ll move from using osmo-bts-virtual to using a SDR to run Osmo-BTS. If you’re using commercial RAN hardware, or just playing along without any RAN, skip straight to the post on Base Station Controllers where we’ll pick up again adding our Virtual BTS to the BSC.

1 thought on “GSM with Osmocom Part 3: Introduction to Osmo Software & Virtual BTS

  1. Dear Nick,
    First of all let me to say you have done a great job here describing Osmocom in a pedagogical way (unlike some osmocom projects which really suffer from lack of good explanation)… This is a very helpful and brilliant description.

    So when i run only osmo-bts-virtual (without bsc) i got following output which is a way longer than examples you provided (please find below)…. Is it normal output or something is strange ?

    [email protected]:~$ osmo-bts-virtual -c /etc/osmocom/osmo-bts-virtual.cfg
    ((*))
    |
    / \ OsmoBTS
    DLCTRL control_if.c:911 CTRL at 127.0.0.1 4238
    DL1C bts_model.c:174 Unimplemented bts_model_ctrl_cmds_install
    DLGLOBAL telnet_interface.c:104 Available via telnet 127.0.0.1 4241
    DLINP input/ipaccess.c:1060 enabling ipaccess BTS mode, OML connecting to 127.0.0.1:3002
    DABIS abis.c:229 Input Signal LINE-INIT received for link_type=None
    DL1C phy_link.c:58 PHY link state change shutdown -> connecting
    DL1C scheduler.c:594 Init scheduler for trx=0
    DL1P scheduler_virtbts.c:605 starting VBTS scheduler
    DL1C phy_link.c:58 PHY link state change connecting -> connected
    DL1C phy_link.c:68 trx_set_avail(1)
    DOML oml.c:350 OC=RADIO-CARRIER INST=(00,00,ff) AVAIL STATE Power off -> OK
    DOML oml.c:357 OC=RADIO-CARRIER INST=(00,00,ff) OPER STATE NULL -> Disabled
    DOML oml.c:350 OC=BASEBAND-TRANSCEIVER INST=(00,00,ff) AVAIL STATE Power off -> OK
    DOML oml.c:350 OC=CHANNEL INST=(00,00,00) AVAIL STATE Power off -> OK
    DOML oml.c:357 OC=CHANNEL INST=(00,00,00) OPER STATE NULL -> Disabled
    DOML oml.c:350 OC=CHANNEL INST=(00,00,01) AVAIL STATE Power off -> OK
    DOML oml.c:357 OC=CHANNEL INST=(00,00,01) OPER STATE NULL -> Disabled
    DOML oml.c:350 OC=CHANNEL INST=(00,00,02) AVAIL STATE Power off -> OK
    DOML oml.c:357 OC=CHANNEL INST=(00,00,02) OPER STATE NULL -> Disabled
    DOML oml.c:350 OC=CHANNEL INST=(00,00,03) AVAIL STATE Power off -> OK
    DOML oml.c:357 OC=CHANNEL INST=(00,00,03) OPER STATE NULL -> Disabled
    DOML oml.c:350 OC=CHANNEL INST=(00,00,04) AVAIL STATE Power off -> OK
    DOML oml.c:357 OC=CHANNEL INST=(00,00,04) OPER STATE NULL -> Disabled
    DOML oml.c:350 OC=CHANNEL INST=(00,00,05) AVAIL STATE Power off -> OK
    DOML oml.c:357 OC=CHANNEL INST=(00,00,05) OPER STATE NULL -> Disabled
    DOML oml.c:350 OC=CHANNEL INST=(00,00,06) AVAIL STATE Power off -> OK
    DOML oml.c:357 OC=CHANNEL INST=(00,00,06) OPER STATE NULL -> Disabled
    DOML oml.c:350 OC=CHANNEL INST=(00,00,07) AVAIL STATE Power off -> OK
    DOML oml.c:357 OC=CHANNEL INST=(00,00,07) OPER STATE NULL -> Disabled
    DL1P scheduler_virtbts.c:579 vbts_fn_timer_cb after 9606 us
    DABIS abis.c:142 Signalling link down
    DOML bts.c:292 Shutting down BTS 0, Reason Abis close
    DL1C bts_model.c:161 Unimplemented bts_model_trx_deact_rf
    DL1C bts_model.c:55 Unimplemented bts_model_trx_close
    DL1P scheduler_virtbts.c:579 vbts_fn_timer_cb after 12697 us
    Shutdown timer expired

Leave a Reply to Mario Cancel reply

Your email address will not be published. Required fields are marked *