Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 17

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 17 jolly
=== opencore-amr (optional, for LCR only) ===
12 1 jolly
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 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 3 jolly
=== OpenBSC ===
121 1 jolly
122 3 jolly
This package installs the open source base station controller.
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
osmo-bts: (BTS software)
146
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
}}}
184
185
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:
186
{{{
187
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....
188
}}}
189
190
The configure result should include:
191
{{{
192
configure: Compiled with GSM network side support
193
configure: Compiled with GSM mobile side support
194
configure: Compiled with GSM half rate codec support
195
configure: Compiled with GSM AMR codec support
196
configure: Compiled with SIP support
197
}}}
198
199
Finish the installation:
200
{{{
201
make
202
make install
203
ldconfig
204
cd ..
205
}}}
206
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
 gsmtap-sapi bcch
226
 gsmtap-sapi ccch
227 1 jolly
 gsmtap-sapi rach
228 2 jolly
 gsmtap-sapi agch
229
 gsmtap-sapi pch
230
 gsmtap-sapi sdcch
231
 gsmtap-sapi pacch
232
 gsmtap-sapi pdtch
233
 gsmtap-sapi sacch
234
 fn-advance 20
235
 ms-power-loop -10
236
 timing-advance-loop
237
 trx 0
238
  rxgain 0
239 1 jolly
  power 0
240
}}}
241 4 jolly
242
243
=== OpenBSC ===
244
245
{{{
246
mkdir ~/.osmocom
247
edit ~/.osmocom/open-bsc.cfg
248
}}}
249
250 5 jolly
'''Be sure to change 'arfcn' to a frequency you have license for!'''
251
252 4 jolly
{{{
253
e1_input
254
 e1_line 0 driver ipa
255
 e1_line 0 port 0
256
network
257
 network country code 262
258
 mobile network code 42
259
 short name OpenBSC
260
 long name OpenBSC
261
 auth policy accept-all
262
 location updating reject cause 13
263
 encryption a5 0
264
 neci 1
265
 paging any use tch 0
266
 rrlp mode ms-based
267
 mm info 1
268
 handover 0
269
 handover window rxlev averaging 10
270
 handover window rxqual averaging 1
271
 handover window rxlev neighbor averaging 10
272
 handover power budget interval 6
273
 handover power budget hysteresis 3
274
 handover maximum distance 9999
275
 timer t3101 10
276
 timer t3103 0
277
 timer t3105 0
278
 timer t3107 0
279
 timer t3109 0
280
 timer t3111 0
281
 timer t3113 60
282
 timer t3115 0
283
 timer t3117 0
284
 timer t3119 0
285
 timer t3122 10
286
 timer t3141 0
287
 dtx-used 0
288
 subscriber-keep-in-ram 0
289
 bts 0
290
  type nanobts
291
  band DCS1800
292
  cell_identity 0
293
  location_area_code 1
294
  training_sequence_code 7
295
  base_station_id_code 63
296
  ms max power 0
297
  cell reselection hysteresis 4
298
  rxlev access min 0
299
  periodic location update 30
300
  channel allocator descending
301
  rach tx integer 9
302
  rach max transmission 7
303
  channel-descrption attach 1
304
  channel-descrption bs-pa-mfrms 5
305
  channel-descrption bs-ag-blks-res 1
306
  ip.access unit_id 1801 0
307
  oml ip.access stream_id 255 line 0
308
  neighbor-list mode automatic
309
  trx 0
310
   rf_locked 0
311
   arfcn 869
312
   nominal power 0
313
   max_power_red 0
314
   rsl e1 tei 0
315
    timeslot 0
316
     phys_chan_config CCCH+SDCCH4
317
     hopping enabled 0
318
    timeslot 1
319
     phys_chan_config TCH/F
320
     hopping enabled 0
321
    timeslot 2
322
     phys_chan_config TCH/F
323
     hopping enabled 0
324
    timeslot 3
325
     phys_chan_config TCH/F
326
     hopping enabled 0
327
    timeslot 4
328
     phys_chan_config TCH/F
329
     hopping enabled 0
330
    timeslot 5
331
     phys_chan_config TCH/F
332
     hopping enabled 0
333
    timeslot 6
334
     phys_chan_config TCH/F
335
     hopping enabled 0
336
    timeslot 7
337
     phys_chan_config TCH/F
338
     hopping enabled 0
339 5 jolly
}}}
340 4 jolly
341
342 17 jolly
=== Linux-Call-Router (LCR) (optional) ===
343 4 jolly
344 12 jolly
==== options.conf ====
345
346
{{{
347
edit /usr/local/etc/lcr/options.conf
348
}}}
349
350
Add a line to show logging to the console:
351
{{{
352
debug 0x100000
353
}}}
354
355
356 4 jolly
==== interface.conf ====
357
358
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.
359
360
{{{
361
edit /usr/local/etc/lcr/interface.conf
362
}}}
363
364
You can remove (or comment out) everything and just add this interface:
365
366 1 jolly
{{{
367
[gsm]
368
gsm-bs
369
tones yes
370 4 jolly
earlyb no
371
extern
372
}}}
373
374
==== routing.conf ====
375
376
{{{
377
edit /usr/local/etc/lcr/routing.conf
378
}}}
379
380
You can remove (or comment out) everything and just add these rulesets:
381
382
{{{
383
[main]
384
interface=gsm                           : goto ruleset=gsm
385
                                        : disconnect cause=31
386
387
[gsm]
388
dialing=99                              : test
389
                                        : extern interfaces=gsm
390
}}}
391
392
Look at the main rule set. All calls from interface 'gsm' are forwarded to rule set 'gsm'.
393
394
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.
395
396
397
== Running ==
398 1 jolly
399 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.
400
401
=== OpenBSC ===
402
403
Open a shell and start OpenBSC:
404
405
{{{
406 17 jolly
osmo-nitb -c ~/.osmocom/open-bsc.cfg -l ~/.osmocom/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM
407 6 jolly
}}}
408
409 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.
410 9 jolly
411 17 jolly
{{{
412
osmo-nitb -c ~/.osmocom/open-bsc.cfg -l ~/.osmocom/hlr.sqlite3 -P -m -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM
413
}}}
414
415 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.
416 9 jolly
417 6 jolly
The debugging is usefull for early tests, because you will quickly see what happens if a mobile requests something.
418 1 jolly
419
{{{
420
<0005> bsc_init.c:422 
421 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!
422
423
<0019> input/ipaccess.c:925 enabling ipaccess BSC mode
424
DB: Database initialized.
425
DB: Database prepared.
426
<001d> sms_queue.c:220 Attempting to send 20 SMS
427
}}}
428
429
430
=== OsmoBTS ===
431
432
Open a shell and start OsmoBTS:
433 1 jolly
434 6 jolly
{{{
435
osmobts-trx -c ~/.osmocom/osmo-bts.cfg
436
}}}
437
438
{{{
439
((*))
440
  |
441
 / \ OsmoBTS
442
Using MAC address of eth0: 'xx:xx:xx:xx:xx:xx'
443
...
444
<000a> trx_if.c:176 No response from tranceiver
445
<000a> trx_if.c:176 No response from tranceiver
446
<000a> trx_if.c:176 No response from tranceiver
447
}}}
448 7 jolly
449
450
=== Transceiver ===
451
452
Now start your OpenBTS transceiver.
453
454
==== UmTRX ====
455
456
The installation/setup/calibration of UmTRX is beyond the scope of this document. Please refer to:
457
458
 * https://github.com/fairwaves
