Categories
hardware networking

Building a GSM network with USRP1 (URAN-1) SDR (2021)

They said on #osmocom, that it’s not possible, so I put it together.

The notebook on the left is running the network, while the right one runs an open source mobile connected to it.

The hardware and the driver

The USRP1, or custom boards based on it, like the URAN-1 are old hardware, available on ebay cheaper than most full duplex SDRs. But because they are old, the osmocom project no longer supports them officially. This support is what I have fixed.

The seller on ebay provides an old ubuntu installer, which includes a full OpenBTS installation. Although this is not the network we need, it’s transceiver program uses an almost identical Osmo-TRXC and Osmo-TRXD protocol to communicate with higher level network components. We can use this to connect the osmocom network to OpenBTS’s transceiver software, which is already compiled with the old, nowadays unsupported drivers.

System requirements

A separate virtual machine is required to run the ubuntu system with the transceiver, with a network connection to a machine with the osmocom.

I’ve used Qubes OS, but any debian install with qemu, or a hypervisor system running a debian and the ubuntu install will do it. The debian install will contain the core network components(as described here), while ubuntu will control the SDR itself.

The network side

These are the osmocom components you’ll need:

  • osmo-hlr
  • osmo-msc
    • libsmpp34 (if you need sms support)
  • osmo-bsc
  • osmo-mgw
  • osmo-bsc
  • osmo-bts
  • libosmo-sccp
  • libosmo-netif
  • libosmo-abis

You can download them with git clone git://git.osmocom.org/<component name>

Install all of them from their folders:

cd <name>
autoreconf -i
./configure
make
sudo make install

./configure will give a lot of warnings about missing libraries, install all of them to proceed. You can find help on osmocom wiki pages and on github.

If you managed to install all the required libraries and have compiled everything (might be complicated for the first time), you’ll need a config file for every distinct component. Feel free to use my config files:

Note, that I have changed the osmo-bts.cfg to communicate with a remote TRX (radio driver) at the lines osmotrx remote <ip> and osmotrx local <ip>. The terms local and remote might be confusing first, these are from the BTS’s perspective.

The SDR driver side

Now you need to set up the program that can actually communicate with the USRP1 board. You need the special ubuntu iso from here. Don’t let it install any kind of updates, everything is already in there what we need. Although using a live system is possible, you might find it useful to install it to a virtual hard drive to make config files permanent, especially iptables rules.

After the installation/boot, you need to stop the openbts service (Password is openbts too by default), and restart it manually from /OpenBTS/OpenBTS. Connect the USRP1 via usb to the VM, otherwise it won’t start. After it gives you a shell, list the options with config . Note the TRX.IP option. This is not the IP for the transceiver to listen on, this is the address of your osmocom installation. Change it with config TRX.IP <address> .

Now you have almost everything configured. Exit OpenBTS, we won’t need it anymore. The transceiver program is located in the same folder and will be able to communicate with Osmo-BTS on its own. But because it talks in a bit older Osmo-TRXC protocol, we’ll need a few iptables rules to filter out unhandled commands. iptables -A INPUT -m string --algo bm --string "HANDOVER" -j DROP.
iptables -A OUTPUT -m string --algo bm --string "HANDOVER" -j DROP.

Allow the two systems to access each other’s ports in the 5700-5802 range.

With all these steps, you should have a working setup. Start the transceiver, then all the osmocom network components. Be aware that by default the hardware will produce an enormous output power and noise, so try to lower the tx power somehow (I haven’t found a solution yet).

One reply on “Building a GSM network with USRP1 (URAN-1) SDR (2021)”

Generally I do not learn article on blogs, however I would like to say that this write-up very forced me to try and do so! Your writing style has been surprised me. Thanks, very great post.

Comments are closed.