
In this article I would like to describe in detail how I managed to launch my own GSM network using Osmocom and modest investments in equipment.
The instructions on the official website are outdated and I had to spend quite a lot of time adapting them. Fortunately, all the problems were solved, and if you strictly follow the tips below, then you will succeed.
')
As a result, we will launch an experimental 2G cellular network within the room with support for SMS and voice calls, without GPRS. It can be used to study the operation and interaction of devices and components of a GSM network, without interfering with commercial cellular networks.
Cycle articles:We start GSM network at homeAnalysis of GSM network traffic in WiresharkAdd GPRS to your home GSM networkPractical examples of attacks inside the GSM networkAttention!
The author does not bear any responsibility for the actions of other users, their interference with commercial GSM networks and damage to their own equipment. Before you start anything, make sure you understand what you are doing.
UPD: If you encounter problems when building or using my configuration files, I recommend installing everything you can from the
Nightly Builds deb packages to a newer OS. To build osmocombb (jolly / testing) branches, you will need the old toolchain, which I wrote about later in the text. I installed everything on Debian 9 (32 bits), there are no problems with libdbi and something else, install the dependencies that apt offers. When building a toolchain, there may be problems with texinfo. The
axilirator script already has a couple of patches for this, but for Debian 9, I needed more edits to gcc / doc / gcc.texi.
Iron and Soft
Iron- Computer with installed 32-bit Ubuntu 14.04 (not virtualka)
- 2 phones on the TI Calypso chipset (Motorola c113, c118, c123, ...)
- 2 USB-TTL converter
- 2 wires (2.5 mm jack + jumpers)
SoftWe are buying
Phones based on the TI Calypso chipset will be the easiest to search for free classified ads in your city. The price varies from 300 to 700 rubles, depending on the state and availability of the charger. The probability of buying a phone in Russia designed for western GSM bands is very small, but if you decide to buy it abroad, I recommend paying attention to GSM working bands. You need phones that work with 900 MHz and 1800 MHz, if you live in Russia.
The list of supported models can be found
here .
Perhaps there are other compatible phones, in particular, the Motorola c113 and c113a are fully compatible with OsmocomBB, although not presented on the official website.
No SIM cards needed.
USB-TTL converters can run on CP2102, FT232 or PL2303 chips.
I recommend using the CP2102 because with the help of a
specialized utility you can make this converter work at non-standard speeds, which is required for some OsmocomBB branches.
You can buy it from 100 rubles on ebay or aliexpress, or 2-3 times more expensive in more or less large electronics stores. The second option is preferable if you do not want to wait.
The wire connecting the computer to the phone may look different, but I recommend to buy a 2.5 mm jack in the radio parts store
UPD: In the photo, as you noticed later, a jack with 4 pins is depicted, you need from 3, the most ordinary!
and wires with connectors, like those that are often used for Arduino or Raspberry Pi.

In the absence of a second, you can think of something different. Your task is to connect the terminals Tx, Rx, GND of the converter with the jack contacts as follows:
TxD connect to jack tip
RxD connect to the middle jack contact
GND connect to the bottom of the jack.
You can take a bundle of three wires, bite off connectors from one end and solder the remaining wires with connectors on one end to the jack terminals.
Please note that to start a network with voice call support, you need
2 phones,
2 converters and
2 ready wires.
Unobvious problem
After buying a jack, make sure that it can be inserted into the headset jack to the end. Otherwise, you may get errors due to unreliable connection with the phone or not have it at all.
Jackies, which are most often sold in stores of radio components, are not inserted into the slot to the end, because They interfere with the case (your / phone).


To make sure that the jack enters to the end, you can get the phone out of the case and try inserting the jack.

If you later realized that the case interferes with the jack, you will have to arm with pliers and a file, turn on your wits and change the case of the jack or phone so that the contact is reliable.
You can check the reliability of the connection with PuTTY. You can find the COM port number by looking in the Device Manager.

