wiki:network_from_scratch

Installing a GSM network from scratch

This document describes how to install, configure and run OsmoTRX, OsmoBTS, OsmoNITB and LCR.

In order to use this quick howto, you must have basic knowledge about GIT and be familiar with compiling packages from source.

Prerequisite

These packages may be available from you distribution. If not, install them by hand as follows.

opencore-amr (optional, for LCR only)

This package installs GSM adaptive multirate codecs and the EFR codec. The Full-Rate codec is included in LCR's repository.

It can downloaded at http://sourceforge.net/projects/opencore-amr/files/opencore-amr/

tar xvzf opencore-amr-x.x.x.tar.gz
cd opencore-amr-x.x.x
./configure
make
make install
ldconfig
cd ..

Sip-Sofia (optional, for LCR only)

This package installs the open source SIP stack of Nokia Research Center.

It can downloaded at http://sourceforge.net/projects/sofia-sip/files/sofia-sip/.

tar xvzf sofia-sip-x.xx.xx.tar.gz
cd sofia-sip-x.xx.xx
./configure
make
make install
ldconfig
cd ..

oRTP

This package installs the open source RTP protocol required for libosmo-abis.

It can downloaded at http://download.savannah.gnu.org/releases/linphone/ortp/sources/.

tar xvzf ortp-x.xx.x.tar.gz
cd ortp-x.xx.x
./configure
make
make install
ldconfig
cd ..

others

sqlite3, libdbi, dbd-sqlite3 (driver) should should be available from your distribution.

Installing

libosmocore

This package installs the core utility library for various Osmocom projects.

The latest version can downloaded via git:

git clone git://git.osmocom.org/libosmocore.git

Finish the installation:

cd libosmocore
autoreconf -i
./configure
make
make install
ldconfig
cd ..

libosmo-abis

Use jolly/multi-trx branch. It is required for multiple TRX support, until it is applied to master. jolly/trx branch of osmo-bts will not compile without it.

This package installs the core utility library for various Osmocom projects.

The latest version can downloaded via git:

git clone git://git.osmocom.org/libosmo-abis.git

Sometimes it is necessary to point to different pkgconfig path, because your distribution may use other pkgconfig path than the default path of the packages above. Use the following prefix:

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....

Finish the installation:

cd libosmo-abis
# change branch:
git checkout -b jolly/multi-trx origin/jolly/multi-trx
autoreconf -i
./configure
(sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....)
make
make install
ldconfig
cd ..

OsmoNITB

This package installs the Osmocom Network In The Box software

The latest version can downloaded via git:

git clone git://git.osmocom.org/openbsc.git

Finish the installation:

cd openbsc/openbsc/
# change branch:
git checkout -b jolly/testing origin/jolly/testing
autoreconf -i
./configure
(sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....)
make
make install
cd ../..

OsmoBTS

OsmoBTS: (BTS software)

This package installs the open source Base Transceiver Station.

The latest version can downloaded via git:

git clone git://git.osmocom.org/osmo-bts.git

Finish the installation:

cd osmo-bts
#change branch:
git checkout -b jolly/trx origin/jolly/trx
autoreconf -i
./configure --enable-trx
(sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....)
make
make install
cd ..

OsmoTRX

Refer to the OsmoTRX page for build instructions.

Linux-Call-Router (LCR) (optional)

This package installs the open source PBX software to bridge ISDN (DSS1) / SIP / GSM (MNCC protocol)

The latest version can downloaded via git:

git clone git://git.misdn.eu/lcr.git/

Now configure, as described here:

cd lcr
autoreconf -i
./configure --with-sip --with-gsm-bs --with-gsm-ms

I strongly suggest not to use the Half-Rate codec (--enable-gsmhr) except for testing, because this codec is so slow, that only one or two calls may occupy CPU completely.

Sometimes it is necessary to point to different pkgconfig path, because your distribution may use other pkgconfig path than the default path of the packages above. Use the following prefix:

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....

The configure result should include:

configure: Compiled with GSM network side support
configure: Compiled with GSM mobile side support
configure: Compiled with GSM half rate codec support
configure: Compiled with GSM AMR codec support
configure: Compiled with SIP support

Finish the installation:

make
make install
ldconfig
cd ..

Configuration examples

OsmoBTS

