13 OpenGGSN was developed and tested using Redhat 8.0 and 9.0. It should
14 run also on other Linux distributions as well as FreeBSD, but this is
15 untested. Compilation on Solaris 2.8 has also been verified.
18 The tun driver is required for proper operation of openggsn. For linux
19 kernels later than 2.4.7 the driver is typically included, but need
20 to be configured for automatic loading:
22 1. Add the following line to /etc/modules.conf: alias char-major-10-200 tun
26 Installation from binary
27 ------------------------
29 rpm -i openggsn-<version>.rpm
31 This will install binaries, man pages, configuration files as well as
32 a Sys V init script for the ggsn.
35 Installation from source
36 ------------------------
42 You need to be root in order to install the package, but not in order
50 Start the emulator as root using the command:
52 sgsnemu -l 10.0.0.50 -r 10.0.0.40 --createif --defaultroute
54 This will cause the sgsn emulator to bind to local address 10.0.0.50
55 and connect to the ggsn found at 10.0.0.40. It will first send off an
56 ECHO_REQUEST message. After this it will attempt to establish a pdp
57 context. If successful it will create a local interface and set up
58 routing. Now you should be able to ping through the connection. Use a
59 network analysator such as ethereal to monitor the traffic.
61 sgsnemu -h will show a list of available options.
63 sgsnemu -c sgsnemu.conf will use sgsnemu.conf as a configuration
64 file. A sample file is provided in examples/sgsnemu.conf.
67 Edit the configuration file ggsn.conf found under openggsn/examples.
68 Start the ggsn as root using the command:
70 ggsn --fg -c examples/ggsn.conf -l 10.0.0.40 --statedir ./
72 This will run the ggsn in foreground using the local interface
73 10.0.0.40. If you don't have a GSM network available for testing you
74 can use sgsnemu to test the GGSN.
80 If you have any questions drop me a line at jj@openggsn.org.
86 OpenGGSN is an open source implementation of GPRS Support Nodes
87 (GSNs). It implements the GPRS tunneling protocol (GTP) version 0 and
90 OpenGGSN provides 3 components:
96 This library contains all functionality relating to the GTP
97 protocol. Use this library if you want to implement your own
98 GSN. gtplib supports both GTPv0 (GSM 09.60) and GTPv1 (3GPP
99 29.060). At the moment no interface documentation is available for
103 The ggsn implements a Gateway GPRS Support Node. The GGSN is a small
104 application which is provided in order to test and demonstrate the use
105 of gtplib. It is fully compliant to the 3GPP standards, but lacks
106 important functionality such as charging and management. Use this
107 application as a starting point if you want to build your own GGSN
108 with your own fancy VPN, management and charging functionality.
111 This application emulates a Serving GPRS Support Node (SGSN). sgsnemu
112 enables you to test your 3GPP core network without the need to invest
113 in a 3G radio access network. An important application of sgsnemu is
114 the testing of roaming connectivity through a GPRS roaming
115 exchange. sgsnemu will first attempt to use GTPv1. If unsuccessful it
116 will fallback to GTPv0.
122 Two experiments were performed in order to test the performance of
123 sgsnemu and ggsn. The ggsn used a 550 MHz Athlon with 384 MB of
124 RAM. sgsnemu used a 1 GHz Athlon with 256 MB of RAM. Both machines had
125 100 Mb/s NICs (RTL-8139) and were connected through a crossed patch
126 cable. Both tests were performed by sending ICMP echo packets from
129 89.5 Mb/s IP throughput when sending 10000 ICMP ping packets with a
130 payload of 1400 bytes. Transfer time 1.27 sec, no packets lost.
132 71.4 Mb/s IP throughput when sending 10000 ICMP ping packets with a
133 payload of 1000 bytes. Transfer time 1.15 sec, no packets lost.
135 12,1 Mb/s IP throughput when sending 10000 ICMP ping packets with a
136 payload of 100 bytes. Transfer time 0.84 sec, no packets lost.
145 Both ggsn and sgsnemu uses the tun package. You need at least tun
146 version 1.1. With Linux tun is normally included from kernel version
147 2.4.7. To configure automatic loading:
149 1. Add the following line to /etc/modules.conf: alias char-major-10-200 tun
152 Alternatively you can execute "modprobe tun" on the commandline.
154 For Solaris the tun driver needs to be installed manually. For general
155 information about tun see http://vtun.sourceforge.net/tun/
160 Gengetopt is required if you want to change the options defined in the
161 cmdline.ggo source file. You need at least gengetopt version 2.8. If
162 you are just going to compile the programs you don't need gengetopt.
164 To use gengetopt for the ggsn do the following:
166 gengetopt < cmdline.ggo --conf-parser
168 To use gengetopt for the sgsnemu do the following:
170 gengetopt < cmdline.ggo --conf-parser
172 For more information about gengetopt see
173 http://www.gnu.org/software/gengetopt/gengetopt.html
176 Compilation and Installation
177 ============================
183 You do not need to perform this step if you are only going to compile
186 1. Get version from somewhere: Script to extract version from configure.in
187 2. Copy the latest config.guess and config.sub from ftp://ftp.gnu.org/gnu/config
188 3. Run autoscan and copy configure.scan to configure.in
189 4. Add/edit the following lines in configure.in:
190 - AC_INIT(openggsn, 0.70, jj@openggsn.org)
191 - AC_CONFIG_SRCDIR([gtp/gtp.c])
192 - AM_CONFIG_HEADER([config.h])
196 5. libtoolize --automake --copy
197 (ads copy of ltmain.sh)
200 8. automake --add-missing --copy
201 (Ads copy of mkinstalldirs missing, install-sh, depcomp)
205 The above will initialise the project to the current version of
206 autotools (As installed in RedHat 8.0). See
207 http://sources.redhat.com/autobook/autobook/autobook_25.html#SEC25
208 for details on autotools.
211 Checking out from CVS
212 ---------------------
214 To download the latest source code from anonymous CVS:
216 cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ggsn login
217 cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ggsn co openggsn
219 Or to download from developer CVS:
222 cvs -z3 -d:ext:developername@cvs.sourceforge.net:/cvsroot/ggsn co openggsn
224 Both the above sets of commands creates a new directory called openggsn.
227 Compilation and installation
228 ----------------------------
230 If compiling under Solaris you need to edit the following line in
231 ggsn/Makefile.in and sgsnemu/Makefile.in:
233 LDFLAGS = -Wl,--rpath -Wl,/usr/local/lib @EXEC_LDFLAGS@
235 should be changed to:
237 LDFLAGS = -lresolv -lsocket -lnsl @EXEC_LDFLAGS@
239 Note that the above is not necessary on other platforms. Compilation
240 and installation is performed by the following steps:
246 5. make install (as root)
248 (Step 3 to 6 you only need to run the first time to install libgtp)
250 8. make install (as root)
251 9. Add /usr/local/lib to /etc/ld.so.conf
254 (Steps 9 and 10 are not required as path to libgtp is included in Makefile)
256 Documentation can be converted to html by issuing:
258 1. txt2html -pm -tf README > README.html
259 2. txt2html -pm -tf NEWS > NEWS.html
260 3. txt2html -pm -tf ChangeLog > ChangeLog.html
261 4. man2htm ggsn.8 > ggsn.html
262 5. man2htm sgsnemu.8 > sgsnemu.html
265 Installation from binary
266 ------------------------
268 1. rpm -i openggsn-<version>.rpm
270 This will install binaries, man pages, configuration files as well as
271 a Sys V init script for the ggsn.
277 Use ggsn -h for a list of available options. All options available on
278 the command line can also be given in a configuration file. See
279 examples/ggsn.conf for the format of this file.
281 Start the ggsn as root using the command:
283 ggsn -c examples/ggsn.conf --fg -l 10.0.0.40 --net 192.168.0.0/24 --dynip 192.168.0.0/24
285 First a tun network interface will be created. In the above example
286 the network interface address is 192.168.0.0 and the mask is
287 255.255.255.0. You can check that this interface is up by using
290 After tun has been successfully established the ggsn will wait for GTP
291 create PDP context requests on the local interface
292 10.0.0.40. Currently all requests are accepted, and no password,
293 username or APN validation is performed.
295 When receiving a create PDP context request a dynamic IP address will
296 be allocated from the address pool determined by --dynip. In the above
297 example the first allocated address will be 192.168.0.1, followed by
298 192.168.0.2 and so on. The request is confirmed by sending a create
299 PDP context response message to the peer (SGSN).
301 Now IP packets will be forwarded between the tun network interface and
302 the established GTP tunnel. In order to allow users to access the
303 external network routing needs to be set up. If private addresses are
304 used you need to configure network address translation. See the Linux
305 Networking HOWTO for details.
307 Remember to enable routing:
309 echo 1 > /proc/sys/net/ipv4/ip_forward
311 If you installed using a binary RPM package it is possible to start
312 ggsn by using the Sys 5 script:
314 /etc/init.d/ggsn start
320 Use sgsnemu -h for a list of available options. All options available
321 on the command line can also be given in a configuration file. See
322 examples/sgsnemu.conf for the format of this file.
324 If you want to test a GRX roaming connection you will need to do the
327 1. Install sgsnemu on a Linux Box. See under installation above.
328 2. Connect your Linux box with sgsnemu installed to the GPRS core
329 network. Use the same LAN switch as the one your SGSN is connected
330 to. You also need a free IP address that can be used by sgsnemu.
331 3. You need to configure networking in terms of interface address,
332 subnet mask and default route. See the Linux Networking HOWTO for
334 4. Launch sgsnemu with something like:
336 sgsnemu --listen 10.0.0.50 --remote 10.0.0.40 --dns 10.20.38.51 --timelimit 10 --contexts 0
338 sgsnemu will print something like the following on the screen:
342 Using DNS server: 10.20.38.51 (10.20.38.51)
343 Local IP address is: 10.0.0.50 (10.0.0.50)
344 Remote IP address is: 10.0.0.40 (10.0.0.40)
345 IMSI is: 240011234567890 (0x98765432110042)
347 Using MSISDN: 46702123456
349 Initialising GTP library
350 OpenGGSN[1823]: GTP: gtp_newgsn() started
351 Done initialising GTP library
353 Sending off echo request
354 Waiting for response from ggsn........
356 Received echo response. Cause value: 0
360 This is quite good. It means that you managed to send off an echo
361 request to a remote GGSN, and it was friendly enough to answer you. If
362 you did not get an echo response it means that something is wrong
363 either with your setup OR with the GRX connection OR with your roaming
366 If the above went well you might want to try to establish a PDP
367 context to the remote GGSN. Note that you should be careful when
368 establishing PDP contexts using sgsnemu as each established PDP
369 context will result in a Charge Detail Record (CDR) being generated by
370 the GGSN. You should use real IMSI and MSISDN from a valid test SIM
371 card. Otherwise some poor customer might get charged for your
372 testing. Also note that you are establishing a connection to the Gi
373 network, so please be carefull not to route internet traffic onto the
374 GPRS core network! Assuming you know what you are doing:
376 sgsnemu --listen 10.0.0.50 --remote 10.0.0.40 --dns 10.20.38.51 --timelimit 10 --contexts 1 --apn internet --imsi 240011234567890 --msisdn 46702123456 --createif --defaultroute
378 sgsnemu will print something like the following on the screen:
382 Using DNS server: 10.20.38.51 (10.20.38.51)
383 Local IP address is: 10.0.0.50 (10.0.0.50)
384 Remote IP address is: 10.0.0.40 (10.0.0.40)
385 IMSI is: 240011234567890 (0x98765432110042)
387 Using MSISDN: 46702123456
389 Initialising GTP library
390 OpenGGSN[1838]: GTP: gtp_newgsn() started
391 Done initialising GTP library
393 Sending off echo request
394 Setting up PDP context #0
395 Waiting for response from ggsn........
397 Received echo response. Cause value: 0
398 Received create PDP context response. Cause value: 128
399 Setting up interface and routing
400 /sbin/ifconfig tun0 192.168.0.1
401 /sbin/route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.1
405 Now a context is established to the remote GGSN. The IP address of the
406 context is 192.168.0.1. You should be able to ping a known address on
407 the Gi network of the roaming partner. You should even be able to do
408 web browsing through the PDP context.
410 Note however that you probably need to adjust your routing tables, so
411 that you make sure that all GRX traffic is routed to the GPRS core
412 network and everything else through the PDP context. The proper way to
413 do this is to use policy routing. Also note that you are effectively
414 connecting the same computer to both the Gn and Gi network, so please
415 be carefull not to route internet traffic onto the GPRS core network
416 and please protect yourself against hackers! For this reason it is
417 advised to always use --contexts 0 when testing a live network.
419 After --timelimit seconds the PDP context is disconnected with the
420 following messages from sgsnemu:
425 Disconnecting PDP context #0
426 Received delete PDP context response. Cause value: 128
427 Deleting tun interface