Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 24

jolly, 02/19/2016 10:47 PM

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