blob: 4a20c00d046c247ed8d32c7f8d1ac65b0aad76af [file] [log] [blame]
jjako52c24142002-12-16 13:33:51 +00001*** QuickStart ***
2
3REQUIREMENTS
4
jjako9944eba2003-04-11 10:49:02 +00005Linux OpenGGSN was developed and tested using Redhat 7.1, 7.2 and
68.0. It should run also on other Linux distributions as well as
jjako52c24142002-12-16 13:33:51 +00007FreeBSD and Solaris, but this is untested. Please tell me of any
8testing results.
9
10Tun
11Both ggsn and sgsnemu uses the tun package. You need at least tun
12version 1.1. See http://vtun.sourceforge.net/tun/ for instructions on
jjako0ac82a12003-01-05 18:36:33 +000013installation. Tun is included in the kernel from early version 2.4, so
jjakob3061692003-01-14 17:13:26 +000014you will not normally need to install it. For Redhat 7.1, 7.2 and 8.0
15you do however need to do the following:
jjako0ac82a12003-01-05 18:36:33 +000016mkdir /dev/net
17mknod /dev/net/tun c 10 200
jjakobcbfb412003-01-06 21:21:03 +000018Add this line to /etc/modules.conf: alias char-major-10-200 tun
jjako0ac82a12003-01-05 18:36:33 +000019depmod -a
jjako52c24142002-12-16 13:33:51 +000020
jjako0ac82a12003-01-05 18:36:33 +000021
22COMPILATION and INSTALLATION
jjako52c24142002-12-16 13:33:51 +000023
jjakob3061692003-01-14 17:13:26 +0000241 ./configure
jjako7bac2f82003-01-29 10:24:10 +0000252 make
263 make install
jjakob3061692003-01-14 17:13:26 +000027
28You need to be root in order to install the package, but not in order
29to compile.
30
jjako52c24142002-12-16 13:33:51 +000031RUNNING
32
33sgsnemu
34Edit the configuration file sgsnemu.conf found under
jjako0ac82a12003-01-05 18:36:33 +000035openggsn/examples. Use sgsnemu -h for a list of available options.
jjakob3061692003-01-14 17:13:26 +000036Start the emulator as root using the command:
jjako52c24142002-12-16 13:33:51 +000037
jjako7bac2f82003-01-29 10:24:10 +000038 sgsnemu -c examples/sgsnemu.conf -l 10.20.30.50 -r 10.20.30.40 --createif
jjako52c24142002-12-16 13:33:51 +000039
40This will cause the sgsn emulator to bind to local address 10.20.30.50
41and connect to the ggsn found at 10.20.30.40. It will first send off
jjakobcbfb412003-01-06 21:21:03 +000042an ECHO_REQUEST message. After this it will attempt to establish a pdp
jjako52c24142002-12-16 13:33:51 +000043context. If successful it will create a local interface and set up
44routing. Now you should be able to ping through the connection. Use a
45network analysator such as ethereal to monitor the traffic.
46
47ggsn
jjako0ac82a12003-01-05 18:36:33 +000048Edit the configuration file ggsn.conf found under
49openggsn/examples. Use sgsnemu -h for a list of available options.
jjakob3061692003-01-14 17:13:26 +000050Start the ggsn as root using the command:
jjako0ac82a12003-01-05 18:36:33 +000051
52 ggsn --fg -c examples/ggsn.conf -l 10.20.30.40 --statedir .
53
jjako52c24142002-12-16 13:33:51 +000054This will run the ggsn in foreground using the local interface
jjako9944eba2003-04-11 10:49:02 +00005510.20.30.40. If you don't have a GSM network available for testing you
56can use sgsnemu to test the GGSN.
jjakobcbfb412003-01-06 21:21:03 +000057
58
59SUPPORT
60If you have any questions drop me a line at jj@openggsn.org.
jjako52c24142002-12-16 13:33:51 +000061
62
63*** Features ***
64
65OpenGGSN is an open source implementation of GPRS Support Nodes
66(GSNs). It implements the GPRS tunneling protocol (GTP) version 0.
67
68OpenGGSN provides 3 components:
69* gtplib
70* ggsn
71* sgsnemu
72
73gtplib
jjako0ac82a12003-01-05 18:36:33 +000074This library contains all functionality relating to the GTP
jjako9944eba2003-04-11 10:49:02 +000075protocol. Use this library if you want to implement your own
jjakobcbfb412003-01-06 21:21:03 +000076GSN. Currently gtplib supports GTPv0. At the moment no interface
77documentation is available for download.
jjako52c24142002-12-16 13:33:51 +000078
79ggsn
jjako0ac82a12003-01-05 18:36:33 +000080The ggsn implements a Gateway GPRS Support Node. The GGSN is a small
81application which is provided in order to test and demonstrate the use
82of gtplib. It is fully compliant to the 3GPP standards, but lacks
83important functionality such as charging and management. Use this
jjako52c24142002-12-16 13:33:51 +000084application as a starting point if you want to build your own GGSN
85with your own fancy VPN, management and charging functionality.
86
jjako0ac82a12003-01-05 18:36:33 +000087sgsnemu
88This application emulates a Serving GPRS Support Node (SGSN). sgsnemu
jjakobcbfb412003-01-06 21:21:03 +000089enables you to test your 3GPP core network without the need to invest
jjako52c24142002-12-16 13:33:51 +000090in a 3G radio access network. An important application of sgsnemu is
91the testing of roaming connectivity through a GPRS roaming exchange.
92
jjako0ac82a12003-01-05 18:36:33 +000093
jjako7bac2f82003-01-29 10:24:10 +000094*** Performance ***
95
96Two experiments were performed in order to test the performance of
97sgsnemu and ggsn. The ggsn used a 550 MHz Athlon with 384 MB of
98RAM. sgsnemu used a 1 GHz Athlon with 256 MB of RAM. Both machines had
jjakoafb2a972003-01-29 21:04:13 +000099100 Mb/s NICs (RTL-8139) and were connected through a crossed patch
100cable. Both tests were performed by sending ICMP echo packets from
101sgsnemu to the ggsn.
jjako7bac2f82003-01-29 10:24:10 +0000102
jjakoafb2a972003-01-29 21:04:13 +000010389.5 Mb/s IP throughput when sending 10000 ICMP ping packets with a
104payload of 1400 bytes. Transfer time 1.27 sec, no packets lost.
jjako7bac2f82003-01-29 10:24:10 +0000105
jjakoafb2a972003-01-29 21:04:13 +000010671.4 Mb/s IP throughput when sending 10000 ICMP ping packets with a
107payload of 1000 bytes. Transfer time 1.15 sec, no packets lost.
108
10912,1 Mb/s IP throughput when sending 10000 ICMP ping packets with a
110payload of 100 bytes. Transfer time 0.84 sec, no packets lost.
jjako7bac2f82003-01-29 10:24:10 +0000111
112
jjako52c24142002-12-16 13:33:51 +0000113*** Required software ***
114
jjakobcbfb412003-01-06 21:21:03 +0000115TUN (http://vtun.sourceforge.net/tun/)
jjako52c24142002-12-16 13:33:51 +0000116
117Both ggsn and sgsnemu uses the tun package. You need at least tun
jjako0ac82a12003-01-05 18:36:33 +0000118version 1.1. See the above web page for instructions on
119installation. Tun is included in the kernel from early version 2.4, so
jjakob3061692003-01-14 17:13:26 +0000120you will not normally need to install it. For Redhat 7.1, 7.2 and 8.0
121you do however need to do the following:
jjako0ac82a12003-01-05 18:36:33 +0000122mkdir /dev/net
123mknod /dev/net/tun c 10 200
124Add the following line to /etc/modules.conf: alias char-major-10-200 tun
125depmod -a
126
jjako52c24142002-12-16 13:33:51 +0000127
jjakobcbfb412003-01-06 21:21:03 +0000128GENGETOPT (http://www.gnu.org/software/gengetopt/gengetopt.html)
jjako52c24142002-12-16 13:33:51 +0000129
130Gengetopt is required if you want to change the options defined in the
jjakobcbfb412003-01-06 21:21:03 +0000131cmdline.ggo source file. You need at least gengetopt version 2.8. If
132you are just going to compile the programs you don't need gengetopt.
jjako52c24142002-12-16 13:33:51 +0000133
jjako0ac82a12003-01-05 18:36:33 +0000134To use gengetopt for the ggsn do the following:
jjako52c24142002-12-16 13:33:51 +0000135cd ggsn
jjako0ac82a12003-01-05 18:36:33 +0000136gengetopt < cmdline.ggo --conf-parser
jjako52c24142002-12-16 13:33:51 +0000137
jjako0ac82a12003-01-05 18:36:33 +0000138To use gengetopt for the sgsnemu do the following:
jjako52c24142002-12-16 13:33:51 +0000139cd sgsnemu
jjako0ac82a12003-01-05 18:36:33 +0000140gengetopt < cmdline.ggo --conf-parser
jjako52c24142002-12-16 13:33:51 +0000141
jjako52c24142002-12-16 13:33:51 +0000142
143*** Compilation and Installation ***
144
jjakob3061692003-01-14 17:13:26 +0000145SETTING UP AUTOTOOLS
146
147You do not need to perform this step if you are only going to compile
148the package:
149
jjako7bac2f82003-01-29 10:24:10 +00001500 Get version from somewhere: Script to extract version from configure.in
jjakob3061692003-01-14 17:13:26 +00001511 Copy the latest config.guess and config.sub from ftp://ftp.gnu.org/gnu/config
jjako7bac2f82003-01-29 10:24:10 +00001522 Run autoscan and copy configure.scan to configure.in
1533 Add/edit the following lines in configure.in:
jjakob3061692003-01-14 17:13:26 +0000154 AC_INIT(openggsn, 0.52, jj@openggsn.org)
155 AC_CONFIG_SRCDIR([gtp/gtp.c])
156 AM_CONFIG_HEADER([config.h])
157 AC_PROG_LIBTOOL
158 AM_PROG_LIBTOOL
159 AM_INIT_AUTOMAKE()
1604 libtoolize --automake --copy
161 (ads copy of ltmain.sh)
1625 aclocal
1636 autoheader
jjako7bac2f82003-01-29 10:24:10 +00001647 automake --add-missing --copy
165 (Ads copy of mkinstalldirs missing, install-sh, depcomp)
jjakob3061692003-01-14 17:13:26 +00001668 automake
1679 autoconf
168
169The above will initialise the project to the current version of
170autotools (As installed in RedHat 8.0). See
171http://sources.redhat.com/autobook/autobook/autobook_25.html#SEC25
172for details on autotools.
jjako52c24142002-12-16 13:33:51 +0000173
174
jjakob3061692003-01-14 17:13:26 +0000175COMPILATION AND INSTALLATION
176
177 1 ./configure
178 2 make clean
179 3 cd gtp
180 4 make
181 5 make install (as root)
182 6 cd ..
183 (Step 3 to 6 you only need to run the first time to install libgtp)
184 7 make
185 8 make install (as root)
186 9 Add /usr/local/lib to /etc/ld.so.conf
18710 run ldconfig
188 (Step 9 and 10 are not required as path to libgtp is included in Makefile)
189
jjako52c24142002-12-16 13:33:51 +0000190
191*** Running ggsn ***
jjakobcbfb412003-01-06 21:21:03 +0000192
193Use ggsn -h for a list of available options. All options available on
194the command line can also be given in a configuration file. See
195examples/ggsn.conf for the format of this file.
jjako52c24142002-12-16 13:33:51 +0000196
jjakoafb2a972003-01-29 21:04:13 +0000197Start the ggsn as root using the command:
198
jjako9944eba2003-04-11 10:49:02 +0000199 ggsn -c examples/ggsn.conf --fg -l 10.20.30.40 --net 192.168.0.0/24 --dynip 192.168.0.0/24
jjakoafb2a972003-01-29 21:04:13 +0000200
201First a tun network interface will be created. In the above example
202the network interface address is 192.168.0.0 and the mask is
jjako9944eba2003-04-11 10:49:02 +0000203255.255.255.0. You can check that this interface is up by using
jjakoafb2a972003-01-29 21:04:13 +0000204ifconfig.
205
206After tun has been successfully established the ggsn will wait for GTP
207create PDP context requests on the local interface
jjako9944eba2003-04-11 10:49:02 +000020810.20.30.40. Currently all requests are accepted, and no password,
209username or APN validation is performed.
jjakoafb2a972003-01-29 21:04:13 +0000210
211When receiving a create PDP context request a dynamic IP address will
jjako9944eba2003-04-11 10:49:02 +0000212be allocated from the address pool determined by --dynip. In the above
213example the first allocated address will be 192.168.0.1, followed by
214192.168.0.2 and so on. The request is confirmed by sending a create
215PDP context response message to the peer (SGSN).
jjakoafb2a972003-01-29 21:04:13 +0000216
217Now IP packets will be forwarded between the tun network interface and
218the established GTP tunnel. In order to allow users to access the
219external network routing needs to be set up. If private addresses are
jjako9944eba2003-04-11 10:49:02 +0000220used you need to configure network address translation. See the Linux
221Networking HOWTO for details.
jjakoafb2a972003-01-29 21:04:13 +0000222
jjako7bac2f82003-01-29 10:24:10 +0000223Remember to enable routing: echo 1 > /proc/sys/net/ipv4/ip_forward
224
jjako52c24142002-12-16 13:33:51 +0000225*** Running sgsnemu ***
jjakobcbfb412003-01-06 21:21:03 +0000226
227Use sgsnemu -h for a list of available options. All options available
228on the command line can also be given in a configuration file. See
229examples/sgsnemu.conf for the format of this file.
230
231If you want to test a GRX roaming connection you will need to do the
232following:
233
2341) Install sgsnemu on a Linux Box. See under installation above.
235
2362) Connect your Linux box with sgsnemu installed to the GPRS core
237network. Use the same LAN switch as the one your SGSN is connected
238to. You also need a free IP address that can be used by sgsnemu.
239
2403) You need to configure networking in terms of interface address,
241subnet mask and default route. See the Linux Networking HOWTO for
242details.
243
2444) Launch sgsnemu with something like:
245
246 sgsnemu --fg --listen 10.20.30.50 --remote 10.20.30.40 --dns 10.20.38.51 --timelimit 10 --contexts 0
247
248sgsnemu will print something like the following on the screen:
249
250 Using DNS server: 10.20.38.51 (10.20.38.51)
251 Local IP address is: 10.20.30.50 (10.20.30.50)
252 Remote IP address is: 10.20.30.40 (10.20.30.40)
253 IMSI is: 240011234567890 (0x98765432110042)
254 Using APN: internet
255 Using MSISDN: 46702123456
256
257 Initialising GTP library
258 OpenGGSN[1823]: GTP: gtp_newgsn() started
259 Done initialising GTP library
260
261 Sending off echo request
262 Waiting for response from ggsn........
263
264 Received echo response. Cause value: 0
265
266This is quite good. It means that you managed to send off an echo
267request to a remote GGSN, and it was friendly enough to answer you. If
268you did not get an echo response it means that something is wrong
269either with your setup OR with the GRX connection OR with your roaming
270partners connection.
271
272If the above went well you might want to try to establish a PDP
jjako7bac2f82003-01-29 10:24:10 +0000273context to the remote GGSN. Note that you should be careful when
jjakobcbfb412003-01-06 21:21:03 +0000274establishing PDP contexts using sgsnemu as each established PDP
275context will result in a Charge Detail Record (CDR) being generated by
276the GGSN. You should use real IMSI and MSISDN from a valid test SIM
277card. Otherwise some poor customer might get charged for your
278testing. Also note that you are establishing a connection to the Gi
jjako7bac2f82003-01-29 10:24:10 +0000279network, so please be carefull not to route internet traffic onto the
jjakobcbfb412003-01-06 21:21:03 +0000280GPRS core network! Assuming you know what you are doing:
281
jjako9944eba2003-04-11 10:49:02 +0000282 sgsnemu --fg --listen 10.20.30.50 --remote 10.20.30.40 --dns 10.20.38.51 --timelimit 10 --contexts 1 --apn internet --imsi 240011234567890 --msisdn 46702123456 --createif --defaultroute
jjakobcbfb412003-01-06 21:21:03 +0000283
284sgsnemu will print something like the following on the screen:
285
286 Using DNS server: 10.20.38.51 (10.20.38.51)
287 Local IP address is: 10.20.30.50 (10.20.30.50)
288 Remote IP address is: 10.20.30.40 (10.20.30.40)
289 IMSI is: 240011234567890 (0x98765432110042)
290 Using APN: internet
291 Using MSISDN: 46702123456
292
293 Initialising GTP library
294 OpenGGSN[1838]: GTP: gtp_newgsn() started
295 Done initialising GTP library
296
297 Sending off echo request
298 Setting up PDP context #0
299 Waiting for response from ggsn........
300
301 Received echo response. Cause value: 0
302 Received create PDP context response. Cause value: 128
303 Setting up interface and routing
304 /sbin/ifconfig tun0 192.168.0.1
305 /sbin/route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.1
306
307
308Now a context is established to the remote GGSN. The IP address of the
jjako9944eba2003-04-11 10:49:02 +0000309context is 192.168.0.1. You should be able to ping a known address on
310the Gi network of the roaming partner. You should even be able to do
311web browsing through the PDP context.
jjakobcbfb412003-01-06 21:21:03 +0000312
313Note however that you probably need to adjust your routing tables, so
314that you make sure that all GRX traffic is routed to the GPRS core
315network and everything else through the PDP context. The proper way to
316do this is to use policy routing. Also note that you are effectively
317connecting the same computer to both the Gn and Gi network, so please
318be carefull not to route internet traffic onto the GPRS core network
319and please protect yourself against hackers! For this reason it is
320advised to always use --contexts 0 when testing a live network.
321
322After --timelimit seconds the PDP context is disconnected with the
323following messages from sgsnemu:
324
325 Disconnecting PDP context #0
326 Received delete PDP context response. Cause value: 128
327 Deleting tun interface
jjako52c24142002-12-16 13:33:51 +0000328