SDR OsmoTRX network from scratch » History » Version 11
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 | === opencore-amr === |
||
12 | |||
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 | === Sip-Sofia === |
||
29 | |||
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 | 2 | jolly | |
70 | === Linux-Call-Router (LCR) === |
||
71 | |||
72 | This package installs the open source PBX software to bridge ISDN (DSS1) / SIP / GSM (MNCC protocol) |
||
73 | |||
74 | The latest version can downloaded via git: |
||
75 | {{{ |
||
76 | git clone git://git.misdn.eu/lcr.git/ |
||
77 | }}} |
||
78 | |||
79 | 3 | jolly | Now configure, as described here: |
80 | |||
81 | 2 | jolly | {{{ |
82 | cd lcr |
||
83 | autoreconf -i |
||
84 | ./configure --with-sip --with-gsm-bs --with-gsm-ms --enable-gsm-hr |
||
85 | }}} |
||
86 | 1 | jolly | |
87 | 3 | jolly | 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: |
88 | {{{ |
||
89 | PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure ..... |
||
90 | }}} |
||
91 | 1 | jolly | |
92 | 3 | jolly | The configure result should include: |
93 | {{{ |
||
94 | 2 | jolly | configure: Compiled with GSM network side support |
95 | configure: Compiled with GSM mobile side support |
||
96 | configure: Compiled with GSM half rate codec support |
||
97 | 1 | jolly | configure: Compiled with GSM AMR codec support |
98 | 2 | jolly | configure: Compiled with SIP support |
99 | 3 | jolly | }}} |
100 | 1 | jolly | |
101 | 3 | jolly | Finish the installation: |
102 | {{{ |
||
103 | 2 | jolly | make |
104 | make install |
||
105 | 1 | jolly | ldconfig |
106 | 2 | jolly | cd .. |
107 | 3 | jolly | }}} |
108 | 1 | jolly | |
109 | |||
110 | 3 | jolly | === libosmocore === |
111 | 1 | jolly | |
112 | 3 | jolly | This package installs the core utility library for various Osmocom projects. |
113 | 1 | jolly | |
114 | 3 | jolly | The latest version can downloaded via git: |
115 | {{{ |
||
116 | git clone git://git.osmocom.org/libosmocore.git |
||
117 | }}} |
||
118 | |||
119 | Finish the installation: |
||
120 | {{{ |
||
121 | 2 | jolly | cd libosmocore |
122 | git checkout -b |
||
123 | autoreconf -i |
||
124 | ./configure |
||
125 | 1 | jolly | make |
126 | 2 | jolly | make install |
127 | ldconfig |
||
128 | 1 | jolly | cd .. |
129 | 3 | jolly | }}} |
130 | 1 | jolly | |
131 | |||
132 | 3 | jolly | === libosmo-abis === |
133 | 1 | jolly | |
134 | 3 | jolly | This package installs the core utility library for various Osmocom projects. |
135 | |||
136 | The latest version can downloaded via git: |
||
137 | {{{ |
||
138 | git clone git://git.osmocom.org/libosmo-abis.git |
||
139 | }}} |
||
140 | |||
141 | 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: |
||
142 | {{{ |
||
143 | PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure ..... |
||
144 | }}} |
||
145 | |||
146 | Finish the installation: |
||
147 | {{{ |
||
148 | 2 | jolly | cd libosmo-abis |
149 | autoreconf -i |
||
150 | 1 | jolly | ./configure |
151 | 2 | jolly | (sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....) |
152 | make |
||
153 | 1 | jolly | make install |
154 | ldconfig |
||
155 | cd .. |
||
156 | 3 | jolly | }}} |
157 | 1 | jolly | |
158 | |||
159 | 3 | jolly | === OpenBSC === |
160 | 1 | jolly | |
161 | 3 | jolly | This package installs the open source base station controller. |
162 | 2 | jolly | |
163 | 3 | jolly | The latest version can downloaded via git: |
164 | {{{ |
||
165 | git clone git://git.osmocom.org/openbsc.git |
||
166 | }}} |
||
167 | |||
168 | Finish the installation: |
||
169 | {{{ |
||
170 | 1 | jolly | cd openbsc/openbsc/ |
171 | 11 | jolly | # change branch: |
172 | git checkout -b jolly/testing origin/jolly/testing |
||
173 | 2 | jolly | autoreconf -i |
174 | 1 | jolly | ./configure |
175 | (sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....) |
||
176 | 2 | jolly | make |
177 | 1 | jolly | make install |
178 | cd ../.. |
||
179 | 3 | jolly | }}} |
180 | 1 | jolly | |
181 | |||
182 | 3 | jolly | === OsmoBTS === |
183 | |||
184 | 1 | jolly | osmo-bts: (BTS software) |
185 | |||
186 | 3 | jolly | This package installs the open source base transceiver station. |
187 | |||
188 | The latest version can downloaded via git: |
||
189 | {{{ |
||
190 | git clone git://git.osmocom.org/osmo-bts.git |
||
191 | }}} |
||
192 | |||
193 | Finish the installation: |
||
194 | 1 | jolly | {{{ |
195 | cd osmo-bts |
||
196 | 11 | jolly | #change branch: |
197 | git checkout -b jolly/trx origin/jolly/trx |
||
198 | 1 | jolly | autoreconf -i |
199 | ./configure --enable-trx |
||
200 | (sometimes it is necessary to point to different .../lib/pkgconfig/ path: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure .....) |
||
201 | 2 | jolly | make |
202 | 1 | jolly | make install |
203 | cd .. |
||
204 | 3 | jolly | }}} |
205 | 2 | jolly | |
206 | |||
207 | 3 | jolly | == Configuration examples == |
208 | 2 | jolly | |
209 | 10 | jolly | === OsmoBTS === |
210 | 3 | jolly | |
211 | {{{ |
||
212 | 2 | jolly | mkdir ~/.osmocom |
213 | 3 | jolly | edit ~/.osmocom/osmo-bts.cfg |
214 | }}} |
||
215 | 2 | jolly | |
216 | 3 | jolly | {{{ |
217 | 2 | jolly | bts 0 |
218 | band DCS1800 |
||
219 | ipa unit-id 1801 0 |
||
220 | oml remote-ip 127.0.0.1 |
||
221 | rtp bind-ip 127.0.0.1 |
||
222 | rtp jitter-buffer 0 |
||
223 | paging lifetime 0 |
||
224 | radio-link-timeout 32 |
||
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 | === LCR === |
||
343 | |||
344 | ==== interface.conf ==== |
||
345 | |||
346 | 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. |
||
347 | |||
348 | {{{ |
||
349 | edit /usr/local/etc/lcr/interface.conf |
||
350 | }}} |
||
351 | |||
352 | You can remove (or comment out) everything and just add this interface: |
||
353 | |||
354 | {{{ |
||
355 | [gsm] |
||
356 | gsm-bs |
||
357 | tones yes |
||
358 | earlyb no |
||
359 | extern |
||
360 | }}} |
||
361 | |||
362 | ==== routing.conf ==== |
||
363 | |||
364 | {{{ |
||
365 | edit /usr/local/etc/lcr/routing.conf |
||
366 | }}} |
||
367 | |||
368 | You can remove (or comment out) everything and just add these rulesets: |
||
369 | |||
370 | {{{ |
||
371 | [main] |
||
372 | interface=gsm : goto ruleset=gsm |
||
373 | : disconnect cause=31 |
||
374 | |||
375 | [gsm] |
||
376 | dialing=99 : test |
||
377 | : extern interfaces=gsm |
||
378 | }}} |
||
379 | |||
380 | Look at the main rule set. All calls from interface 'gsm' are forwarded to rule set 'gsm'. |
||
381 | |||
382 | 1 | jolly | 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. |
383 | 6 | jolly | |
384 | |||
385 | == Running == |
||
386 | |||
387 | 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. |
||
388 | |||
389 | === OpenBSC === |
||
390 | |||
391 | Open a shell and start OpenBSC: |
||
392 | |||
393 | {{{ |
||
394 | 9 | jolly | osmo-nitb -c ~/.osmocom/open-bsc.cfg -l ~/.osmocom/hlr.sqlite3 -P -m -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM |
395 | 6 | jolly | }}} |
396 | |||
397 | 1 | jolly | OpenBSC runs as a stand-alone network with given config file and data base. It allows forwarding of RTP data and connection to LCR, if the options above are used. |
398 | 8 | jolly | |
399 | 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. |
||
400 | 1 | jolly | |
401 | 9 | jolly | The debugging is usefull for early tests, because you will quickly see what happens if a mobile requests something. |
402 | |||
403 | 6 | jolly | {{{ |
404 | <0005> bsc_init.c:422 |
||
405 | 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! |
||
406 | |||
407 | <0019> input/ipaccess.c:925 enabling ipaccess BSC mode |
||
408 | DB: Database initialized. |
||
409 | DB: Database prepared. |
||
410 | <001d> sms_queue.c:220 Attempting to send 20 SMS |
||
411 | }}} |
||
412 | |||
413 | |||
414 | === OsmoBTS === |
||
415 | |||
416 | Open a shell and start OsmoBTS: |
||
417 | |||
418 | {{{ |
||
419 | osmobts-trx -c ~/.osmocom/osmo-bts.cfg |
||
420 | }}} |
||
421 | |||
422 | {{{ |
||
423 | ((*)) |
||
424 | | |
||
425 | / \ OsmoBTS |
||
426 | Using MAC address of eth0: 'xx:xx:xx:xx:xx:xx' |
||
427 | ... |
||
428 | <000a> trx_if.c:176 No response from tranceiver |
||
429 | <000a> trx_if.c:176 No response from tranceiver |
||
430 | <000a> trx_if.c:176 No response from tranceiver |
||
431 | }}} |
||
432 | 7 | jolly | |
433 | |||
434 | === Transceiver === |
||
435 | |||
436 | Now start your OpenBTS transceiver. |
||
437 | |||
438 | ==== UmTRX ==== |
||
439 | |||
440 | The installation/setup/calibration of UmTRX is beyond the scope of this document. Please refer to: |
||
441 | |||
442 | * https://github.com/fairwaves |
||
443 | * http://files.ettus.com/uhd_docs/manual/html/build.html |
||
444 | * http://wush.net/trac/rangepublic/wiki/BuildInstallRun |
||
445 | |||
446 | ==== calypso-BTS ==== |
||
447 | |||
448 | TBD |
||
449 | |||
450 | |||
451 | === LCR === |
||
452 | |||
453 | Run LCR with debugging output. |
||
454 | |||
455 | {{{ |
||
456 | lcr start |
||
457 | }}} |
||
458 | |||
459 | {{{ |
||
460 | ** LCR Version 1.14 |
||
461 | |||
462 | LCR 1.14 started, waiting for calls... |
||
463 | }}} |
||
464 | 1 | jolly | |
465 | |||
466 | 9 | jolly | == Test == |
467 | |||
468 | === Location Updating === |
||
469 | |||
470 | Switch on the phone. |
||
471 | |||
472 | 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: |
||
473 | {{{ |
||
474 | ... |
||
475 | <0002> gsm_04_08.c:424 -> LOCATION UPDATE ACCEPT |
||
476 | ... |
||
477 | }}} |
||
478 | |||
479 | |||
480 | === Call the music === |
||
481 | |||
482 | Now enter phone number 995 to select the test function 5 of LCR. This test function just plays the hold music. |
||
483 | |||
484 | |||
485 | === Echo and BFI test === |
||
486 | |||
487 | 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. |
||
488 | |||
489 | 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.) |