Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 15

jolly, 02/19/2016 10:47 PM

1 1 jolly
[[PageOutline]]
2
= Installing a GSM network from scratch =
3
4
This document describes how to install, configure and run BTS transceiver, OsmoBTS, OpenBSC and LCR.
5
6
In order to use this quick howto, you must have basic knowledge about GIT and be familiar with compiling packages from source.
7
8
9
== Prerequisite ==
10
11
=== opencore-amr ===
12
13
This package installs GSM adaptive multirate codecs
14
15
It can downloaded at [http://sourceforge.net/projects/opencore-amr/files/opencore-amr/]
16
17
{{{
18
tar xvzf opencore-amr-x.x.x.tar.gz
19
cd opencore-amr-x.x.x
20
./configure
21
make
22
make install
23
ldconfig
24
cd ..
25
}}}
26
27
28
=== Sip-Sofia ===
29
30
This package installs the open source SIP stack of Nokia Research Center.
31
32
It can downloaded at [http://sourceforge.net/projects/sofia-sip/files/sofia-sip/].
33
34
{{{
35
tar xvzf sofia-sip-x.xx.xx.tar.gz
36
cd sofia-sip-x.xx.xx
37
./configure
38
make
39
make install
40
ldconfig
41
cd ..
42
}}}
43
44
45
=== oRTP ===
46
47
This package installs the open source RTP protocol required for libosmo-abis.
48
49
It can downloaded at [http://download.savannah.gnu.org/releases/linphone/ortp/sources/].
50
51
{{{
52
tar xvzf ortp-x.xx.x.tar.gz
53
cd ortp-x.xx.x
54
./configure
55
make
56
make install
57
ldconfig
58
cd ..
59
}}}
60
61
62
=== others ===
63
64
sqlite3 and libdbi should be available from your distribution.
65
66
67
68
== Installing  ==
69 2 jolly
70
=== Linux-Call-Router (LCR) ===
71
72
This package installs the open source PBX software to bridge ISDN (DSS1) / SIP / GSM (MNCC protocol)
73
74
The latest version can downloaded via git:
75
{{{
76
git clone git://git.misdn.eu/lcr.git/
77
}}}
78
79 3 jolly
Now configure, as described here:
80
81 2 jolly
{{{
82
cd lcr
83
autoreconf -i
84 14 jolly
./configure --with-sip --with-gsm-bs --with-gsm-ms
85 2 jolly
}}}
86 1 jolly
87 3 jolly
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:
88
{{{
89
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....
90
}}}
91 1 jolly
92 3 jolly
The configure result should include:
93
{{{
94 2 jolly
configure: Compiled with GSM network side support
95
configure: Compiled with GSM mobile side support
96
configure: Compiled with GSM half rate codec support
97 1 jolly
configure: Compiled with GSM AMR codec support
98 2 jolly
configure: Compiled with SIP support
99 3 jolly
}}}
100 1 jolly
101 3 jolly
Finish the installation:
102
{{{
103 2 jolly
make
104
make install
105 1 jolly
ldconfig
106 2 jolly
cd ..
107 3 jolly
}}}
108 1 jolly
109
110 3 jolly
=== libosmocore ===
111 1 jolly
112 3 jolly
This package installs the core utility library for various Osmocom projects.
113 1 jolly
114 3 jolly
The latest version can downloaded via git:
115
{{{
116
git clone git://git.osmocom.org/libosmocore.git
117
}}}
118
119
Finish the installation:
120
{{{
121 2 jolly
cd libosmocore
122 15 jolly
# change to jolly/trx branch
123
git checkout -b jolly/trx origin/jolly/trx
124 2 jolly
autoreconf -i
125
./configure
126 1 jolly
make
127 2 jolly
make install
128
ldconfig
129 1 jolly
cd ..
130 3 jolly
}}}
131 1 jolly
132
133 3 jolly
=== libosmo-abis ===
134 1 jolly
135 3 jolly
This package installs the core utility library for various Osmocom projects.
136
137
The latest version can downloaded via git:
138
{{{
139
git clone git://git.osmocom.org/libosmo-abis.git
140
}}}
141
142
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:
143
{{{
144
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....
145
}}}
146
147
Finish the installation:
148
{{{
149 2 jolly
cd libosmo-abis
150
autoreconf -i
151 1 jolly
./configure
152 2 jolly
(sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....)
153
make
154 1 jolly
make install
155
ldconfig
156
cd ..
157 3 jolly
}}}
158 1 jolly
159
160 3 jolly
=== OpenBSC ===
161 1 jolly
162 3 jolly
This package installs the open source base station controller.
163 2 jolly
164 3 jolly
The latest version can downloaded via git:
165
{{{
166
git clone git://git.osmocom.org/openbsc.git
167
}}}
168
169
Finish the installation:
170
{{{
171 1 jolly
cd openbsc/openbsc/
172 11 jolly
# change branch:
173
git checkout -b jolly/testing origin/jolly/testing
174 2 jolly
autoreconf -i
175 1 jolly
./configure
176
(sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....)
177 2 jolly
make
178 1 jolly
make install
179
cd ../..
180 3 jolly
}}}
181 1 jolly
182
183 3 jolly
=== OsmoBTS ===
184
185 1 jolly
osmo-bts: (BTS software)
186
187 3 jolly
This package installs the open source base transceiver station.
188
189
The latest version can downloaded via git:
190
{{{
191
git clone git://git.osmocom.org/osmo-bts.git
192
}}}
193
194
Finish the installation:
195 1 jolly
{{{
196
cd osmo-bts
197 11 jolly
#change branch:
198
git checkout -b jolly/trx origin/jolly/trx
199 1 jolly
autoreconf -i
200
./configure --enable-trx
201
(sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....)
202 2 jolly
make
203 1 jolly
make install
204
cd ..
205 3 jolly
}}}
206 2 jolly
207
208 3 jolly
== Configuration examples ==
209 2 jolly
210 10 jolly
=== OsmoBTS ===
211 3 jolly
212
{{{
213 2 jolly
mkdir ~/.osmocom
214 3 jolly
edit ~/.osmocom/osmo-bts.cfg
215
}}}
216 2 jolly
217 3 jolly
{{{
218 2 jolly
bts 0
219
 band DCS1800
220
 ipa unit-id 1801 0
221
 oml remote-ip 127.0.0.1
222
 rtp bind-ip 127.0.0.1
223
 rtp jitter-buffer 0
224
 paging lifetime 0
225
 radio-link-timeout 32
226
 gsmtap-sapi bcch
227
 gsmtap-sapi ccch
228 1 jolly
 gsmtap-sapi rach
229 2 jolly
 gsmtap-sapi agch
230
 gsmtap-sapi pch
231
 gsmtap-sapi sdcch
232
 gsmtap-sapi pacch
233
 gsmtap-sapi pdtch
234
 gsmtap-sapi sacch
235
 fn-advance 20
236
 ms-power-loop -10
237
 timing-advance-loop
238
 trx 0
239
  rxgain 0
240 1 jolly
  power 0
241
}}}
242 4 jolly
243
244
=== OpenBSC ===
245
246
{{{
247
mkdir ~/.osmocom
248
edit ~/.osmocom/open-bsc.cfg
249
}}}
250
251 5 jolly
'''Be sure to change 'arfcn' to a frequency you have license for!'''
252
253 4 jolly
{{{
254
e1_input
255
 e1_line 0 driver ipa
256
 e1_line 0 port 0
257
network
258
 network country code 262
259
 mobile network code 42
260
 short name OpenBSC
261
 long name OpenBSC
262
 auth policy accept-all
263
 location updating reject cause 13
264
 encryption a5 0
265
 neci 1
266
 paging any use tch 0
267
 rrlp mode ms-based
268
 mm info 1
269
 handover 0
270
 handover window rxlev averaging 10
271
 handover window rxqual averaging 1
272
 handover window rxlev neighbor averaging 10
273
 handover power budget interval 6
274
 handover power budget hysteresis 3
275
 handover maximum distance 9999
276
 timer t3101 10
277
 timer t3103 0
278
 timer t3105 0
279
 timer t3107 0
280
 timer t3109 0
281
 timer t3111 0
282
 timer t3113 60
283
 timer t3115 0
284
 timer t3117 0
285
 timer t3119 0
286
 timer t3122 10
287
 timer t3141 0
288
 dtx-used 0
289
 subscriber-keep-in-ram 0
290
 bts 0
291
  type nanobts
292
  band DCS1800
293
  cell_identity 0
294
  location_area_code 1
295
  training_sequence_code 7
296
  base_station_id_code 63
297
  ms max power 0
298
  cell reselection hysteresis 4
299
  rxlev access min 0
300
  periodic location update 30
301
  channel allocator descending
302
  rach tx integer 9
303
  rach max transmission 7
304
  channel-descrption attach 1
305
  channel-descrption bs-pa-mfrms 5
306
  channel-descrption bs-ag-blks-res 1
307
  ip.access unit_id 1801 0
308
  oml ip.access stream_id 255 line 0
309
  neighbor-list mode automatic
310
  trx 0
311
   rf_locked 0
312
   arfcn 869
313
   nominal power 0
314
   max_power_red 0
315
   rsl e1 tei 0
316
    timeslot 0
317
     phys_chan_config CCCH+SDCCH4
318
     hopping enabled 0
319
    timeslot 1
320
     phys_chan_config TCH/F
321
     hopping enabled 0
322
    timeslot 2
323
     phys_chan_config TCH/F
324
     hopping enabled 0
325
    timeslot 3
326
     phys_chan_config TCH/F
327
     hopping enabled 0
328
    timeslot 4
329
     phys_chan_config TCH/F
330
     hopping enabled 0
331
    timeslot 5
332
     phys_chan_config TCH/F
333
     hopping enabled 0
334
    timeslot 6
335
     phys_chan_config TCH/F
336
     hopping enabled 0
337
    timeslot 7
338
     phys_chan_config TCH/F
339
     hopping enabled 0
340 5 jolly
}}}
341 4 jolly
342
343
=== LCR ===
344
345 12 jolly
==== options.conf ====
346
347
{{{
348
edit /usr/local/etc/lcr/options.conf
349
}}}
350
351
Add a line to show logging to the console:
352
{{{
353
debug 0x100000
354
}}}
355
356
357 4 jolly
==== interface.conf ====
358
359
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.
360
361
{{{
362
edit /usr/local/etc/lcr/interface.conf
363
}}}
364
365
You can remove (or comment out) everything and just add this interface:
366
367
{{{
368
[gsm]
369
gsm-bs
370
tones yes
371
earlyb no
372
extern
373
}}}
374
375
==== routing.conf ====
376
377
{{{
378
edit /usr/local/etc/lcr/routing.conf
379
}}}
380
381
You can remove (or comment out) everything and just add these rulesets:
382
383
{{{
384
[main]
385
interface=gsm                           : goto ruleset=gsm
386
                                        : disconnect cause=31
387
388
[gsm]
389
dialing=99                              : test
390
                                        : extern interfaces=gsm
391
}}}
392
393
Look at the main rule set. All calls from interface 'gsm' are forwarded to rule set 'gsm'.
394
395 1 jolly
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.
396 6 jolly
397
398
== Running ==
399
400
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.
401
402
=== OpenBSC ===
403
404
Open a shell and start OpenBSC:
405
406
{{{
407 9 jolly
osmo-nitb -c ~/.osmocom/open-bsc.cfg -l ~/.osmocom/hlr.sqlite3 -P -m -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM
408 6 jolly
}}}
409
410 1 jolly
OpenBSC runs as a stand-alone network with given config file and data base. It allows forwarding of RTP data and connection to LCR, if the options above are used.
411 8 jolly
412
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.
413 1 jolly
414 9 jolly
The debugging is usefull for early tests, because you will quickly see what happens if a mobile requests something.
415
416 6 jolly
{{{
417
<0005> bsc_init.c:422 
418
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!
419
420
<0019> input/ipaccess.c:925 enabling ipaccess BSC mode
421
DB: Database initialized.
422
DB: Database prepared.
423
<001d> sms_queue.c:220 Attempting to send 20 SMS
424
}}}
425
426
427
=== OsmoBTS ===
428
429
Open a shell and start OsmoBTS:
430
431
{{{
432
osmobts-trx -c ~/.osmocom/osmo-bts.cfg
433
}}}
434
435
{{{
436
((*))
437
  |
438
 / \ OsmoBTS
439
Using MAC address of eth0: 'xx:xx:xx:xx:xx:xx'
440
...
441
<000a> trx_if.c:176 No response from tranceiver
442
<000a> trx_if.c:176 No response from tranceiver
443
<000a> trx_if.c:176 No response from tranceiver
444
}}}
445 7 jolly
446
447
=== Transceiver ===
448
449
Now start your OpenBTS transceiver.
450
451
==== UmTRX ====
452
453
The installation/setup/calibration of UmTRX is beyond the scope of this document. Please refer to:
454
455
 * https://github.com/fairwaves
456
 * http://files.ettus.com/uhd_docs/manual/html/build.html
457
 * http://wush.net/trac/rangepublic/wiki/BuildInstallRun
458
459
==== calypso-BTS ====
460
461 13 jolly
Building OsmocomBB with arm-elf toolchain is also beyond the scope of this document. If you managed to compile and run OsmocomBB you should be able to run the transceiver too.
462
463
In order to compile OsmocomBB with transceiver support, do the following:
464
{{{
465
cd osmocombb
466
# change branch:
467
git checkout -b jolly/testing origin/jolly/testing
468
cd src
469
make
470
# after it compiles, just enable transceiver support
471
cd host/layer23
472
./configure --enable-transceiver
473
make
474
}}}
475
476 7 jolly
TBD
477
478
479
=== LCR ===
480
481
Run LCR with debugging output.
482
483
{{{
484
lcr start
485
}}}
486
487
{{{
488
** LCR  Version 1.14
489
490
LCR 1.14 started, waiting for calls...
491
}}}
492 1 jolly
493
494 9 jolly
== Test ==
495
496
=== Location Updating ===
497
498
Switch on the phone.
499
500
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:
501
{{{
502
...
503
 <0002> gsm_04_08.c:424 -> LOCATION UPDATE ACCEPT
504
...
505
}}}
506
507
508
=== Call the music ===
509
510
Now enter phone number 995 to select the test function 5 of LCR. This test function just plays the hold music.
511
512
513
=== Echo and BFI test ===
514
515
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.
516
517
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.)
Add picture from clipboard (Maximum size: 48.8 MB)