459
 * http://files.ettus.com/uhd_docs/manual/html/build.html
460
 * http://wush.net/trac/rangepublic/wiki/BuildInstallRun
461 1 jolly
462 7 jolly
==== calypso-BTS ====
463 13 jolly
464 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.
465 1 jolly
466 17 jolly
In order to compile Osmocom-BB with transceiver support, do the following:
467 13 jolly
{{{
468 17 jolly
cd osmocom-bb
469 13 jolly
# change branch:
470
git checkout -b jolly/testing origin/jolly/testing
471
cd src
472
make
473
# after it compiles, just enable transceiver support
474
cd host/layer23
475
./configure --enable-transceiver
476
make
477
}}}
478
479 7 jolly
TBD
480
481
482 17 jolly
=== Linux-Call-Router (LCR) (optional) ===
483 7 jolly
484
Run LCR with debugging output.
485
486
{{{
487
lcr start
488
}}}
489
490
{{{
491
** LCR  Version 1.14
492
493
LCR 1.14 started, waiting for calls...
494
}}}
495 1 jolly
496
497 9 jolly
== Test ==
498
499
=== Location Updating ===
500
501
Switch on the phone.
502
503
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:
504
{{{
505
...
506
 <0002> gsm_04_08.c:424 -> LOCATION UPDATE ACCEPT
507
...
508
}}}
509
510
511 17 jolly
=== Call the music (LCR required) ===
512 9 jolly
513
Now enter phone number 995 to select the test function 5 of LCR. This test function just plays the hold music.
514
515
516 17 jolly
=== Echo and BFI test (LCR required) ===
517 9 jolly
518
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.
519
520
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)