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