Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 20

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