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