blob: a16ed6dc83e8052ba6016aee9f099b1202b1968d [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
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
199 ggsn -c examples/ggsn.conf --fg -l 10.20.30.40 --net 192.168.0.0 --mask 255.255.0.0
200
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
203255.255.0.0. You can check that this interface is up by using
204ifconfig.
205
206After tun has been successfully established the ggsn will wait for GTP
207create PDP context requests on the local interface
20810.20.30.40. Currently all requests are excepted, and no password,
209username or APN validation is performed.
210
211When receiving a create PDP context request a dynamic IP address will
212be allocated from the address pool determined by --net and --mask. In
213the above example the first allocated address will be 192.168.0.1,
214followed by 192.168.0.2 and so on. The request is confirmed by sending
215a create PDP context response message to the peer (SGSN).
216
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
220are used you need to configure network address translation. See the
221Linux Networking HOWTO for details.
222
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
jjako7bac2f82003-01-29 10:24:10 +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 --net 192.168.0.0 --mask 255.255.255.0 --createif
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
309context is 192.168.0.1. If you specified the correct --net and --mask
310you should be able to ping a known address on the Gi network of the
311roaming partner. You should even be able to do web browsing through
312the PDP context.
313
314Note however that you probably need to adjust your routing tables, so
315that you make sure that all GRX traffic is routed to the GPRS core
316network and everything else through the PDP context. The proper way to
317do this is to use policy routing. Also note that you are effectively
318connecting the same computer to both the Gn and Gi network, so please
319be carefull not to route internet traffic onto the GPRS core network
320and please protect yourself against hackers! For this reason it is
321advised to always use --contexts 0 when testing a live network.
322
323After --timelimit seconds the PDP context is disconnected with the
324following messages from sgsnemu:
325
326 Disconnecting PDP context #0
327 Received delete PDP context response. Cause value: 128
328 Deleting tun interface
jjako52c24142002-12-16 13:33:51 +0000329