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