Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 30

9600, 02/19/2016 10:47 PM

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