Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 28

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