Project

General

Profile

OpenBSC GPRS » History » Version 9

Anonymous, 02/19/2016 10:47 PM
Added guide on how to compile OpenBSC with EGPRS support

1 1 tnt
[[PageOutline]]
2
3
= OpenBSC GPRS/EDGE Setup page =
4
5
== Pre-requisites ==
6
7
 * A nano BTS with GPRS or EDGE support. BS-11 are not supported (yet?)
8 6 tnt
 * A compiled GGSN from OpenGGSN (make sure to use the osmocom version. git://git.osmocom.org/openggsn.git )
9 2 tnt
 * A working and up-to-date OpenBSC (see [wiki:Building_OpenBSC])
10 3 tnt
   * You will need to (re-)build it after having installed OpenGGSN so that the `libgtp` is detected and the SGSN binary `osmo-sgsn` built.
11 8 tnt
 * A custom SIM for your network
12
   * Currently osmo-sgsn refuses all roaming, so you need a SIM that matches your custom MCC/MNC network
13 1 tnt
14
== Setup ==
15
16 3 tnt
First a little picture to illustrate the different elements and their interactions :
17 1 tnt
18 8 tnt
[[Image(gprs.2.png)]]
19 1 tnt
20 9 tnt
=== Compiling OpenBSC with [E]GPRS ===
21
22
The guide below was tested on Ubuntu 11.10 but should work on Debian as well. This guide uses /root for everything.
23
24
First you need to download all dependencies:
25
26
{{{
27
apt-get install libdbi0-dev libdbd-sqlite3 libtool autoconf git-core pkg-config make libortp-dev
28
}}}
29
30
Next, download the OpenGGSN source code:
31
{{{
32
cd /root
33
git clone git://git.osmocom.org/openggsn.git
34
}}}
35
36
Compile OpenGGSN:
37
{{{
38
cd /root/openggsn
39
autoreconf; automake --add-missing; autoreconf; autoconf; automake; ./configure --prefix=/usr/local; make -j 2; make install
40
}}}
41
42
Now download everything else:
43
{{{
44
cd /root
45
git clone git://git.osmocom.org/libosmocore.git; git clone git://git.osmocom.org/libosmo-abis.git; git clone git://git.osmocom.org/openbsc.git
46
}}}
47
48
Compile the rest:
49
{{{
50
cd /root/libosmocore; autoreconf -fi; ./configure; make; make install; ldconfig
51
cd /root/libosmo-abis; autoreconf -fi; ./configure; make; make install; ldconfig
52
cd /root/openbsc/openbsc; autoreconf -fi; export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig; ./configure; make
53
}}}
54
55
You should now have a working copy of ggsn, osmo-sgsn and osmo-nitb on your machine.
56
57 1 tnt
=== OpenBSC configuration ===
58
59 3 tnt
The first step is to configure OpenBSC for gprs support. Add this to the `network/bts` node in `openbsc.cfg`:
60 1 tnt
{{{
61 3 tnt
gprs mode gprs
62
gprs routing area 0
63
gprs cell bvci 2
64
gprs nsei 101
65
gprs nsvc 0 nsvci 101
66
gprs nsvc 0 local udp port 23000
67
gprs nsvc 0 remote udp port 23000
68
gprs nsvc 0 remote ip 192.168.0.128
69 1 tnt
}}}
70
71 3 tnt
The `gprs nsvc 0 remote` entries `192.168.0.128:23000` is the IP/port of the machine running the SGSN as seen from the BTS. It will be sent by OpenBSC to the BTS in the configration phase and the BTS will connect back to the SGSN.
72
73
The second step is to allocate some timeslots to packet data. For this, just change the 1 or more `network/bts/trx/timeslot` nodes using :
74 2 tnt
{{{
75 3 tnt
phys_chan_config PDCH
76 2 tnt
}}}
77 1 tnt
78
79 2 tnt
=== Osmocom SGSN configuration ===
80 4 tnt
81
Here's a sample SGSN configuration file `osmo-sgsn.cfg` with some explanations :
82 2 tnt
83
{{{
84
!
85
! Osmocom SGSN configuration
86
!
87
!
88
line vty
89
 no login
90
!
91
sgsn
92
 gtp local-ip 192.168.1.128
93
 ggsn 0 remote-ip 192.168.1.129
94
 ggsn 0 gtp-version 1
95
!
96
ns
97
 timer tns-block 3
98
 timer tns-block-retries 3
99
 timer tns-reset 3
100
 timer tns-reset-retries 3
101
 timer tns-test 30
102
 timer tns-alive 3
103
 timer tns-alive-retries 10
104
 encapsulation udp local-ip 192.168.0.128
105
 encapsulation udp local-port 23000
106
 encapsulation framerelay-gre enabled 0
107
!
108
bssgp
109
!
110 1 tnt
}}}
111 4 tnt
112
 * The `gtp local-ip` entry is the local IP the SGSN will bind to.
113 1 tnt
 * The `ggsn 0 remote-ip` entry if the remote IP of the GGSN. The SGSN will connect to it.
114 9 tnt
 * Those two IPs '''must''' be different even if you're running both processes on the same machine. A solution for that is to put several IP aliases on the same network interface or use the loopback interface.
115 4 tnt
 * The `encapsulation` settings must be the same IP/port than you've setup in `openbsc.cfg`
116
117 2 tnt
=== OpenGGSN configuration ===
118
119 4 tnt
The ggsn.conf file is pretty well documented. What is mostly of interest here is :
120
121
 * The configuration of the GTP link. (Must match the `ggsn 0 remote-ip` entry in `osmo-sgsn.cfg`)
122
123 2 tnt
{{{
124
# TAG: listen
125
# Specifies the local IP address to listen to
126
listen 192.168.1.129
127
}}}
128
129 4 tnt
 * The configuration given to phones, IP pool & DNS.
130
131 2 tnt
{{{
132
# TAG: dynip
133
# Dynamic IP address pool.
134
# Used for allocation of dynamic IP address when address is not given
135
# by HLR.
136
# If this option is not given then the net option is used as a substitute.
137
dynip 192.168.254.0/24
138
139
# TAG: pcodns1/pcodns2
140
# Protocol configuration option domain name system server 1 & 2.
141
pcodns1 208.67.222.222
142
pcodns2 208.67.220.220
143
}}}
144
145
=== Network configuration ===
146
147
You will also need to configure some networking rules to allow connectivity from `tun0`. Look up linux networking/nat howtos on google.
148
The basic setup for testing only in a safe environment would be :
149
150
{{{
151
bash# echo 1 > /proc/sys/net/ipv4/ip_forward
152
bash# iptables -A POSTROUTING -s 192.168.254.0/24 -t nat -o eth0 -j MASQUERADE
153
}}} 
154
155
(replace `eth0` by the interface providing your machine connectivity)
156
157
== Running ==
158 1 tnt
159 4 tnt
Just start the three processes :
160
 * `ggsn`
161
 * `osmo-sgsn`
162 7 laforge
 * `osmo-nitb`
163 4 tnt
164
You can access vty from 
165 6 tnt
 * OpenBSC on port 4242 See [wiki:osmo-nitb_VTY]
166 5 tnt
 * SGSN on port 4245. See [wiki:osmo-sgsn_VTY]
Add picture from clipboard (Maximum size: 48.8 MB)