Ettus USRP B2xx family » History » Version 15
Anonymous, 02/19/2016 10:47 PM
1 | 1 | This page will describe how to install and configure OpenBSC, Osmo-BTS, Osmo-TRX, Osmo-PCU and OpenGGSN to create an opensource 2G/GSM network with your Ettus USRP B200/B210 SDR hardware. |
|
---|---|---|---|
2 | |||
3 | This page in under development, please stay tuned. |
||
4 | |||
5 | 3 | '''Pre-Req:''' |
|
6 | 1 | ||
7 | The following guide is created on Ubuntu 14.14.03 LTS 64bit with kernel 3.19.0-26-lowlatency |
||
8 | 2 | ||
9 | 1. Installing the UHD driver stack for Ettus USRP SDRs: |
||
10 | |||
11 | http://files.ettus.com/manual/page_install.html#install_linux_ourbins |
||
12 | 1 | ||
13 | 3 | '''2. Installing dependencies:''' |
|
14 | |||
15 | {{{ |
||
16 | 15 | apt-get install libdbi0-dev libdbd-sqlite3 build-essential libtool autoconf automake git-core pkg-config libssl-dev libpcsclite-dev libusb-1.0 libncurses5-dev libgsm1-dev libpcap-dev libc-ares-dev libtalloc-dev libsctp-dev |
|
17 | 3 | }}} |
|
18 | |||
19 | 5 | Create a folder, where all the projects files will be stored: |
|
20 | |||
21 | {{{ |
||
22 | mkdir osmocom |
||
23 | cd osmocom |
||
24 | }}} |
||
25 | |||
26 | 3 | '''Get Opencore AMR:''' |
|
27 | |||
28 | {{{ |
||
29 | wget http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz |
||
30 | tar xvzf opencore-amr-0.1.3.tar.gz |
||
31 | cd opencore-amr-0.1.3 |
||
32 | ./configure |
||
33 | make |
||
34 | make install |
||
35 | ldconfig |
||
36 | cd .. |
||
37 | }}} |
||
38 | |||
39 | '''Get ORTP:'' |
||
40 | |||
41 | Note: 0.24.2 is not working with OpenBSC! |
||
42 | |||
43 | {{{ |
||
44 | wget http://download.savannah.gnu.org/releases/linphone/ortp/sources/ortp-0.22.0.tar.gz |
||
45 | tar xvzf ortp-0.22.0.tar.gz |
||
46 | cd ortp-0.24.2 |
||
47 | ./configure |
||
48 | make |
||
49 | make install |
||
50 | ldconfig |
||
51 | cd .. |
||
52 | }}} |
||
53 | 4 | ||
54 | '''Get libosmocore (master):''' |
||
55 | {{{ |
||
56 | git clone git://git.osmocom.org/libosmocore.git |
||
57 | cd libosmocore |
||
58 | autoreconf -fi |
||
59 | ./configure |
||
60 | make |
||
61 | make install |
||
62 | ldconfig |
||
63 | cd .. |
||
64 | }}} |
||
65 | '''Get libosmo-abis (master)''' |
||
66 | {{{ |
||
67 | git clone git://git.osmocom.org/libosmo-abis.git |
||
68 | cd libosmo-abis |
||
69 | autoreconf -fi |
||
70 | ./configure |
||
71 | make |
||
72 | make install |
||
73 | ldconfig |
||
74 | cd .. |
||
75 | }}} |
||
76 | '''Get libosmo-netif (master):''' |
||
77 | {{{ |
||
78 | git clone git://git.osmocom.org/libosmo-netif.git |
||
79 | cd libosmo-netif |
||
80 | autoreconf -fi |
||
81 | ./configure |
||
82 | make |
||
83 | make install |
||
84 | ldconfig |
||
85 | cd .. |
||
86 | }}} |
||
87 | '''Get OpenGGSN:''' |
||
88 | {{{ |
||
89 | git clone git://git.osmocom.org/openggsn.git |
||
90 | cd openggsn |
||
91 | autoreconf -i |
||
92 | ./configure --prefix=/usr/local |
||
93 | make |
||
94 | make install |
||
95 | ldconfig |
||
96 | cd .. |
||
97 | }}} |
||
98 | '''Get libosmo-sccp (master):''' |
||
99 | {{{ |
||
100 | git clone git://git.osmocom.org/libosmo-sccp.git |
||
101 | cd libosmo-sccp |
||
102 | autoreconf -fi |
||
103 | ./configure |
||
104 | make |
||
105 | make install |
||
106 | ldconfig |
||
107 | cd .. |
||
108 | }}} |
||
109 | 13 | '''Get OpenBSC (master):''' |
|
110 | 4 | {{{ |
|
111 | git clone git://git.osmocom.org/openbsc.git |
||
112 | cd openbsc/openbsc |
||
113 | autoreconf -fi |
||
114 | export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig |
||
115 | ./configure |
||
116 | make |
||
117 | make install |
||
118 | ldconfig |
||
119 | 1 | cd ../.. |
|
120 | 4 | }}} |
|
121 | 13 | '''Get Osmo-BTS (201509-fairwaves-rebase):''' |
|
122 | 1 | {{{ |
|
123 | 4 | git clone git://git.osmocom.org/osmo-bts.git |
|
124 | cd osmo-bts |
||
125 | 13 | git checkout 201509-fairwaves-rebase |
|
126 | 4 | autoreconf -fi |
|
127 | ./configure --enable-trx |
||
128 | make |
||
129 | make install |
||
130 | ldconfig |
||
131 | cd .. |
||
132 | }}} |
||
133 | '''Get Osmo-PCU (master):''' |
||
134 | {{{ |
||
135 | git clone git://git.osmocom.org/osmo-pcu.git |
||
136 | autoreconf -fi |
||
137 | ./configure --enable-sysmocom-bts |
||
138 | make |
||
139 | make install |
||
140 | ldconfig |
||
141 | cd .. |
||
142 | }}} |
||
143 | '''Get Osmo-TRX (master):''' |
||
144 | {{{ |
||
145 | git clone git://git.osmocom.org/osmo-trx.git |
||
146 | cd osmo-trx |
||
147 | ./autogen.sh |
||
148 | ./configure |
||
149 | make |
||
150 | make install |
||
151 | ldconfig |
||
152 | cd .. |
||
153 | }}} |
||
154 | 6 | ||
155 | '''Get mISDN kernel and user space:''' |
||
156 | |||
157 | Note: if you see "configure: error: kernel build tree does not exist" then you need to install kernel headers. |
||
158 | {{{ |
||
159 | git clone git://git.misdn.eu/mISDN.git |
||
160 | cd mISDN |
||
161 | ./configure |
||
162 | cp mISDN.cfg.default standalone/mISDN.cfg |
||
163 | make modules |
||
164 | make modules_install |
||
165 | ldconfig |
||
166 | cd .. |
||
167 | |||
168 | git clone git://git.misdn.eu/mISDNuser.git |
||
169 | cd mISDNuser |
||
170 | make |
||
171 | ./configure |
||
172 | make |
||
173 | sudo make install |
||
174 | ldconfig |
||
175 | cd .. |
||
176 | |||
177 | depmod –a |
||
178 | modprobe mISDN_core |
||
179 | modprobe mISDN_dsp |
||
180 | modprobe mISDN_l1loop nchannel=30 interfaces=2 |
||
181 | }}} |
||
182 | |||
183 | To auto-load the mISDN kernel modules do: |
||
184 | |||
185 | {{{ |
||
186 | cd /etc/modules-load.d/ |
||
187 | cat > misdn-modules.conf |
||
188 | mISDN_core |
||
189 | mISDN_dsp |
||
190 | mISDN_l1loop nchannel=30 interfaces=2 |
||
191 | }}} |
||
192 | Hit Ctrl+C |
||
193 | {{{ |
||
194 | chmod 644 misdn-modules.conf |
||
195 | cd / |
||
196 | }}} |
||
197 | |||
198 | '''Install Asterisk (ver 1.8 !):''' |
||
199 | |||
200 | On Ubuntu 14.04 there is no version 1.8 Asterisk anymore, to get it, do the following: |
||
201 | {{{ |
||
202 | wget http://launchpadlibrarian.net/153943558/asterisk-modules_1.8.13.1~dfsg-3ubuntu3_amd64.deb |
||
203 | wget http://launchpadlibrarian.net/153943773/asterisk-config_1.8.13.1~dfsg-3ubuntu3_all.deb |
||
204 | wget http://launchpadlibrarian.net/153943772/asterisk-dev_1.8.13.1~dfsg-3ubuntu3_all.deb |
||
205 | wget http://launchpadlibrarian.net/153943557/asterisk_1.8.13.1~dfsg-3ubuntu3_amd64.deb |
||
206 | wget http://launchpadlibrarian.net/107480639/asterisk-core-sounds-en-gsm_1.4.22-1_all.deb |
||
207 | wget http://launchpadlibrarian.net/58272892/asterisk-moh-opsound-gsm_2.03-1_all.deb |
||
208 | dpkg -i *.deb |
||
209 | apt-get -f install |
||
210 | }}} |
||
211 | |||
212 | Otherwise the Asterisk channel driver (chan_lcr) will not compile. |
||
213 | |||
214 | '''Get LCR (master):''' |
||
215 | {{{ |
||
216 | git clone git://git.misdn.eu/lcr.git/ |
||
217 | cd lcr |
||
218 | autoreconf -fi |
||
219 | ./configure --with-gsm-bs --with-misdn --with-asterisk |
||
220 | make |
||
221 | make install |
||
222 | cp chan_lcr.so /usr/lib/asterisk/modules/ |
||
223 | ldconfig |
||
224 | cd .. |
||
225 | }}} |
||
226 | |||
227 | Configure the LCR interfaces: |
||
228 | {{{ |
||
229 | cat > /usr/etc/lcr/interface.conf |
||
230 | [GSM] |
||
231 | gsm-bs |
||
232 | tones no |
||
233 | earlyb no |
||
234 | bridge ast |
||
235 | |||
236 | [ast] |
||
237 | remote asterisk |
||
238 | context from-lcr |
||
239 | earlyb no |
||
240 | tones yes |
||
241 | bridge GSM |
||
242 | }}} |
||
243 | Hit Ctrl+C |
||
244 | |||
245 | Add the following two lines to the bottom of options.conf: |
||
246 | {{{ |
||
247 | nano /usr/etc/lcr/options.conf |
||
248 | |||
249 | socketuser asterisk |
||
250 | socketgroup asterisk |
||
251 | }}} |
||
252 | 7 | ||
253 | '''Configuration of Asterisk:''' |
||
254 | |||
255 | You can find an attached configuration file called "extensions.conf". Please put that file and overwrite the original configuration at /etc/asterisk/exetensions.conf |
||
256 | |||
257 | Then restart asterisk: |
||
258 | |||
259 | {{{ |
||
260 | sudo service asterisk restart |
||
261 | }}} |
||
262 | |||
263 | '''Configuring the GGSN:''' |
||
264 | |||
265 | Use the example configuration file called "ggsn.conf" and put it to /etc/ggsn.conf |
||
266 | |||
267 | The traffic from the UEs (mobiles, USB modems etc) are terminated on a TUN interface with the IP address: 10.0.0.1 |
||
268 | The UEs are going to get an address from this range: 10.0.0.2 - 10.0.0.254 |
||
269 | The GGSN will listen on 127.0.0.5. In this example all the services (BSC, GGSN, SGSN, PCU etc.) are running on the same computer. |
||
270 | 8 | ||
271 | '''Configuring OpenBSC, Osmo-SGSN, Osmo-PCU''' |
||
272 | |||
273 | Please use the attached examle config files at the bottom fo this page. |
||
274 | |||
275 | '''Starting the services''' |
||
276 | |||
277 | Please note that in this example we are going to need quite a few terminals to be open, because except for LCR, GGSN and Asterisk, we are going to run the services in foreground. |
||
278 | |||
279 | Start the GGSN: |
||
280 | |||
281 | {{{ |
||
282 | ggsn |
||
283 | }}} |
||
284 | |||
285 | Start LCR: |
||
286 | |||
287 | {{{ |
||
288 | lcr fork |
||
289 | }}} |
||
290 | |||
291 | Open a new terminal and start the SGSN (with the sample config file provided): |
||
292 | |||
293 | {{{ |
||
294 | sudo osmo-sgsn -c sgsn.conf |
||
295 | }}} |
||
296 | |||
297 | Open a new terminal and start the BSC (with the sample config file provided): |
||
298 | |||
299 | {{{ |
||
300 | sudo osmo-nitb -C -c openbsc.conf -T -P -m |
||
301 | }}} |
||
302 | |||
303 | Open a new terminal and start Osmo-TRX: |
||
304 | |||
305 | {{{ |
||
306 | sudo osmo-trx |
||
307 | }}} |
||
308 | |||
309 | Open a new terminal and start Osmo-BTS (with the sample config file provided): |
||
310 | |||
311 | {{{ |
||
312 | sudo osmobts-trx -c osmo-bts.cfg |
||
313 | }}} |
||
314 | |||
315 | Open a new terminal and start Osmo-PCU (with the sample config file provided): |
||
316 | |||
317 | {{{ |
||
318 | sudo osmo-pcu -c osmo-pcu.cfg |
||
319 | }}} |
||
320 | 9 | ||
321 | '''Setting up NAT for GPRS:''' |
||
322 | |||
323 | In order for the UEs to be able to "see" the internet, we need to enable network address translation (NAT). |
||
324 | |||
325 | First determine which network interface is connected to the internet with: |
||
326 | {{{ |
||
327 | ifconfig |
||
328 | }}} |
||
329 | |||
330 | After you know the interface name (for example: eth0 or eth1 or em1 etc.), run the following commands. |
||
331 | |||
332 | Note that in the second command you need to use your interface name instead of "em1". |
||
333 | |||
334 | {{{ |
||
335 | sudo echo 1 > /proc/sys/net/ipv4/ip_forward |
||
336 | sudo iptables -A POSTROUTING -s 10.0.0.0/24 -t nat -o em1 -j MASQUERADE |
||
337 | }}} |