Ettus USRP B2xx family » History » Version 24
wirelesss, 12/09/2016 10:16 AM
1 | 20 | laforge | {{include(Disclaimer-user-content)}} |
---|---|---|---|
2 | 19 | laforge | |
3 | 23 | wirelesss | This page will describe how to install and configure [[OpenBSC:]], [[OsmoBTS:]], [[OsmoTRX:]], [[OsmoPCU:]] 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 | 18 | *Get Opencore AMR:* |
|
22 | 3 | ||
23 | 18 | <pre> |
|
24 | 3 | wget http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz |
|
25 | tar xvzf opencore-amr-0.1.3.tar.gz |
||
26 | cd opencore-amr-0.1.3 |
||
27 | ./configure |
||
28 | make |
||
29 | make install |
||
30 | ldconfig |
||
31 | cd .. |
||
32 | 18 | </pre> |
|
33 | 3 | ||
34 | 23 | wirelesss | *Get ORTP:* |
35 | 3 | ||
36 | 23 | wirelesss | Note: 0.24.2 is not working with [[OpenBSC:]]! |
37 | 3 | ||
38 | 18 | <pre> |
|
39 | 3 | wget http://download.savannah.gnu.org/releases/linphone/ortp/sources/ortp-0.22.0.tar.gz |
|
40 | tar xvzf ortp-0.22.0.tar.gz |
||
41 | 16 | cd ortp-0.22.0 |
|
42 | 1 | ./configure |
|
43 | 3 | make |
|
44 | make install |
||
45 | ldconfig |
||
46 | cd .. |
||
47 | </pre> |
||
48 | 18 | ||
49 | 24 | wirelesss | Please refer to [[Build from source]] to get, built and install source for the projects listed below. |
50 | 21 | wirelesss | |
51 | * libosmocore |
||
52 | * libosmo-abis |
||
53 | * libosmo-netif |
||
54 | * openggsn |
||
55 | * libosmo-sccp |
||
56 | * openbsc after command autoreconf -fi enter @export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig |
||
57 | * osmo-pcu |
||
58 | * osmo-trx |
||
59 | 22 | wirelesss | * osmo-bts |
60 | 21 | wirelesss | |
61 | 22 | wirelesss | for osmo-bts use branch: 201509-fairwaves-rebase by issuing command bellow: |
62 | 21 | wirelesss | |
63 | <pre> git checkout 201509-fairwaves-rebase |
||
64 | </pre> |
||
65 | 4 | <pre> |
|
66 | ./configure --enable-trx |
||
67 | </pre> |
||
68 | |||
69 | 21 | wirelesss | |
70 | |||
71 | 4 | *Get mISDN kernel and user space:* |
|
72 | |||
73 | 18 | Note: if you see "configure: error: kernel build tree does not exist" then you need to install kernel headers. |
|
74 | 6 | <pre> |
|
75 | 18 | git clone git://git.misdn.eu/mISDN.git |
|
76 | 6 | cd mISDN |
|
77 | ./configure |
||
78 | 18 | cp mISDN.cfg.default standalone/mISDN.cfg |
|
79 | 6 | make modules |
|
80 | make modules_install |
||
81 | ldconfig |
||
82 | cd .. |
||
83 | 21 | wirelesss | </pre> |
84 | 6 | ||
85 | 21 | wirelesss | <pre> |
86 | 6 | git clone git://git.misdn.eu/mISDNuser.git |
|
87 | cd mISDNuser |
||
88 | make |
||
89 | ./configure |
||
90 | make |
||
91 | sudo make install |
||
92 | ldconfig |
||
93 | cd .. |
||
94 | 21 | wirelesss | </pre> |
95 | 6 | ||
96 | 21 | wirelesss | <pre> |
97 | 6 | depmod –a |
|
98 | modprobe mISDN_core |
||
99 | modprobe mISDN_dsp |
||
100 | modprobe mISDN_l1loop nchannel=30 interfaces=2 |
||
101 | 1 | </pre> |
|
102 | 18 | ||
103 | 6 | To auto-load the mISDN kernel modules do: |
|
104 | |||
105 | <pre> |
||
106 | 18 | cd /etc/modules-load.d/ |
|
107 | 6 | cat > misdn-modules.conf |
|
108 | mISDN_core |
||
109 | mISDN_dsp |
||
110 | mISDN_l1loop nchannel=30 interfaces=2 |
||
111 | </pre> |
||
112 | 18 | Hit Ctrl+C |
|
113 | 6 | <pre> |
|
114 | 18 | chmod 644 misdn-modules.conf |
|
115 | 6 | cd / |
|
116 | </pre> |
||
117 | 18 | ||
118 | 6 | *Install Asterisk (ver 1.8 !):* |
|
119 | 18 | ||
120 | 6 | On Ubuntu 14.04 there is no version 1.8 Asterisk anymore, to get it, do the following: |
|
121 | <pre> |
||
122 | 18 | wget http://launchpadlibrarian.net/153943558/asterisk-modules_1.8.13.1~dfsg-3ubuntu3_amd64.deb |
|
123 | 6 | wget http://launchpadlibrarian.net/153943773/asterisk-config_1.8.13.1~dfsg-3ubuntu3_all.deb |
|
124 | wget http://launchpadlibrarian.net/153943772/asterisk-dev_1.8.13.1~dfsg-3ubuntu3_all.deb |
||
125 | wget http://launchpadlibrarian.net/153943557/asterisk_1.8.13.1~dfsg-3ubuntu3_amd64.deb |
||
126 | wget http://launchpadlibrarian.net/107480639/asterisk-core-sounds-en-gsm_1.4.22-1_all.deb |
||
127 | wget http://launchpadlibrarian.net/58272892/asterisk-moh-opsound-gsm_2.03-1_all.deb |
||
128 | dpkg -i *.deb |
||
129 | apt-get -f install |
||
130 | </pre> |
||
131 | 18 | ||
132 | 6 | Otherwise the Asterisk channel driver (chan_lcr) will not compile. |
|
133 | |||
134 | *Get LCR (master):* |
||
135 | 18 | <pre> |
|
136 | git clone git://git.misdn.eu/lcr.git/ |
||
137 | 6 | cd lcr |
|
138 | autoreconf -fi |
||
139 | ./configure --with-gsm-bs --with-misdn --with-asterisk |
||
140 | make |
||
141 | make install |
||
142 | cp chan_lcr.so /usr/lib/asterisk/modules/ |
||
143 | ldconfig |
||
144 | cd .. |
||
145 | </pre> |
||
146 | 18 | ||
147 | 6 | Configure the LCR interfaces: |
|
148 | <pre> |
||
149 | 18 | cat > /usr/etc/lcr/interface.conf |
|
150 | 6 | [GSM] |
|
151 | gsm-bs |
||
152 | tones no |
||
153 | earlyb no |
||
154 | bridge ast |
||
155 | |||
156 | [ast] |
||
157 | remote asterisk |
||
158 | context from-lcr |
||
159 | earlyb no |
||
160 | tones yes |
||
161 | bridge GSM |
||
162 | </pre> |
||
163 | 18 | Hit Ctrl+C |
|
164 | 6 | ||
165 | Add the following two lines to the bottom of options.conf: |
||
166 | <pre> |
||
167 | 18 | nano /usr/etc/lcr/options.conf |
|
168 | 6 | ||
169 | socketuser asterisk |
||
170 | socketgroup asterisk |
||
171 | </pre> |
||
172 | 18 | ||
173 | 7 | *Configuration of Asterisk:* |
|
174 | 18 | ||
175 | 7 | You can find an attached configuration file called "extensions.conf". Please put that file and overwrite the original configuration at /etc/asterisk/exetensions.conf |
|
176 | |||
177 | Then restart asterisk: |
||
178 | |||
179 | 18 | <pre> |
|
180 | 7 | sudo service asterisk restart |
|
181 | 18 | </pre> |
|
182 | 7 | ||
183 | 18 | *Configuring the GGSN:* |
|
184 | 7 | ||
185 | Use the example configuration file called "ggsn.conf" and put it to /etc/ggsn.conf |
||
186 | |||
187 | The traffic from the UEs (mobiles, USB modems etc) are terminated on a TUN interface with the IP address: 10.0.0.1 |
||
188 | The UEs are going to get an address from this range: 10.0.0.2 - 10.0.0.254 |
||
189 | 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. |
||
190 | 8 | ||
191 | 23 | wirelesss | *Configuring [[OpenBSC:]], [[OsmoSGSN:]], [[OsmoPCU:]]* |
192 | 8 | ||
193 | Please use the attached examle config files at the bottom fo this page. |
||
194 | |||
195 | 18 | *Starting the services* |
|
196 | 8 | ||
197 | 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. |
||
198 | |||
199 | 21 | wirelesss | *Start the GGSN:* |
200 | 8 | ||
201 | 18 | <pre> |
|
202 | 8 | ggsn |
|
203 | 18 | </pre> |
|
204 | 8 | ||
205 | Start LCR: |
||
206 | |||
207 | 18 | <pre> |
|
208 | 8 | lcr fork |
|
209 | 18 | </pre> |
|
210 | 8 | ||
211 | Open a new terminal and start the SGSN (with the sample config file provided): |
||
212 | |||
213 | 18 | <pre> |
|
214 | 8 | sudo osmo-sgsn -c sgsn.conf |
|
215 | 18 | </pre> |
|
216 | 8 | ||
217 | Open a new terminal and start the BSC (with the sample config file provided): |
||
218 | |||
219 | 18 | <pre> |
|
220 | 8 | sudo osmo-nitb -C -c openbsc.conf -T -P -m |
|
221 | 18 | </pre> |
|
222 | 8 | ||
223 | Open a new terminal and start Osmo-TRX: |
||
224 | |||
225 | 18 | <pre> |
|
226 | 8 | sudo osmo-trx |
|
227 | 18 | </pre> |
|
228 | 8 | ||
229 | Open a new terminal and start Osmo-BTS (with the sample config file provided): |
||
230 | |||
231 | 18 | <pre> |
|
232 | 8 | sudo osmobts-trx -c osmo-bts.cfg |
|
233 | 18 | </pre> |
|
234 | 8 | ||
235 | Open a new terminal and start Osmo-PCU (with the sample config file provided): |
||
236 | |||
237 | 18 | <pre> |
|
238 | 8 | sudo osmo-pcu -c osmo-pcu.cfg |
|
239 | 18 | </pre> |
|
240 | 9 | ||
241 | 18 | *Setting up NAT for GPRS:* |
|
242 | 9 | ||
243 | In order for the UEs to be able to "see" the internet, we need to enable network address translation (NAT). |
||
244 | |||
245 | First determine which network interface is connected to the internet with: |
||
246 | 18 | <pre> |
|
247 | 9 | ifconfig |
|
248 | 18 | </pre> |
|
249 | 9 | ||
250 | After you know the interface name (for example: eth0 or eth1 or em1 etc.), run the following commands. |
||
251 | |||
252 | Note that in the second command you need to use your interface name instead of "em1". |
||
253 | |||
254 | 18 | <pre> |
|
255 | 9 | sudo echo 1 > /proc/sys/net/ipv4/ip_forward |
|
256 | sudo iptables -A POSTROUTING -s 10.0.0.0/24 -t nat -o em1 -j MASQUERADE |
||
257 | 18 | </pre> |