We connect the phone to the computer via a USB-TTL converter and the assembled wire,
briefly press the power button and the message @ftmtoolerror should appear among other characters in the PuTTY window.
The same can be done under Linux using minicom.
Installation
As stated at the beginning, I recommend using Ubuntu 14.04, the 32-bit version of it. It is possible that you will be able to install everything on 64-bit Ubuntu 16.04, but then you will have to solve all dependency problems yourself during installation and compatibility with the Osmocom project branches.
Also, you can try to use a virtual machine, but I never managed to get a stable connection on the guest OS. Problems may arise at the level of USB port virtualization.
You can use a virtual machine to work with osmocombb and its individual applications, but when it comes to launching a GSM network, I advise you not to use virtualization.
Install the basic packages we need to build Osmocom.
apt-get install build-essential libtool libtalloc-dev shtool autoconf automake git-core pkg-config make gcc libpcsclite-dev
libosmocoregit clone git://git.osmocom.org/libosmocore.git
cd libosmocore/
autoreconf -i
./configure
make
make install
ldconfig -i
toolchain- toolchain. , osmocombb, .
, , toolchain, -.
git clone https://github.com/axilirator/gnu-arm-installer.git
cd gnu-arm-installer
apt-get install libgmp3-dev libmpfr-dev libx11-6 libx11-dev flex bison libncurses5 libncurses5-dbg libncurses5-dev libncursesw5 libncursesw5-dbg libncursesw5-dev zlibc zlib1g-dev libmpfr4 libmpc-dev texinfo
./download.sh
./build.sh
, . 3 .
PATH, /root/osmocom/gnu-arm-installer/install/bin
vi /etc/bash.bashrc
add in the end
export PATH=$PATH:/root/osmocom/gnu-arm-installer/install/bin
osmocombbMaster- GSM , , , RSSI cell_log (. ).
- , src/target/firmware/Makefile :
CFLAGS += -DCONFIG_TX_ENABLE
git clone git://git.osmocom.org/osmocom-bb.git osmocombb
cd osmocombb/src
make
FFTwget http://www.fftw.org/fftw-3.3.6-pl2.tar.gz
tar -xvzf fftw-3.3.6-pl2.tar.gz
cd fftw-3.3.6-pl2
./configure --enable-threads --enable-float
make
make install
ldconfig
libosmo-dspgit clone git://git.osmocom.org/libosmo-dsp.git
cd libosmo-dsp/
autoreconf -i
./configure
make
make install
ldconfig
osmocombb OsmoBTSgit clone git://git.osmocom.org/osmocom-bb.git trx
cd trx/
git checkout jolly/testing
cd src/
target/firmware/Makefile
CFLAGS += -DCONFIG_TX_ENABLE
:
make HOST_layer23_CONFARGS=--enable-transceiver
libdbi sqliteapt-get install sqlite3 libsqlite3-dev libsctp-dev
:
sourceforge.net/projects/libdbi/files/libdbi/libdbi-0.8.3tar -xvzf libdbi-0.8.3.tar.gz
cd libdbi-0.8.3
autogen.sh
./configure --disable-docs
make
make install
ldconfig
cd ..
:
sourceforge.net/projects/libdbi-drivers/files/libdbi-drivers/libdbi-drivers-0.8.3tar -xvzf libdbi-drivers-0.8.3.tar.gz
cd libdbi-drivers-0.8.3
, HLR. .
vi drivers/sqlite3/dbd_sqlite3.c
_dbi_internal_error_handler
_dbd_internal_error_handler
.
:
./autogen.sh
./configure --disable-docs --with-sqlite3 --with-sqlite3-dir=/usr/bin --with-dbi-incdir=/usr/local/include
make
make install
ldconfig
ORTPwget http://download.savannah.gnu.org/releases/linphone/ortp/sources/ortp-0.22.0.tar.gz
tar -xvf ortp-0.22.0.tar.gz
cd ortp-0.22.0/
./autogen.sh
./configure
make
make install
ldconfig
libosmo-abisgit clone git://git.osmocom.org/libosmo-abis.git
cd libosmo-abis
autoreconf -i
./configure
make
make install
ldconfig
libosmo-netifgit clone git://git.osmocom.org/libosmo-netif.git
cd libosmo-netif
autoreconf -i
./configure
make
make install
ldconfig
OpenBSCapt-get install libssl0.9.8 libssl-dev
ldconfig
git clone git://git.osmocom.org/openbsc.git
cd openbsc/openbsc/
autoreconf -i
./configure
make
make install
OsmoBTSgit clone git://git.osmocom.org/osmo-bts.git
cd osmo-bts
autoreconf -i
./configure --enable-trx
make
make install
Osmocom root, /root/.osmocom
mkdir /root/.osmocom;cd /root/.osmocom
touch ~/.osmocom/osmo-bts.cfg
touch ~/.osmocom/open-bsc.cfg
:
osmo-bts.cfg open-bsc.cfg .
(band) GSM ARFCN.
ARFCN — .
ARFCN
RSSI, osmocombb,
cell_log.
, GSM . , , band.
,
. Calypso BTS SCH bursts . ( ), .
ARFCN band , OsmoNTIB .
.ls -l /dev/ttyUSB*
ttyUSB0 ttyUSB1.
.
osmocon .
compal_e86 e87 c123xor,
- .
cd /root/osmocom/trx/src
host/osmocon/osmocon -m c123xor -p /dev/ttyUSB0 -s /tmp/osmocom_l2 -c target/firmware/board/compal_e88/trx.highram.bin -r 99
, . TRX.
cd /root/osmocom/trx/src
host/osmocon/osmocon -m c123xor -p /dev/ttyUSB1 -s /tmp/osmocom_l2.2 -c target/firmware/board/compal_e88/trx.highram.bin -r 99
, . TRX.
BTSARFCN , . , RSSI cell_log.
cd /root/osmocom/trx/src/host/layer23/src/transceiver/
./transceiver -a ARFCN -2 -r 99
MSC, HLR -cd /root/.osmocom
osmo-nitb -c ~/.osmocom/open-bsc.cfg -l ~/.osmocom/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM
cd /root/.osmocom
osmo-bts-trx --debug DRSL:DOML:DLAPDM -r 99
GSM !
, . 00101 TestNet. .
- , , .
USSD *#100#.
OsmoNTIB
telnet localhost 4242
OsmoBTS
telnet localhost 4241
.
, wireshark.
UPD: GPRS
!
osmo-bts.cfg!
! OsmoBTS (0.4.0.433-8913) configuration saved from vty
!!!
!
log stderr
logging filter all 1
logging color 1
logging print category 0
logging timestamp 0
logging level all everything
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp debug
logging level pcu notice
logging level ho notice
logging level trx notice
logging level loop notice
logging level abis notice
logging level rtp notice
logging level sum notice
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats notice
logging level lgsup notice
logging level loap notice
logging level lss7 notice
logging level lsccp notice
logging level lsua notice
logging level lm3ua notice
log file OsmoBTS.log
logging filter all 0
logging color 1
logging print category 0
logging timestamp 1
logging level all everything
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp debug
logging level pcu notice
logging level ho notice
logging level trx notice
logging level loop notice
logging level abis notice
logging level rtp notice
logging level sum notice
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats notice
logging level lgsup notice
logging level loap notice
logging level lss7 notice
logging level lsccp notice
logging level lsua notice
logging level lm3ua notice
!
line vty
no login
!
e1_input
e1_line 0 driver ipa
e1_line 0 port 0
no e1_line 0 keepalive
phy 0
osmotrx ip 127.0.0.1
osmotrx fn-advance 30
osmotrx rts-advance 5
instance 0
bts 0
band [ GSM900 DCS1800]
ipa unit-id 1801 0
oml remote-ip 127.0.0.1
rtp jitter-buffer 0
paging queue-size 200
paging lifetime 0
uplink-power-target -75
min-qual-rach 50
min-qual-norm -5
ms-power-loop -65
timing-advance-loop
setbsic
trx 0
power-ramp max-initial 0 mdBm
power-ramp step-size 2000 mdB
power-ramp step-interval 1
ms-power-control dsp
phy 0 instance 0
open-bsc.cfg!
! OpenBSC (0.15.0.763-5121) configuration saved from vty
!!!
!
log stderr
logging filter all 1
logging color 1
logging print category 0
logging timestamp 0
logging level all everything
logging level rll everything
logging level cc everything
logging level mm everything
logging level rr everything
logging level rsl everything
logging level nm everything
logging level mncc notice
logging level pag notice
logging level meas notice
logging level sccp notice
logging level msc notice
logging level mgcp notice
logging level ho notice
logging level db notice
logging level ref notice
logging level gprs debug
logging level ns info
logging level bssgp debug
logging level llc debug
logging level sndcp debug
logging level nat notice
logging level ctrl notice
logging level smpp debug
logging level filter debug
logging level ranap debug
logging level sua debug
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats notice
logging level lgsup notice
logging level loap notice
logging level lss7 notice
logging level lsccp notice
logging level lsua notice
logging level lm3ua notice
log file OsmoBSC.log
logging filter all 0
logging color 1
logging print category 0
logging timestamp 1
logging level all info
logging level rll notice
logging level cc notice
logging level mm notice
logging level rr notice
logging level rsl notice
logging level nm info
logging level mncc notice
logging level pag notice
logging level meas notice
logging level sccp notice
logging level msc notice
logging level mgcp notice
logging level ho notice
logging level db notice
logging level ref notice
logging level gprs debug
logging level ns info
logging level bssgp debug
logging level llc debug
logging level sndcp debug
logging level nat notice
logging level ctrl notice
logging level smpp debug
logging level filter debug
logging level ranap debug
logging level sua debug
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats notice
logging level lgsup notice
logging level loap notice
logging level lss7 notice
logging level lsccp notice
logging level lsua notice
logging level lm3ua notice
!
stats interval 5
!
line vty
no login
!
e1_input
e1_line 0 driver ipa
e1_line 0 port 0
no e1_line 0 keepalive
network
network country code 1
mobile network code 1
short name TestNet
long name TestNet
auth policy accept-all
authorized-regexp .*
location updating reject cause 13
encryption a5 0
neci 1
paging any use tch 0
rrlp mode none
mm info 1
handover 0
handover window rxlev averaging 10
handover window rxqual averaging 1
handover window rxlev neighbor averaging 10
handover power budget interval 6
handover power budget hysteresis 3
handover maximum distance 9999
timer t3101 10
timer t3103 0
timer t3105 40
timer t3107 0
timer t3109 0
timer t3111 0
timer t3113 60
timer t3115 0
timer t3117 0
timer t3119 0
timer t3122 10
timer t3141 0
dyn_ts_allow_tch_f 0
subscriber-keep-in-ram 0
bts 0
type sysmobts
description calypso
band DCS1800
cell_identity 0
location_area_code 1
base_station_id_code 63
ms max power 30
cell reselection hysteresis 4
rxlev access min 0
periodic location update 30
radio-link-timeout 32
channel allocator ascending
rach tx integer 9
rach max transmission 7
channel-descrption attach 1
channel-descrption bs-pa-mfrms 5
channel-descrption bs-ag-blks-res 1
early-classmark-sending forbidden
ip.access unit_id 1801 0
oml ip.access stream_id 255 line 0
neighbor-list mode automatic
codec-support fr amr
amr tch-h modes 0
amr tch-h start-mode 1
gprs mode none
no force-combined-si
trx 0
rf_locked 0
arfcn []
nominal power 23
max_power_red 0
rsl e1 tei 0
timeslot 0
phys_chan_config CCCH+SDCCH4
hopping enabled 0
timeslot 1
phys_chan_config TCH/H
hopping enabled 0
timeslot 2
phys_chan_config TCH/H
hopping enabled 0
timeslot 3
phys_chan_config TCH/H
hopping enabled 0
timeslot 4
phys_chan_config TCH/H
hopping enabled 0
timeslot 5
phys_chan_config TCH/H
hopping enabled 0
timeslot 6
phys_chan_config TCH/H
hopping enabled 0
timeslot 7
phys_chan_config TCH/H
hopping enabled 0
mncc-int
default-codec tch-f amr
default-codec tch-h amr
nitb
subscriber-create-on-demand
assign-tmsi
UPD: — ( ) Pentestit Security Conference : « GSM».UPD: Osmocom
defcon.ru/wireless-security/4716