Project

General

Profile

SDR OsmoTRX network from scratch » History » Version 26

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
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 22 jolly
  type sysmobts
293 4 jolly
  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 21 jolly
WARNING: You are running an 'accept-all' network on a BTS that is not barred.
424
This configuration is likely to interfere with production GSM networks and
425
should only be used in a RF shielded environment such as a faraday cage!
426 6 jolly
427
<0019> input/ipaccess.c:925 enabling ipaccess BSC mode
428
DB: Database initialized.
429
DB: Database prepared.
430
<001d> sms_queue.c:220 Attempting to send 20 SMS
431
}}}
432
433
434
=== OsmoBTS ===
435
436
Open a shell and start OsmoBTS:
437 1 jolly
438 6 jolly
{{{
439
osmobts-trx -c ~/.osmocom/osmo-bts.cfg
440
}}}
441
442
{{{
443
((*))
444
  |
445
 / \ OsmoBTS
446
Using MAC address of eth0: 'xx:xx:xx:xx:xx:xx'
447
...
448
<000a> trx_if.c:176 No response from tranceiver
449
<000a> trx_if.c:176 No response from tranceiver
450
<000a> trx_if.c:176 No response from tranceiver
451
}}}
452 7 jolly
453
454
=== Transceiver ===
455
456
Now start your OpenBTS transceiver.
457
458
==== UmTRX ====
459
460
The installation/setup/calibration of UmTRX is beyond the scope of this document. Please refer to:
461
462
 * https://github.com/fairwaves
463
 * http://files.ettus.com/uhd_docs/manual/html/build.html
464
 * http://wush.net/trac/rangepublic/wiki/BuildInstallRun
465 1 jolly
466 7 jolly
==== calypso-BTS ====
467 13 jolly
468 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.
469 1 jolly
470 20 jolly
The latest version can downloaded via git:
471
{{{
472
git clone git://git.osmocom.org/libosmo-dsp.git
473
git clone git://git.osmocom.org/osmocom-bb.git
474
}}}
475
476 17 jolly
In order to compile Osmocom-BB with transceiver support, do the following:
477 13 jolly
{{{
478 20 jolly
cd libosmo-dsp
479
autoreconf -i
480
./configure
481
(sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....)
482
make
483
make install
484
cd ..
485
486 17 jolly
cd osmocom-bb
487 13 jolly
# change branch:
488
git checkout -b jolly/testing origin/jolly/testing
489
cd src
490
make
491
# after it compiles, just enable transceiver support
492
cd host/layer23
493
./configure --enable-transceiver
494
make
495
}}}
496 1 jolly
497 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).'''
498 26 jolly
499
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:
500
501
{{{
502
bts 0
503
 band DCS1800
504
 ipa unit-id 1801 0
505
 oml remote-ip 127.0.0.1
506
 rtp jitter-buffer 0
507
 paging queue-size 200
508
 paging lifetime 0
509
 fn-advance 30
510
 ms-power-loop -60
511
 timing-advance-loop
512
 settsc
513
 setbsic
514
 trx 0
515
  rxgain 0
516
  power 0
517
  slotmask 1 0 0 0 0 0 0 0
518
}}}
519
520
Run osmocon and transceiver application in separate shells:
521
522
{{{
523
# Please refer to Osmocom-BB wiki for compiling and running own firmware on compal phones...
524
osmocon -p /dev/ttyUSB0 -m c123xor -c path_to/trx.highram.bin -r 99
525
}}}
526
527
{{{
528
transceiver -e 5 -r 99
529
}}}
530
531
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:
532
533
{{{
534
  slotmask 1 1 0 0 0 0 0 0
535
}}}
536
537
Run two osmocon and transceiver application in separate shells:
538
539
{{{
540
osmocon -p /dev/ttyUSB0 -m c123xor -c path_to/trx.highram.bin -r 99
541
}}}
542
543
{{{
544
# This osmocon connects to the serial interface of the second phone.
545
# Note: "/tmp/osmocom_l2.2" is the second socket to which the transceiver will connect.
546
osmocon -p /dev/ttyUSB1 -s /tmp/osmocom_l2.2 -m c123xor -c path_to/trx.highram.bin -r 99
547
}}}
548
549
{{{
550
transceiver -e 5 -r 99 -2
551
}}}
552 7 jolly
553
554 17 jolly
=== Linux-Call-Router (LCR) (optional) ===
555 7 jolly
556
Run LCR with debugging output.
557
558
{{{
559
lcr start
560
}}}
561
562
{{{
563
** LCR  Version 1.14
564
565
LCR 1.14 started, waiting for calls...
566
}}}
567 1 jolly
568
569 9 jolly
== Test ==
570
571
=== Location Updating ===
572
573
Switch on the phone.
574
575
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:
576
{{{
577
...
578
 <0002> gsm_04_08.c:424 -> LOCATION UPDATE ACCEPT
579
...
580
}}}
581
582
583 17 jolly
=== Call the music (LCR required) ===
584 9 jolly
585
Now enter phone number 995 to select the test function 5 of LCR. This test function just plays the hold music.
586
587
588 17 jolly
=== Echo and BFI test (LCR required) ===
589 9 jolly
590
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.
591
592
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)