blob: acf94f7596e4fadfc438387316365eb8c356974a [file] [log] [blame]
jjako52c24142002-12-16 13:33:51 +00001*** QuickStart ***
2
3REQUIREMENTS
4
jjako0ac82a12003-01-05 18:36:33 +00005Linux
jjako52c24142002-12-16 13:33:51 +00006OpenGGSN was developed and tested using Redhat 7.1 and Redhat
77.2. It should run also on other Linux distributions as well as
8FreeBSD and Solaris, but this is untested. Please tell me of any
9testing results.
10
11Tun
12Both ggsn and sgsnemu uses the tun package. You need at least tun
13version 1.1. See http://vtun.sourceforge.net/tun/ for instructions on
jjako0ac82a12003-01-05 18:36:33 +000014installation. Tun is included in the kernel from early version 2.4, so
jjakob3061692003-01-14 17:13:26 +000015you will not normally need to install it. For Redhat 7.1, 7.2 and 8.0
16you do however need to do the following:
jjako0ac82a12003-01-05 18:36:33 +000017mkdir /dev/net
18mknod /dev/net/tun c 10 200
jjakobcbfb412003-01-06 21:21:03 +000019Add this line to /etc/modules.conf: alias char-major-10-200 tun
jjako0ac82a12003-01-05 18:36:33 +000020depmod -a
jjako52c24142002-12-16 13:33:51 +000021
jjako0ac82a12003-01-05 18:36:33 +000022
23COMPILATION and INSTALLATION
jjako52c24142002-12-16 13:33:51 +000024
jjakob3061692003-01-14 17:13:26 +0000251 ./configure
jjako7bac2f82003-01-29 10:24:10 +0000262 make
273 make install
jjakob3061692003-01-14 17:13:26 +000028
29You need to be root in order to install the package, but not in order
30to compile.
31
jjako52c24142002-12-16 13:33:51 +000032RUNNING
33
34sgsnemu
35Edit the configuration file sgsnemu.conf found under
jjako0ac82a12003-01-05 18:36:33 +000036openggsn/examples. Use sgsnemu -h for a list of available options.
jjakob3061692003-01-14 17:13:26 +000037Start the emulator as root using the command:
jjako52c24142002-12-16 13:33:51 +000038
jjako7bac2f82003-01-29 10:24:10 +000039 sgsnemu -c examples/sgsnemu.conf -l 10.20.30.50 -r 10.20.30.40 --createif
jjako52c24142002-12-16 13:33:51 +000040
41This will cause the sgsn emulator to bind to local address 10.20.30.50
42and connect to the ggsn found at 10.20.30.40. It will first send off
jjakobcbfb412003-01-06 21:21:03 +000043an ECHO_REQUEST message. After this it will attempt to establish a pdp
jjako52c24142002-12-16 13:33:51 +000044context. If successful it will create a local interface and set up
45routing. Now you should be able to ping through the connection. Use a
46network analysator such as ethereal to monitor the traffic.
47
48ggsn
jjako0ac82a12003-01-05 18:36:33 +000049Edit the configuration file ggsn.conf found under
50openggsn/examples. Use sgsnemu -h for a list of available options.
jjakob3061692003-01-14 17:13:26 +000051Start the ggsn as root using the command:
jjako0ac82a12003-01-05 18:36:33 +000052
53 ggsn --fg -c examples/ggsn.conf -l 10.20.30.40 --statedir .
54
jjako52c24142002-12-16 13:33:51 +000055This will run the ggsn in foreground using the local interface
jjakobcbfb412003-01-06 21:21:03 +00005610.20.30.40. Of cause you can use sgsnemu to test the GGSN.
57
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
jjako52c24142002-12-16 13:33:51 +000075protocol. Use this libraty 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
99100 Mb/s NICs and were connected through a Netgear FS105 switch. Both
100tests were performed by sending ICMP echo packets from the ggsn to
101sgsnemu.
102
10389.4 Mb/s IP downlink throughput when sending 10001 ICMP ping packets
104with a payload of 1000 bytes. Transfer time 0.9 sec, no packets lost.
105
10617,1 Mb/s IP downlink throughput when sending 10001 ICMP ping packets with
107a payload of 100 bytes. Transfer time 0.6 sec, no packets lost.
108
109
jjako52c24142002-12-16 13:33:51 +0000110*** Required software ***
111
jjakobcbfb412003-01-06 21:21:03 +0000112TUN (http://vtun.sourceforge.net/tun/)
jjako52c24142002-12-16 13:33:51 +0000113
114Both ggsn and sgsnemu uses the tun package. You need at least tun
jjako0ac82a12003-01-05 18:36:33 +0000115version 1.1. See the above web page for instructions on
116installation. Tun is included in the kernel from early version 2.4, so
jjakob3061692003-01-14 17:13:26 +0000117you will not normally need to install it. For Redhat 7.1, 7.2 and 8.0
118you do however need to do the following:
jjako0ac82a12003-01-05 18:36:33 +0000119mkdir /dev/net
120mknod /dev/net/tun c 10 200
121Add the following line to /etc/modules.conf: alias char-major-10-200 tun
122depmod -a
123
jjako52c24142002-12-16 13:33:51 +0000124
jjakobcbfb412003-01-06 21:21:03 +0000125GENGETOPT (http://www.gnu.org/software/gengetopt/gengetopt.html)
jjako52c24142002-12-16 13:33:51 +0000126
127Gengetopt is required if you want to change the options defined in the
jjakobcbfb412003-01-06 21:21:03 +0000128cmdline.ggo source file. You need at least gengetopt version 2.8. If
129you are just going to compile the programs you don't need gengetopt.
jjako52c24142002-12-16 13:33:51 +0000130
jjako0ac82a12003-01-05 18:36:33 +0000131To use gengetopt for the ggsn do the following:
jjako52c24142002-12-16 13:33:51 +0000132cd ggsn
jjako0ac82a12003-01-05 18:36:33 +0000133gengetopt < cmdline.ggo --conf-parser
jjako52c24142002-12-16 13:33:51 +0000134
jjako0ac82a12003-01-05 18:36:33 +0000135To use gengetopt for the sgsnemu do the following:
jjako52c24142002-12-16 13:33:51 +0000136cd sgsnemu
jjako0ac82a12003-01-05 18:36:33 +0000137gengetopt < cmdline.ggo --conf-parser
jjako52c24142002-12-16 13:33:51 +0000138
jjako52c24142002-12-16 13:33:51 +0000139
140*** Compilation and Installation ***
141
jjakob3061692003-01-14 17:13:26 +0000142SETTING UP AUTOTOOLS
143
144You do not need to perform this step if you are only going to compile
145the package:
146
jjako7bac2f82003-01-29 10:24:10 +00001470 Get version from somewhere: Script to extract version from configure.in
jjakob3061692003-01-14 17:13:26 +00001481 Copy the latest config.guess and config.sub from ftp://ftp.gnu.org/gnu/config
jjako7bac2f82003-01-29 10:24:10 +00001492 Run autoscan and copy configure.scan to configure.in
1503 Add/edit the following lines in configure.in:
jjakob3061692003-01-14 17:13:26 +0000151 AC_INIT(openggsn, 0.52, jj@openggsn.org)
152 AC_CONFIG_SRCDIR([gtp/gtp.c])
153 AM_CONFIG_HEADER([config.h])
154 AC_PROG_LIBTOOL
155 AM_PROG_LIBTOOL
156 AM_INIT_AUTOMAKE()
1574 libtoolize --automake --copy
158 (ads copy of ltmain.sh)
1595 aclocal
1606 autoheader
jjako7bac2f82003-01-29 10:24:10 +00001617 automake --add-missing --copy
162 (Ads copy of mkinstalldirs missing, install-sh, depcomp)
jjakob3061692003-01-14 17:13:26 +00001638 automake
1649 autoconf
165
166The above will initialise the project to the current version of
167autotools (As installed in RedHat 8.0). See
168http://sources.redhat.com/autobook/autobook/autobook_25.html#SEC25
169for details on autotools.
jjako52c24142002-12-16 13:33:51 +0000170
171
jjakob3061692003-01-14 17:13:26 +0000172COMPILATION AND INSTALLATION
173
174 1 ./configure
175 2 make clean
176 3 cd gtp
177 4 make
178 5 make install (as root)
179 6 cd ..
180 (Step 3 to 6 you only need to run the first time to install libgtp)
181 7 make
182 8 make install (as root)
183 9 Add /usr/local/lib to /etc/ld.so.conf
18410 run ldconfig
185 (Step 9 and 10 are not required as path to libgtp is included in Makefile)
186
jjako52c24142002-12-16 13:33:51 +0000187
188*** Running ggsn ***
jjakobcbfb412003-01-06 21:21:03 +0000189
190Use ggsn -h for a list of available options. All options available on
191the command line can also be given in a configuration file. See
192examples/ggsn.conf for the format of this file.
jjako52c24142002-12-16 13:33:51 +0000193
jjako7bac2f82003-01-29 10:24:10 +0000194Remember to enable routing: echo 1 > /proc/sys/net/ipv4/ip_forward
195
jjako52c24142002-12-16 13:33:51 +0000196*** Running sgsnemu ***
jjakobcbfb412003-01-06 21:21:03 +0000197
198Use sgsnemu -h for a list of available options. All options available
199on the command line can also be given in a configuration file. See
200examples/sgsnemu.conf for the format of this file.
201
202If you want to test a GRX roaming connection you will need to do the
203following:
204
2051) Install sgsnemu on a Linux Box. See under installation above.
206
2072) Connect your Linux box with sgsnemu installed to the GPRS core
208network. Use the same LAN switch as the one your SGSN is connected
209to. You also need a free IP address that can be used by sgsnemu.
210
2113) You need to configure networking in terms of interface address,
212subnet mask and default route. See the Linux Networking HOWTO for
213details.
214
2154) Launch sgsnemu with something like:
216
217 sgsnemu --fg --listen 10.20.30.50 --remote 10.20.30.40 --dns 10.20.38.51 --timelimit 10 --contexts 0
218
219sgsnemu will print something like the following on the screen:
220
221 Using DNS server: 10.20.38.51 (10.20.38.51)
222 Local IP address is: 10.20.30.50 (10.20.30.50)
223 Remote IP address is: 10.20.30.40 (10.20.30.40)
224 IMSI is: 240011234567890 (0x98765432110042)
225 Using APN: internet
226 Using MSISDN: 46702123456
227
228 Initialising GTP library
229 OpenGGSN[1823]: GTP: gtp_newgsn() started
230 Done initialising GTP library
231
232 Sending off echo request
233 Waiting for response from ggsn........
234
235 Received echo response. Cause value: 0
236
237This is quite good. It means that you managed to send off an echo
238request to a remote GGSN, and it was friendly enough to answer you. If
239you did not get an echo response it means that something is wrong
240either with your setup OR with the GRX connection OR with your roaming
241partners connection.
242
243If the above went well you might want to try to establish a PDP
jjako7bac2f82003-01-29 10:24:10 +0000244context to the remote GGSN. Note that you should be careful when
jjakobcbfb412003-01-06 21:21:03 +0000245establishing PDP contexts using sgsnemu as each established PDP
246context will result in a Charge Detail Record (CDR) being generated by
247the GGSN. You should use real IMSI and MSISDN from a valid test SIM
248card. Otherwise some poor customer might get charged for your
249testing. Also note that you are establishing a connection to the Gi
jjako7bac2f82003-01-29 10:24:10 +0000250network, so please be carefull not to route internet traffic onto the
jjakobcbfb412003-01-06 21:21:03 +0000251GPRS core network! Assuming you know what you are doing:
252
jjako7bac2f82003-01-29 10:24:10 +0000253 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 --net 192.168.0.0 --mask 255.255.255.0 --createif
jjakobcbfb412003-01-06 21:21:03 +0000254
255sgsnemu will print something like the following on the screen:
256
257 Using DNS server: 10.20.38.51 (10.20.38.51)
258 Local IP address is: 10.20.30.50 (10.20.30.50)
259 Remote IP address is: 10.20.30.40 (10.20.30.40)
260 IMSI is: 240011234567890 (0x98765432110042)
261 Using APN: internet
262 Using MSISDN: 46702123456
263
264 Initialising GTP library
265 OpenGGSN[1838]: GTP: gtp_newgsn() started
266 Done initialising GTP library
267
268 Sending off echo request
269 Setting up PDP context #0
270 Waiting for response from ggsn........
271
272 Received echo response. Cause value: 0
273 Received create PDP context response. Cause value: 128
274 Setting up interface and routing
275 /sbin/ifconfig tun0 192.168.0.1
276 /sbin/route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.1
277
278
279Now a context is established to the remote GGSN. The IP address of the
280context is 192.168.0.1. If you specified the correct --net and --mask
281you should be able to ping a known address on the Gi network of the
282roaming partner. You should even be able to do web browsing through
283the PDP context.
284
285Note however that you probably need to adjust your routing tables, so
286that you make sure that all GRX traffic is routed to the GPRS core
287network and everything else through the PDP context. The proper way to
288do this is to use policy routing. Also note that you are effectively
289connecting the same computer to both the Gn and Gi network, so please
290be carefull not to route internet traffic onto the GPRS core network
291and please protect yourself against hackers! For this reason it is
292advised to always use --contexts 0 when testing a live network.
293
294After --timelimit seconds the PDP context is disconnected with the
295following messages from sgsnemu:
296
297 Disconnecting PDP context #0
298 Received delete PDP context response. Cause value: 128
299 Deleting tun interface
jjako52c24142002-12-16 13:33:51 +0000300