mkdir ~/.osmocom
edit ~/.osmocom/osmo-bts.cfg
bts 0
 band DCS1800
 ipa unit-id 1801 0
 oml remote-ip 127.0.0.1
 rtp bind-ip 127.0.0.1
 rtp jitter-buffer 0
 paging lifetime 0
 gsmtap-sapi bcch
 gsmtap-sapi ccch
 gsmtap-sapi rach
 gsmtap-sapi agch
 gsmtap-sapi pch
 gsmtap-sapi sdcch
 gsmtap-sapi pacch
 gsmtap-sapi pdtch
 gsmtap-sapi sacch
 fn-advance 20
 ms-power-loop -10
 timing-advance-loop
 trx 0
  rxgain 0
  power 0

OpenBSC

mkdir ~/.osmocom
edit ~/.osmocom/open-bsc.cfg

Be sure to change 'arfcn' to a frequency you have license for'''

e1_input
 e1_line 0 driver ipa
 e1_line 0 port 0
network
 network country code 262
 mobile network code 42
 short name OpenBSC
 long name OpenBSC
 auth policy accept-all
 location updating reject cause 13
 encryption a5 0
 neci 1
 paging any use tch 0
 rrlp mode ms-based
 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 0
 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
 dtx-used 0
 subscriber-keep-in-ram 0
 bts 0
  type sysmobts
  band DCS1800
  cell_identity 0
  location_area_code 1
  training_sequence_code 7
  base_station_id_code 63
  ms max power 0
  cell reselection hysteresis 4
  rxlev access min 0
  periodic location update 30
  channel allocator descending
  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
  ip.access unit_id 1801 0
  oml ip.access stream_id 255 line 0
  neighbor-list mode automatic
  trx 0
   rf_locked 0
   arfcn 869
   nominal power 0
   max_power_red 0
   rsl e1 tei 0
    timeslot 0
     phys_chan_config CCCH+SDCCH4
     hopping enabled 0
    timeslot 1
     phys_chan_config TCH/F
     hopping enabled 0
    timeslot 2
     phys_chan_config TCH/F
     hopping enabled 0
    timeslot 3
     phys_chan_config TCH/F
     hopping enabled 0
    timeslot 4
     phys_chan_config TCH/F
     hopping enabled 0
    timeslot 5
     phys_chan_config TCH/F
     hopping enabled 0
    timeslot 6
     phys_chan_config TCH/F
     hopping enabled 0
    timeslot 7
     phys_chan_config TCH/F
     hopping enabled 0

Linux-Call-Router (LCR) (optional)

options.conf

edit /usr/local/etc/lcr/options.conf

Add a line to show logging to the console:

debug 0x100000

interface.conf

The simplest configuration uses only the GSM interface. It allows LCR to forward calls from GSM to GSM or from GSM to a call test feature.

edit /usr/local/etc/lcr/interface.conf

You can remove (or comment out) everything and just add this interface:

[gsm]
gsm-bs
tones yes
earlyb no
extern

routing.conf

edit /usr/local/etc/lcr/routing.conf

You can remove (or comment out) everything and just add these rulesets:

[main]
interface=gsm                           : goto ruleset=gsm
                                        : disconnect cause=31

[gsm]
dialing=99                              : test
                                        : extern interfaces=gsm

Look at the main rule set. All calls from interface 'gsm' are forwarded to rule set 'gsm'.

Look at the gsm rule set. All calls that dial '99' prefix, will be test calls. All other calls will be forwarded back to 'gsm' interface.

Running

I suggest to have one shell for every process to run, rather than stating all processes as damon from one shell. Not starting as deamon allows to easily see the debugging output.

OpenBSC

Open a shell and start OpenBSC:

osmo-nitb -c ~/.osmocom/open-bsc.cfg -l ~/.osmocom/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM

OpenBSC runs as a stand-alone network with given config file and data base. In order to use LCR, add '-m' option. In this case the LCR replaces the built-in call control.

osmo-nitb -c ~/.osmocom/open-bsc.cfg -l ~/.osmocom/hlr.sqlite3 -P -m -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM

Very important is the option '-C'. On certain machines, osmo-nitb will halt from time to time while writing counters to database. This Without this option, audio might interrupt several seconds from time to time.

The debugging is usefull for early tests, because you will quickly see what happens if a mobile requests something.

<0005> bsc_init.c:422 
WARNING: You are running an 'accept-all' network on a BTS that is not barred.
This configuration is likely to interfere with production GSM networks and
should only be used in a RF shielded environment such as a faraday cage!

<0019> input/ipaccess.c:925 enabling ipaccess BSC mode
DB: Database initialized.
DB: Database prepared.
<001d> sms_queue.c:220 Attempting to send 20 SMS

OsmoBTS

Open a shell and start OsmoBTS:

osmobts-trx -c ~/.osmocom/osmo-bts.cfg
((*))
  |
 / \ OsmoBTS
Using MAC address of eth0: 'xx:xx:xx:xx:xx:xx'
...
<000a> trx_if.c:176 No response from tranceiver
<000a> trx_if.c:176 No response from tranceiver
<000a> trx_if.c:176 No response from tranceiver

OsmoTRX

Refer to the OsmoTRX page on how to run OsmoTRX.

UmTRX

The installation/setup/calibration of UmTRX is beyond the scope of this document. Please refer to:

calypso-BTS

Building Osmocom-BB with arm-elf toolchain is also beyond the scope of this document. If you managed to compile and run Osmocom-BB you should be able to run the transceiver too.

The latest version can downloaded via git:

git clone git://git.osmocom.org/libosmo-dsp.git
git clone git://git.osmocom.org/osmocom-bb.git

In order to compile Osmocom-BB with transceiver support, do the following:

cd libosmo-dsp
autoreconf -i
./configure
(sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....)
make
make install
cd ..

cd osmocom-bb
# change branch:
git checkout -b jolly/testing origin/jolly/testing
cd src
make
# after it compiles, just enable transceiver support
cd host/layer23
./configure --enable-transceiver
make

NOTE: "ms-power-loop" at osmo-bts.cfg should be set to -65, in order to prevent saturating the input. Also if the phone is only one or few meters away, "ms max power" should be set to 0. In case of long distance test it can be set to 30 (DCS) or 33 (GSM 900).

Now you should start with a single phone for one timeslot only. If it works, you can try two phones to serve two timeslots. Since you have only one slot, you will only be able to transmit broadcast, do location updating and send/receive SMS. Here is the "osmo-bts.cfg" for a single timeslot:

bts 0
 band DCS1800
 ipa unit-id 1801 0
 oml remote-ip 127.0.0.1
 rtp jitter-buffer 0
 paging queue-size 200
 paging lifetime 0
 fn-advance 30
 ms-power-loop -60
 timing-advance-loop
 settsc
 setbsic
 trx 0
  rxgain 0
  power 0
  slotmask 1 0 0 0 0 0 0 0

Run osmocon and transceiver application in separate shells:

# Please refer to Osmocom-BB wiki for compiling and running own firmware on compal phones...
osmocon -p /dev/ttyUSB0 -m c123xor -c path_to/trx.highram.bin -r 99
transceiver -e 5 -r 99

When using two phones, two timeslots can be served. I suggest to configure second timeslot (TS 1) as TCH/H at openbsc.cnf. This way it is possible to allow two traffic channels on a single timeslot. If you do a call from one phone to another, you will need one channel for each phone. In order to use two phones, you need to change the alot map of osmo-bts.cnf:

  slotmask 1 1 0 0 0 0 0 0

Run two osmocon and transceiver application in separate shells:

osmocon -p /dev/ttyUSB0 -m c123xor -c path_to/trx.highram.bin -r 99
# This osmocon connects to the serial interface of the second phone.
# Note: "/tmp/osmocom_l2.2" is the second socket to which the transceiver will connect.
osmocon -p /dev/ttyUSB1 -s /tmp/osmocom_l2.2 -m c123xor -c path_to/trx.highram.bin -r 99
transceiver -e 5 -r 99 -2

Linux-Call-Router (LCR) (optional)

Run LCR with debugging output.

lcr start
** LCR  Version 1.14

LCR 1.14 started, waiting for calls...

Test

Location Updating

Switch on the phone.

If you have a SIM card for your network 262 42, you can use it and do automatic network search. If not, do a manual network and select this network. You should see debugging output on OpenBSC like this:

...
 <0002> gsm_04_08.c:424 -> LOCATION UPDATE ACCEPT
...

Call the music (LCR required)

Now enter phone number 995 to select the test function 5 of LCR. This test function just plays the hold music.

Echo and BFI test (LCR required)

Enter phone number 993 to select the test function 3 of LCR. This test function echoes back everything that is received. Note that it will re-transcode the speech data, so the audio from your voice is compressed and decompressed twice until you can hear a fraction of a second later.

You may experience short beeps. These beeps represent all bad frames that could not be decoded or got lost over the air. (Without this test, the missing frames will be extrapolated from previous frame, so some loss rate will not be recognized by the remote end.)

Last modified 11 months ago Last modified on Jan 25, 2014, 4:57:36 AM