Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 23

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